/**
 * Sistema Responsive Global
 * Mantiene las proporciones del diseño actual y se adapta automáticamente
 * Breakpoints:
 * - Mobile: < 768px
 * - Tablet: 768px - 1024px
 * - Desktop: > 1024px
 */

/* ============================================
   UTILIDADES RESPONSIVE
   ============================================ */

/* Ocultar en móvil */
.hide-mobile {
    display: block !important;
}
@media (max-width: 767px) {
    .hide-mobile {
        display: none !important;
    }
}

/* Ocultar en tablet */
.hide-tablet {
    display: block !important;
}
@media (min-width: 768px) and (max-width: 1024px) {
    .hide-tablet {
        display: none !important;
    }
}

/* Ocultar en desktop */
.hide-desktop {
    display: block !important;
}
@media (min-width: 1025px) {
    .hide-desktop {
        display: none !important;
    }
}

/* Mostrar solo en móvil */
.show-mobile-only {
    display: none !important;
}
@media (max-width: 767px) {
    .show-mobile-only {
        display: block !important;
    }
}

/* Mostrar solo en tablet */
.show-tablet-only {
    display: none !important;
}
@media (min-width: 768px) and (max-width: 1024px) {
    .show-tablet-only {
        display: block !important;
    }
}

/* Mostrar solo en desktop */
.show-desktop-only {
    display: none !important;
}
@media (min-width: 1025px) {
    .show-desktop-only {
        display: block !important;
    }
}

/* ============================================
   TIPOGRAFÍA RESPONSIVE (Mantiene proporciones)
   ============================================ */

h1 {
    font-size: clamp(28px, 5vw, 48px);
    line-height: 1.2;
}

h2 {
    font-size: clamp(24px, 4vw, 36px);
    line-height: 1.3;
}

h3 {
    font-size: clamp(20px, 3vw, 28px);
    line-height: 1.4;
}

p, .text-body {
    font-size: clamp(14px, 2vw, 16px);
    line-height: 1.6;
}

/* ============================================
   CONTENEDORES RESPONSIVE
   ============================================ */

.container-responsive {
    width: 100%;
    padding-left: 20px;
    padding-right: 20px;
    margin: 0 auto;
}

@media (min-width: 576px) {
    .container-responsive {
        max-width: 540px;
    }
}

@media (min-width: 768px) {
    .container-responsive {
        max-width: 720px;
        padding-left: 30px;
        padding-right: 30px;
    }
}

@media (min-width: 992px) {
    .container-responsive {
        max-width: 960px;
    }
}

@media (min-width: 1200px) {
    .container-responsive {
        max-width: 1140px;
    }
}

@media (min-width: 1400px) {
    .container-responsive {
        max-width: 1320px;
    }
}

/* ============================================
   GRID RESPONSIVE
   ============================================ */

.responsive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

@media (max-width: 767px) {
    .responsive-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .responsive-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }
}

/* ============================================
   BOTONES RESPONSIVE
   ============================================ */

.btn-responsive {
    padding: 12px 24px;
    font-size: 16px;
    min-height: 44px; /* Tamaño táctil mínimo para móvil */
    transition: all 0.2s ease;
}

@media (max-width: 767px) {
    .btn-responsive {
        width: 100%;
        padding: 14px 20px;
        font-size: 16px; /* Evita zoom en iOS */
    }
}

/* ============================================
   FORMULARIOS RESPONSIVE
   ============================================ */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="url"],
textarea,
select {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px; /* Evita zoom automático en iOS */
    min-height: 44px; /* Tamaño táctil mínimo */
    box-sizing: border-box;
}

@media (max-width: 767px) {
    .search-form {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-form input {
        border-radius: 25px;
        margin-bottom: 0;
    }
    
    .search-form button {
        border-radius: 25px;
        width: 100%;
    }
}

/* ============================================
   TABLAS RESPONSIVE
   ============================================ */

@media (max-width: 767px) {
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        display: block;
        width: 100%;
    }
    
    .table-responsive table {
        min-width: 600px;
        width: 100%;
    }
    
    /* Versión de tarjetas para tablas en móvil */
    .table-mobile-cards {
        display: block;
    }
    
    .table-mobile-cards thead {
        display: none;
    }
    
    .table-mobile-cards tbody,
    .table-mobile-cards tr,
    .table-mobile-cards td {
        display: block;
        width: 100%;
    }
    
    .table-mobile-cards tr {
        margin-bottom: 15px;
        border: 1px solid #e5e5ea;
        border-radius: 8px;
        padding: 15px;
        background: #fff;
    }
    
    .table-mobile-cards td {
        border: none;
        padding: 8px 0;
        text-align: left;
    }
    
    .table-mobile-cards td:before {
        content: attr(data-label) ": ";
        font-weight: 600;
        color: #8a8a8e;
    }
}

/* ============================================
   MODO APP PARA MÓVIL
   ============================================ */

body.app-mode {
    /* Estilos específicos para modo app en móvil */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

body.app-mode * {
    -webkit-tap-highlight-color: transparent;
}

/* Mejoras de rendimiento en móvil */
@media (max-width: 767px) {
    * {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    /* Optimizar animaciones en móvil */
    * {
        will-change: auto;
    }
}

/* ============================================
   ESPECÍFICO POR DISPOSITIVO
   ============================================ */

/* Estilos para móvil */
body.device-mobile .hero-section h1 {
    font-size: 32px;
    line-height: 1.2;
    margin-bottom: 15px;
}

body.device-mobile .hero-subtitle {
    font-size: 16px;
    line-height: 1.5;
}

/* Estilos para tablet */
body.device-tablet .hero-section h1 {
    font-size: 40px;
}

body.device-tablet .resultados-grid {
    grid-template-columns: repeat(2, 1fr) !important;
}

/* Estilos para desktop - mantener diseño actual */
body.device-desktop .hero-section {
    padding: 80px 20px;
}

/* ============================================
   MEJORAS DE ACCESIBILIDAD TÁCTIL
   ============================================ */

@media (max-width: 767px) {
    /* Aumentar área táctil de botones y enlaces */
    a, button, .btn {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Espaciado mejorado para elementos interactivos */
    .sidebar-nav a,
    .main-nav a {
        padding: 12px 16px;
    }
}









