/* =============================================
   OVERLAY MENU — floating glassmorphism panel
   ============================================= */

.overlay-menu {
    position: fixed;
    top: 12px;
    left: 12px;
    width: min(640px, calc(100vw - 24px));
    z-index: 9999;
    background: rgba(247,244,238,0.82);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255,255,255,0.55);
    border-radius: 1.75rem;
    box-shadow: 0 24px 80px rgba(8,13,36,0.18), 0 2px 12px rgba(8,13,36,0.08);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px 24px 24px;
    gap: 16px;
    min-height: 480px;

    /* Hidden state */
    opacity: 0;
    transform: scale(0.97) translateY(-6px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.overlay-menu.is-open {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: all;
}

/* ── Top bar (close button) ── */
.overlay-menu__topbar {
    display: flex;
    justify-content: flex-end;
}

.overlay-menu__close {
    position: static;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 9999px;
    border: 1.5px solid rgba(14,27,77,0.18);
    background: rgba(255,255,255,0.6);
    color: #0e1b4d;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.overlay-menu__close:hover { background: rgba(255,255,255,0.95); border-color: rgba(14,27,77,0.4); }

/* ── 2-col body ── */
.overlay-menu__body {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 24px;
    align-items: start;
}

/* ── Nav links ── */
.overlay-menu__nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.overlay-menu__nav li {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.overlay-menu.is-open .overlay-menu__nav li { opacity: 1; transform: translateY(0); }
.overlay-menu.is-open .overlay-menu__nav li:nth-child(1) { transition-delay: 0.04s; }
.overlay-menu.is-open .overlay-menu__nav li:nth-child(2) { transition-delay: 0.08s; }
.overlay-menu.is-open .overlay-menu__nav li:nth-child(3) { transition-delay: 0.12s; }
.overlay-menu.is-open .overlay-menu__nav li:nth-child(4) { transition-delay: 0.16s; }
.overlay-menu.is-open .overlay-menu__nav li:nth-child(5) { transition-delay: 0.20s; }

.overlay-menu__nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 1rem;
    font-family: 'AlteHaasGrotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 3.5vw, 2.1rem);
    color: #0e1b4d;
    line-height: 1.1;
    text-decoration: none;
    transition: background 0.18s;
}
.overlay-menu__nav a:hover { background: rgba(14,27,77,0.06); }
.overlay-menu__nav a svg { opacity: 0.35; flex-shrink: 0; transition: opacity 0.2s, transform 0.2s; }
.overlay-menu__nav a:hover svg { opacity: 0.7; transform: translateX(3px); }

/* ── Aside: Most Loved ── */
.overlay-menu__aside {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.overlay-menu__aside-label {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: #0e1b4d;
    opacity: 0.45;
    margin: 0;
}

.overlay-menu__products {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.overlay-menu__product {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 1.1rem;
    background: rgba(255,255,255,0.7);
    border: 1px solid rgba(14,27,77,0.07);
    text-decoration: none;
    transition: background 0.18s;
}
.overlay-menu__product:hover { background: rgba(255,255,255,0.95); }

.overlay-menu__product-img {
    width: 52px;
    height: 52px;
    border-radius: 0.75rem;
    overflow: hidden;
    background: #f0ede8;
    flex-shrink: 0;
}
.overlay-menu__product-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

.overlay-menu__product-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.overlay-menu__product-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #0e1b4d;
    line-height: 1.2;
}
.overlay-menu__product-badge {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #0e1b4d;
    opacity: 0.45;
}

/* ── Mobile-only recommended product (desktop shows the aside instead) ── */
.overlay-menu__mobile-recommend { display: none; }

.overlay-menu__mobile-recommend .overlay-menu__product {
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    overflow: hidden;
}
.overlay-menu__mobile-recommend .overlay-menu__product-img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: 1.1rem 1.1rem 0 0;
    background: #f0ede8;
}
.overlay-menu__mobile-recommend .overlay-menu__product-img img { padding: 24px; }
.overlay-menu__mobile-recommend .overlay-menu__product-info {
    padding: 14px 16px 16px;
    gap: 4px;
}
.overlay-menu__mobile-recommend .overlay-menu__product-name { font-size: 0.95rem; }
.overlay-menu__mobile-recommend .overlay-menu__product-badge { font-size: 0.68rem; }

/* ── Footer: newsletter + isotipo ── */
.overlay-menu__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 4px;
    border-top: 1px solid rgba(14,27,77,0.1);
}

.overlay-menu__newsletter {
    display: flex;
    align-items: center;
    flex: 1;
    background: rgba(255,255,255,0.6);
    border: 1.5px solid rgba(14,27,77,0.14);
    border-radius: 9999px;
    overflow: hidden;
    padding: 0 6px 0 18px;
    max-width: 320px;
}
.overlay-menu__newsletter input {
    flex: 1;
    border: none;
    background: none;
    font-size: 0.82rem;
    color: #0e1b4d;
    padding: 10px 0;
    outline: none;
}
.overlay-menu__newsletter input::placeholder { opacity: 0.45; }
.overlay-menu__newsletter button {
    width: 34px; height: 34px;
    border-radius: 9999px;
    background: #0e1b4d;
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: opacity 0.2s;
}
.overlay-menu__newsletter button:hover { opacity: 0.82; }

.overlay-menu__isotipo img {
    width: 40px;
    height: 40px;
    opacity: 1;
    transition: opacity 0.2s;
}
.overlay-menu__isotipo:hover img { opacity: 0.75; }

/* ── Backdrop ── */
.overlay-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(8,13,36,0.25);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.overlay-backdrop.is-visible {
    opacity: 1;
    pointer-events: all;
}

/* ── Mobile ── */
@media (max-width: 600px) {
    .overlay-menu {
        top: 8px;
        left: 8px;
        width: calc(100vw - 16px);
        padding: 16px;
    }
    .overlay-menu__body { grid-template-columns: 1fr; }
    .overlay-menu__aside { display: none; }
    .overlay-menu__nav a { font-size: 1.6rem; }
    .overlay-menu__mobile-recommend { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
}
