/* ════════════════════════════════
   SEARCH OVERLAY - Identité Aperitiu
   Bandeau plein-largeur qui descend du haut.
   Fond crème, bande gradient haute (signature), loupe rouge, items polaroid.
════════════════════════════════ */

:root {
    --so-cream:     #f3e9d7;
    --so-cream-2:   #fbf4e9;
    --so-cream-3:   #f1ead8;
    --so-orange:    #ffa200;
    --so-orange-2:  #f3a63c;
    --so-red:       #e85a28;
    --so-red-dark:  #b22222;
    --so-dark:      #242323;
    --so-muted:     #7a6b58;
    --so-border:    rgba(36, 35, 35, 0.12);

    --so-font-display: 'Darumadrop One', 'Caveat', 'Poppins', system-ui, sans-serif;
    --so-font-body:    'DM Sans', 'Poppins', system-ui, sans-serif;
}

.search-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
    pointer-events: none;
}

.search-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.search-overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(36, 35, 35, 0.55);
    cursor: pointer;
}

/* ── Panneau : bandeau qui descend du haut ── */
.search-overlay-panel {
    position: relative;
    width: 100%;
    background: var(--so-cream-2);
    box-shadow: 0 22px 56px rgba(36, 35, 35, 0.22);
    transform: translateY(-100%);
    transition: transform .42s cubic-bezier(.2, .8, .2, 1);
    overflow: hidden;
}

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

/* Bande dégradée en haut - signature Aperitiu (hero / cookie / modals) */
.search-overlay-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--so-red) 0%, var(--so-orange) 50%, var(--so-red) 100%);
    z-index: 2;
}

/* ── Barre input ── */
.search-overlay-bar {
    display: flex;
    align-items: center;
    gap: 18px;
    max-width: 1440px;
    margin: 0 auto;
    padding: 28px 40px 22px;
    box-sizing: border-box;
    position: relative;
}

/* Soulignement décoratif sous la barre (pointillé Aperitiu) */
.search-overlay-bar::after {
    content: '';
    position: absolute;
    left: 40px;
    right: 40px;
    bottom: 0;
    height: 1.5px;
    background-image: linear-gradient(to right, var(--so-border) 50%, transparent 50%);
    background-size: 10px 1.5px;
    background-repeat: repeat-x;
}

/* Loupe en cercle rouge (signature) */
.search-overlay-icon {
    width: 22px;
    height: 22px;
    color: #fff;
    flex-shrink: 0;
    padding: 12px;
    background: var(--so-red);
    border-radius: 50%;
    box-shadow: 0 8px 18px rgba(232, 90, 40, 0.30);
    box-sizing: content-box;
    stroke-width: 2.2;
}

.search-overlay-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    font-family: var(--so-font-display);
    font-size: 1.7rem;
    line-height: 1.2;
    color: var(--so-dark);
    outline: none;
    padding: 0;
    letter-spacing: 0.005em;
}
.search-overlay-input::placeholder {
    color: var(--so-muted);
    font-family: var(--so-font-display);
    font-size: 1.5rem;
    font-style: normal;
    opacity: 0.75;
}

/* Close en pilule ronde - même pattern que les autres modals */
.search-overlay-close {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: rgba(36, 35, 35, 0.08);
    color: var(--so-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .2s ease, transform .2s ease, color .2s ease;
}
.search-overlay-close svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.search-overlay-close:hover {
    background: var(--so-red);
    color: #fff;
    transform: rotate(90deg);
}

/* ── Zone résultats ── */
.search-overlay-results {
    max-width: 1440px;
    margin: 0 auto;
    padding: 22px 40px 32px;
    box-sizing: border-box;
    max-height: calc(100vh - 130px);
    overflow-y: auto;
}

/* Scrollbar custom orange */
.search-overlay-results::-webkit-scrollbar { width: 8px; }
.search-overlay-results::-webkit-scrollbar-track { background: transparent; }
.search-overlay-results::-webkit-scrollbar-thumb {
    background: rgba(232, 90, 40, 0.3);
    border-radius: 4px;
}
.search-overlay-results::-webkit-scrollbar-thumb:hover { background: var(--so-red); }

.search-overlay-hint {
    margin: 0;
    padding: 30px 0 20px;
    text-align: center;
    color: var(--so-muted);
    font-family: var(--so-font-body);
    font-size: 0.92rem;
    line-height: 1.5;
}

.search-overlay-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px;
}

/* Item style polaroid : crème, bord léger, hover lift + bord rouge */
.search-overlay-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    background: var(--so-cream-2);
    border: 1.5px solid var(--so-border);
    border-radius: 16px;
    text-decoration: none;
    color: var(--so-dark);
    transition: transform .18s ease, box-shadow .2s ease, border-color .18s ease;
}
.search-overlay-item:hover,
.search-overlay-item:focus {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(36, 35, 35, 0.10);
    border-color: rgba(232, 90, 40, 0.45);
    outline: none;
}

/* Thumb en mini-polaroid avec rotation Aperitiu */
.search-overlay-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
    background: var(--so-cream-3);
    border: 4px solid #fff;
    box-shadow: 0 4px 10px rgba(36, 35, 35, 0.12);
    flex-shrink: 0;
    transform: rotate(-2deg);
    transition: transform .22s ease;
    box-sizing: content-box;
}
.search-overlay-item:hover .search-overlay-thumb {
    transform: rotate(0deg) scale(1.04);
}

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

.search-overlay-product-title {
    font-family: var(--so-font-display);
    font-weight: 400;
    font-size: 1.15rem;
    color: var(--so-dark);
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.005em;
}

.search-overlay-cat {
    font-family: var(--so-font-body);
    font-size: 0.72rem;
    color: var(--so-red);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 2px;
}

.search-overlay-price {
    font-family: var(--so-font-display);
    font-weight: 400;
    font-size: 1.15rem;
    color: var(--so-red);
    flex-shrink: 0;
    letter-spacing: 0.005em;
}

.search-overlay-more {
    grid-column: 1 / -1;
    margin: 12px 0 0;
    padding: 14px;
    text-align: center;
    background: rgba(255, 162, 0, 0.10);
    border: 1.5px dashed rgba(255, 162, 0, 0.45);
    border-radius: 14px;
    color: var(--so-dark);
    font-family: var(--so-font-body);
    font-size: 0.88rem;
    font-weight: 500;
    font-style: normal;
}

/* Désactive le scroll body quand l'overlay est ouvert (géré aussi en JS) */
body.search-overlay-open { overflow: hidden; }

@media (max-width: 720px) {
    .search-overlay-bar {
        padding: 20px 20px 16px;
        gap: 12px;
    }
    .search-overlay-bar::after { left: 20px; right: 20px; }

    .search-overlay-icon {
        width: 18px;
        height: 18px;
        padding: 10px;
    }
    .search-overlay-input { font-size: 1.3rem; }
    .search-overlay-input::placeholder { font-size: 1.15rem; }
    .search-overlay-close { width: 38px; height: 38px; }
    .search-overlay-close svg { width: 14px; height: 14px; }

    .search-overlay-results {
        padding: 18px 20px 24px;
        max-height: calc(100vh - 105px);
    }
    .search-overlay-list {
        grid-template-columns: 1fr;
    }
}
