/**
 * SANNA CLÍNICA BELÉN - Estilos Responsive 100%
 * Adaptación completa para todos los dispositivos
 */

/* ===================================
   TABLETS GRANDES (1024px - 1280px)
   =================================== */
@media screen and (max-width: 1280px) {
    .container,
    .mapa-container,
    .feedback-container,
    .supervision-container,
    .competencias-container {
        max-width: 95%;
        padding-left: 2rem;
        padding-right: 2rem;
    }
    
    /* Hero sections */
    .mapa-hero h1,
    .feedback-hero h1,
    .supervision-hero h1,
    .competencias-hero h1,
    .protocolo-hero h1 {
        font-size: 2.8rem;
    }
    
    /* Tablas */
    .tasks-table,
    .roles-table,
    .escalation-table {
        font-size: 0.9rem;
    }
}

/* ===================================
   TABLETS (768px - 1024px)
   =================================== */
@media screen and (max-width: 1024px) {
    .section-header h2 {
        font-size: 2rem;
    }
    
    .cards-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    
    /* Hero sections */
    .mapa-hero,
    .feedback-hero,
    .supervision-hero,
    .competencias-hero,
    .protocolo-hero {
        padding: 60px 20px 40px;
    }
    
    .mapa-hero h1,
    .feedback-hero h1,
    .supervision-hero h1,
    .competencias-hero h1,
    .protocolo-hero h1 {
        font-size: 2.4rem;
    }
    
    .mapa-hero .subtitle,
    .feedback-hero .subtitle,
    .supervision-hero .subtitle,
    .competencias-hero .subtitle,
    .protocolo-hero .subtitle {
        font-size: 1.2rem;
    }
    
    /* Sections */
    .stage-section,
    .cycle-section,
    .objectives-section,
    .intro-section,
    .justification-section {
        padding: 35px 30px;
    }
    
    /* Tablas - Hacer scroll horizontal */
    .tasks-table,
    .roles-table,
    .escalation-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .tasks-table th,
    .tasks-table td,
    .roles-table th,
    .roles-table td,
    .escalation-table th,
    .escalation-table td {
        padding: 12px 10px;
        font-size: 0.85rem;
    }
}

/* ===================================
   MÓVILES Y TABLETS (max 768px)
   =================================== */
@media screen and (max-width: 768px) {
    /* === HERO SECTION === */
    .hero-section {
        min-height: auto;
        padding: 100px 20px 60px;
    }
    
    .hero-title {
        font-size: 2.2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 15px;
    }
    
    .btn-hero-primary,
    .btn-hero-secondary {
        width: 100%;
        text-align: center;
    }
    
    .hero-stats {
        gap: 20px;
    }
    
    .stat-number {
        font-size: 2.2rem;
    }
    
    .stat-label {
        font-size: 0.9rem;
    }
    
    /* === NAVIGATION === */
    .menu-toggle {
        display: flex;
        z-index: 1001;
    }
    
    .brand-logo img,
    .logo-image {
        height: 38px;
    }
    
    .site-tagline {
        font-size: 0.7rem;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 380px;
        height: 100vh;
        background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
        flex-direction: column;
        padding: 5rem 1.5rem 2rem;
        gap: 0.5rem;
        box-shadow: -5px 0 30px rgba(0, 168, 89, 0.2);
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        z-index: 1000;
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-item {
        width: 100%;
        margin: 0.25rem 0;
    }
    
    .nav-link {
        width: 100%;
        padding: 1rem 1.25rem;
        font-size: 1rem;
        justify-content: flex-start;
    }
    
    .nav-link:hover {
        transform: translateX(0);
    }
    
    /* Dropdowns en móvil */
    .dropdown-menu {
        position: static;
        box-shadow: none;
        border-radius: 8px;
        margin-top: 8px;
        padding: 8px;
        background: #f8f9fa;
        border: none;
        transform: none !important;
        display: none;
    }
    
    .dropdown.active .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: none;
        display: block;
    }
    
    .dropdown-menu li {
        margin: 0.25rem 0;
    }
    
    .dropdown-menu li a {
        padding: 0.85rem 1rem;
        font-size: 0.95rem;
        border-radius: 8px;
    }
    
    .dropdown-menu li a:hover {
        transform: translateX(0);
    }
    
    .btn-search {
        width: 100%;
        justify-content: center;
    }
    
    /* === SEARCH MODAL === */
    .search-modal {
        padding: 1rem;
    }
    
    .search-modal-content {
        padding: 1.5rem;
        max-height: 90vh;
        border-radius: 12px;
    }
    
    .search-modal-content h2 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    #searchInput {
        font-size: 16px; /* Prevenir zoom en iOS */
        padding: 0.9rem;
    }
    
    /* Resultados de búsqueda responsive */
    .search-summary {
        padding: 1rem;
        font-size: 0.95rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .search-result-item {
        padding: 1.2rem;
    }
    
    .result-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .result-title {
        font-size: 1.1rem;
    }
    
    .result-description {
        font-size: 0.9rem;
    }
    
    .result-link {
        font-size: 0.9rem;
    }
    
    /* === HERO SECTIONS === */
    .mapa-hero,
    .feedback-hero,
    .supervision-hero,
    .competencias-hero,
    .protocolo-hero {
        padding: 50px 15px 35px;
        margin-top: 70px;
    }
    
    .mapa-hero h1,
    .feedback-hero h1,
    .supervision-hero h1,
    .competencias-hero h1,
    .protocolo-hero h1 {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .mapa-hero .subtitle,
    .feedback-hero .subtitle,
    .supervision-hero .subtitle,
    .competencias-hero .subtitle,
    .protocolo-hero .subtitle {
        font-size: 1rem;
        line-height: 1.5;
    }
    
    .mapa-hero .badge,
    .feedback-hero .badge,
    .supervision-hero .badge,
    .competencias-hero .badge,
    .protocolo-hero .badge {
        font-size: 0.9rem;
        padding: 8px 18px;
    }
    
    .mapa-hero::before,
    .feedback-hero::before,
    .supervision-hero::before,
    .competencias-hero::before,
    .protocolo-hero::before {
        font-size: 10rem;
        opacity: 0.05;
    }
    
    /* === CONTAINERS === */
    .mapa-container,
    .feedback-container,
    .supervision-container,
    .competencias-container,
    .protocolo-container {
        padding: 40px 15px;
    }
    
    /* === SECTIONS === */
    .stage-section,
    .cycle-section,
    .objectives-section,
    .intro-section,
    .justification-section,
    .principles-section,
    .coordination-section,
    .benefits-section,
    .escalation-levels,
    .competencia-card,
    .manifiesto-section {
        padding: 30px 20px;
        margin-bottom: 30px;
        border-radius: 15px;
    }
    
    .stage-section h3,
    .cycle-section h3,
    .objectives-section h3,
    .intro-section h2,
    .justification-section h2 {
        font-size: 1.6rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .stage-section h3 i,
    .cycle-section h3 i {
        font-size: 1.5rem;
    }
    
    /* === TABLAS RESPONSIVE === */
    .tasks-table,
    .roles-table,
    .escalation-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        font-size: 0.8rem;
        border-radius: 10px;
    }
    
    .tasks-table thead,
    .roles-table thead,
    .escalation-table thead {
        display: table;
        width: 100%;
        table-layout: fixed;
    }
    
    .tasks-table tbody,
    .roles-table tbody,
    .escalation-table tbody {
        display: table;
        width: 100%;
    }
    
    .tasks-table th,
    .tasks-table td,
    .roles-table th,
    .roles-table td,
    .escalation-table th,
    .escalation-table td {
        padding: 10px 8px;
        font-size: 0.8rem;
        min-width: 100px;
    }
    
    .tasks-table td:first-child,
    .roles-table td:first-child,
    .escalation-table td:first-child {
        min-width: 150px;
    }
    
    /* === CARDS === */
    .step-card,
    .level-card {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .step-card h4,
    .level-card h4 {
        font-size: 1.3rem;
        flex-wrap: wrap;
    }
    
    .step-card p,
    .step-card ul,
    .level-card p {
        font-size: 0.95rem;
    }
    
    /* === DIFFERENTIATOR & ESCALATION BOXES === */
    .differentiator-box,
    .escalation-box,
    .example-box {
        padding: 18px;
        margin: 18px 0;
        border-radius: 12px;
    }
    
    .differentiator-box h4,
    .escalation-box h4 {
        font-size: 1.1rem;
        flex-wrap: wrap;
    }
    
    .differentiator-box p,
    .escalation-box p,
    .escalation-box li {
        font-size: 0.9rem;
    }
    
    /* === LISTAS === */
    .justification-list li,
    .intro-section li,
    .objectives-section li,
    .principles-section li,
    .coordination-section li,
    .benefits-section li {
        padding: 14px 16px;
        font-size: 0.95rem;
        flex-direction: row;
        align-items: flex-start;
    }
    
    .justification-list li i,
    .intro-section li i,
    .objectives-section li i,
    .principles-section li i,
    .coordination-section li i,
    .benefits-section li i {
        font-size: 1.1rem;
        min-width: 25px;
        margin-top: 2px;
    }
    
    /* === BADGES === */
    .impact-badge,
    .result-category,
    .result-matches {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
    
    /* === COMPETENCIAS === */
    .escala-dominio {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .nivel-item {
        padding: 12px 15px;
    }
    
    .nivel-numero {
        font-size: 1.1rem;
        min-width: 35px;
        height: 35px;
    }
    
    .nivel-descripcion {
        font-size: 0.85rem;
    }
    
    /* === PATIENT JOURNEY === */
    .phase-card {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .phase-header h3 {
        font-size: 1.3rem;
    }
    
    .phase-timeline::before {
        left: 20px;
    }
    
    .timeline-dot {
        left: 12px;
        width: 16px;
        height: 16px;
    }
    
    /* === CONTENT SECTIONS === */
    .content-section {
        padding: 3rem 0;
    }
    
    .section-header {
        margin-bottom: 2rem;
    }
    
    .section-icon {
        font-size: 2.5rem;
    }
    
    .section-header h2 {
        font-size: 1.8rem;
    }
    
    .section-header p {
        font-size: 1rem;
    }
    
    /* === CARDS GRID === */
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .protocol-card {
        padding: 1.5rem;
    }
    
    .protocol-card h3 {
        font-size: 1.3rem;
    }
    
    .card-btn,
    .download-btn {
        width: 100%;
        text-align: center;
        padding: 0.9rem 1.5rem;
        font-size: 0.95rem;
    }
    

    /* === FOOTER === */
    .main-footer,
    footer {
        padding: 2rem 0 1rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .footer-section {
        text-align: center;
    }
    
    .footer-links {
        text-align: center;
    }
    
    .footer-bottom {
        font-size: 0.85rem;
    }
}

/* ===================================
   MÓVILES PEQUEÑOS (max 480px)
   =================================== */
@media screen and (max-width: 480px) {
    /* === HERO SECTION === */
    .hero-section {
        padding: 90px 15px 50px;
    }
    
    .hero-badge {
        font-size: 0.8rem;
        padding: 6px 18px;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .btn-hero-primary,
    .btn-hero-secondary {
        padding: 14px 30px;
        font-size: 1rem;
    }
    
    .hero-stats {
        gap: 15px;
        padding: 20px 15px;
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
    
    .stat-label {
        font-size: 0.85rem;
    }
    
    /* === NAVIGATION === */
    .brand-logo img,
    .logo-image {
        height: 32px;
    }
    
    .site-tagline {
        font-size: 0.6rem;
        display: none; /* Ocultar en móviles muy pequeños */
    }
    
    .nav-menu {
        width: 92%;
        padding: 4.5rem 1rem 2rem;
    }
    
    .nav-link {
        padding: 0.9rem 1rem;
        font-size: 0.95rem;
    }
    
    /* === SEARCH === */
    .search-modal-content {
        padding: 1.2rem;
    }
    
    .search-modal-content h2 {
        font-size: 1.3rem;
    }
    
    .search-summary {
        font-size: 0.85rem;
        padding: 0.9rem;
    }
    
    .search-result-item {
        padding: 1rem;
    }
    
    .result-title {
        font-size: 1rem;
    }
    
    .result-category,
    .result-matches {
        font-size: 0.75rem;
        padding: 5px 10px;
    }
    
    /* === HERO SECTIONS === */
    .mapa-hero,
    .feedback-hero,
    .supervision-hero,
    .competencias-hero,
    .protocolo-hero {
        padding: 40px 12px 30px;
    }
    
    .mapa-hero h1,
    .feedback-hero h1,
    .supervision-hero h1,
    .competencias-hero h1,
    .protocolo-hero h1 {
        font-size: 1.6rem;
    }
    
    .mapa-hero .subtitle,
    .feedback-hero .subtitle,
    .supervision-hero .subtitle,
    .competencias-hero .subtitle,
    .protocolo-hero .subtitle {
        font-size: 0.95rem;
    }
    
    .mapa-hero .badge,
    .feedback-hero .badge,
    .supervision-hero .badge,
    .competencias-hero .badge,
    .protocolo-hero .badge {
        font-size: 0.8rem;
        padding: 6px 14px;
    }
    
    /* === CONTAINERS === */
    .mapa-container,
    .feedback-container,
    .supervision-container,
    .competencias-container,
    .protocolo-container {
        padding: 30px 12px;
    }
    
    /* === SECTIONS === */
    .stage-section,
    .cycle-section,
    .objectives-section,
    .intro-section,
    .justification-section,
    .principles-section,
    .coordination-section,
    .benefits-section,
    .escalation-levels {
        padding: 20px 15px;
        margin-bottom: 25px;
    }
    
    .stage-section h3,
    .cycle-section h3,
    .objectives-section h3,
    .intro-section h2,
    .justification-section h2 {
        font-size: 1.4rem;
    }
    
    .content-section {
        padding: 2.5rem 0;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .section-header p {
        font-size: 0.95rem;
    }
    
    /* === TABLAS === */
    .tasks-table,
    .roles-table,
    .escalation-table {
        font-size: 0.75rem;
    }
    
    .tasks-table th,
    .tasks-table td,
    .roles-table th,
    .roles-table td,
    .escalation-table th,
    .escalation-table td {
        padding: 8px 6px;
        font-size: 0.75rem;
        min-width: 80px;
    }
    
    /* === CARDS === */
    .protocol-card,
    .step-card,
    .level-card,
    .competencia-card {
        padding: 1.2rem;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .card-header i {
        font-size: 1.5rem;
    }
    
    .protocol-card h3 {
        font-size: 1.15rem;
    }
    
    .protocol-card p {
        font-size: 0.9rem;
    }
    
    .step-card h4,
    .level-card h4 {
        font-size: 1.2rem;
    }
    
    /* === BOXES === */
    .differentiator-box,
    .escalation-box,
    .example-box {
        padding: 15px;
    }
    
    .differentiator-box h4,
    .escalation-box h4 {
        font-size: 1rem;
    }
    
    .differentiator-box p,
    .escalation-box p,
    .escalation-box li {
        font-size: 0.85rem;
    }
    
    /* === LISTAS === */
    .justification-list li,
    .intro-section li,
    .objectives-section li,
    .principles-section li,
    .coordination-section li,
    .benefits-section li {
        padding: 12px 14px;
        font-size: 0.9rem;
    }
    
    /* === EQUIPO === */
    .lead-text {
        font-size: 1rem;
    }
    

    /* === FOOTER === */
    .footer-section h3 {
        font-size: 1.2rem;
    }
    
    .footer-section h4 {
        font-size: 1rem;
    }
    
    .footer-bottom {
        font-size: 0.8rem;
        padding: 0.8rem;
    }
}

/* ===================================
   MÓVILES MUY PEQUEÑOS (max 360px)
   =================================== */
@media screen and (max-width: 360px) {
    .mapa-hero h1,
    .feedback-hero h1,
    .supervision-hero h1,
    .competencias-hero h1,
    .protocolo-hero h1 {
        font-size: 1.4rem;
    }
    
    .mapa-hero .subtitle,
    .feedback-hero .subtitle,
    .supervision-hero .subtitle,
    .competencias-hero .subtitle,
    .protocolo-hero .subtitle {
        font-size: 0.85rem;
    }
    
    .stage-section h3,
    .cycle-section h3,
    .intro-section h2,
    .justification-section h2 {
        font-size: 1.2rem;
    }
    
    .tasks-table,
    .roles-table,
    .escalation-table {
        font-size: 0.7rem;
    }
    
    .tasks-table th,
    .tasks-table td,
    .roles-table th,
    .roles-table td,
    .escalation-table th,
    .escalation-table td {
        padding: 6px 4px;
        min-width: 70px;
    }
}

/* ===================================
   LANDSCAPE MÓVILES
   =================================== */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .mapa-hero,
    .feedback-hero,
    .supervision-hero,
    .competencias-hero,
    .protocolo-hero {
        padding: 30px 15px 25px;
    }
    
    .mapa-hero h1,
    .feedback-hero h1,
    .supervision-hero h1,
    .competencias-hero h1,
    .protocolo-hero h1 {
        font-size: 1.8rem;
    }
    
    .search-modal-content {
        max-height: 85vh;
    }
}

/* ===================================
   MEJORAS DE ACCESIBILIDAD TÁCTIL
   =================================== */
@media (hover: none) and (pointer: coarse) {
    /* Aumentar áreas táctiles en móviles */
    .nav-menu > li > a,
    .dropdown-toggle,
    .card-btn,
    .download-btn,
    .result-link {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .dropdown-menu li a {
        min-height: 44px;
    }
    
    /* Remover efectos hover en dispositivos táctiles */
    .protocol-card:hover,
    .card-btn:hover,
    .search-result-item:hover,
    .step-card:hover,
    .level-card:hover {
        transform: none;
    }
}

/* ===================================
   IMPRESIÓN
   =================================== */
@media print {
    .main-header,
    header,
    .menu-toggle,
    .search-modal,
    .main-footer,
    footer,
    .download-btn,
    .card-btn {
        display: none !important;
    }
    
    .main-content {
        margin-top: 0;
    }
    
    .mapa-hero,
    .feedback-hero,
    .supervision-hero,
    .competencias-hero,
    .protocolo-hero {
        margin-top: 0;
        padding: 20px;
    }
    
    .protocol-card,
    .stage-section,
    .cycle-section {
        page-break-inside: avoid;
    }
    
    a {
        text-decoration: underline;
        color: #000 !important;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }
    
    .tasks-table,
    .roles-table,
    .escalation-table {
        font-size: 0.7rem;
    }
}

/* ===================================
   DARK MODE (Opcional para futuro)
   =================================== */
@media (prefers-color-scheme: dark) {
    /* Implementar si se desea soporte para modo oscuro
    body {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }
    */
}

/* ===================================
   ANIMACIONES REDUCIDAS (Accesibilidad)
   =================================== */
@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;
    }
}

/* ===================================
   ORIENTACIÓN HORIZONTAL EN TABLETS
   =================================== */
@media screen and (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tasks-table,
    .roles-table,
    .escalation-table {
        font-size: 0.85rem;
    }
}
