/* ===================================
   GARVAZ - ESTILOS RESPONSIVE
   Media Queries para Tablet y Mobile
   =================================== */

/* ==================== TABLET (768px - 1023px) ==================== */

@media (max-width: 1023px) {
    
    /* Tipografía */
    :root {
        --text-5xl: 2.5rem;    /* 40px */
        --text-4xl: 2rem;      /* 32px */
        --text-3xl: 1.75rem;   /* 28px */
    }
    
    /* Contenedor */
    .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    /* Header */
    .header-content {
        height: var(--header-height);
    }
    
    .nav-menu {
        gap: var(--space-4);
    }
    
    .header-ctas .btn {
        padding: 0.75rem 1.25rem;
        font-size: var(--text-sm);
    }
    
    .header-ctas {
        gap: var(--space-3);
    }
    
    /* Hero */
    .hero-slider {
        min-height: 500px;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: var(--text-lg);
    }
    
    .hero-ctas {
        flex-direction: column;
        align-items: stretch;
    }
    
    .hero-ctas .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Trust Bar */
    .benefits-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Solutions */
    .solutions-cards {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }
    
    .solution-card {
        min-height: 480px;
    }
    
    /* Categories */
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Process Timeline */
    .process-timeline {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-6);
    }
    
    .process-timeline::before {
        display: none;
    }
    
    /* Social Proof */
    .proof-grid {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-6);
    }
    
    .footer-grid .footer-col:first-child {
        grid-column: 1 / -1;
    }
}


/* ==================== MOBILE (320px - 767px) ==================== */

@media (max-width: 767px) {
    
    /* Variables específicas mobile */
    :root {
        --container-padding: 1rem;
        --header-height: var(--header-height-mobile);
        
        /* Tipografía mobile */
        --text-6xl: 2.25rem;   /* 36px */
        --text-5xl: 2rem;      /* 32px */
        --text-4xl: 1.75rem;   /* 28px */
        --text-3xl: 1.5rem;    /* 24px */
        --text-2xl: 1.25rem;   /* 20px */
    }
    
    /* Secciones */
    .section {
        padding-top: var(--space-12);
        padding-bottom: var(--space-12);
    }
    
    .section-title {
        margin-bottom: var(--space-8);
        font-size: var(--text-3xl);
    }
    
    /* ==================== HEADER MOBILE ==================== */
    
    .site-header {
        height: var(--header-height-mobile);
    }
    
    .header-content {
        height: var(--header-height-mobile);
        position: relative;
    }
    
    .logo svg {
        width: 120px;
        height: 36px;
    }
    
    /* CTAs Header Mobile - Reordenar */
    .header-ctas {
        display: flex;
        align-items: center;
        gap: var(--space-2);
        margin-left: auto;
        order: 2;
    }
    
    /* Botón Cotiza oculto en mobile */
    .header-ctas .btn-primary {
        display: none;
    }
    
    /* Botón Login más pequeño en mobile */
    .btn-login {
        width: 36px;
        height: 36px;
    }
    
    .btn-login svg {
        width: 18px;
        height: 18px;
    }
    
    /* Mobile Menu Toggle - más pequeño y reordenado */
    .mobile-menu-toggle {
        display: flex;
        width: 36px;
        height: 36px;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        order: 3;
        padding: 0;
        margin-left: var(--space-2);
        gap: 4px;
    }
    
    .mobile-menu-toggle span {
        width: 20px;
        height: 2px;
    }
    
    /* Menú mobile */
    .main-nav {
        position: fixed;
        top: var(--header-height-mobile);
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--white);
        padding: var(--space-6);
        transform: translateX(-100%);
        transition: transform var(--transition-base) var(--ease-out);
        overflow-y: auto;
        z-index: var(--z-fixed);
    }
    
    .main-nav.active {
        transform: translateX(0);
        box-shadow: var(--shadow-2xl);
    }
    
    .nav-menu {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }
    
    .nav-menu > li {
        border-bottom: 1px solid var(--slate-200);
    }
    
    .nav-menu > li > a {
        padding: var(--space-3) 0;
        font-size: var(--text-lg);
    }
    
    /* Dropdown mobile */

     /* --- Menú mobile: filas uniformes --- */
  .nav-menu > li > a{
    display: flex;
    align-items: center;
    justify-content: space-between; /* texto izq, flecha der */
    width: 100%;
    padding: var(--space-4) 0;      /* altura más consistente */
  }

  .nav-menu > li > a .nav-arrow{
    margin-left: var(--space-3);
  }

  /* --- Dropdown mobile: sin “aire” cuando está cerrado --- */
  .dropdown{
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;

    /* CLAVE: reset total */
    margin: 0;
    padding: 0;

    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-base) var(--ease-out),
                padding var(--transition-base) var(--ease-out);
  }

  /* Cuando se abre, ahora sí agregamos padding */
  .has-dropdown.active .dropdown{
    max-height: 500px;
    padding: var(--space-2) 0 var(--space-3) var(--space-4);
  }

    /*.dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        margin-top: 0;
        padding-left: var(--space-4);
        max-height: 0;
        overflow: hidden;
        transition: max-height var(--transition-base) var(--ease-out);
    }
    
    .has-dropdown.active .dropdown {
        max-height: 500px;
    }*/
    
    .has-dropdown > a::before {
        position: absolute;
        right: 0;
        transition: transform var(--transition-base) var(--ease-out);
    }
    
    .has-dropdown.active > a::before {
        transform: rotate(180deg);
    }
    
    /* CTAs Header Mobile */
    .header-ctas {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* ==================== HERO MOBILE ==================== */
    
    .hero-slider {
        height: auto;
        min-height: 520px;
        margin-top: var(--header-height-mobile);
        overflow: visible;            /* antes heredaba hidden */
        padding-bottom: var(--space-6); /* colchón general */
    }
    
    .hero-content {
        justify-content: flex-start;  /* evita que todo quede “apretado” centrado */
        padding: var(--space-8) 0 var(--space-6) 0;
    }
    
    .hero-content h1 {
        font-size: 2rem;
        line-height: 1.2;
        margin-bottom: var(--space-3);
    }
    
    .hero-subtitle {
        font-size: var(--text-base);
        margin-bottom: var(--space-4);
    }
    
    .hero-bullets {
        margin-bottom: var(--space-6);
    }
    
    .hero-bullets li {
        font-size: var(--text-base);
        margin-bottom: var(--space-2);
    }
    
    .hero-ctas {
        flex-direction: column;
        gap: var(--space-3);
    }
    
    .hero-ctas .btn {
        width: 100%;
        padding: 1rem 1.5rem;
    }
    
    /* Slider controls mobile */
    .slider-controls {
       position: relative;           /* antes absolute */
    bottom: auto;                 /* anula bottom */
    left: auto;
    right: auto;
    margin-top: var(--space-4);
    padding-bottom: var(--space-3);
    z-index: 3;
        /*bottom: var(--space-4);*/
    }
    
    .slider-dot {
        width: 10px;
        height: 10px;
    }
    
    /* ==================== TRUST BAR MOBILE ==================== */
    
    .trust-bar {
        padding: var(--space-12) 0;
    }
    
    .benefits-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
        margin-top: var(--space-6);
    }
    
    .benefit-card {
        padding: var(--space-5);
    }
    
    .benefit-icon {
        width: 64px;
        height: 64px;
        margin-bottom: var(--space-3);
    }
    
    .benefit-icon svg {
        width: 32px;
        height: 32px;
    }
    
    /* ==================== SOLUTIONS MOBILE ==================== */
    
    .solutions-grid {
        padding: var(--space-12) 0;
    }
    
    .solutions-cards {
        margin-top: var(--space-6);
        gap: var(--space-6);
    }
    
    .solution-card {
        min-height: 420px;
    }
    
    .solution-content {
        padding: var(--space-6);
    }
    
    .solution-content h3 {
        font-size: var(--text-xl);
    }
    
    .solution-content p {
        font-size: var(--text-sm);
    }
    
    /* ==================== CATEGORIES MOBILE ==================== */
    
    .product-categories {
        padding: var(--space-12) 0;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
        margin-top: var(--space-6);
    }
    
    .category-card {
        padding: var(--space-5);
    }
    
    .category-icon {
        width: 64px;
        height: 64px;
        margin-bottom: var(--space-3);
    }
    
    .category-icon svg {
        width: 40px;
        height: 40px;
    }
    
    .category-ctas {
        flex-direction: column;
        gap: var(--space-2);
    }
    
    .category-ctas .btn-gold-sm {
        width: 100%;
    }
    
    /* ==================== PROCESS MOBILE ==================== */
    
    .how-we-work {
        padding: var(--space-12) 0;
    }
    
    .process-timeline {
        grid-template-columns: 1fr;
        gap: var(--space-8);
        margin-top: var(--space-6);
    }
    
    .step-number {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }
    
    .step-icon {
        width: 56px;
        height: 56px;
    }
    
    .process-step h3 {
        font-size: var(--text-lg);
    }
    
    .process-step p {
        font-size: var(--text-sm);
    }
    
    /* ==================== BRANDS MOBILE ==================== */
    
    .brands-strip {
        padding: var(--space-8) 0;
    }
    
    .brand-item {
        font-size: var(--text-lg);
        padding: var(--space-3) var(--space-4);
    }
    
    /* ==================== SOCIAL PROOF MOBILE ==================== */
    
    .social-proof {
        padding: var(--space-12) 0;
    }
    
    .proof-grid {
        margin-top: var(--space-6);
    }
    
    .metrics-block {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }
    
    .metric {
        padding: var(--space-5);
    }
    
    .metric-number {
        font-size: 3rem;
    }
    
    .metric-label {
        font-size: var(--text-sm);
    }
    
    .case-block {
        padding: var(--space-6);
    }
    
    .case-block h3 {
        font-size: var(--text-xl);
    }
    
    /* ==================== FINAL CTA MOBILE ==================== */
    
    .final-cta {
        padding: var(--space-16) 0;
    }
    
    .cta-content h2 {
        font-size: var(--text-3xl);
        line-height: 1.2;
    }
    
    .cta-subtitle {
        font-size: var(--text-base);
    }
    
    .cta-buttons {
        flex-direction: column;
        gap: var(--space-3);
    }
    
    .cta-buttons .btn {
        width: 100%;
    }
    
    /* ==================== FOOTER MOBILE ==================== */
    
    .site-footer {
        padding: var(--space-12) 0 var(--space-6);
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-8);
        margin-bottom: var(--space-8);
    }
    
    .footer-grid .footer-col:first-child {
        grid-column: auto;
    }
    
    .footer-col h4 {
        font-size: var(--text-base);
        margin-bottom: var(--space-3);
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: var(--space-4);
        text-align: center;
    }
    
    .footer-legal {
        flex-direction: column;
        gap: var(--space-2);
    }
    
    /* ==================== UTILIDADES MOBILE ==================== */
    
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }
    
    /* Botones mobile */
    .btn-lg {
        padding: 1rem 1.75rem;
        font-size: var(--text-base);
    }
    
    /* Espaciado mobile */
    .py-8 {
        padding-top: var(--space-6);
        padding-bottom: var(--space-6);
    }
    
    .mt-8 { margin-top: var(--space-6); }
    .mb-8 { margin-bottom: var(--space-6); }
    
    /* WhatsApp flotante mobile */
    .whatsapp-float {
        bottom: 5.5rem;  /* Por encima del back-to-top */
        right: 1rem;
        width: 56px;
        height: 56px;
    }
    
    .whatsapp-float svg {
        width: 24px;
        height: 24px;
    }

    /* FIX iOS/Safari: backdrop-filter rompe el fixed de hijos */
  .site-header {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  /* Asegurar capa superior del overlay del menú */
  .main-nav {
    z-index: calc(var(--z-fixed) + 20);
  }

  /* Contenedor dropdown abierto */
  .has-dropdown.active .dropdown{
    max-height: 500px;
    padding: var(--space-2) 0 var(--space-3) var(--space-4);
  }

  /* Lista interna */
  .dropdown ul{
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  /* Subitems */
  .dropdown li a{
    position: relative;
    display: block;
    padding: 0.75rem 0 0.75rem 1rem;
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--color-gray-600);
    transition: all var(--transition-fast) var(--ease-out);
  }

  /* Línea lateral elegante */
  .dropdown li a::before{
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0%;
    background: var(--color-primary);
    transition: height 0.25s ease;
    border-radius: 2px;
  }

  /* Hover / active */
  .dropdown li a:hover{
    color: var(--color-primary);
    padding-left: 1.25rem;
  }

  .dropdown li a:hover::before{
    height: 60%;
  }

  /* Separador sutil */
  .dropdown li:not(:last-child) a{
    border-bottom: 1px solid rgba(0,0,0,0.05);
  }

}


/* ==================== MOBILE PEQUEÑO (< 375px) ==================== */

@media (max-width: 374px) {
    
    :root {
        --container-padding: 0.875rem;
    }
    
    .hero-content h1 {
        font-size: 1.75rem;
    }
    
    .section-title {
        font-size: var(--text-2xl);
    }
    
    .btn {
        padding: 0.75rem 1.25rem;
        font-size: var(--text-sm);
    }
    
    .metric-number {
        font-size: 2.5rem;
    }
}


/* ==================== LANDSCAPE MOBILE ==================== */

@media (max-height: 500px) and (orientation: landscape) {
    
    .hero-slider {
        height: auto;
        min-height: 100vh;
    }
    
    .hero-content {
        padding: var(--space-6) 0;
    }
    
    .hero-content h1 {
        font-size: 1.75rem;
        margin-bottom: var(--space-2);
    }
    
    .hero-subtitle {
        font-size: var(--text-sm);
        margin-bottom: var(--space-3);
    }
    
    .hero-bullets {
        margin-bottom: var(--space-4);
    }
    
    .slider-controls {
        bottom: var(--space-4);
    }
}


/* ==================== IMPRESIÓN ==================== */

@media print {
    
    .site-header,
    .mobile-menu-toggle,
    .slider-controls,
    .btn,
    .footer-social,
    .final-cta {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
    }
    
    .hero-content h1 {
        font-size: 24pt;
    }
    
    a {
        text-decoration: underline;
        color: #000;
    }
    
    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 10pt;
    }
}


/* ==================== MODO OSCURO (OPCIONAL) ==================== */

@media (prefers-color-scheme: dark) {
    /* 
    Descomentar si se desea soporte para modo oscuro:
    
    :root {
        --white: #0F172A;
        --off-white: #1E293B;
        --cream: #1E293B;
        --slate-900: #F8FAFC;
        --slate-800: #F1F5F9;
        --slate-700: #E2E8F0;
    }
    
    .hero-overlay {
        background: linear-gradient(...);
    }
    */
}


/* ==================== REDUCCIÓN DE MOVIMIENTO ==================== */

@media (prefers-reduced-motion: reduce) {
    
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .brands-track {
        animation: none;
    }
}
