/* ═══════════════════════════════════════════════════════
   HIMOTHY — Search Overlay
   Matches the site's white / clean / luxury design system
   ═══════════════════════════════════════════════════════ */


/* Dark backdrop — same as drawer overlay */

.search-overlay {
    position: fixed;
    inset: 0;
    z-index: 600;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.32s cubic-bezier(0.76, 0, 0.24, 1);
}

.search-overlay.is-open {
    opacity: 1;
    pointer-events: all;
}


/* White top panel — slides down from behind header */

.search-panel {
    background: #ffffff;
    border-bottom: 1px solid rgba(11, 11, 11, 0.09);
    width: 100%;
    transform: translateY(-20px);
    transition: transform 0.36s cubic-bezier(0.76, 0, 0.24, 1);
    z-index: 1;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(11, 11, 11, 0.12);
}

.search-overlay.is-open .search-panel {
    transform: translateY(0);
}


/* Inner width constraint matches site's max-width */

.search-panel-inner {
    max-width: 1905px;
    margin: 0 auto;
    width: 100%;
    padding: 0 var(--section-px, clamp(20px, 3.5%, 66px));
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}


/* Results wrapper gets all remaining space and scrolls */

.search-results-wrap {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(11, 11, 11, 0.12) transparent;
    padding-bottom: 28px;
}

.search-results-wrap::-webkit-scrollbar {
    width: 4px;
}

.search-results-wrap::-webkit-scrollbar-track {
    background: transparent;
}

.search-results-wrap::-webkit-scrollbar-thumb {
    background: rgba(11, 11, 11, 0.12);
    border-radius: 2px;
}


/* ── Input row ───────────────────────────────────────── */

.search-input-row {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 72px;
    border-bottom: 1px solid rgba(11, 11, 11, 0.08);
    flex-shrink: 0;
}

.search-input-icon {
    color: rgba(11, 11, 11, 0.35);
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.search-input-field {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #282828;
    font-family: "HelveticaW1Roman", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: clamp(18px, 2vw, 24px);
    font-weight: 400;
    letter-spacing: 0.01em;
    caret-color: #1d1d1d;
}

.search-input-field::placeholder {
    color: rgba(11, 11, 11, 0.3);
}


/* Hide native browser search clear button */

.search-input-field::-webkit-search-cancel-button,
.search-input-field::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}

.search-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(11, 11, 11, 0.4);
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
    transition: color 0.18s ease, background-color 0.18s ease, transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.search-close-btn:hover {
    color: #282828;
    background-color: rgba(11, 11, 11, 0.06);
    transform: rotate(90deg);
}


/* ── Status / count bar ──────────────────────────────── */

.search-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0 10px;
    flex-shrink: 0;
}

.search-status {
    font-family: "HelveticaW1Roman", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(11, 11, 11, 0.45);
}

.search-view-all {
    font-family: "HelveticaW1Roman", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #1d1d1d;
    text-decoration: none;
    display: none;
}

.search-view-all:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.search-view-all.visible {
    display: inline;
}


/* ── Results grid ────────────────────────────────────── */

.search-results {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}


/* ── Product card — mirrors .product-card from style.css ─ */

.search-result-card {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.search-result-card:hover .search-result-img img {
    transform: scale(1.07);
}

.search-result-img {
    position: relative;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    background-color: #f3f0ea;
}

.search-result-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    transition: transform 0.54s cubic-bezier(0.76, 0, 0.24, 1);
}

.search-result-badge {
    position: absolute;
    top: 7px;
    left: 7px;
    z-index: 2;
    font-family: "HelveticaW1Roman", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 7.5px;
    font-weight: 400;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #ffffff;
    background-color: #282828;
    padding: 3px 7px;
    pointer-events: none;
}

.search-result-info {
    padding: 8px 0 0;
}

.search-result-category {
    font-family: "HelveticaW1Roman", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 9px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(11, 11, 11, 0.4);
    margin-bottom: 3px;
}

.search-result-name {
    font-family: "HelveticaW1Bold", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 11px;
    font-weight: 400;
    color: #282828;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    line-height: 1.3;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-price {
    font-family: "HelveticaW1Roman", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 11px;
    font-weight: 400;
    color: #282828;
    letter-spacing: 0.06em;
}


/* ── No results ──────────────────────────────────────── */

.search-no-results {
    grid-column: 1 / -1;
    padding: 32px 0 16px;
    font-family: "HelveticaW1Roman", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 13px;
    color: rgba(11, 11, 11, 0.4);
    letter-spacing: 0.05em;
}


/* ── Empty state — shown before typing ───────────────── */

.search-empty-state {
    padding: 24px 0 28px;
    flex-shrink: 0;
}

.search-empty-label {
    font-family: "HelveticaW1Roman", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(11, 11, 11, 0.4);
    margin-bottom: 14px;
}

.search-quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.search-quick-link {
    display: inline-block;
    text-decoration: none;
    font-family: "HelveticaW1Roman", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #282828;
    border: 1.5px solid rgba(11, 11, 11, 0.2);
    padding: 7px 18px;
    border-radius: 3px;
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.search-quick-link:hover {
    border-color: #1d1d1d;
    color: #1d1d1d;
}


/* ── Dark backdrop behind panel ──────────────────────── */

.search-backdrop {
    flex: 1;
    background: rgba(11, 11, 11, 0.5);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    cursor: pointer;
}


/* ── Responsive ──────────────────────────────────────── */

@media (max-width: 1100px) {
    .search-results {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 991px) {
    .search-results {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 860px) {
    .search-results {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 700px) {
    .search-results {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .search-input-row {
        height: 56px;
    }
    .search-input-field {
        font-size: 17px;
    }
}

@media (max-width: 480px) {
    .search-results {
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    .search-result-card {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 14px;
        padding: 12px 0;
        border-bottom: 1px solid rgba(11, 11, 11, 0.07);
    }

    .search-result-card:last-child {
        border-bottom: none;
    }

    .search-result-img {
        width: 72px;
        min-width: 72px;
        aspect-ratio: 3 / 4;
        flex-shrink: 0;
    }

    .search-result-info {
        flex: 1;
        padding: 0;
        min-width: 0;
    }

    .search-result-name {
        white-space: normal;
        font-size: 10px;
    }

    .search-result-category {
        font-size: 8px;
    }

    .search-result-price {
        font-size: 10px;
    }

    .search-status-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 10px 0 8px;
    }
}