/* ============================================
   RESPONSIVE.CSS - VERSIÓN 3.0
   Cobertura completa del rediseño corporativo
============================================ */

/* ============================================
   TABLETS GRANDES (1024px y menos)
============================================ */
@media (max-width: 1024px) {

    .container {
        padding: 0 28px;
    }

    .hero-title {
        font-size: clamp(32px, 6vw, 52px);
    }

    .features-grid,
    .features-grid.cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .features-grid.cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .services-layout {
        grid-template-columns: 1fr;
        gap: var(--spacing-2xl);
    }

    .services-panel {
        position: relative;
        top: 0;
        min-height: 320px;
    }

    .contact-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-xl);
    }

    .footer-section.footer-brand {
        grid-column: 1 / -1;
    }

    .grid-3,
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}


/* ============================================
   TABLETS (768px y menos)
============================================ */
@media (max-width: 768px) {

    html, body {
        max-width: 100%;
        overflow-x: hidden;
    }

    .container {
        width: 100%;
        padding: 0 20px;
    }

    h1 { font-size: var(--font-size-3xl); }
    h2 { font-size: var(--font-size-2xl); }
    h3 { font-size: var(--font-size-lg); }

    section {
        padding: var(--spacing-2xl) 0;
    }

    /* ===== NAVEGACIÓN ===== */
    .menu-toggle {
        display: flex !important;
        position: relative;
        z-index: 1100 !important;
    }

    .nav-menu {
        display: none !important;
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        left: auto !important;
        width: 80% !important;
        max-width: 320px !important;
        height: 100vh !important;
        background: var(--color-primary) !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        align-items: stretch !important;
        gap: 0 !important;
        padding: 100px 0 32px !important;
        transition: transform 0.35s ease !important;
        z-index: 1050 !important;
        box-shadow: -10px 0 40px rgba(0,0,0,0.3) !important;
        max-height: none !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        transform: translateX(100%) !important;
    }

    .nav-menu.active {
        display: flex !important;
        transform: translateX(0) !important;
    }

    .nav-menu li {
        width: 100%;
        border-bottom: 1px solid rgba(255,255,255,0.08) !important;
        border-style: solid !important;
        list-style: none !important;
    }

    .nav-menu li:last-child {
        border-bottom: none !important;
    }

    .nav-menu a {
        display: block;
        padding: 18px 28px;
        font-size: var(--font-size-base);
        color: rgba(255,255,255,0.85) !important;
    }

    .nav-menu a:hover {
        color: var(--color-secondary) !important;
        background-color: rgba(255,255,255,0.05);
    }

    .nav-menu a::after {
        display: none;
    }

    .nav-menu .btn-contact {
        margin: var(--spacing-lg) 28px 0 !important;
        text-align: center;
        justify-content: center;
        padding: 12px 22px !important;
        color: var(--color-primary) !important;
    }

    /* Overlay oscuro detrás del menú */
    .nav-menu.active::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: -1;
    }

    /* ===== LOGO ===== */
    .logo {
        padding: 5px 9px;
    }

    .logo img {
        max-height: 62px;
    }

    .header.scrolled .logo img {
        max-height: 50px;
    }

    /* ===== HERO ===== */
    .hero {
        min-height: auto;
    }

    .hero-content {
        padding: 130px 0 60px;
        max-width: 100%;
    }

    .hero-label {
        font-size: 10px;
        padding: 6px 16px;
    }

    .hero-title {
        font-size: clamp(28px, 8vw, 40px);
    }

    .hero-subtitle {
        font-size: var(--font-size-base);
        max-width: 100%;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }

    .hero-buttons .btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .hero-stats {
        flex-wrap: wrap;
        gap: var(--spacing-lg) var(--spacing-xl);
    }

    .hero-stat-number {
        font-size: var(--font-size-2xl);
    }

    .scroll-indicator {
        display: none;
    }

    /* ===== FEATURES ===== */
    .features-grid,
    .features-grid.cols-3,
    .features-grid.cols-4 {
        grid-template-columns: 1fr;
    }

    .feature-card {
        padding: var(--spacing-lg);
    }

    .feature-icon {
        font-size: 36px;
    }

    /* ===== STATS SECTION ===== */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .stat-item {
        padding: 32px 20px;
    }

    .stat-number {
        font-size: var(--font-size-2xl);
    }

    /* ===== SERVICIOS ===== */
    .services-layout {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }

    .services-panel {
        position: relative;
        top: 0;
        padding: 32px;
        min-height: auto;
    }

    .service-item {
        padding: var(--spacing-md) var(--spacing-lg);
    }

    /* ===== CTA BAND ===== */
    .cta-band-inner {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-lg);
    }

    .cta-band-inner > div:last-child {
        width: 100%;
        flex-direction: column;
        display: flex;
    }

    .cta-band-inner .btn {
        width: 100%;
        justify-content: center;
    }

    /* ===== PROVEEDORES slider ===== */
    .providers-track::before,
    .providers-track::after {
        width: 50px;
    }

    .provider-logo {
        min-width: 120px;
        height: 70px;
        padding: 14px 20px;
    }

    .provider-logo img {
        max-width: 90px;
        max-height: 38px;
    }

    /* ===== CONTACTO RÁPIDO ===== */
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .contact-item {
        padding: var(--spacing-lg);
    }

    /* ===== FOOTER ===== */
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }

    .footer-section.footer-brand {
        grid-column: auto;
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--spacing-sm);
        text-align: center;
    }

    /* ===== GRIDS GENÉRICOS (páginas internas) ===== */
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr !important;
    }

    /* ===== PÁGINA INTERNA ===== */
    .page-hero {
        padding-top: 120px;
    }

    .page-hero h1 {
        font-size: var(--font-size-2xl);
    }

    /* ===== PRODUCTOS ===== */
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }

    .filter-bar {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
    }

    .filter-btn {
        flex-shrink: 0;
    }

    /* ===== PROVEEDORES página interna ===== */
    .providers-full-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* ===== GALERÍA ===== */
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    /* ===== IMÁGENES: nunca más anchas que la pantalla ===== */
    img, iframe, video, table {
        max-width: 100%;
        height: auto;
    }
}


/* ============================================
   MÓVILES (480px y menos)
============================================ */
@media (max-width: 480px) {

    .container {
        padding: 0 16px;
    }

    body {
        font-size: 14px;
    }

    h1 { font-size: var(--font-size-2xl); }
    h2 { font-size: var(--font-size-xl); }
    h3 { font-size: var(--font-size-base); }

    section {
        padding: var(--spacing-xl) 0;
    }

    /* ===== HEADER / LOGO ===== */
    .navbar {
        padding: var(--spacing-md) 0;
    }

    .navbar-wrapper {
        gap: var(--spacing-sm);
    }

    .logo {
        padding: 4px 7px;
        border-width: 2px;
    }

    .logo img {
        max-height: 52px;
    }

    .header.scrolled .logo img {
        max-height: 42px;
    }

    /* ===== HERO ===== */
    .hero-content {
        padding: 110px 0 50px;
    }

    .hero-title {
        font-size: 26px;
    }

    .hero-subtitle {
        font-size: var(--font-size-sm);
    }

    .hero-stats {
        gap: var(--spacing-md) var(--spacing-lg);
        padding-top: var(--spacing-lg);
    }

    .hero-stat-number {
        font-size: var(--font-size-xl);
    }

    .hero-stat-label {
        font-size: 10px;
    }

    /* ===== BOTONES ===== */
    .btn {
        padding: var(--spacing-md) var(--spacing-lg);
        font-size: var(--font-size-sm);
    }

    .btn-large {
        padding: 16px 28px;
        font-size: var(--font-size-sm);
    }

    /* ===== SECCIONES ===== */
    .section-title {
        font-size: var(--font-size-xl);
    }

    .section-subtitle {
        font-size: var(--font-size-base);
    }

    /* ===== STATS ===== */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .stat-number {
        font-size: var(--font-size-xl);
    }

    .stat-suffix {
        font-size: var(--font-size-lg);
    }

    .stat-label {
        font-size: 9px;
    }

    /* ===== SERVICIOS ===== */
    .service-icon {
        width: 42px;
        height: 42px;
        font-size: 22px;
    }

    .services-panel {
        padding: 24px;
    }

    .panel-icon {
        font-size: 40px;
    }

    .panel-content h3 {
        font-size: var(--font-size-lg);
    }

    /* ===== PROVEEDORES ===== */
    .provider-logo {
        min-width: 100px;
        height: 60px;
        padding: 10px 16px;
    }

    .provider-logo img {
        max-width: 72px;
        max-height: 30px;
    }

    /* ===== CONTACTO ===== */
    .contact-item h3 {
        font-size: var(--font-size-sm);
    }

    /* ===== FOOTER ===== */
    .footer {
        padding: var(--spacing-xl) 0 0;
    }

    .footer-section h4 {
        font-size: var(--font-size-sm);
    }

    /* ===== PRODUCTOS ===== */
    .products-grid {
        grid-template-columns: 1fr;
    }

    /* ===== PROVEEDORES interna ===== */
    .providers-full-grid {
        grid-template-columns: 1fr;
    }

    /* ===== GALERÍA ===== */
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    /* ===== FAQ ===== */
    .faq-question {
        padding: var(--spacing-md) var(--spacing-lg);
        font-size: var(--font-size-sm);
    }

    .faq-answer.open {
        padding: var(--spacing-md) var(--spacing-lg);
    }

    /* ===== SCROLL TOP ===== */
    #scrollTopBtn {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
    }

    /* ===== FORM: evita zoom automático iOS ===== */
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px;
    }
}


/* ============================================
   EXTRA PEQUEÑOS (360px y menos)
============================================ */
@media (max-width: 360px) {

    .container {
        padding: 0 14px;
    }

    .logo img {
        max-height: 44px;
    }

    .hero-title {
        font-size: 22px;
    }

    .stats-grid,
    .providers-full-grid,
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .btn {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: var(--font-size-xs);
    }
}


/* ============================================
   PANTALLAS MUY GRANDES (1600px+)
============================================ */
@media (min-width: 1600px) {

    .container {
        max-width: 1400px;
    }

    .hero-title {
        font-size: 72px;
    }
}


/* ============================================
   IMPRESIÓN
============================================ */
@media print {
    header,
    footer,
    .hero-buttons,
    .cta-band,
    .quick-contact,
    #scrollTopBtn {
        display: none;
    }

    body {
        font-size: 12px;
        color: #000;
    }

    a {
        color: #000;
        text-decoration: underline;
    }

    section {
        page-break-inside: avoid;
        padding: var(--spacing-lg) 0;
    }

    .container {
        max-width: 100%;
    }
}


/* ============================================
   ACCESIBILIDAD: REDUCIR 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;
    }

    .providers-slider {
        animation: none;
    }
}