/* =====================================================
   FA SEARCH OVERLAY
   Tokens: --fa-wine #681226  --fa-ink #651126
           --fa-rose #d78ea1  --fa-blush #f4dddd
           --fa-choco #540219 --fa-muted #6d6460
   ===================================================== */

/* ── Overlay backdrop (full screen, mobile) ─────────── */
.fa-search-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(60, 10, 20, .38);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

    .fa-search-overlay.is-open {
        display: block;
    }

/* ── Search panel ───────────────────────────────────── */
.fa-search-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 20px 60px rgba(60, 10, 20, .18);
    border-bottom: 2px solid #f0d4d6;
    max-height: 100dvh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* ── Search bar row inside panel ────────────────────── */
.fa-search-bar-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 24px;
    border-bottom: 1px solid #f0d4d6;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 1;
}

.fa-search-bar-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #FFF8F7;
    border: 1.5px solid #e8c8ca;
    border-radius: 999px;
    padding: 0 18px;
    height: 48px;
    transition: border-color .2s, box-shadow .2s;
}

    .fa-search-bar-input-wrap:focus-within {
        border-color: var(--fa-wine, #681226);
        box-shadow: 0 0 0 3px rgba(104, 18, 38, .10);
    }

    .fa-search-bar-input-wrap svg {
        color: #d78ea1;
        flex-shrink: 0;
    }

.fa-search-input-main {
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    color: var(--fa-ink, #651126);
    min-width: 0;
}

    .fa-search-input-main::placeholder {
        color: #c8a4a8;
    }

.fa-search-clear {
    display: none;
    background: none;
    border: 0;
    color: #c8a4a8;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    font-size: 18px;
    transition: color .2s;
    flex-shrink: 0;
}

    .fa-search-clear:hover { color: var(--fa-wine, #681226); }
    .fa-search-clear.visible { display: block; }

.fa-search-close-btn {
    background: none;
    border: 0;
    color: var(--fa-muted, #6d6460);
    cursor: pointer;
    font-size: 13px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    padding: 8px 4px;
    white-space: nowrap;
    transition: color .2s;
}

    .fa-search-close-btn:hover { color: var(--fa-wine, #681226); }

/* ── Results body ───────────────────────────────────── */
.fa-search-body {
    padding: 20px 24px 28px;
    flex: 1;
}

/* section label */
.fa-search-section-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #d78ea1;
    margin: 0 0 14px;
}

/* ── Product grid in dropdown ───────────────────────── */
.fa-search-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

/* single product card */
.fa-search-card {
    display: flex;
    flex-direction: column;
    gap: 0;
    text-decoration: none;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #f0d4d6;
    background: #fff;
    transition: box-shadow .2s, transform .2s;
}

    .fa-search-card:hover {
        box-shadow: 0 8px 24px rgba(104, 18, 38, .12);
        transform: translateY(-2px);
    }

.fa-search-card__img {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f5dfe1;
}

    .fa-search-card__img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform .4s;
    }

    .fa-search-card:hover .fa-search-card__img img {
        transform: scale(1.06);
    }

.fa-search-card__body {
    padding: 10px 11px 12px;
}

.fa-search-card__title {
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: var(--fa-ink, #651126);
    line-height: 1.3;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fa-search-card__price {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.fa-search-card__price-now {
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: var(--fa-wine, #681226);
}

.fa-search-card__price-old {
    font-size: 11px;
    color: #c4a0a0;
    text-decoration: line-through;
}

.fa-search-card__cat {
    font-size: 10px;
    color: #c8a4a8;
    margin-top: 3px;
}

/* ── "View all results" footer link ─────────────────── */
.fa-search-view-all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    border-radius: 999px;
    border: 1.5px solid #e8c8ca;
    background: #FFF8F7;
    color: var(--fa-wine, #681226);
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: background .2s, border-color .2s, box-shadow .2s;
    margin-top: 6px;
}

    .fa-search-view-all:hover {
        background: var(--fa-wine, #681226);
        border-color: var(--fa-wine, #681226);
        color: #fff;
        box-shadow: 0 8px 20px rgba(104, 18, 38, .2);
    }

/* ── States ─────────────────────────────────────────── */
.fa-search-loading,
.fa-search-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 36px 20px;
    text-align: center;
    color: var(--fa-muted, #6d6460);
    font-size: 14px;
    gap: 12px;
}

.fa-search-loading svg {
    animation: fa-spin .7s linear infinite;
    color: #d78ea1;
}

@keyframes fa-spin {
    to { transform: rotate(360deg); }
}

.fa-search-empty svg {
    color: #e8c8ca;
}

.fa-search-empty strong {
    display: block;
    color: var(--fa-ink, #651126);
    font-size: 15px;
    margin-bottom: 4px;
}

/* ── Highlight matched text ─────────────────────────── */
.fa-search-highlight {
    background: #ffe5e8;
    color: var(--fa-wine, #681226);
    border-radius: 2px;
    padding: 0 1px;
}

/* ── Popular searches chips ─────────────────────────── */
.fa-search-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.fa-search-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid #e8c8ca;
    background: #FFF8F7;
    color: var(--fa-ink, #651126);
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: background .2s, border-color .2s;
    cursor: pointer;
}

    .fa-search-chip:hover {
        background: var(--fa-blush, #f4dddd);
        border-color: #d78ea1;
        color: var(--fa-wine, #681226);
    }

/* ═══════════════════════════════════════════════════
   MOBILE — full screen takeover
═══════════════════════════════════════════════════ */
@media (max-width: 767px) {
    .fa-search-panel {
        max-height: 100dvh;
    }

    .fa-search-bar-row {
        padding: 12px 16px;
    }

    .fa-search-body {
        padding: 16px 16px 32px;
    }

    .fa-search-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .fa-search-card__title { font-size: 11px; }
    .fa-search-card__price-now { font-size: 12px; }
}

@media (min-width: 768px) and (max-width: 1099px) {
    .fa-search-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ── Header search bar trigger (top strip) ──────────── */
.fa-top-search {
    cursor: text;
}

    .fa-top-search input {
        cursor: text;
    }
