/* ===== RESPONSIVE DESIGN COMPLETO ===== */

/* Tablet Grande (1024px y menos) */
@media (max-width: 1024px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: var(--spacing-xl);
    }
    
    .hero-visual {
        order: -1;
    }
    
    .hero-graphic {
        width: 250px;
        height: 250px;
    }
    
    .security-icon {
        font-size: 5rem;
    }
    
    .emergency-icons span {
        font-size: 1.5rem;
    }
    
    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

/* ===== TABLET Y MÓVIL (768px y menos) ===== */
@media (max-width: 768px) {
    :root {
        --spacing-sm: 0.75rem;
        --spacing-md: 1rem;
        --spacing-lg: 1.5rem;
        --spacing-xl: 2rem;
        --spacing-2xl: 3rem;
    }
    
    /* ===== NAVEGACIÓN MÓVIL COMPLETA ===== */
    
    /* Ocultar menú desktop en móvil */
    .nav-menu {
        position: fixed !important;
        left: -100% !important;
        top: 100px !important;
        flex-direction: column !important;
        background: white !important;
        width: 100% !important;
        height: calc(100vh - 100px) !important;
        text-align: center !important;
        transition: left 0.3s ease !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
        padding: 2rem 0 !important;
        border-top: 3px solid var(--primary-color) !important;
        z-index: 999 !important;
        overflow-y: auto !important;
        opacity: 0 !important;
    }

    .nav-menu.active {
        left: 0 !important;
        opacity: 1 !important;
    }

    /* Mostrar botón hamburguesa en móvil */
    .nav-toggle {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 3px !important;
        cursor: pointer !important;
        padding: 12px 16px !important;
        border-radius: 8px !important;
        background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
        border: none !important;
        transition: all 0.3s ease !important;
        position: relative !important;
        z-index: 1001 !important;
        min-width: 70px !important;
        box-shadow: 0 2px 8px rgba(30, 58, 138, 0.3) !important;
    }

    .nav-toggle:hover {
        transform: scale(1.05) !important;
        box-shadow: 0 4px 12px rgba(30, 58, 138, 0.4) !important;
    }

    .nav-toggle .bar {
        width: 22px !important;
        height: 3px !important;
        background: white !important;
        transition: all 0.3s ease !important;
        border-radius: 2px !important;
        display: block !important;
    }

    .toggle-text {
        color: white !important;
        font-size: 11px !important;
        font-weight: 700 !important;
        margin-top: 3px !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
        font-family: var(--font-heading) !important;
        display: block !important;
    }

    /* Animaciones del botón activo */
    .nav-toggle.active {
        background: linear-gradient(135deg, #dc2626, #ef4444) !important;
    }

    .nav-toggle.active .bar:nth-child(2) {
        opacity: 0 !important;
    }

    .nav-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg) !important;
    }

    .nav-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg) !important;
    }

    /* Enlaces del menú móvil */
    .nav-menu .nav-link {
        display: block !important;
        padding: 1.5rem 2rem !important;
        margin: 0.5rem 0 !important;
        color: var(--text-primary) !important;
        font-size: 1.2rem !important;
        font-weight: 500 !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
        transition: all 0.3s ease !important;
        text-decoration: none !important;
    }

    .nav-menu .nav-link:hover {
        background: linear-gradient(135deg, rgba(30, 58, 138, 0.1), rgba(5, 150, 105, 0.1)) !important;
        color: var(--primary-color) !important;
        transform: translateX(10px) !important;
    }

    .nav-menu .proveedores-link {
        margin: 1rem 2rem !important;
        padding: 1rem 1.5rem !important;
        border-radius: 1.5rem !important;
        display: inline-block !important;
        width: auto !important;
    }

    /* WhatsApp en menú móvil */
    .nav-menu .whatsapp-nav-btn {
        margin: 1.5rem auto !important;
        display: block !important;
        width: 50px !important;
        height: 50px !important;
    }

    /* ===== NAVBAR CONTAINER MÓVIL ===== */
    .nav-container {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 0 1rem !important;
        min-height: 100px !important;
    }

    .nav-logo {
        flex: 1 !important;
    }

    .logo-image {
        height: 75px !important;
    }

    /* ===== BANNER ESTADÍSTICAS MÓVIL ===== */
    .stats-banner {
        background: linear-gradient(135deg, rgba(220, 38, 38, 0.9), rgba(239, 68, 68, 0.95)) !important;
        padding: 1rem 0 !important;
        margin-top: 100px !important;
        position: relative !important;
        z-index: 1 !important;
        overflow: hidden !important;
    }
    
    .stats-track {
        animation: slide-stats 30s linear infinite !important;
        gap: 1.5rem !important;
    }
    
    .stat-item {
        min-width: 320px !important;
        padding: 0.75rem 1rem !important;
        background: rgba(0, 0, 0, 0.6) !important;
        border: 2px solid rgba(255, 255, 255, 0.5) !important;
        border-radius: 8px !important;
    }
    
    .stat-number {
        font-size: 1.5rem !important;
        color: #ffffff !important;
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8) !important;
    }
    
    .stat-text {
        font-size: 0.9rem !important;
        color: #ffffff !important;
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8) !important;
        font-weight: 800 !important;
    }
    
    /* ===== HERO CAROUSEL MÓVIL ===== */
    .hero-carousel-section {
        height: 80vh !important;
    }
    
    .slide-content {
        padding: 0 1rem !important;
    }
    
    .slide-title {
        font-size: clamp(2rem, 6vw, 3rem) !important;
    }
    
    .slide-description {
        font-size: 1rem !important;
    }
    
    .carousel-controls {
        padding: 0 1rem !important;
        /* Mantener las flechas del Hero en la parte superior en móvil */
        top: 20px !important;
        transform: translateY(0) !important;
        justify-content: space-between !important;
    }
    
    .carousel-btn {
        width: 45px !important;
        height: 45px !important;
        font-size: 1.2rem !important;
        /* Mejorar visibilidad en la parte superior */
        background: rgba(0, 0, 0, 0.6) !important;
        border: 2px solid rgba(255, 255, 255, 0.4) !important;
        backdrop-filter: blur(15px) !important;
    }
    
    .carousel-btn:hover {
        background: rgba(0, 0, 0, 0.8) !important;
        border-color: rgba(255, 255, 255, 0.6) !important;
    }
    
    /* Ajustar indicadores del carousel en móvil */
    .carousel-indicators {
        bottom: 10px !important; /* Muy abajo para evitar traslapes */
        gap: 8px !important;
    }
    
    .indicator {
        width: 10px !important;
        height: 10px !important;
        border-width: 1px !important;
    }

    
    /* ===== SERVICIOS MÓVIL ===== */
    .services-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .service-card {
        padding: var(--spacing-lg);
    }
    
    /* ===== CARRUSEL ESPECIALISTAS MÓVIL ===== */
    .specialist-card {
        flex: 0 0 280px !important;
        padding: var(--spacing-lg) !important;
    }
    
    .specialists-container {
        padding: var(--spacing-md) !important;
        margin: var(--spacing-xl) var(--spacing-sm) !important;
    }
    
    .specialist-icon {
        width: 50px !important;
        height: 50px !important;
        font-size: 2rem !important;
    }
    
    .specialist-title {
        font-size: var(--font-size-lg) !important;
    }
    
    .name-gradient {
        font-size: var(--font-size-md) !important;
        color: #ea580c !important;
        background: none !important;
        -webkit-text-fill-color: #ea580c !important;
    }
    
    .specialists-btn {
        width: 45px !important;
        height: 45px !important;
        font-size: var(--font-size-md) !important;
    }
}

/* REDES SOCIALES RESPONSIVE */
@media screen and (max-width: 1024px) {
    .social-nav-links {
        gap: 0.4rem;
        margin-left: 0.75rem;
    }
    
    .social-nav-btn {
        width: 36px;
        height: 36px;
    }
    
    .social-nav-icon {
        width: 18px;
        height: 18px;
    }
}

@media screen and (max-width: 768px) {
    .social-nav-links {
        flex-direction: column;
        gap: 0.3rem;
        margin-left: 0.5rem;
    }
    
    .social-nav-btn {
        width: 32px;
        height: 32px;
    }
    
    .social-nav-icon {
        width: 16px;
        height: 16px;
    }
    
    /* ===== CARRUSEL TIPS MÓVIL ===== */
    .tip-card {
        flex: 0 0 280px !important;
        padding: var(--spacing-lg) !important;
    }
    
    .tips-container {
        padding: var(--spacing-md) !important;
        margin: var(--spacing-xl) auto !important;
        max-width: calc(100vw - 2rem) !important;
    }
    
    .tip-icon {
        width: 50px !important;
        height: 50px !important;
        font-size: 2rem !important;
    }
    
    .tip-header h3 {
        font-size: var(--font-size-lg) !important;
    }
    
    .tips-viewport {
        max-width: 100% !important;
        margin: 0 auto !important;
        padding: 0 1rem !important;
    }
    
    .tips-btn {
        width: 45px !important;
        height: 45px !important;
        font-size: var(--font-size-md) !important;
    }
    
    /* ===== HISTORIAS RESPONSIVE ===== */
    .historias {
        background-attachment: scroll;
    }
    
    .story-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .story-result {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .stories-grid {
        grid-template-columns: 1fr;
    }
    
    /* ===== TIPS RESPONSIVE ===== */
    .tips {
        background-attachment: scroll;
    }
    
    .tips-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .tip-card {
        padding: var(--spacing-lg);
    }
    
    .tip-header {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    
    .tip-icon {
        align-self: center;
    }
    
    /* ===== CTA RESPONSIVE ===== */
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .cta-buttons .btn {
        width: 100%;
        max-width: 300px;
    }
    
    /* ===== FOOTER RESPONSIVE ===== */
    .footer-links {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    /* ===== MODAL RESPONSIVE ===== */
    .modal-content {
        margin: 10% auto;
        width: 95%;
        padding: var(--spacing-lg);
    }
    
    .expert-categories {
        grid-template-columns: 1fr;
    }
}

/* ===== MÓVIL PEQUEÑO (480px y menos) ===== */
@media (max-width: 480px) {
    :root {
        --font-size-3xl: 1.5rem;
        --font-size-4xl: 1.875rem;
        --font-size-5xl: 2.25rem;
    }
    
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    /* ===== NAVEGACIÓN EXTRA PEQUEÑA ===== */
    .nav-container {
        padding: 0 var(--spacing-sm) !important;
        min-height: 80px !important;
    }
    
    .nav-logo {
        height: 60px !important;
    }
    
    .logo-image {
        height: 55px !important;
    }
    
    .nav-toggle {
        padding: 10px 12px !important;
        min-width: 65px !important;
    }
    
    .nav-toggle .bar {
        width: 20px !important;
        height: 2px !important;
    }
    
    .toggle-text {
        font-size: 10px !important;
    }
    
    /* ===== BANNER EXTRA PEQUEÑO ===== */
    .stats-banner {
        margin-top: 80px !important;
        padding: 0.75rem 0 !important;
    }
    
    .stat-item {
        min-width: 280px !important;
        padding: 0.5rem 0.75rem !important;
    }
    
    .stat-number {
        font-size: 1.2rem !important;
    }
    
    .stat-text {
        font-size: 0.8rem !important;
    }
    
    /* ===== HERO EXTRA PEQUEÑO ===== */
    .hero-carousel-section {
        height: 70vh !important;
    }
    
    .slide-title {
        font-size: clamp(1.5rem, 5vw, 2.5rem) !important;
    }
    
    .slide-description {
        font-size: 0.9rem !important;
    }
    
    .carousel-btn {
        width: 40px !important;
        height: 40px !important;
        font-size: 1rem !important;
    }
    
    /* ===== CARRUSELES EXTRA PEQUEÑOS ===== */
    .specialist-card {
        flex: 0 0 250px !important;
        padding: var(--spacing-md) !important;
    }
    
    .tip-card {
        flex: 0 0 260px !important;
        padding: var(--spacing-md) !important;
    }
    
    .specialists-container,
    .tips-container {
        padding: var(--spacing-sm) !important;
        margin: var(--spacing-lg) var(--spacing-xs) !important;
    }
    
    .specialists-btn,
    .tips-btn {
        width: 40px !important;
        height: 40px !important;
        font-size: var(--font-size-sm) !important;
    }
}

/* ===== MÓVIL EXTRA PEQUEÑO (360px y menos) ===== */
@media (max-width: 360px) {
    .nav-container {
        padding: 0 0.5rem !important;
    }
    
    .logo-image {
        height: 50px !important;
    }
    
    .nav-toggle {
        padding: 8px 10px !important;
        min-width: 60px !important;
    }
    
    .stats-banner {
        padding: 0.5rem 0 !important;
    }
    
    .stat-item {
        min-width: 260px !important;
        padding: 0.5rem !important;
    }
    
    .stat-number {
        font-size: 1rem !important;
    }
    
    .stat-text {
        font-size: 0.75rem !important;
    }
    
    .hero-carousel-section {
        height: 65vh !important;
    }
    
    .slide-content {
        padding: 0 0.75rem !important;
    }
}

/* ===== LANDSCAPE MÓVIL ===== */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-carousel-section {
        height: 100vh !important;
    }
    
    .stats-banner {
        padding: 0.5rem 0 !important;
    }
    
    .nav-container {
        min-height: 60px !important;
    }
    
    .logo-image {
        height: 45px !important;
    }
}

/* ===== WHATSAPP NAVEGACIÓN RESPONSIVE ===== */
@media (max-width: 768px) {
    .whatsapp-nav-btn {
        width: 35px !important;
        height: 35px !important;
        margin-left: var(--spacing-sm) !important;
    }
    
    .whatsapp-nav-icon {
        width: 18px !important;
        height: 18px !important;
    }
}

@media (max-width: 480px) {
    .whatsapp-nav-btn {
        width: 32px !important;
        height: 32px !important;
        margin-left: var(--spacing-xs) !important;
    }
    
    .whatsapp-nav-icon {
        width: 16px !important;
        height: 16px !important;
    }
}

/* ===== UTILIDADES RESPONSIVE ===== */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
    
    .show-mobile {
        display: block !important;
    }
    
    .text-center-mobile {
        text-align: center !important;
    }
    
    .flex-column-mobile {
        flex-direction: column !important;
    }
    
    .full-width-mobile {
        width: 100% !important;
    }
}

/* ===== ESTADOS HOVER SOLO EN DESKTOP ===== */
@media (hover: hover) and (pointer: fine) {
    .service-card:hover,
    .story-card:hover,
    .tip-card:hover {
        transform: translateY(-5px);
    }
    
    .btn:hover {
        transform: translateY(-2px);
    }
}

/* ===== REDUCIR ANIMACIONES PARA ACCESIBILIDAD ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .hero-graphic {
        animation: none;
    }
    
    .emergency-icons span {
        animation: none;
        position: static;
        display: inline-block;
        margin: 0 0.5rem;
    }
}

/* ===== ALTO CONTRASTE PARA ACCESIBILIDAD ===== */
@media (prefers-contrast: high) {
    :root {
        --shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.3);
        --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
        --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    }
    
    .btn {
        border-width: 2px;
    }
    
    .service-card,
    .story-card,
    .tip-card {
        border: 2px solid rgba(0, 0, 0, 0.1);
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .navbar,
    .hero-visual,
    .cta-section,
    .modal,
    .btn {
        display: none !important;
    }
    
    .hero-carousel-section {
        background: none !important;
        color: black !important;
        height: auto !important;
        padding: 1rem 0 !important;
    }
    
    .historias,
    .tips {
        background: none !important;
        color: black !important;
    }
    
    .story-card,
    .tip-card {
        border: 1px solid #ccc !important;
        background: white !important;
        break-inside: avoid;
    }
    
    h1, h2, h3 {
        color: black !important;
    }
    
    .section-header h2,
    .section-header p {
        color: black !important;
    }
}