/* ============================================================
   MOBILE / _nav.css — Menú hamburguesa y drawer de navegación
   Breakpoint: max-width 900px (sincronizado con JS en app.blade.php)
   ============================================================ */

/* ── Botón hamburguesa (oculto en desktop) ─────────────────── */
.menu-hamburguesa {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    cursor: pointer;
    z-index: 1100;
    flex-shrink: 0;
}

.menu-hamburguesa span {
    display: block;
    width: 100%;
    height: 1.5px;
    background-color: #d4af37;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animación X al activarse */
.menu-hamburguesa.activo span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-hamburguesa.activo span:nth-child(2) {
    opacity: 0;
}

.menu-hamburguesa.activo span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Task 4: ocultar la X del hamburguesa cuando el drawer está abierto
   (el circular .menu-cerrar dentro del drawer ya cumple esa función) */
.menu-hamburguesa.activo {
    display: none;
}

/* ── Overlay oscuro detrás del drawer ──────────────────────── */
.menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(2px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.menu-overlay.activo {
    display: block;
    opacity: 1;
}

/* ── Botón cerrar (X) dentro del drawer ────────────────────── */
.menu-cerrar {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #d4af37;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.menu-cerrar:hover {
    background: #d4af37;
}

.menu-cerrar:hover svg {
    stroke: #000;
}

.menu-cerrar svg {
    width: 16px;
    height: 16px;
    stroke: #d4af37;
    stroke-width: 2;
}

/* ── Breakpoint: activar menú móvil ────────────────────────── */
@media (max-width: 900px) {

    .menu-hamburguesa {
        display: flex;
    }

    .menu-cerrar {
        display: flex;
    }

    /* Drawer lateral inspirado en 'Gloweet' adaptado a DH Black/Gold */
    .header-principal.figma-header .navegacion {
        box-sizing: border-box;
        position: fixed;
        top: 0;
        right: -100%;
        width: 85vw;
        max-width: 400px;
        height: 100vh;
        background: #0a0a0a;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.8);
        border-left: 1px solid #222;
        border-right: none;
        flex-direction: column;
        justify-content: flex-start !important;
        /* Vence el space-between de escritorio */
        align-items: stretch;
        padding: 50px 20px 20px;
        gap: 0;
        margin-left: 0;
        z-index: 1000;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
    }

    /* Corrección crítica de desborde horizontal para que el buscador no se corte */
    .header-principal.figma-header .navegacion *,
    .header-principal.figma-header .navegacion *::before,
    .header-principal.figma-header .navegacion *::after {
        box-sizing: border-box;
    }

    .header-principal.figma-header .navegacion.activo {
        right: 0;
    }


    /* Contenedores Principales */
    .header-principal.figma-header .navegacion .nav-links-group,
    .header-principal.figma-header .navegacion .nav-right-group {
        display: flex;
        flex-direction: column;
        width: 100%;
        margin: 0;
    }

    /* ORDEN Y DISEÑO TIPO TARJETA UNIFICADA */
    .navegacion .nav-links-group {
        order: 1;
        background: #111;
        border-radius: 20px 20px 0 0;
        padding: 10px 10px 5px 10px;
        margin-bottom: 0;
        box-shadow: none;
        /* Quitamos sombra inferior para pegarlo con nav-right-group */
    }

    /* BUSCADOR Y CARRITO (Dentro de nav-right-group pegado al anterior) */
    .navegacion .nav-right-group {
        order: 2;
        background: #111;
        /* Mismo fondo para simular la misma tarjeta */
        border-radius: 0 0 20px 20px;
        padding: 5px 10px 15px 10px !important;
        margin: 0 0 20px 0 !important;
        gap: 15px;
        width: 100%;
        align-items: stretch;
        box-shadow: 0 10px 15px rgba(0, 0, 0, 0.5);
        /* Sombra solo al fondo de ambos */
    }

    .navegacion .header-figma-actions {
        display: flex;
        flex-direction: column;
        gap: 15px;
        width: 100%;
        padding: 0 !important;
        margin: 0 !important;
        align-items: stretch;
    }

    .navegacion .header-search-wrapper {
        width: 100%;
        margin: 0;
    }

    /* Buscador estilo burbuja */
    .navegacion .header-search-expand {
        display: flex;
        align-items: center;
        background: #fff;
        border-radius: 30px;
        padding: 10px 15px;
        width: 100%;
        box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
    }

    .navegacion .header-search-btn {
        margin-right: 10px;
        color: #555;
        display: flex;
        align-items: center;
    }

    .navegacion .header-search-btn svg {
        width: 18px;
        height: 18px;
        stroke-width: 2.5;
    }

    .navegacion #header-search-input {
        width: 100%;
        background: transparent;
        border: none;
        color: #111;
        font-size: 1em;
        font-weight: 500;
        outline: none;
    }

    .navegacion #header-search-input::placeholder {
        color: #888;
    }

    /* BOTONES DE SESIÓN Y REGISTRO (Al pie del drawer) */
    .navegacion>a:not(.nav-link):not(.carrito-link),
    .navegacion .nav-usuario-dropdown,
    .navegacion .btn-registro {
        text-align: left;
        display: flex;
        align-items: center;
        width: 100% !important;
        color: #d4af37;
        text-decoration: none;
        padding: 12px 10px !important;
        margin: 0 !important;
        font-size: 1.05em;
        font-weight: 600;
        box-sizing: border-box;
    }

    .navegacion .btn-registro {
        background: #d4af37;
        color: #000;
        padding: 14px 20px !important;
        border-radius: 30px;
        justify-content: center;
        margin-top: 5px !important;
        font-weight: 700;
    }

    /* Links individuales */
    .navegacion .nav-link {
        display: block;
        padding: 16px 15px;
        border-bottom: none;
        border-radius: 12px;
        font-size: 1.05em;
        font-weight: 600;
        text-align: left;
        color: #f5f5f5;
        transition: all 0.2s;
        margin-bottom: 2px;
    }

    .navegacion .nav-link:hover {
        background: rgba(212, 175, 55, 0.15);
        color: #d4af37;
    }

    .navegacion .nav-link:hover {
        background-color: rgba(212, 175, 55, 0.05);
        color: #d4af37;
        padding-left: 25px;
    }

    /* Dropdown en móvil: estático */
    .nav-dropdown {
        width: 100%;
    }

    .nav-dropdown>.nav-link {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .navegacion .nav-dropdown .nav-link {
        min-width: 0;
        justify-content: space-between;
    }

    .dropdown-content {
        position: static;
        display: none;
        background: rgba(0, 0, 0, 0.3);
        box-shadow: none;
        margin: 0;
        border-radius: 0;
        min-width: 100%;
    }

    .nav-dropdown.dropdown-activo .dropdown-content {
        display: block;
    }

    .dropdown-content a {
        padding: 10px 25px;
        font-size: 0.85em;
        border-bottom: 1px solid rgba(212, 175, 55, 0.1);
    }

    .dropdown-content a:last-child {
        border-bottom: none;
    }

    /* CARRITO EN BLOQUE ASIMILADO A LA BÚSQUEDA */
    .carrito-link {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        /* Alineado a la izquierda */
        width: 100%;
        background: #111;
        border: 1px solid #333;
        border-radius: 30px;
        padding: 10px 20px;
        /* Igual que el pad del buscador internamente */
        color: #fff;
        text-decoration: none;
        font-size: 1em;
        font-weight: 600;
        gap: 12px;
        box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2);
        margin: 0;
    }

    .carrito-link::after {
        content: "Mi Carrito";
    }

    .carrito-link svg {
        width: 22px;
        height: 22px;
        stroke: #d4af37;
    }

    .carrito-link .badge,
    .carrito-link .carrito-badge {
        position: static;
        background: #d4af37;
        color: #000;
        font-size: 0.9em;
        font-weight: 800;
        width: 22px;
        height: 22px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        margin-left: 2px;
    }

    /* Botón X posicionado y visible de color dorado */
    .menu-cerrar {
        top: 15px;
        right: 15px;
        width: 35px;
        height: 35px;
        background: #1a1a1a;
        border: 1px solid #d4af37;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1050;
        cursor: pointer;
        color: #d4af37 !important;
        /* Fuerza currentColor de los SVG internos */
    }

    .menu-cerrar svg,
    .menu-cerrar svg path {
        stroke: #d4af37 !important;
        stroke-width: 2.5;
        width: 18px;
        height: 18px;
    }

    /* Header row */
    .header-principal .contenedor {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        flex-wrap: nowrap;
    }

    /* Logo reducido */
    .logo-imagen {
        width: 55px;
        height: 55px;
    }

    .logo-texto {
        font-size: 1.1em;
    }

    .slogan-rotativo {
        display: none;
    }
}

/* ── Teléfonos pequeños (< 480px) ──────────────────────────── */
@media (max-width: 480px) {

    .navegacion {
        width: 80vw;
        max-width: 320px;
        padding: 50px 15px 15px;
    }

    .navegacion .nav-link {
        padding: 10px 12px;
        font-size: 0.85em;
    }

    .dropdown-content a {
        padding: 8px 20px;
        font-size: 0.8em;
    }

    .btn-registro {
        padding: 8px 12px;
        font-size: 0.85em;
    }

    .logo-imagen {
        width: 45px;
        height: 45px;
    }

    .logo-texto {
        font-size: 0.95em;
    }

    /* Ocultar texto del logo en teléfonos muy pequeños */
    .logo>a>div {
        display: none;
    }

    .menu-cerrar {
        width: 26px;
        height: 26px;
        top: 10px;
        right: 10px;
    }

    .menu-cerrar svg {
        width: 14px;
        height: 14px;
    }
}