/* 910 SEGUROS - Responsive Design */
/* Mobile-first approach para optimización completa */

/* Large Desktop */
@media (min-width: 1400px) {
    .container {
        max-width: 1400px;
    }
    
    .hero-content {
        max-width: 1400px;
    }
    
    .hero-text h1 {
        font-size: 4rem;
    }
    
    .hero-text p {
        font-size: 1.3rem;
    }
}

/* Desktop */
@media (max-width: 1200px) {
    .container {
        max-width: 100%;
        padding: 0 30px;
    }
    
    .nav-container {
        padding: 0 30px;
    }
    
    .services-carousel {
        height: 500px;
    }
    
    .service-card {
        padding: 2.5rem;
        margin: 0 1rem;
    }
    
    .cases-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

/* Tablet Landscape */
@media (max-width: 1024px) {
    .hero-content {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }
    
    .hero-text h1 {
        font-size: 3rem;
    }
    
    .hero-image {
        height: 300px;
    }
    
    .hero-image i {
        font-size: 8rem;
    }
    
    .services-carousel {
        height: 550px;
    }
    
    .service-card {
        padding: 2rem;
        margin: 0 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .contact-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablet Portrait */
@media (max-width: 768px) {
    /* Navigation - Hide desktop menu first */
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 60px; /* Adjusted for ultra compact header */
        flex-direction: column;
        background-color: #FFFFFF; /* Pure white #FFFFFF to match header */
        width: 100%;
        text-align: center;
        transition: var(--transition-medium);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        padding: 2rem 0;
        gap: 1rem;
        border-top: 1px solid var(--border-light);
        z-index: 9998; /* Below hamburger but above content */
        min-height: 100vh; /* Full height for better UX */
        padding-top: 3rem;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-menu li {
        margin: 0;
    }
    
    .nav-link {
        padding: 1rem 2rem;
        display: block;
        width: 100%;
        color: var(--primary-blue); /* Ensure mobile links are also blue */
    }
    
    .nav-link:hover {
        color: var(--secondary-blue);
        background: var(--background-light);
    }
    
    /* Botones especiales en menú móvil - máxima especificidad */
    .nav-menu .nav-link.whatsapp-nav {
        margin: 1rem 2rem !important;
        display: inline-block !important;
        width: auto !important;
        background: #7BC142 !important;
        background-color: #7BC142 !important;
        color: white !important;
        border-radius: 25px !important;
        font-weight: 600 !important;
        box-shadow: 0 2px 10px rgba(123, 193, 66, 0.3) !important;
        border: 2px solid rgba(255, 255, 255, 0.2) !important;
    }
    
    .nav-menu .nav-link.whatsapp-nav:hover,
    .nav-menu .nav-link.whatsapp-nav:focus,
    .nav-menu .nav-link.whatsapp-nav:active {
        background: #6BA335 !important;
        color: white !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 4px 15px rgba(123, 193, 66, 0.4) !important;
    }
    
    .nav-menu .nav-link.proveedores-btn {
        margin: 1rem 2rem !important;
        display: inline-block !important;
        width: auto !important;
        background: #F59E0B !important;
        background-color: #F59E0B !important;
        background-image: linear-gradient(135deg, #F59E0B, #FBBF24) !important;
        color: white !important;
        border-radius: 25px !important;
        font-weight: 600 !important;
        box-shadow: 0 2px 10px rgba(245, 158, 11, 0.3) !important;
        border: 2px solid rgba(255, 255, 255, 0.2) !important;
    }
    
    .nav-menu .nav-link.proveedores-btn:hover,
    .nav-menu .nav-link.proveedores-btn:focus,
    .nav-menu .nav-link.proveedores-btn:active {
        background: linear-gradient(135deg, #D97706, var(--accent-gold)) !important;
        color: white !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4) !important;
    }
    
    /* Hide tooltip on mobile for better UX */
    .proveedores-btn::after,
    .proveedores-btn::before {
        display: none;
    }
    
    .hamburger {
        display: flex !important; /* Force display in mobile */
        z-index: 10000; /* Above everything */
        background-color: rgba(255, 255, 255, 0.95); /* Subtle white background */
        padding: 12px; /* More padding for better touch target */
        border-radius: 8px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15); /* Subtle shadow for visibility */
        border: 1px solid var(--border-light); /* Subtle border for definition */
    }
    
    /* Mobile hamburger bars styling */
    .hamburger .bar {
        width: 30px; /* Slightly wider for better visibility */
        height: 4px; /* Slightly thicker for better visibility */
        background: var(--primary-blue) !important; /* Ensure blue color */
        border-radius: 2px;
        transition: var(--transition-fast);
    }
    
    .hamburger:hover .bar {
        background: var(--secondary-blue) !important; /* Hover effect */
    }
    
    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active .bar:nth-child(1) {
        transform: translateY(10px) rotate(45deg);
        background: var(--primary-green) !important; /* Green when active */
    }
    
    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-10px) rotate(-45deg);
        background: var(--primary-green) !important; /* Green when active */
    }
    
    /* Body nav-open state */
    body.nav-open {
        overflow: hidden; /* Prevent scrolling when menu is open */
    }
    
    body.nav-open .nav-menu {
        left: 0 !important; /* Force menu visible */
    }
    
    /* Typography */
    h1 {
        font-size: 2.5rem;
    }
    
    h2 {
        font-size: 2rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
    
    /* Hero Section */
    .hero-section {
        min-height: 80vh;
        padding-top: 140px; /* Ajustado para header más compacto */
    }
    
    .hero-carousel {
        height: 500px;
    }
    
    .hero-text h1 {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .hero-text h2 {
        font-size: 1.3rem;
    }
    
    .hero-text p {
        font-size: 1.1rem;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .btn-primary, .btn-secondary {
        padding: 0.9rem 1.5rem;
        font-size: 0.95rem;
    }
    
    .hero-image {
        height: 200px;
    }
    
    .hero-image i {
        font-size: 6rem;
    }
    
    /* Medical Features Responsive */
    .medical-features {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        margin: 1rem 0;
        padding: 0.8rem;
    }
    
    .feature-item {
        padding: 0.4rem;
        font-size: 0.85rem;
    }
    
    .feature-item i {
        font-size: 1rem;
        width: 18px;
    }
    
    /* Statistics */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .stat-item {
        padding: 1.5rem;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
    
    /* Services Carousel */
    .services-carousel {
        height: 600px;
        overflow: hidden; /* Hide side cards on mobile */
    }
    
    .service-card {
        padding: 1.5rem;
        margin: 0 0.5rem;
    }
    
    /* Hide side cards on mobile */
    .service-slide.prev,
    .service-slide.next,
    .case-slide.prev,
    .case-slide.next {
        opacity: 0 !important;
        visibility: hidden !important;
    }
    
    .services-controls {
        margin-top: 1.5rem;
        gap: 0.8rem;
    }
    
    .services-prev, .services-next {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
    
    .service-card {
        padding: 2rem;
    }
    
    /* Expertise */
    .expertise-carousel {
        height: 600px;
    }
    
    .expertise-content {
        padding: 2rem;
        margin: 0 1rem;
    }
    
    .expertise-features {
        text-align: center;
    }
    
    .expertise-features li {
        justify-content: center;
    }
    
    /* Cases Carousel */
    .cases-carousel {
        min-height: 600px; /* Increased height for mobile */
        overflow: hidden; /* Hide side cards on tablet */
    }
    
    .case-card {
        padding: 2rem;
        margin: 0 1rem; /* Add horizontal margin */
    }
    
    /* Hide side cards on tablet */
    .service-slide.prev,
    .service-slide.next,
    .case-slide.prev,
    .case-slide.next {
        opacity: 0 !important;
        visibility: hidden !important;
    }
    

    
    /* Forms */
    .form-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .tab-btn {
        padding: 0.8rem;
        text-align: center;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .contact-form {
        padding: 1.5rem;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .footer-links {
        justify-content: center;
    }
    
    /* WhatsApp Float */
    .whatsapp-float {
        bottom: 1.5rem;
        right: 1.5rem;
    }
    
    .whatsapp-float a {
        width: 55px;
        height: 55px;
        font-size: 1.6rem;
    }
    
    /* Social Float */
    .social-float {
        left: 1.5rem;
        bottom: 1.5rem;
        gap: 0.6rem;
    }
    
    .social-float-btn {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
    
    /* Asegurar botones especiales visibles en tablet con máxima especificidad */
    .nav-menu .nav-link.whatsapp-nav,
    .nav-menu .nav-link.proveedores-btn {
        opacity: 1 !important;
        visibility: visible !important;
        text-shadow: none !important;
        /* Forzar colores específicos */
    }
    
    /* FORZAR COLORES CON VALORES DIRECTOS - NO VARIABLES */
    .nav-menu .nav-link.whatsapp-nav {
        background: #7BC142 !important;
        background-color: #7BC142 !important;
        background-image: none !important;
        color: #FFFFFF !important;
    }
    
    .nav-menu .nav-link.proveedores-btn {
        background: #F59E0B !important;
        background-color: #F59E0B !important;
        background-image: linear-gradient(135deg, #F59E0B, #FBBF24) !important;
        color: #FFFFFF !important;
    }
    
    /* Selectores adicionales por si hay conflictos */
    li .nav-link.whatsapp-nav {
        background: #7BC142 !important;
        color: white !important;
    }
    
    li .nav-link.proveedores-btn {
        background: #F59E0B !important;
        color: white !important;
    }
}

/* Mobile Large */
@media (max-width: 480px) {
    /* Container */
    .container {
        padding: 0 20px;
    }
    
    .nav-container {
        padding: 0 20px;
    }
    
    /* Typography */
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.8rem;
    }
    
    h3 {
        font-size: 1.3rem;
    }
    
    /* Sections */
    :root {
        --section-padding: 60px 0;
    }
    
    .section-header {
        margin-bottom: 3rem;
    }
    
    /* Header Mobile Optimization */
    .navbar {
        padding: 0.5rem 0; /* Aún más reducido para header ultra compacto */
    }
    
    .logo-img {
        height: 55px; /* Logo más compacto en móvil */
        padding: 2px 0;
    }
    
    /* Botones especiales móvil - máxima visibilidad con especificidad completa */
    .nav-menu .nav-link.whatsapp-nav {
        background: #7BC142 !important;
        background-color: #7BC142 !important;
        color: white !important;
        padding: 1rem 2rem !important;
        margin: 0.8rem 1.5rem !important;
        border-radius: 30px !important;
        font-size: 1.1rem !important;
        font-weight: 700 !important;
        box-shadow: 0 3px 15px rgba(123, 193, 66, 0.4) !important;
        border: 2px solid rgba(255, 255, 255, 0.4) !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
    }
    
    .nav-menu .nav-link.proveedores-btn {
        background: #F59E0B !important;
        background-color: #F59E0B !important;
        background-image: linear-gradient(135deg, #F59E0B, #FBBF24) !important;
        color: white !important;
        padding: 1rem 2rem !important;
        margin: 0.8rem 1.5rem !important;
        border-radius: 30px !important;
        font-size: 1.1rem !important;
        font-weight: 700 !important;
        box-shadow: 0 3px 15px rgba(245, 158, 11, 0.4) !important;
        border: 2px solid rgba(255, 255, 255, 0.4) !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
    }
    
    .nav-menu .nav-link.whatsapp-nav:hover,
    .nav-menu .nav-link.whatsapp-nav:focus,
    .nav-menu .nav-link.whatsapp-nav:active {
        background: #6BA335 !important;
        color: white !important;
        box-shadow: 0 5px 20px rgba(123, 193, 66, 0.6) !important;
    }
    
    .nav-menu .nav-link.proveedores-btn:hover,
    .nav-menu .nav-link.proveedores-btn:focus,
    .nav-menu .nav-link.proveedores-btn:active {
        background: #D97706 !important;
        background-color: #D97706 !important;
        background-image: linear-gradient(135deg, #D97706, #F59E0B) !important;
        color: white !important;
        box-shadow: 0 5px 20px rgba(245, 158, 11, 0.6) !important;
    }
    
    /* Hero */
    .hero-section {
        min-height: 70vh;
        padding-top: 160px; /* Ajustado para móvil con header compacto */
    }
    
    .hero-carousel {
        height: 450px;
    }
    
    .hero-content {
        gap: 2rem;
    }
    
    .hero-text h1 {
        font-size: 2rem;
        margin-bottom: 0.8rem;
    }
    
    .hero-text h2 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
    
    .hero-text p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 0.8rem;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
        max-width: 280px;
        justify-content: center;
        padding: 1rem 2rem;
    }
    
    .hero-image {
        height: 150px;
    }
    
    .hero-image i {
        font-size: 4rem;
    }
    
    /* Controls */
    .hero-controls, .experts-controls, .expertise-controls {
        gap: 0.5rem;
    }
    
    .hero-prev, .hero-next, .experts-prev, .experts-next, 
    .expertise-prev, .expertise-next {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
    
    .hero-indicators .indicator, .experts-indicators .indicator,
    .expertise-indicators .indicator {
        width: 10px;
        height: 10px;
    }
    
    /* Statistics */
    .statistics-banner {
        padding: 3rem 0;
    }
    
    .stat-item {
        padding: 1.2rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .stat-text {
        font-size: 0.9rem;
    }
    
    /* Services */
    .service-card {
        padding: 1.5rem;
    }
    
    .service-icon {
        width: 70px;
        height: 70px;
        margin-bottom: 1rem;
    }
    
    .service-icon i {
        font-size: 1.8rem;
    }
    
    .service-card h3 {
        font-size: 1.2rem;
    }
    
    .service-link {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }
    
    /* Expertise */
    .expertise-carousel {
        height: 550px;
    }
    
    .expertise-content {
        padding: 1.5rem;
        margin: 0 0.5rem;
    }
    
    .expertise-icon {
        width: 100px;
        height: 100px;
        margin-bottom: 1rem;
    }
    
    .expertise-icon i {
        font-size: 2.5rem;
    }
    
    .expertise-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
    
    /* Header Mobile Small */
    .navbar {
        padding: 0.3rem 0; /* Ultra compacto para pantallas pequeñas */
    }
    
    .logo-img {
        height: 45px; /* Logo compacto para pantallas muy pequeñas */
    }
    
    /* Hero adjustments */
    .hero-section {
        padding-top: 140px; /* Ajustado para pantallas pequeñas */
    }
    
    /* Cases */
    .cases-carousel {
        min-height: 550px;
    }
    
    .case-card {
        padding: 1.5rem;
    }
    

    
    .case-icon {
        width: 70px;
        height: 70px;
        margin-bottom: 1rem;
    }
    
    .case-icon i {
        font-size: 1.8rem;
    }
    
    .result-number {
        font-size: 2rem;
    }
    
    .benefit {
        font-size: 0.75rem;
        padding: 0.25rem 0.6rem;
    }
    
    .case-link {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }
    
    /* Contact */
    .contact-method {
        padding: 1.2rem;
        flex-direction: column;
        text-align: center;
    }
    
    .method-icon {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
        margin-bottom: 0.5rem;
    }
    
    .emergency-contact {
        padding: 1.2rem;
    }
    
    /* Forms */
    .contact-form {
        padding: 1.2rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.8rem;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .form-submit {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
    
    /* Footer */
    .footer {
        padding: 2rem 0 1rem;
    }
    
    .footer-section h4 {
        font-size: 1.1rem;
    }
    
    .footer-contact p {
        flex-direction: column;
        text-align: center;
        gap: 0.25rem;
    }
    
    .footer-emergency {
        padding: 0.8rem;
    }
    
    .emergency-footer {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    /* WhatsApp Float */
    .whatsapp-float {
        bottom: 1rem;
        right: 1rem;
    }
    
    .whatsapp-float a {
        width: 50px;
        height: 50px;
        font-size: 1.4rem;
    }
    
    /* Social Float */
    .social-float {
        left: 1rem;
        bottom: 1rem;
        gap: 0.5rem;
    }
    
    .social-float-btn {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
}

/* Mobile Small */
@media (max-width: 320px) {
    .container {
        padding: 0 15px;
    }
    
    .nav-container {
        padding: 0 15px;
    }
    
    /* Hero */
    .hero-text h1 {
        font-size: 1.8rem;
    }
    
    .hero-text h2 {
        font-size: 1rem;
    }
    
    .hero-text p {
        font-size: 0.95rem;
    }
    
    .btn-primary, .btn-secondary {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
    
    /* Cards and Components */
    .service-card, .case-card, .expert-card, .expertise-content {
        padding: 1.2rem;
    }
    
    .contact-form {
        padding: 1rem;
    }
    
    /* Typography adjustments */
    h2 {
        font-size: 1.6rem;
    }
    
    h3 {
        font-size: 1.2rem;
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
    
    .result-number {
        font-size: 1.8rem;
    }
}

/* Landscape orientation fixes */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        min-height: 100vh;
    }
    
    .hero-carousel {
        height: 400px;
    }
    
    .hero-content {
        gap: 2rem;
    }
    
    .hero-text h1 {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
    
    .hero-text p {
        margin-bottom: 1rem;
    }
    
    .hero-buttons {
        gap: 0.5rem;
    }
    
    .btn-primary, .btn-secondary {
        padding: 0.7rem 1.5rem;
    }
    
    .hero-image {
        height: 120px;
    }
    
    .hero-image i {
        font-size: 3rem;
    }
}

/* High contrast and accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .hero-image i {
        animation: none;
    }
    
    .whatsapp-float a {
        animation: none;
    }
    
    .expertise-btn.emergency {
        animation: none;
    }
}

@media (prefers-color-scheme: dark) {
    /* Force white header even in dark mode preference */
    .header {
        background: #FFFFFF !important;
        background-color: #FFFFFF !important;
    }
    
    .nav-link {
        color: var(--primary-blue) !important; /* Keep blue navigation */
    }
}

/* Print styles */
@media print {
    .header,
    .hero-controls,
    .experts-controls,
    .expertise-controls,
    .whatsapp-float,
    .whatsapp-nav,
    .service-link,
    .expert-contact,
    .expertise-btn,
    .case-link,
    .contact-forms,
    .emergency-btn,
    .emergency-footer {
        display: none !important;
    }
    
    .hero-section {
        background: white !important;
        color: black !important;
        min-height: auto;
        padding: 2rem 0;
    }
    
    .hero-text h1,
    .hero-text h2,
    .hero-text p {
        color: black !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1 { font-size: 24pt; }
    h2 { font-size: 20pt; }
    h3 { font-size: 16pt; }
    h4 { font-size: 14pt; }
    
    .container {
        max-width: none;
        padding: 0;
    }
    
    .service-card,
    .case-card,
    .expert-card {
        border: 1px solid #ccc;
        margin-bottom: 1rem;
        break-inside: avoid;
    }
}

/* Focus styles for accessibility */
button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--primary-green);
    outline-offset: 2px;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-green);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Hover effects for touch devices */
@media (hover: none) {
    .service-card:hover,
    .case-card:hover,
    .contact-method:hover {
        transform: none;
    }
    
    .btn-primary:hover,
    .btn-secondary:hover,
    .service-link:hover,
    .expert-contact:hover,
    .expertise-btn:hover,
    .case-link:hover {
        transform: none;
    }
}