/* ==========================================================================
   Sagrera Search — Search Layer Overlay
   Estilo adaptado al tema Shoppica de Sagrera Canarias:
     - rojo principal #c70909
     - morado #ff7b0a (acento secundario)
     - tipografía Titillium Web
   ========================================================================== */

/* Backdrop invisible: solo sirve para cerrar al hacer click fuera. */
.ss-backdrop {
    position: fixed;
    inset: 0;
    background: transparent;
    z-index: 99998;
    pointer-events: none;
}

.ss-backdrop.is-open {
    pointer-events: auto;
}

.ss-overlay {
    position: fixed;
    top: 6vh;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    width: min(1020px, 95vw);
    max-height: 84vh;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(80, 39, 5, 0.22);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    font-family: 'Titillium Web', 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    color: #222222;
}

.ss-overlay.is-open {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* ---------- Cabecera ---------- */
.ss-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 22px;
    border-bottom: 1px solid #eee;
    background: #ffffff;
}

.ss-search-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    color: #ff7b0a;
}

.ss-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 20px;
    outline: none;
    color: #222222;
    padding: 6px 0;
    font-family: inherit;
    font-weight: 500;
}

.ss-input::placeholder {
    color: #aaaaaa;
    font-weight: 400;
}

.ss-mic, .ss-close {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #7a7a7a;
    transition: background 0.15s ease, color 0.15s ease;
}

.ss-mic:hover, .ss-close:hover {
    background: #f5f5f5;
    color: #222222;
}

.ss-mic.is-listening {
    color: #ffffff;
    background: #c70909;
    box-shadow: 0 0 0 4px rgba(199, 9, 9, 0.18);
    animation: ss-pulse 1s ease-in-out infinite;
}

@keyframes ss-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

/* ---------- Banner did-you-mean ---------- */
.ss-dym {
    padding: 12px 22px;
    background: #ffffff;
    border-bottom: 1px solid #eee;
    color: #222222;
    font-size: 14px;
}

.ss-dym a {
    color: #c70909;
    font-weight: 700;
    text-decoration: underline;
}

/* ---------- Cuerpo ---------- */
.ss-body {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
    gap: 0;
    overflow: auto;
    flex: 1;
    min-height: 0;
}

.ss-empty {
    grid-column: 1 / -1;
    padding: 50px 22px;
    text-align: center;
    color: #7a7a7a;
}

.ss-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #ff7b0a;
    padding: 16px 22px 8px;
    margin: 0;
}

/* ---------- Productos ---------- */
.ss-products {
    list-style: none;
    margin: 0;
    padding: 0 10px 14px;
    border-right: 1px solid #eee;
}

.ss-product {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: background 0.12s ease;
}

.ss-product:hover, .ss-product.is-active {
    background: #f8f4fa;
}

.ss-product__img {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 8px;
    background: #f5f5f5;
    object-fit: contain;
    border: 1px solid #eee;
}

.ss-product__name {
    font-weight: 600;
    margin: 0 0 4px;
    font-size: 14px;
    color: #222222;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.ss-product__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: baseline;
    font-size: 13px;
}

.ss-product__brand {
    color: #7a7a7a;
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ss-product__price {
    color: #222222;
    font-weight: 700;
    font-size: 15px;
}

.ss-product__price--sale {
    color: #ff7b0a;
}

.ss-product__strike {
    text-decoration: line-through;
    color: #aaaaaa;
    font-size: 12px;
    font-weight: 500;
}

.ss-product__badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #ff7b0a;
    color: #ffffff;
    margin-left: auto;
    flex-shrink: 0;
}

/* ---------- Sidebar (marcas, categorías, populares) ---------- */
.ss-side {
    padding: 0 12px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: auto;
    background: #fafafa;
}

.ss-chip-list {
    list-style: none;
    margin: 0 0 10px;
    padding: 0 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ss-chip {
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    border-radius: 999px;
    background: #ffffff;
    color: #222222;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #e5e5e5;
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.ss-chip:hover {
    background: #ff7b0a;
    color: #ffffff;
    border-color: #ff7b0a;
}

.ss-chip--brand {
    background: #fff3e6;
    border-color: #ffcc99;
    color: #ff7b0a;
}

.ss-chip--brand:hover {
    background: #ff7b0a;
    color: #ffffff;
    border-color: #ff7b0a;
}

.ss-chip--category {
    background: #fff3e6;
    border-color: #ffcc99;
    color: #ff7b0a;
}

.ss-chip--category:hover {
    background: #ff7b0a;
    color: #ffffff;
    border-color: #ff7b0a;
}

/* ---------- Footer ---------- */
.ss-foot {
    border-top: 1px solid #eee;
    padding: 14px 22px;
    background: #fafafa;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    flex-wrap: wrap;
    gap: 10px;
}

.ss-foot__link {
    color: #ffffff;
    background: #ff7b0a;
    padding: 8px 18px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    transition: background 0.15s ease;
}

.ss-foot__link:hover {
    background: #e36a00;
    color: #ffffff;
    text-decoration: none;
}

.ss-foot__hint {
    color: #ff7b0a;
    font-size: 12px;
    font-weight: 600;
}

.ss-kbd {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 4px;
    background: #ffffff;
    border: 1px solid #ddd;
    font-family: "SF Mono", Menlo, Consolas, monospace;
    font-size: 11px;
    color: #555;
    margin: 0 2px;
}

/* ---------- Estado vacío ---------- */
.ss-emptystate {
    grid-column: 1 / -1;
    padding: 26px 22px;
    background: #ffffff;
}

.ss-emptystate h4 {
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #ff7b0a;
}

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
    .ss-overlay {
        top: 0;
        left: 0;
        transform: none;
        width: 100vw;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
    }
    .ss-overlay.is-open {
        transform: none;
    }
    .ss-body {
        grid-template-columns: 1fr;
    }
    .ss-products {
        border-right: none;
        border-bottom: 1px solid #eee;
    }
    .ss-side {
        background: #fafafa;
    }
    .ss-head {
        padding: 12px 16px;
    }
    .ss-input {
        font-size: 18px;
    }
}
