/* =========================================================
   feature-misc.css
   - Search typeahead (header)
   - Skeleton loaders (CSS-only)
   - Section spacing audit (desktop + mobile)
   ========================================================= */


/* ---------- Search form inside header-dropdown ---------- */

.header-dropdown__col--search {
    flex: 1 1 100%;
    width: 100%;
    margin-bottom: 10px;
}

.search-form {
    margin: 0;
    width: 100%;
}

.search-form__wrap {
    position: relative;
    display: flex;
    align-items: center;
    background: #FFFFFF;
    border: 1px solid rgba(17, 16, 31, 0.15);
    border-radius: 30px;
    padding: 0 8px 0 18px;
    height: 46px;
    box-sizing: border-box;
}

.search-form__input {
    flex: 1;
    border: 0;
    background: transparent;
    height: 100%;
    font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 14px;
    color: #243F2F;
    outline: none;
    padding: 0;
}

.search-form__input::placeholder {
    color: rgba(17, 16, 31, 0.45);
}

.search-form__submit {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background-color: #EBE8DD;
    border: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
}

.search-form__submit img {
    width: 16px;
    height: 16px;
    display: block;
}


/* ---------- Typeahead dropdown ---------- */

.search-typeahead {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #FFFFFF;
    box-shadow: 0 12px 32px rgba(17, 16, 31, 0.12);
    border-radius: 16px;
    max-height: 60vh;
    overflow-y: auto;
    z-index: 200;
    padding: 6px 0;
}

.search-typeahead[hidden] {
    display: none;
}

.search-typeahead__item {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px 14px;
    text-decoration: none;
    color: #243F2F;
    border-bottom: 1px solid rgba(17, 16, 31, 0.05);
    transition: background-color 0.15s ease;
}

.search-typeahead__item:last-child {
    border-bottom: 0;
}

.search-typeahead__item:hover,
.search-typeahead__item.is-active {
    background: #F8F6F0;
}

.search-typeahead__img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    background: #F8F6F0;
    flex-shrink: 0;
}

.search-typeahead__img--placeholder {
    background: linear-gradient(135deg, #F8F6F0 0%, #EBE8DD 100%);
}

.search-typeahead__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.search-typeahead__title {
    font-family: "Plus Jakarta Sans", sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    color: #243F2F;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-typeahead__price {
    font-family: "Plus Jakarta Sans", sans-serif;
    font-size: 12px;
    color: #5C5B66;
    line-height: 1.2;
}

.search-typeahead__price ins {
    text-decoration: none;
}

.search-typeahead__price del {
    opacity: 0.6;
    margin-right: 4px;
}

.search-typeahead__empty {
    padding: 14px 18px;
    font-family: "Plus Jakarta Sans", sans-serif;
    font-size: 13px;
    color: #5C5B66;
}


/* ---------- Skeleton loaders (CSS-only) ---------- */

.skeleton {
    background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.4s infinite;
    border-radius: 6px;
    display: inline-block;
}

@keyframes skeleton-loading {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton--text {
    height: 14px;
    margin: 6px 0;
    display: block;
}

.skeleton--image {
    width: 100%;
    aspect-ratio: 1;
}

.skeleton--btn {
    height: 44px;
    width: 140px;
}

/* If a Quick View / modal markup later uses .qv-* hooks, this gives it a skeleton
   shell out of the box. Safe to keep even without an active Quick View plugin. */
.qv-modal .qv-image-skeleton,
.qv-modal .qv-title-skeleton,
.qv-modal .qv-price-skeleton,
.qv-modal .qv-btn-skeleton {
    background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.4s infinite;
    border-radius: 6px;
}


/* ---------- Section spacing audit (desktop + mobile) ---------- */
/*
   Findings from style.css:
   - .home-hero__inner: padding-top 140px (hero offset under fixed header — keep), padding-bottom 40px (tight)
   - .home-about__inner: padding-top 80px, no padding-bottom (cards float against next section)
   - .bestsellers-section__inner: padding 80px 20px 0 (no bottom)
   - .delivery-banner: margin-top 80px, no margin-bottom
   - .new-arrivals: margin-top 80px
   - .catalog-section: margin-top 60px

   Inconsistencies: gaps are driven by top-margins only, so collapsing/zero bottoms
   create uneven rhythm between sections (especially on mobile where .new-arrivals
   uses 60px while others stay 80px). Normalize to ~100px desktop / ~50px mobile.
*/

.home-hero__inner {
    padding-bottom: 80px;
}

.home-about {
    padding-bottom: 40px;
}

.bestsellers-section__inner {
    padding-bottom: 40px;
}

.delivery-banner {
    margin-top: 100px;
}

.new-arrivals {
    margin-top: 100px;
}

.catalog-section {
    margin-top: 100px;
}

@media (max-width: 768px) {
    .home-hero__inner {
        padding-bottom: 40px;
    }

    .home-about__inner {
        padding-top: 50px;
    }

    .home-about {
        padding-bottom: 20px;
    }

    .bestsellers-section__inner {
        padding-top: 50px;
        padding-bottom: 20px;
    }

    .delivery-banner {
        margin-top: 50px;
    }

    .new-arrivals {
        margin-top: 50px;
    }

    .catalog-section {
        margin-top: 50px;
    }

    /* About cards: keep internal whitespace consistent on mobile */
    .about-card--info {
        padding: 28px 24px;
        min-height: 280px !important;
    }

    .about-card--info .about-card__icon {
        margin-bottom: 16px;
    }

    .about-card--info .about-card__title {
        padding-left: 0;
        padding-right: 0;
        max-width: 100%;
    }

    .about-card--info .about-card__desc {
        position: static;
        margin-top: 12px;
    }

    .about-card--main {
        padding: 28px 24px;
    }
}
