/**
 * CAMPRE - Estilos Responsivos
 * Adaptación para todos los dispositivos
 */

/* ============================================
   TABLET (max-width: 1024px)
   ============================================ */
@media (max-width: 1024px) {
    :root {
        --text-4xl: 2rem;
        --text-5xl: 2.5rem;
        --text-6xl: 3rem;
    }

    .section {
        padding: var(--space-16) 0;
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-8);
    }

    .hero-title {
        font-size: var(--text-4xl);
    }

    /* Top Bar - Eliminar completamente en móvil */
    .top-bar {
        display: none !important;
        height: 0 !important;
        min-height: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        visibility: hidden !important;
        overflow: hidden !important;
    }

    /* Header - Asegurar que esté pegado al borde superior */
    .main-header {
        top: 0 !important;
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    .main-content {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }

    /* Partículas menú móvil - asegura que el contenido esté por encima */
    #particles-mobile-nav {
        z-index: 0 !important;
    }

    #particles-mobile-nav canvas {
        z-index: 0 !important;
    }

    .mobile-nav-content {
        z-index: 10 !important;
    }

    .mobile-nav-header,
    .mobile-nav-menu,
    .mobile-nav-footer,
    .mobile-nav-list,
    .mobile-nav-item {
        z-index: 11 !important;
    }

    /* Main nav */
    .main-nav {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .header-content {
        height: 70px;
    }

    .logo-icon {
        width: 40px;
        height: 40px;
    }

    .logo-main {
        font-size: var(--text-xl);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .products-grid,
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   MOBILE (max-width: 768px)
   ============================================ */
@media (max-width: 768px) {
    :root {
        --text-3xl: 1.5rem;
        --text-4xl: 1.875rem;
        --text-5xl: 2.25rem;
    }

    body {
        max-width: 100vw;
    }

    .container {
        padding: 0 var(--space-4);
    }

    .section {
        padding: var(--space-12) 0;
    }

    /* Hero */
    .hero {
        min-height: 500px;
    }

    .hero-content {
        padding: var(--space-8) 0;
        max-width: 100%;
    }

    .hero-title {
        font-size: var(--text-3xl);
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .hero-subtitle {
        font-size: var(--text-base);
        word-wrap: break-word;
    }

    .hero-buttons {
        flex-direction: column;
        gap: var(--space-3);
        width: 100%;
    }

    .hero-buttons .btn {
        width: 100%;
        max-width: 100%;
    }

    /* Slider controls */
    .slider-controls {
        padding: 0 var(--space-4);
    }

    /* Stats */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-4);
    }

    .stat-number {
        font-size: var(--text-3xl);
    }

    /* Products & Services */
    .products-grid,
    .services-grid {
        grid-template-columns: 1fr;
    }

    /* Features */
    .features-grid {
        grid-template-columns: 1fr;
    }

    /* About */
    .about-grid {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }

    .about-image {
        order: -1;
    }

    /* Contact */
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .contact-info-panel {
        order: 1;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }

    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
    }

    /* FAB */
    .fab-container {
        bottom: var(--space-4);
        right: var(--space-4);
        z-index: 1000;
    }

    .fab {
        width: 48px;
        height: 48px;
        font-size: var(--text-lg);
    }

    .fab-tooltip {
        display: none;
    }

    /* Preloader en móvil */
    #preloader {
        background-size: contain;
    }

    .preloader-logo {
        width: 150px;
        height: 60px;
    }

    .loading-bar {
        width: 150px;
    }

    /* Timeline */
    .timeline::before {
        left: 20px;
    }

    .timeline-item {
        padding-left: 60px;
    }

    .timeline-item:nth-child(odd) {
        padding-right: 0;
        padding-left: 60px;
    }

    .timeline-item:nth-child(odd) .timeline-content::before,
    .timeline-item:nth-child(even) .timeline-content::before {
        left: -40px;
        right: auto;
    }

    .timeline-dot {
        left: 20px;
        transform: translateX(-50%);
    }

    /* Page Header */
    .page-header {
        padding: var(--space-16) 0 var(--space-10);
    }

    .page-title {
        font-size: var(--text-3xl);
    }

    /* Tabs */
    .tabs-nav {
        flex-wrap: wrap;
        scrollbar-width: none;
        -ms-overflow-style: none;
        gap: var(--space-2);
    }

    .tabs-nav::-webkit-scrollbar {
        display: none;
    }

    .tab-btn {
        flex: 1 1 auto;
        min-width: auto;
        padding: var(--space-3) var(--space-4);
        font-size: var(--text-sm);
        white-space: nowrap;
    }
}

/* ============================================
   SMALL MOBILE (max-width: 480px)
   ============================================ */
@media (max-width: 480px) {
    :root {
        --text-2xl: 1.25rem;
        --text-3xl: 1.375rem;
        --text-4xl: 1.5rem;
    }

    body {
        max-width: 100vw;
    }

    .section-title {
        font-size: var(--text-2xl);
    }

    .hero {
        min-height: 450px;
    }

    .hero-title {
        font-size: var(--text-2xl);
    }

    .stat-card {
        padding: var(--space-4);
    }

    .stat-number {
        font-size: var(--text-2xl);
    }

    .product-card,
    .service-card {
        margin: 0 var(--space-2);
    }

    .feature-card {
        padding: var(--space-5);
    }

    .contact-form-wrapper {
        padding: var(--space-5);
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .mobile-nav-content {
        width: 100%;
        max-width: 100%;
    }

    /* Mejoras para el menú hamburguesa en pantallas pequeñas */
    .mobile-menu-btn {
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .hamburger-line {
        width: 22px;
    }

    /* Corregir elementos de texto largos */
    .section-title,
    .hero-title,
    .section-subtitle {
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }

    /* Mejoras para cards */
    .product-card,
    .service-card,
    .feature-card {
        width: 100%;
        max-width: 100%;
        margin: 0;
        box-sizing: border-box;
    }

    /* Mejoras para formularios */
    .form-input,
    .form-textarea,
    .form-select {
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Botones en móvil pequeño */
    .btn {
        padding: var(--space-3) var(--space-6);
        font-size: var(--text-sm);
    }

    .btn-lg {
        padding: var(--space-4) var(--space-8);
        font-size: var(--text-base);
    }
}

/* ============================================
   LARGE SCREENS (min-width: 1440px)
   ============================================ */
@media (min-width: 1440px) {
    .container {
        max-width: 1400px;
    }

    .hero-title {
        font-size: var(--text-6xl);
    }
}

/* ============================================
   ORIENTACIÓN LANDSCAPE EN MÓVIL
   ============================================ */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: 400px;
    }

    .hero-content {
        padding: var(--space-6) 0;
    }
}

/* ============================================
   REDUCIR ANIMACIONES (preferencia usuario)
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }

    #preloader {
        display: none;
    }
}

/* ============================================
   IMPRESIÓN
   ============================================ */
@media print {
    .top-bar,
    .main-header,
    .mobile-nav,
    .fab-container,
    .main-footer {
        display: none !important;
    }

    .main-content {
        padding-top: 0;
    }

    .hero {
        min-height: auto;
        padding: var(--space-8) 0;
    }

    .section {
        padding: var(--space-8) 0;
    }

    * {
        background: white !important;
        color: black !important;
    }
}
