/* ===================================
   RESPONSIVE DESIGN - BREAKPOINTS
   =================================== */

/* ===================================
   TABLET (768px - 1024px)
   =================================== */
@media screen and (max-width: 1024px) {
    /* Ajustes generales */
    .container {
        max-width: 90%;
        padding: 0 15px;
    }
    
    /* Header responsive */
    .nav-wrapper {
        padding: 0 20px;
    }
    
    .nav-menu {
        gap: 20px;
    }
    
    /* Hero section */
    .hero .container {
        gap: 30px;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    /* Grid adjustments */
    .content-grid,
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .trust-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

/* ===================================
   MÓVIL GRANDE (481px - 767px)
   =================================== */
@media screen and (max-width: 767px) {
    /* Tipografía responsive */
    html {
        font-size: 14px;
    }
    
    h1, .hero-title {
        font-size: 2rem !important;
        line-height: 1.3;
    }
    
    h2, .section-title {
        font-size: 1.75rem !important;
    }
    
    h3 {
        font-size: 1.25rem !important;
    }
    
    /* Container adjustments */
    .container {
        max-width: 95%;
        padding: 0 10px;
    }
    
    /* Mobile navigation */
    .mobile-menu-toggle {
        display: block;
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: var(--bg-white);
        flex-direction: column;
        padding: 80px 20px 20px;
        margin: 0;
        gap: 0;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        transition: right 0.3s ease;
        z-index: 999;
        overflow-y: auto;
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-item {
        width: 100%;
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-link {
        display: block;
        padding: 15px 0;
        width: 100%;
    }
    
    /* Dropdown mobile */
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .dropdown.active .dropdown-menu {
        max-height: 300px;
    }
    
    /* Hero section mobile */
    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 40px 20px;
    }
    
    .hero-title {
        font-size: 1.75rem;
        margin-bottom: 15px;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 25px;
    }
    
    .hero-cta {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .btn {
        width: 100%;
        max-width: 280px;
        text-align: center;
    }
    
    .hero-image {
        margin-top: 30px;
    }
    
    .hero-image img {
        max-width: 100%;
        height: auto;
    }
    
    /* Trust indicators */
    .trust-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .trust-item {
        padding: 15px;
    }
    
    .trust-number {
        font-size: 2rem;
    }
    
    /* Content grids */
    .content-grid,
    .products-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .content-card,
    .product-card {
        margin: 0 auto;
        max-width: 400px;
    }
    
    /* FAQ mobile */
    .faq-question button {
        font-size: 1rem;
        padding: 15px;
    }
    
    .faq-answer {
        padding: 0 15px;
    }
    
    .faq-answer.active {
        padding: 15px;
    }
    
    /* Footer mobile */
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 30px;
    }
    
    .footer-section h4 {
        margin-bottom: 15px;
    }
    
    .social-links {
        justify-content: center;
    }
}

/* ===================================
   MÓVIL PEQUEÑO (320px - 480px)
   =================================== */
@media screen and (max-width: 480px) {
    /* Tipografía extra pequeña */
    html {
        font-size: 13px;
    }
    
    .hero-title {
        font-size: 1.5rem !important;
    }
    
    .section-title {
        font-size: 1.5rem !important;
    }
    
    /* Container más pequeño */
    .container {
        padding: 0 8px;
    }
    
    /* Hero adjustments */
    .hero {
        padding: 30px 0;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    /* Botones más pequeños */
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    /* Trust indicators pequeños */
    .trust-number {
        font-size: 1.75rem;
    }
    
    .trust-label {
        font-size: 0.8rem;
    }
    
    /* Cards más pequeñas */
    .content-card img,
    .product-card img {
        height: 150px;
    }
    
    /* Disclaimer más pequeño */
    .medical-disclaimer {
        padding: 20px 0;
    }
    
    .disclaimer-content {
        padding: 0 10px;
    }
    
    .disclaimer-content h3 {
        font-size: 1.1rem;
    }
    
    .disclaimer-content p {
        font-size: 0.85rem;
    }
}

/* ===================================
   MÓVIL MUY PEQUEÑO (< 320px)
   =================================== */
@media screen and (max-width: 320px) {
    html {
        font-size: 12px;
    }
    
    .hero-title {
        font-size: 1.3rem !important;
    }
    
    .nav-menu {
        width: 90%;
        max-width: 260px;
    }
    
    .trust-grid {
        grid-template-columns: 1fr;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
}

/* ===================================
   ORIENTACIÓN HORIZONTAL EN MÓVIL
   =================================== */
@media screen and (max-width: 767px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 20px 0;
    }
    
    .hero .container {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .hero-image {
        margin-top: 0;
    }
    
    .nav-menu {
        padding-top: 60px;
    }
    
    .nav-menu.active {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ===================================
   TABLET EN ORIENTACIÓN VERTICAL
   =================================== */
@media screen and (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .content-grid,
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===================================
   PANTALLAS MUY GRANDES (> 1400px)
   =================================== */
@media screen and (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    .hero-title {
        font-size: 3.5rem;
    }
    
    .content-grid,
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ===================================
   IMPRESIÓN RESPONSIVE
   =================================== */
@media print {
    /* Ocultar elementos no necesarios */
    .main-header,
    .hero-cta,
    .faq-cta,
    .mobile-menu-toggle,
    .social-links {
        display: none !important;
    }
    
    /* Optimizar para impresión */
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
    }
    
    .hero {
        background: none !important;
        color: #000 !important;
        padding: 20px 0;
    }
    
    .content-card,
    .product-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .trust-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* URLs en enlaces */
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
    
    /* Evitar cortes de página */
    .faq-item,
    .content-card,
    .product-card {
        page-break-inside: avoid;
    }
}

/* ===================================
   ACCESIBILIDAD EN MÓVIL
   =================================== */
@media screen and (max-width: 767px) {
    /* Focus visible mejorado */
    .nav-link:focus,
    .btn:focus,
    .faq-toggle:focus {
        outline: 3px solid var(--primary-color);
        outline-offset: 2px;
    }
    
    /* Tamaños de touch targets */
    .btn,
    .nav-link,
    .faq-toggle {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Mejorar contraste en móvil */
    .hero {
        background: linear-gradient(135deg, #0052a3, #0088cc);
    }
    
    /* Texto más legible */
    .hero-subtitle,
    .content-card p,
    .product-card p {
        font-size: 1rem;
        line-height: 1.6;
    }
}

/* ===================================
   ANIMACIONES REDUCIDAS
   =================================== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .nav-menu {
        transition: none;
    }
    
    .dropdown-menu {
        transition: none;
    }
}

/* ===================================
   MODO OSCURO (PREPARADO)
   =================================== */
@media (prefers-color-scheme: dark) {
    :root {
        --text-dark: #ffffff;
        --text-light: #cccccc;
        --bg-light: #1a1a1a;
        --bg-white: #2a2a2a;
        --border-color: #444444;
    }
    
    /* Ajustes específicos para modo oscuro */
    .main-header {
        background: var(--bg-white);
    }
    
    .content-card,
    .product-card {
        background: var(--bg-white);
        color: var(--text-dark);
    }
    
    .faq-item {
        background: var(--bg-white);
    }
}

/* ===================================
   INTERNET EXPLORER 11 (SI ES NECESARIO)
   =================================== */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    /* Fallbacks para IE11 */
    .hero .container {
        display: -ms-flexbox;
        display: flex;
        -ms-flex-direction: column;
        flex-direction: column;
    }
    
    .content-grid,
    .products-grid {
        display: -ms-flexbox;
        display: flex;
        -ms-flex-wrap: wrap;
        flex-wrap: wrap;
    }
    
    .content-card,
    .product-card {
        -ms-flex: 0 0 30%;
        flex: 0 0 30%;
        margin: 1.5%;
    }
}
