/* =========================================
   AR DEV STUDIO - ESTILOS PROFESIONALES V5 (FINAL)
   ========================================= */

/* 1. VARIABLES Y CONFIGURACIÓN BASE */
:root {
    --primary-blue: #001233;  /* Tu marca: Azul Oscuro */
    --teal: #00b4d8;          /* Tu acento: Cyan */
    --white: #ffffff;
    --dark-text: #333;
    --offcanvas-bg: rgba(0, 18, 51, 0.98); /* Fondo menú móvil casi sólido */
}

body {
    font-family: 'Poppins', sans-serif;
    overflow-x: hidden; /* CRÍTICO: Evita que la página baile de lado a lado */
    color: var(--dark-text);
}

html { scroll-behavior: smooth; }

/* 2. PANTALLA DE CARGA (PRELOADER) */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #001233; /* Tu color de fondo azul oscuro */
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
/* Clase para ocultarlo con JS */
#preloader.hide {
    opacity: 0;
    visibility: hidden;
}

/* Contenedor central */
.tech-loader {
    position: relative;
    width: 100px;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* El texto AR central */
.brand-text {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.8rem;
    color: #ffffff;
    letter-spacing: 1px;
    z-index: 10;
    /* Un ligero brillo turquesa fijo */
    text-shadow: 0 0 10px rgba(0, 180, 216, 0.7);
}

/* Estilo base para los anillos orbitales */
.orbit {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid transparent; /* El truco: borde transparente */
}

/* Primer anillo (Turquesa, gira normal) */
.orbit-1 {
    border-top-color: #00b4d8; /* Solo pintamos una parte */
    border-right-color: rgba(0, 180, 216, 0.3); /* Una estela suave */
    animation: spin-orbit 1.5s linear infinite;
}

/* Segundo anillo (Más pequeño y blanco, gira al revés) */
.orbit-2 {
    width: 85%; /* Un poco más pequeño para dar profundidad */
    height: 85%;
    border-bottom-color: #ffffff;
    border-left-color: rgba(255, 255, 255, 0.3);
    animation: spin-orbit 2s linear infinite reverse; /* Gira al revés y más lento */
}

@keyframes spin-orbit {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =========================================
   3. NAVBAR (LÓGICA BLINDADA PC vs MÓVIL)
   ========================================= */

/* Estilos Comunes */
.navbar { transition: all 0.3s ease; }
.logo-box {
    border: 2px solid var(--primary-blue); padding: 2px 6px; border-radius: 6px;
    margin-right: 8px; color: var(--primary-blue); transition: 0.3s;
}
.navbar-brand:hover .logo-box { background: var(--primary-blue); color: white; }

/* Icono Hamburguesa */
.hamburger-icon { width: 28px; height: 20px; position: relative; cursor: pointer; }
.hamburger-icon span {
    display: block; position: absolute; height: 3px; width: 100%;
    background: var(--primary-blue); border-radius: 9px; left: 0; transition: .25s ease-in-out;
}
.hamburger-icon span:nth-child(1) { top: 0px; }
.hamburger-icon span:nth-child(2) { top: 8px; }
.hamburger-icon span:nth-child(3) { top: 16px; }

/* --- A) MODO ESCRITORIO (PC > 992px) --- */
@media (min-width: 992px) {
    .navbar-toggler, .offcanvas-header, .mobile-menu-footer { display: none !important; }

    /* Forzar menú horizontal normal */
    .offcanvas {
        position: static; z-index: auto; flex-grow: 1; width: auto; height: auto;
        visibility: visible; background-color: transparent; border: 0;
        display: flex; justify-content: flex-end;
    }
    .offcanvas-body { padding: 0; overflow: visible; }
    .mobile-nav-list { flex-direction: row; padding: 0 !important; }

    /* Links PC */
    .navbar-nav .nav-link {
        color: var(--dark-text) !important; font-weight: 500; padding: 8px 15px !important;
        position: relative; margin: 0 5px;
    }
    /* Efecto subrayado */
    .navbar-nav .nav-link:not(.btn)::after {
        content: ''; position: absolute; width: 0; height: 2px; bottom: 0; left: 0;
        background-color: var(--teal); transition: width 0.3s ease;
    }
    .navbar-nav .nav-link:not(.btn):hover::after,
    .navbar-nav .nav-link:not(.btn).active::after { width: 100%; }
}

/* --- B) MODO MÓVIL PROFESIONAL (< 991px) --- */
@media (max-width: 991px) {
    .navbar-toggler { 
        display: block !important; 
        margin-right: 15px; /* Separación del borde derecho */
    }

    /* Panel Lateral Azul Oscuro */
    .offcanvas {
        background-color: var(--offcanvas-bg) !important;
        backdrop-filter: blur(10px);
        width: 85% !important; /* Ancho cómodo */
        border-left: 1px solid rgba(255,255,255,0.1);
    }

    .offcanvas-header {
        border-bottom: 1px solid rgba(255,255,255,0.1);
        padding: 20px 25px;
    }

    /* Links Móviles */
    .mobile-nav-list .nav-link {
        color: rgba(255, 255, 255, 0.9) !important;
        font-size: 1.15rem; /* Texto legible */
        font-weight: 500;
        padding: 15px 20px !important;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        transition: 0.3s;
    }

    .mobile-nav-list .nav-link:hover, 
    .mobile-nav-list .nav-link.active {
        background-color: rgba(0, 180, 216, 0.15) !important;
        color: var(--teal) !important;
        padding-left: 30px !important; /* Desplazamiento visual */
        border-left: 4px solid var(--teal);
    }

    /* Footer del menú */
    .mobile-menu-footer {
        border-top: 1px solid rgba(255,255,255,0.1);
        padding: 30px 20px;
    }
    .social-link-mobile {
        width: 45px; height: 45px; border-radius: 50%;
        background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
        display: flex; align-items: center; justify-content: center;
        color: white; text-decoration: none; font-size: 1.2rem;
    }
}

/* =========================================
   4. COMPONENTES GENERALES
   ========================================= */
/* Pestañas Excel */
#pills-tab .nav-link {
    color: var(--primary-blue) !important; background-color: #f0f2f5;
    border: 1px solid #dee2e6; margin: 5px; border-radius: 50px; font-weight: 600;
}
#pills-tab .nav-link.active {
    background-color: var(--teal) !important; color: white !important;
    border-color: var(--teal); box-shadow: 0 4px 10px rgba(0, 180, 216, 0.3);
}

/* Botones */
.btn-primary { background-color: var(--primary-blue); border-color: var(--primary-blue); }
.btn-primary:hover { background-color: var(--teal); border-color: var(--teal); transform: translateY(-2px); }
.btn-info, .btn-outline-info:hover { background-color: var(--teal) !important; border-color: var(--teal) !important; color: white !important; }
.btn-outline-info { color: var(--teal) !important; border-color: var(--teal) !important; }

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-blue) 0%, #002855 100%);
    padding: 140px 0 100px 0; 
    clip-path: polygon(0 0, 100% 0, 100% 92%, 0 100%); 
    min-height: 85vh;
}
.hero-img { 
    max-width: 90%; 
    animation: float 3s ease-in-out infinite; 
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.3)); 
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-15px); } }
.section-title { border-left: 5px solid var(--teal); padding-left: 15px; display: inline-block; }

/* Elementos Extra */
.accordion-button:not(.collapsed) { background-color: #e1f5fe; color: var(--primary-blue); }
.footer-section { background-color: #000c1f; padding-top: 60px; scroll-margin-top: 80px; }
.whatsapp-float, .scroll-top-btn {
    position: fixed; width: 60px; height: 60px; border-radius: 50%; z-index: 1000;
    display: flex; align-items: center; justify-content: center; color: white;
    text-decoration: none; box-shadow: 2px 2px 10px rgba(0,0,0,0.3); transition: transform 0.3s, opacity 0.3s;
}
.whatsapp-float { bottom: 25px; right: 25px; background-color: #25d366; font-size: 35px; }
.whatsapp-float:hover { transform: scale(1.1); background-color: #1ebe57; }
.scroll-top-btn { bottom: 25px; left: 25px; background-color: var(--primary-blue); opacity: 0; visibility: hidden; }
.scroll-top-btn.show { opacity: 1; visibility: visible; }

/* =========================================
   5. 🛡️ BLINDAJE MÓVIL (AJUSTES FINALES)
   ========================================= */
@media (max-width: 768px) {
    /* 1. Márgenes laterales seguros */
    .container {
        padding-left: 25px;
        padding-right: 25px;
    }

    /* 2. Hero más compacto */
    .hero-section { 
        padding-top: 110px; /* Menos espacio arriba */
        text-align: center; 
        clip-path: polygon(0 0, 100% 0, 100% 96%, 0 100%); 
        min-height: auto; /* Altura automática en móvil */
        padding-bottom: 80px;
    }

    /* 3. Título Inteligente (Evita romper palabras) */
    .hero-section h1 { 
        font-size: calc(1.8rem + 1.5vw) !important; /* Tamaño dinámico */
        line-height: 1.2;
    }
    .display-4 { font-size: 2rem !important; }

    /* 4. Títulos de sección centrados */
    .section-title { 
        border-left: none; 
        border-bottom: 4px solid var(--teal); 
        padding-bottom: 10px;
    }

    /* 5. Scroll Horizontal Pestañas (Suave) */
    #pills-tab { 
        flex-wrap: nowrap; 
        overflow-x: auto; 
        padding-bottom: 15px; 
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start !important; /* Alinear a la izquierda para que se note el scroll */
    }
    
    /* 6. Desactivar animación pesada en móvil (Ahorro batería) */
    .hero-img { animation: none; transform: none; margin-top: 30px; }
}
.btn-wsp {
    position: fixed;
    bottom: 20px;
    right: 20px;
}
html, body {
    max-width: 100%;
    overflow-x: hidden; /* Esto evita el scroll horizontal blanco feo */
}
/* CORRECCIÓN: Permitir que se lea todo el texto vendedor */
.product-card p.small {
    display: block;        /* Quitamos el bloqueo de líneas */
    height: auto;          /* Dejamos que crezca lo necesario */
    min-height: 70px;      /* Altura mínima para que se vean alineados si el texto es corto */
    overflow: visible;     /* Mostramos todo el contenido */
    font-size: 0.85rem !important;
    line-height: 1.4;
    margin-bottom: 15px;   /* Espacio extra antes del precio */
}
/* PARCHE: Obligar a la tarjeta a crecer para que quepa todo */
.product-card {
    height: auto !important;       /* Deja que la altura sea automática */
    min-height: 100%;              /* Que llene al menos la columna */
    max-height: none !important;   /* Quita cualquier límite de altura */
    display: flex;                 /* Asegura que sea flexible */
    flex-direction: column;        /* Ordena los elementos en columna */
}

/* Ajuste extra para el cuerpo de la tarjeta */
.product-card .p-4 {
    flex: 1 1 auto;                /* Permite que el contenido empuje hacia abajo */
    display: flex;
    flex-direction: column;
}