/* css/responsive.css - CORREGIDO PARA GRID 2x2 */

/* ===== TABLET - 1024px ===== */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr 280px;
    }

    /* Hero container adaptado para tablet */
    .hero-container {
        grid-template-columns: 1fr 300px;
        gap: var(--spacing-lg);
    }

    .hero-title {
        font-size: var(--font-size-3xl);
    }

    /* CORREGIDO: Grid 2x2 para tablet */
    .event-info-grid {
        grid-template-columns: 1fr 1fr !important;
        grid-template-rows: 1fr 1fr !important;
        gap: var(--spacing-md);
    }

    .carousel-section {
        min-height: 500px;
    }

    /* Video adaptado para tablet */
    .video-container {
        max-width: 300px;
    }

    .play-button {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
    }

    .play-button::before {
        width: 90px;
        height: 90px;
    }

    /* Ajustes para contenido ampliado */
    .instructor-card {
        gap: var(--spacing-sm);
        padding: var(--spacing-sm);
    }

    .instructor-photo {
        width: 60px;
        height: 60px;
    }

    .temario-section {
        margin-bottom: var(--spacing-xs);
    }

    .objective-item {
        padding: var(--spacing-sm);
        gap: var(--spacing-sm);
    }
}

/* ===== TABLET SMALL - 768px ===== */
@media (max-width: 768px) {
    .main-container {
        min-height: 100vh;
        height: auto;
    }

    .main-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        min-height: auto;
        height: auto;
    }

    /* Header adaptado móvil - CORREGIDO */
    .header {
        flex-direction: row;
        height: 70px;
        padding: var(--spacing-sm) var(--spacing-md);
        gap: var(--spacing-sm);
        position: sticky;
        top: 0;
        z-index: var(--z-sticky);
        justify-content: center;
    }

    .header-inner {
        width: 100%;
        max-width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0;
    }

    .logos-section {
        gap: var(--spacing-sm);
        justify-content: flex-start;
        flex: 1;
    }

    .ipa-logo {
        height: 40px;
    }

    .electrodata-logo {
        height: 38px;
    }

    .partnership-indicator {
        font-size: var(--font-size-lg);
    }

    .header-cta-section {
        flex-shrink: 0;
    }

    .main-header-cta {
        font-size: var(--font-size-sm);
        padding: var(--spacing-sm) var(--spacing-md);
    }

    /* Ocultar información del header en móvil */
    .header-info {
        display: none;
    }

    /* Hero section móvil - LAYOUT VERTICAL */
    .hero-section {
        min-height: 85vh;
        padding: var(--spacing-lg) var(--spacing-lg);
        position: relative;
    }

    .hero-container {
        display: flex;
        flex-direction: column;
        gap: var(--spacing-lg);
        height: auto;
        max-width: 100%;
        margin: 0;
    }

    .hero-content {
        order: 1;
    }

    .hero-video {
        order: 2;
        align-self: center;
        width: 100%;
        max-width: 450px;
    }

    .hero-cta-section {
        order: 3;
        margin-top: var(--spacing-md);
        display: none;
    }

    .hero-title {
        font-size: var(--font-size-2xl);
        margin-bottom: var(--spacing-md);
    }

    .hero-subtitle {
        font-size: var(--font-size-lg);
        margin-bottom: var(--spacing-lg);
    }

    .value-proposition {
        font-size: var(--font-size-sm);
        margin-bottom: var(--spacing-lg);
    }

    /* Video móvil */
    .video-container {
        max-width: 100%;
        aspect-ratio: 16/9;
        touch-action: auto;
    }

    .video-wrapper iframe {
        pointer-events: auto;
        touch-action: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* CORREGIDO: Grids móvil - FORMATO 2x2 */
    .hero-right .event-info-grid {
        grid-template-columns: 1fr 1fr !important;
        grid-template-rows: 1fr 1fr !important;
        gap: var(--spacing-xs) !important;
    }

    .hero-right .event-card {
        padding: var(--spacing-xs);
        min-height: 85px;
    }

    .hero-right .event-card i {
        font-size: 0.9rem;
    }

    .hero-right .event-card h3 {
        font-size: var(--font-size-xs);
        line-height: 1.1;
    }

    .hero-right .event-card p {
        font-size: 0.65rem;
        line-height: 1.2;
    }

    .hero-right .price-highlight {
        font-size: 1rem;
    }

    /* Botón móvil */
    .hero-video .main-cta {
        font-size: var(--font-size-lg);
        padding: var(--spacing-lg) var(--spacing-xl);
        margin-top: var(--spacing-lg);
        width: 100%;
    }

    .play-button {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
    }

    .play-button::before {
        width: 90px;
        height: 90px;
    }

    /* Info panel móvil */
    .info-panel {
        position: static;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .carousel-section {
        min-height: calc(100vh - 70px);
        padding: var(--spacing-lg) 0;
    }

    .carousel-nav {
        position: sticky;
        bottom: var(--spacing-lg);
        margin: var(--spacing-lg) auto 0;
        width: fit-content;
        background: rgba(255, 255, 255, 0.95);
        padding: var(--spacing-md);
        border-radius: var(--border-radius-pill);
        backdrop-filter: blur(10px);
    }
}

/* ===== MÓVIL PEQUEÑO - 480px ===== */
@media (max-width: 480px) {
    .header {
        height: 60px;
        padding: var(--spacing-xs) var(--spacing-sm);
        white-space: nowrap;
    }

    /* Hero móvil pequeño */
    .hero-section {
        min-height: 80vh;
        padding: var(--spacing-lg) var(--spacing-sm);
    }

    .hero-container {
        gap: var(--spacing-md);
    }

    .hero-video {
        max-width: 100%;
        margin: 0 auto;
    }

    .hero-title {
        font-size: var(--font-size-xl);
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: var(--font-size-base);
    }

    .value-proposition {
        font-size: var(--font-size-sm);
        line-height: 1.5;
    }

    /* CORREGIDO: Grids móvil pequeño - MANTENER 2x2 */
    .hero-right .event-info-grid {
        grid-template-columns: 1fr 1fr !important;
        grid-template-rows: 1fr 1fr !important;
        gap: 4px !important;
    }

    .hero-right .event-card {
        padding: 4px 2px;
        min-height: 80px;
    }

    .hero-right .event-card i {
        font-size: 0.8rem;
    }

    .hero-right .event-card h3 {
        font-size: 0.6rem;
        margin-bottom: 2px;
        line-height: 1;
    }

    .hero-right .event-card p {
        font-size: 0.55rem;
        line-height: 1.1;
    }

    .hero-right .event-card small {
        font-size: 0.5rem;
    }

    .hero-right .price-highlight {
        font-size: 0.85rem;
        margin: 2px 0;
    }

    /* Ajustes especiales para tarjeta de precio preferencial */
    .hero-right .special-pricing-card {
        padding: 4px 2px;
        min-height: 80px;
    }

    .institution-logo {
        width: 16px;
        height: 16px;
    }

    .limited-spots {
        position: static;
        margin-top: 2px;
        font-size: 0.5rem;
        padding: 1px 4px;
    }

    /* Botón móvil pequeño */
    .hero-video .main-cta {
        font-size: var(--font-size-base);
        padding: var(--spacing-md) var(--spacing-lg);
        margin-top: var(--spacing-md);
        width: 100%;
    }

    .hero-video .main-cta i {
        font-size: var(--font-size-lg);
    }

    /* Video móvil pequeño */
    .play-button {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
        display: none;
    }

    .play-button::before {
        width: 80px;
        height: 80px;
        display: none;
    }

    .video-label {
        font-size: var(--font-size-xs);
        display: none;
    }

    .video-container {
        touch-action: manipulation;
    }

    .video-wrapper iframe {
        min-height: 200px;
        pointer-events: auto;
        touch-action: manipulation;
    }

    /* Carousel móvil pequeño */
    .carousel-section {
        min-height: 85vh;
    }

    .slide-title {
        font-size: var(--font-size-lg);
        margin-bottom: var(--spacing-lg);
        padding-bottom: var(--spacing-sm);
    }

    /* Instructor cards */
    .instructor-card {
        padding: var(--spacing-sm);
        gap: var(--spacing-sm);
    }

    .instructor-photo {
        width: 50px;
        height: 50px;
    }

    .objective-item {
        padding: var(--spacing-xs);
        gap: var(--spacing-xs);
    }

    .objective-number {
        width: 25px;
        height: 25px;
        font-size: var(--font-size-sm);
    }

    .objective-content h5 {
        font-size: var(--font-size-sm);
    }

    .objective-content p {
        font-size: var(--font-size-xs);
    }
}

/* ===== MÓVIL EXTRA PEQUEÑO - 320px ===== */
@media (max-width: 320px) {
    .hero-section {
        padding: var(--spacing-md) var(--spacing-xs);
    }

    .hero-title {
        font-size: var(--font-size-lg);
        line-height: 1.1;
    }

    .hero-subtitle {
        font-size: var(--font-size-sm);
    }

    /* CORREGIDO: Grid extra pequeño - MANTENER 2x2 */
    .hero-right .event-info-grid {
        grid-template-columns: 1fr 1fr !important;
        grid-template-rows: 1fr 1fr !important;
        gap: 2px !important;
        padding: 0 1px;
    }

    .hero-right .event-card {
        padding: 2px 1px;
        min-height: 75px;
    }

    .hero-right .event-card i {
        font-size: 0.7rem;
        margin-bottom: 1px;
    }

    .hero-right .event-card h3 {
        font-size: 0.55rem;
        margin: 1px 0;
        line-height: 0.9;
        word-wrap: break-word;
        hyphens: auto;
    }

    .hero-right .event-card p {
        font-size: 0.5rem;
        line-height: 1;
        margin: 0;
        word-wrap: break-word;
        hyphens: auto;
    }

    .hero-right .event-card small {
        font-size: 0.45rem;
        margin-top: 1px;
        line-height: 0.9;
    }

    .hero-right .price-highlight {
        font-size: 0.75rem;
        margin: 1px 0;
    }

    /* Tarjeta especial para pantallas extra pequeñas */
    .institution-logo {
        width: 14px;
        height: 14px;
    }

    .limited-spots {
        font-size: 0.45rem;
        padding: 1px 3px;
        margin-top: 1px;
    }

    .hero-video .main-cta {
        font-size: var(--font-size-sm);
        padding: var(--spacing-sm) var(--spacing-md);
    }
}

/* ===== LANDSCAPE MOBILE ===== */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        min-height: 100vh;
        padding: var(--spacing-md);
    }

    .hero-container {
        display: grid;
        grid-template-columns: 1fr 320px;
        gap: var(--spacing-lg);
        align-items: start;
    }

    .hero-content {
        order: 1;
    }

    .hero-video {
        order: 2;
        width: 100%;
    }

    .hero-cta-section {
        order: 3;
        grid-column: 1 / -1;
        display: none;
    }

    .video-container {
        max-width: 320px;
        aspect-ratio: 16/9;
        touch-action: manipulation;
    }

    /* CORREGIDO: Mantener grid 2x2 en landscape */
    .hero-right .event-info-grid {
        grid-template-columns: 1fr 1fr !important;
        grid-template-rows: 1fr 1fr !important;
        gap: var(--spacing-xs) !important;
    }

    .play-button {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
        display: none;
    }

    .play-button::before {
        width: 70px;
        height: 70px;
        display: none;
    }

    .video-wrapper iframe {
        pointer-events: auto;
        touch-action: manipulation;
        min-height: 180px;
    }

    .carousel-section {
        min-height: 100vh;
    }

    .instructor-card {
        flex-direction: row;
        padding: var(--spacing-xs);
    }

    .objective-item {
        flex-direction: row;
        padding: var(--spacing-xs);
    }
}

/* ===== TOUCH IMPROVEMENTS ===== */
@media (hover: none) and (pointer: coarse) {
    .carousel-dot {
        width: 16px;
        height: 16px;
    }

    .main-header-cta {
        padding: var(--spacing-md) var(--spacing-lg);
    }

    .modal-cta {
        padding: var(--spacing-lg);
    }

    .play-button {
        min-width: 60px;
        min-height: 60px;
        display: none;
    }

    .video-overlay {
        min-height: 200px;
        display: none;
    }

    .video-container {
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    .video-wrapper iframe {
        pointer-events: auto;
        touch-action: auto;
        -webkit-overflow-scrolling: touch;
        min-height: 200px;
    }

    .carousel-nav {
        padding: var(--spacing-lg);
        gap: var(--spacing-md);
    }

    .objective-number {
        min-width: 35px;
        min-height: 35px;
    }

    .agenda-time {
        min-width: 70px;
        padding: var(--spacing-sm);
    }
}