/* ========== RESPONSIVE FIXES: PROTOCOLO FINAL (FUSIÓN V6.0) ========== */
/* Incluye: Menú Compacto, Rescate de Vaca, Unlock Terminal y Scrolls Horizontales */

/* ===========================================================
   1. HEADER & MENÚ COMPACTO (Solución para no tapar botones)
   =========================================================== */
@media screen and (max-width: 1280px) {

    /* 1. OCULTAR ICONOS DEL HEADER (Lupa, Mundo, Login) EN MÓVIL */
    /* Esto limpia el espacio para que no se encimen con la hamburguesa */
    .header-actions .action-btn {
        display: none !important;
    }

    /* 2. MOSTRAR SOLO LA HAMBURGUESA */
    /* Usamos el ID o la clase específica para forzar su aparición */
    .header-actions .menu-toggle,
    #menuToggle {
        display: flex !important;
        position: relative !important;
        z-index: 10005 !important;
        /* Encima del header */
        width: 50px;
        height: 50px;
        background: rgba(255, 255, 255, 0.1);
        /* Fondo sutil para verlo */
        border-radius: 8px;
        justify-content: center;
        align-items: center;
        margin-left: auto;
        /* Empujar a la derecha */
    }

    .menu-toggle span {
        background: #fff !important;
        /* Líneas blancas fuertes */
        height: 3px !important;
        width: 25px !important;
        margin: 5px 0 !important;
    }

    /* 3. LA CAJA DEL MENÚ DESPLEGABLE */
    .nav-left {
        position: fixed !important;
        top: 90px;
        right: -120%;
        /* Oculto completamente */
        width: 280px !important;
        height: auto !important;
        max-height: 80vh;
        background: rgba(15, 15, 35, 0.98) !important;
        backdrop-filter: blur(20px);
        border: 1px solid var(--primary-cyan);
        border-radius: 15px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
        flex-direction: column;
        justify-content: flex-start;
        padding: 30px 20px !important;
        transition: right 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
        z-index: 10000 !important;
        overflow-y: auto;
    }

    .nav-left.active {
        right: 15px !important;
        /* Aparece flotando a la derecha */
    }

    .nav-link {
        width: 100%;
        font-size: 1.2rem !important;
        margin: 10px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        padding-bottom: 10px;
        display: flex;
        justify-content: flex-start;
    }
}

/* ===========================================================
   2. HERO SECTION (Estático y Centrado)
   =========================================================== */
@media screen and (max-width: 1280px) {
    .carousel {
        height: 100vh;
        min-height: 600px;
        overflow: hidden;
        margin-top: 0;
        background: #000;
        position: relative;
    }

    .carousel .list {
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
        top: 0;
        left: 0;
        transform: none;
    }

    /* Inhibidor de animaciones */
    .carousel .list .item,
    .carousel.next .item,
    .carousel.prev .item {
        width: 100% !important;
        height: 100% !important;
        position: absolute;
        inset: 0;
        border-radius: 0;
        animation: none !important;
        transition: opacity 0.5s ease-in-out;
        opacity: 0;
        z-index: 1;
        transform: none !important;
    }

    /* Item Activo */
    .carousel .list .item:nth-child(2) {
        opacity: 1 !important;
        z-index: 10;
    }

    /* IMAGEN CENTRADA */
    .carousel .list .item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        /* Ajusta este valor si quieres subir o bajar el foco de la imagen */
        object-position: center -160px !important;
        position: absolute;
        top: 0;
        left: 0;
        opacity: 0.6;
        transform: none !important;
    }

    /* TEXTO HERO */
    .carousel .list .item .introduce {
        position: absolute;
        bottom: 12%;
        left: 5% !important;
        width: 45% !important;
        max-width: 500px !important;
        padding: 20px;
        text-align: left !important;
        background: linear-gradient(to right, rgba(0, 0, 0, 0.8), transparent) !important;
        border-radius: 15px;
        transform: none !important;
        opacity: 1 !important;
        animation: none !important;
        z-index: 5;
    }

    @media screen and (max-width: 768px) {
        .carousel .list .item .introduce {
            width: 100% !important;
            left: 0 !important;
            bottom: 15% !important;
            text-align: center !important;
            background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent) !important;
        }
    }

    .introduce .topic {
        font-size: 2.2rem !important;
        line-height: 1.1;
    }

    .introduce .des {
        font-size: 1rem !important;
        -webkit-line-clamp: 4;
        line-clamp: 4;
        -webkit-box-orient: vertical;
        overflow: hidden;
        display: -webkit-box;
    }
}

/* ===========================================================
   3. HOME FOLDERS (Scroll Horizontal Swipe)
   =========================================================== */
@media screen and (max-width: 1280px) {
    .folders-container-linear {
        display: flex !important;
        flex-direction: row !important;
        /* Horizontal */
        flex-wrap: nowrap !important;
        /* No bajar línea */
        overflow-x: auto !important;
        /* Scroll activado */
        justify-content: flex-start !important;
        align-items: flex-start;
        padding: 20px 20px 40px 20px !important;
        gap: 20px;
        width: 100%;
        -webkit-overflow-scrolling: touch;
    }

    .glass-folder {
        min-width: 280px !important;
        /* Ancho fijo para que no se aplasten */
        max-width: 280px !important;
        margin: 0 !important;
        transform: none !important;
        flex-shrink: 0;
        /* Evitar que se encojan */
    }

    /* Estilizar barra scroll horizontal */
    .folders-container-linear::-webkit-scrollbar {
        height: 4px;
    }

    .folders-container-linear::-webkit-scrollbar-thumb {
        background: var(--primary-cyan);
        border-radius: 10px;
    }
}

/* ===========================================================
   4. ARSENAL CATEGORÍAS (Scroll Horizontal Swipe)
   =========================================================== */
@media screen and (max-width: 1280px) {

    /* Contenedor Padre de la fila */
    .acp-categories-row {
        display: flex !important;
        flex-direction: row !important;
        align-items: center;
        gap: 10px;
        width: 100%;
        overflow: hidden;
        /* Evita scroll general, lo delegamos al hijo */
        padding: 0 10px;
    }

    /* El área que debe hacer scroll (donde están las cartas) */
    .acp-scroll-area {
        display: flex !important;
        flex-direction: row !important;
        /* Fila obligatoria */
        flex-wrap: nowrap !important;
        /* PROHIBIDO bajar de línea */
        overflow-x: auto !important;
        /* Scroll horizontal ACTIVADO */
        gap: 15px;
        width: 100%;
        padding: 10px 5px;
        -webkit-overflow-scrolling: touch;
        /* Suavidad en iOS */
        scroll-behavior: smooth;
    }

    /* Las tarjetas de categoría dentro del scroll */
    .acp-scroll-area .geek-card {
        min-width: 160px !important;
        /* Ancho fijo para obligar scroll */
        max-width: 160px !important;
        height: auto !important;
        margin: 0 !important;
        flex-shrink: 0;
        /* Evita que se aplasten */
    }

    /* Ajustes internos de la tarjeta para móvil */
    .geek-card .content h2 {
        font-size: 1rem !important;
    }

    .geek-card .content ul {
        display: none;
        /* Opcional: Ocultar sublistas en la vista previa para ahorrar espacio */
    }

    /* Ocultar botones laterales si estorban (Lupa y Reset) */
    .geek-card.search-card,
    .geek-card.reset-card {
        min-width: 50px !important;
        width: 50px !important;
        padding: 0 !important;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    /* Barra de scroll estilizada */
    .acp-scroll-area::-webkit-scrollbar {
        height: 4px;
    }

    .acp-scroll-area::-webkit-scrollbar-thumb {
        background: var(--primary-cyan);
        border-radius: 10px;
    }
}

@media screen and (max-width: 1280px) {
    .acp-slider-wrapper {
        display: none !important;
    }
}

/* 2. GESTIÓN DE ICONOS HEADER VS MENÚ */
@media screen and (max-width: 1280px) {

    /* Ocultar los botones originales del header (Lupa, Mundo, User) */
    .header-actions .action-btn {
        display: none !important;
    }

    /* Asegurar que la Hamburguesa sea el ÚNICO rey */
    .menu-toggle {
        display: flex !important;
        margin-left: auto;
        /* Empujar a la derecha */
        z-index: 20002 !important;
    }

    /* Mostrar los nuevos enlaces móviles que agregaremos con JS */
    .nav-link.mobile-only-link {
        display: flex !important;
        /* Se muestran en el menú desplegable */
        color: var(--primary-cyan) !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        margin-top: 10px;
        padding-top: 15px;
    }
}

/* En escritorio, esos enlaces nuevos NO deben existir */
@media screen and (min-width: 1281px) {
    .nav-link.mobile-only-link {
        display: none !important;
    }
}

/* 3. CORRECCIÓN CARRUSEL CATEGORÍAS (Arsenal) */
@media screen and (max-width: 1280px) {
    .acp-scroll-area {
        display: flex !important;
        flex-wrap: nowrap !important;
        /* Obligar fila india */
        overflow-x: auto !important;
        /* Permitir deslizar */
        justify-content: flex-start !important;
        width: 100%;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
        gap: 15px;
    }

    /* Asegurar que las tarjetas no se encojan */
    .acp-scroll-area .geek-card {
        min-width: 160px !important;
        flex-shrink: 0 !important;
    }
}

/* ===========================================================
   5. FOOTER & VACA (Rescate V4.0)
   =========================================================== */
.footer {
    overflow: visible !important;
    position: relative;
    z-index: 5;
    margin-top: 300px !important;
    /* Espacio para animación */
}

/* Escenario Parallax */
.footer__parralax {
    top: -300px !important;
    height: 300px !important;
    width: 100%;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
    visibility: visible !important;
    opacity: 1 !important;
}

/* La Vaca / Coche */
.footer__parralax-voiture {
    z-index: 10 !important;
    visibility: visible !important;
    opacity: 1 !important;
    bottom: 0 !important;
}

@media screen and (max-width: 768px) {

    /* Logo Footer */
    .footer-logo {
        transform: none !important;
        margin: 0 auto 20px auto !important;
        display: block;
        max-width: 180px;
    }

    .footer__columns {
        text-align: center;
        display: flex;
        flex-direction: column;
    }

    /* Logo primero */
    .footer__col.center-col {
        order: -1;
    }
}

/* ===========================================================
   6. TERMINAL TRANSACCIONAL (Unlock Scroll V4.0)
   =========================================================== */
@media screen and (max-width: 1280px) {

    /* IMPORTANTE: Permitir scroll en body */
    body {
        overflow-y: auto !important;
        overflow-x: hidden;
        height: auto !important;
        position: static !important;
    }

    .checkout-container {
        display: flex;
        flex-direction: column;
        height: auto !important;
        overflow: visible !important;
        padding-bottom: 50px;
        margin-top: 20px;
    }

    .checkout-section {
        height: auto !important;
        overflow: visible !important;
    }

    .form-grid {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .input-group,
    .full-width,
    .half-width {
        width: 100% !important;
    }

    input,
    select,
    textarea {
        font-size: 16px !important;
    }

    .checkout-section.order-summary {
        order: 1;
        margin-bottom: 30px;
    }
}

/* ===========================================================
   7. AJUSTES VARIOS UI
   =========================================================== */
@media screen and (max-width: 1280px) {
    .mib-card {
        width: 92% !important;
        max-width: 450px;
        margin: 0 auto 30px auto;
    }

    .access-row {
        flex-direction: column;
    }

    .reverse-layout {
        flex-direction: column-reverse;
    }
}

/* Zylox Menu (Flotante no intrusivo) */
.ufo-container {
    pointer-events: none;
    z-index: 9000;
}

.ufo-toggle {
    pointer-events: auto;
}

@media screen and (max-width: 480px) {
    .ufo-container {
        bottom: 15px;
        right: 15px;
    }

    .ufo-menu {
        width: 200px;
        height: 200px;
    }
}

/* ===========================================================
   8. CARTA ZYLOX (Contact Modal) - MOBILE FIX
   =========================================================== */
@media screen and (max-width: 1280px) {
    .contact-modal {
        overflow-y: auto !important;
        align-items: flex-start !important;
        padding: 15px 5px !important;
    }

    .contact-modal.active .letter-container {
        transform: scale(0.95) rotate(-1deg) !important;
    }

    .letter-container {
        width: 100% !important;
        max-width: 380px !important;
        min-height: 720px !important;
        padding: 110px 50px 180px 40px !important;
        background-size: 100% 100% !important;
        background-position: center !important;
        margin: 10px auto !important;
        font-size: 1rem !important;
        line-height: 1.6 !important;
    }

    .close-contact {
        position: fixed !important;
        top: 20px !important;
        right: 15px !important;
        left: auto !important;
        width: 40px !important;
        height: 40px !important;
        font-size: 1.3rem !important;
        z-index: 10002 !important;
        background: rgba(0, 0, 0, 0.8) !important;
    }

    .letter-greeting {
        font-size: 1.1rem !important;
        margin-bottom: 12px !important;
    }

    .letter-text {
        font-size: 0.9rem !important;
        line-height: 1.5 !important;
        margin-bottom: 8px !important;
    }

    .inline-input {
        display: inline-block !important;
        width: auto !important;
        min-width: 80px !important;
        max-width: 100% !important;
        font-size: 1rem !important;
        padding: 2px 6px !important;
    }

    .inline-textarea {
        font-size: 0.95rem !important;
        line-height: 1.4 !important;
    }

    .ovni-complex-scale {
        transform: translateX(-50%) scale(0.3) !important;
        bottom: 30px !important;
    }

    .ufo-button-wrapper {
        margin-top: 15px !important;
    }

    .letter-closing {
        font-size: 0.9rem !important;
    }
}

/* ===========================================================
   9. MINI CAROUSELS (Niveles de Acceso) - MOBILE FIX
   =========================================================== */
@media screen and (max-width: 1280px) {
    .access-row {
        flex-direction: column !important;
        gap: 25px !important;
        padding: 1rem 0 !important;
    }

    .reverse-layout {
        flex-direction: column !important;
    }

    .mib-card {
        width: 90% !important;
        min-width: auto !important;
        max-width: 400px !important;
        height: auto !important;
        min-height: 160px !important;
    }

    .mib-content {
        padding: 15px !important;
        gap: 12px !important;
    }

    .mib-photo {
        width: 100px !important;
    }

    .mib-photo img {
        max-height: 80px !important;
    }

    .group-carousel-container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 35px !important;
        height: auto !important;
        min-height: 120px !important;
    }

    .mini-track-container {
        height: auto !important;
        min-height: 100px !important;
    }

    /* MANTENER 3 COLUMNAS - Solo reducir tamaño */
    .group-slide {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
        min-width: 100% !important;
        height: auto !important;
        min-height: 100px !important;
    }

    .rect-card {
        min-height: 90px !important;
        height: auto !important;
    }

    .rect-card img {
        object-fit: cover !important;
    }

    .rect-overlay {
        font-size: 0.6rem !important;
        padding: 3px !important;
    }

    .mini-arrow {
        width: 30px !important;
        height: 30px !important;
        font-size: 14px !important;
    }

    .prev-btn {
        left: 3px !important;
    }

    .next-btn {
        right: 3px !important;
    }
}

@media screen and (max-width: 480px) {

    /* Aún más pequeño en pantallas muy pequeñas, pero siempre 3 columnas */
    .group-slide {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 5px !important;
    }

    .rect-card {
        min-height: 70px !important;
    }

    .mib-card {
        max-width: 95% !important;
        min-height: 140px !important;
    }

    .mib-photo {
        width: 80px !important;
    }

    .mib-photo img {
        max-height: 60px !important;
    }

    .mib-header h3 {
        font-size: 0.9rem !important;
    }

    .mib-body .description {
        font-size: 0.8rem !important;
    }

    .mib-btn {
        font-size: 0.7rem !important;
        padding: 6px 10px !important;
    }

    .group-carousel-container {
        padding: 0 28px !important;
        min-height: 90px !important;
    }
}

/* ===========================================================
   10. ARSENAL PRODUCT GRID - MOBILE FIX
   =========================================================== */
@media screen and (max-width: 900px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
        padding: 0 10px !important;
    }

    .monster-card {
        max-width: 100% !important;
        height: 350px !important;
    }

    .price-tag-compact {
        font-size: 1.4rem !important;
    }

    .add-btn-glass {
        width: 35px !important;
        height: 35px !important;
        font-size: 1rem !important;
    }
}

@media screen and (max-width: 500px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .monster-card {
        height: 280px !important;
    }

    .card-info-overlay {
        padding: 10px !important;
    }

    .price-tag-compact {
        font-size: 1.2rem !important;
    }

    .add-btn-glass {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.9rem !important;
    }

    .products-section {
        padding: 0 5px !important;
    }
}

/* ===========================================================
   11. PRODUCT MODAL - ADD TO ARSENAL BUTTON FIX
   =========================================================== */
@media screen and (max-width: 1280px) {
    .product-modal-content {
        width: 98% !important;
        height: 90vh !important;
        max-height: 90vh !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .pm-dashboard-layout {
        display: flex !important;
        flex-direction: column !important;
        gap: 15px !important;
        padding: 15px !important;
        padding-top: 60px !important;
        height: auto !important;
        min-height: auto !important;
        overflow: visible !important;
        flex: 1 !important;
    }

    .pm-zone-visual {
        height: 200px !important;
        min-height: 200px !important;
        max-height: 200px !important;
        order: 1 !important;
        flex-shrink: 0 !important;
    }

    .pm-zone-config {
        order: 2 !important;
        padding: 10px 5px !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .pm-zone-intel {
        order: 3 !important;
        padding: 10px 5px !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    #pmTitle {
        font-size: 1.3rem !important;
        margin-bottom: 15px !important;
        text-align: center !important;
        word-wrap: break-word !important;
    }

    #pmLegend {
        font-size: 1rem !important;
        margin-bottom: 10px !important;
    }

    .desc-terminal {
        font-size: 0.95rem !important;
        max-height: 150px !important;
        overflow-y: auto !important;
        padding: 10px !important;
        background: rgba(0, 0, 0, 0.3) !important;
        border-radius: 8px !important;
        margin-bottom: 10px !important;
        word-wrap: break-word !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
        white-space: normal !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .price-display {
        font-size: 1.5rem !important;
    }

    .separator-line {
        margin: 10px 0 !important;
    }

    .stock-readout-module {
        margin-bottom: 10px !important;
    }

    .module-label {
        font-size: 0.8rem !important;
        margin-bottom: 10px !important;
    }

    .color-circles-row {
        gap: 10px !important;
        flex-wrap: wrap !important;
    }

    .color-dot {
        width: 35px !important;
        height: 35px !important;
    }

    .pm-action-deck {
        flex-direction: column !important;
        height: auto !important;
        padding: 12px 15px !important;
        gap: 10px !important;
        position: sticky !important;
        bottom: 0 !important;
        background: rgba(15, 15, 35, 0.98) !important;
        border-top: 2px solid var(--primary-cyan) !important;
        z-index: 100 !important;
        flex-shrink: 0 !important;
    }

    .add-to-arsenal-btn {
        width: 100% !important;
        height: 50px !important;
        clip-path: none !important;
        border-radius: 10px !important;
        font-size: 0.95rem !important;
    }

    .qty-control-wrapper {
        width: 100% !important;
        justify-content: center !important;
        background: rgba(255, 255, 255, 0.08) !important;
        border-radius: 8px !important;
    }

    .qty-control-wrapper button {
        width: 45px !important;
        height: 45px !important;
        font-size: 1.3rem !important;
    }

    .qty-control-wrapper input {
        width: 50px !important;
        font-size: 1.2rem !important;
    }

    .close-product {
        top: 10px !important;
        right: 10px !important;
        padding: 6px 12px !important;
        font-size: 0.75rem !important;
        position: absolute !important;
        z-index: 10001 !important;
    }

    .nav-arrow {
        width: 30px !important;
        height: 30px !important;
        font-size: 1rem !important;
    }

    .nav-arrow.left {
        left: 5px !important;
    }

    .nav-arrow.right {
        right: 5px !important;
    }

    .carousel-slide img {
        max-width: 85% !important;
        max-height: 85% !important;
    }
}

/* ===========================================================
   12. ZYLOX MENU (UFO) - POSITIONING FIX
   =========================================================== */
@media screen and (max-width: 1280px) {
    .ufo-container {
        bottom: 15px !important;
        right: 15px !important;
        z-index: 8500 !important;
    }

    .ufo-toggle {
        width: 70px !important;
        height: 70px !important;
    }

    .ufo-menu {
        width: 210px !important;
        height: 210px !important;
    }

    .ufo-menu.active li {
        transform: rotate(calc(360deg / 8 * var(--i))) translateX(85px) !important;
    }

    .ufo-menu li {
        width: 50px !important;
        height: 50px !important;
    }

    .notification-bubble {
        bottom: 180px !important;
        right: 100px !important;
        max-width: 200px !important;
        font-size: 0.9rem !important;
        padding: 10px 15px !important;
    }
}