/* ============================================================
   search.css — Dedicated Search Results Page Styles
   Depends on style.css for product cards, filter sidebar,
   sort bar, mobile filter panel, and header.
   ============================================================ */

/* ── Search Hero Bar ────────────────────────────────────── */
.search-hero {
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    padding: 14px 0 0;
    position: sticky;
    top: 0;
    z-index: 50;
}

/* Desktop uses the header search bar — hide the duplicate hero bar */
@media (min-width: 769px) {
    .mobile-only-search {
        display: none !important;
    }
}

/* Mobile: show the hero search bar since the header bar is hidden */
@media (max-width: 768px) {
    .mobile-only-search {
        display: flex;
    }
}

.search-hero-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-hero-form {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-hero-input {
    width: 100%;
    height: 44px;
    border: 2px solid #e5e7eb;
    border-radius: 24px;
    padding: 0 40px 0 18px;
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 400;
    color: #111;
    background: #f8f8f8;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    outline: none;
}


.search-hero-input:focus {
    border-color: #FF2E63;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(255, 46, 99, 0.08);
}

.search-hero-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #9ca3af;
    transition: color 0.2s;
}

.search-hero-btn:hover {
    color: #FF2E63;
}

.search-hero-btn svg {
    display: block;
}

/* Hide browser native clear (X) button on type=search */
.search-hero-input::-webkit-search-cancel-button,
.search-hero-input::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}


/* ── Results Meta Bar ───────────────────────────────────── */
.search-results-meta {
    padding: 0 0 4px;
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    color: #6b7280;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px 10px;
}

.search-results-meta strong {
    color: #111;
    font-weight: 600;
}

.search-results-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff8f9;
    border: 1px solid #ffc6d5;
    color: #FF2E63;
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 6px;
}

/* ── Empty State (no results) ───────────────────────────── */
.search-empty-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    font-family: 'Outfit', sans-serif;
}

.search-empty-state.visible {
    display: flex;
}

.search-empty-icon {
    margin-bottom: 16px;
    color: #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
}


.search-empty-state h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 22px;
    font-weight: 600;
    color: #111;
    margin-bottom: 8px;
}

.search-empty-state p {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 20px;
    max-width: 320px;
    line-height: 1.6;
}

.search-empty-back-btn {
    display: inline-block;
    padding: 10px 24px;
    background: #111;
    color: #fff;
    border-radius: 24px;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s;
}

.search-empty-back-btn:hover {
    background: #FF2E63;
    transform: translateY(-1px);
}

/* ── Loading skeleton (reuses product-card skeleton) ─────  */
.search-skeleton-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 0;
}

@media (max-width: 600px) {
    .search-skeleton-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ── Responsive tweaks ───────────────────────────────────── */
@media (max-width: 768px) {
    .search-hero-inner {
        padding: 0 12px 12px;
    }

    .search-hero-input {
        font-size: 14px;
        height: 40px;
    }

    .search-results-meta {
        padding: 0 12px 8px;
        font-size: 12px;
    }
}

/* ── Search Dropdown (live results + recent) ─────────────── */
.search-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    z-index: 200;
    max-height: 420px;
    overflow-y: auto;
    overflow-x: hidden;
    animation: dropdown-in 0.18s ease;
    scrollbar-width: none;
}

.search-dropdown::-webkit-scrollbar {
    display: none;
}

.search-dropdown.open {
    display: block;
}

@keyframes dropdown-in {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Dropdown section headers ───── */
.search-dropdown-section {
    padding: 10px 14px 4px;
    font-family: 'Outfit', sans-serif;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
}

/* ── Recent search row ──────────── */
.search-recent-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    cursor: pointer;
    transition: background 0.13s;
}

.search-recent-row:hover {
    background: #fdf2f5;
}

.search-recent-icon {
    flex-shrink: 0;
    color: #9ca3af;
    display: flex;
    align-items: center;
}

.search-recent-term {
    flex: 1;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-recent-del {
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 3px 5px;
    cursor: pointer;
    color: #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1;
    transition: color 0.15s, background 0.15s;
}

.search-recent-del:hover {
    color: #FF2E63;
    background: #fff0f4;
}

/* ── Live result card row ───────── */
.search-live-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background 0.13s;
}

.search-live-row:hover {
    background: #fdf2f5;
}

.search-live-img {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid #f0f0f0;
    background: #f8f8f8;
}

.search-live-img-placeholder {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, #fdf2f5, #fff0f4);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    border: 1px solid #f0f0f0;
}

.search-live-info {
    flex: 1;
    overflow: hidden;
}

.search-live-name {
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-live-brand {
    font-family: 'Outfit', sans-serif;
    font-size: 11px;
    color: #9ca3af;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-live-price {
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #FF2E63;
    flex-shrink: 0;
    white-space: nowrap;
}

/* ── "See all results" footer row ── */
.search-see-all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 14px;
    border-top: 1px solid #f5f5f5;
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #FF2E63;
    cursor: pointer;
    transition: background 0.13s;
}

.search-see-all:hover {
    background: #fdf2f5;
}

/* ── Empty dropdown (no results) ── */
.search-dropdown-empty {
    padding: 18px 14px;
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    color: #9ca3af;
    text-align: center;
}

/* ── Divider between sections ───── */
.search-dropdown-divider {
    height: 1px;
    background: #f5f5f5;
    margin: 4px 0;
}

@media (max-width: 600px) {
    .search-dropdown {
        border-radius: 12px;
        max-height: 340px;
    }

    .search-live-img,
    .search-live-img-placeholder {
        width: 38px;
        height: 38px;
    }
}

/* ── Mobile: hide search dropdown (live search handles results) */
@media (max-width: 768px) {
    .search-dropdown {
        display: none !important;
    }
}