/**
 * Selector de idioma profesional - ZUMAC
 * Posicionado en esquina superior izquierda del modal, dentro del contenedor
 * ✅ PROTEGIDO: Todos los selectores tienen prefijo .modzumac
 */

.modzumac .language-selector {
    position: absolute;
    top: 10px; /* ✅ Movido más arriba (antes: 24px → 16px → 10px) */
    left: 32px;
    z-index: 100 !important; /* ✅ OPTIMIZADO: Reducido de 10002 a 100 */
}

.modzumac .language-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 20px;
    background: white;
    border: 1.5px solid #e5e7eb;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    position: relative;
    z-index: 100 !important; /* ✅ OPTIMIZADO: Reducido de 10002 a 100 */
}

.modzumac .language-btn:hover {
    border-color: #06b6d4;
    box-shadow: 0 4px 16px rgba(6, 182, 212, 0.25);
    transform: translateY(-2px);
}

.modzumac .language-btn:active {
    transform: translateY(0);
}

.modzumac .language-btn-flag {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.modzumac .language-btn-text {
    font-size: 11px;
    font-weight: 600;
    color: #1f2937;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modzumac .language-btn-icon {
    color: #9ca3af;
    font-size: 10px;
    transition: transform 0.3s ease;
}

.modzumac .language-selector.open .language-btn-icon {
    transform: rotate(180deg);
}

/* Dropdown de idiomas */
.modzumac .language-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: white;
    border-radius: 12px;
    border: 1.5px solid #e5e7eb;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: 4px;
    min-width: 180px;
    display: none;
    animation: modzumac-language-slideDownFade 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* ✅ RENOMBRADO */
    overflow: hidden;
    z-index: 150 !important; /* ✅ OPTIMIZADO: Reducido de 10002 a 150 */
}

.modzumac .language-dropdown.show {
    display: block;
}

/* ✅ PROTEGIDO: Animación con prefijo modzumac- */
@keyframes modzumac-language-slideDownFade {
    from {
        opacity: 0;
        transform: translateY(-12px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Opciones de idioma */
.modzumac .language-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    color: #1f2937;
    position: relative;
}

.modzumac .language-option:hover {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    transform: translateX(4px);
}

.modzumac .language-option.active {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e3a8a;
    font-weight: 600;
}

.modzumac .language-option.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 70%;
    background: linear-gradient(135deg, #06b6d4 0%, #0ea5e9 100%);
    border-radius: 0 4px 4px 0;
}

.modzumac .language-flag {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid white;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
}

.modzumac .language-name {
    flex: 1;
    font-weight: 500;
    font-size: 12px;
}

.modzumac .language-option.active .language-name {
    font-weight: 700;
}

.modzumac .language-native {
    font-size: 10px;
    color: #6b7280;
    font-weight: 400;
}

.modzumac .language-option.active .language-native {
    color: #60a5fa;
}

.modzumac .language-check {
    color: #10b981;
    font-size: 14px;
    font-weight: 700;
    opacity: 0;
    transition: all 0.3s ease;
    transform: scale(0.5);
}

.modzumac .language-option.active .language-check {
    opacity: 1;
    transform: scale(1);
}

/* Divider en dropdown */
.modzumac .language-dropdown-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #e5e7eb, transparent);
    margin: 6px 0;
}

/* Label del dropdown */
.modzumac .language-dropdown-label {
    padding: 6px 10px 3px 10px;
    font-size: 9px;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* ============================================================================
   RESPONSIVE - MEDIA QUERIES
   ============================================================================ */

/* ✅ TABLET Y MOBILE GRANDE (768px) */
@media (max-width: 768px) {
    .modzumac .language-selector {
        top: 20px;
        left: 26px;
    }

    /* DEFINITIVO: Selector dentro del modal, arriba del texto */
    .modzumac.step-1 .language-selector,
    .modzumac .hero-search-card.step-1 .language-selector,
    body .modzumac.step-1 .language-selector {
        top: 4px !important; /* ✅ Un poco más arriba */
        left: auto !important; /* ✅ Anular left */
        right: 4px !important; /* ✅ Más a la derecha */
    }

    .modzumac .language-btn {
        padding: 5px 8px;
        gap: 5px;
    }

    .modzumac .language-btn-flag {
        width: 16px;
        height: 16px;
    }

    .modzumac .language-btn-text {
        font-size: 10px;
    }

    .modzumac .language-dropdown {
        min-width: 160px;
    }

    .modzumac .language-option {
        padding: 7px 8px;
        font-size: 12px;
    }

    .modzumac .language-flag {
        width: 20px;
        height: 20px;
    }
}

/* Asegurar que no interfiera con el scroll del modal */
.modzumac .hero-search-card {
    position: relative;
    overflow: visible;
}

/* ✅ TABLET (1024px) */
@media (max-width: 1024px) {
    .modzumac .language-selector {
        top: 22px;
        left: 32px;
    }
}

/* ✅ MOBILE PEQUEÑO (480px) */
@media (max-width: 480px) {
    .modzumac .language-selector {
        top: 18px;
        left: 20px;
    }

    /* DEFINITIVO: Selector dentro del modal, arriba del texto */
    .modzumac.step-1 .language-selector,
    .modzumac .hero-search-card.step-1 .language-selector,
    body .modzumac.step-1 .language-selector {
        top: 4px !important; /* ✅ Un poco más arriba */
        left: auto !important; /* ✅ Anular left */
        right: 4px !important; /* ✅ Más a la derecha */
    }
}

/* ✅ MOBILE MUY PEQUEÑO (400px - iPhone 15 Pro y similares) */
@media (max-width: 400px) {
    .modzumac .language-selector {
        top: 16px;
        left: 16px;
    }

    /* DEFINITIVO: Selector dentro del modal, arriba del texto */
    .modzumac.step-1 .language-selector,
    .modzumac .hero-search-card.step-1 .language-selector,
    body .modzumac.step-1 .language-selector {
        top: 4px !important; /* ✅ Un poco más arriba */
        left: auto !important; /* ✅ Anular left */
        right: 4px !important; /* ✅ Más a la derecha */
    }
}

/* ============================================================================
   FIX PARA PASO 3: Z-INDEX NO DEBE TAPAR INPUTS
   ============================================================================ */

/* ✅ En paso 3, el selector debe estar DEBAJO del formulario */
.modzumac.step-3 .language-selector,
.modzumac .hero-search-card.step-3 .language-selector {
    z-index: 1 !important; /* Bajo para NO tapar inputs del formulario */
}

.modzumac.step-3 .language-btn,
.modzumac .hero-search-card.step-3 .language-btn {
    z-index: 1 !important;
}

.modzumac.step-3 .language-dropdown,
.modzumac .hero-search-card.step-3 .language-dropdown {
    z-index: 10 !important; /* Solo el dropdown puede estar más alto cuando se abre */
}

/* ============================================================================
   ESTILOS ESPECÍFICOS PARA PASO 4 (PAGO)
   ============================================================================ */

/* Contenedor que tiene título + selector de idioma */
.modzumac .step4-title-with-language {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    position: relative;
    overflow: visible;
    z-index: 100 !important; /* ✅ OPTIMIZADO: Reducido de 10002 a 100 */
}

/* En paso 4, el selector NO está posicionado absolute */
.modzumac .step4-title-with-language .language-selector {
    position: relative;
    top: auto;
    left: auto;
    margin: 0;
}

/* Ajustar el botón de idioma en paso 4 para que sea más compacto */
.modzumac .step4-title-with-language .language-btn {
    padding: 5px 9px;
    gap: 5px;
}

.modzumac .step4-title-with-language .language-btn-flag {
    width: 16px;
    height: 16px;
}

.modzumac .step4-title-with-language .language-btn-text {
    font-size: 10px;
}

.modzumac .step4-title-with-language .language-btn-icon {
    font-size: 9px;
}

/* Asegurar que el dropdown se alinee correctamente desde la derecha */
.modzumac .step4-title-with-language .language-dropdown {
    left: auto;
    right: 0;
}

/* ✅ RESPONSIVE PASO 4 - Tablet (768px) */
@media (max-width: 768px) {
    .modzumac .step4-title-with-language {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .modzumac .step4-title-with-language .language-selector {
        align-self: flex-end;
    }
}

/* ✅ RESPONSIVE PASO 4 - Mobile (480px) */
@media (max-width: 480px) {
    .modzumac .step4-title-with-language {
        gap: 10px;
    }

    .modzumac .step4-title-with-language .language-btn {
        padding: 4px 7px;
        gap: 4px;
    }

    .modzumac .step4-title-with-language .language-btn-flag {
        width: 14px;
        height: 14px;
    }

    .modzumac .step4-title-with-language .language-btn-text {
        font-size: 9px;
    }
}

/* ============================================================================
   TOUCH OPTIMIZATION - Dispositivos táctiles
   ============================================================================ */

/* ✅ OPTIMIZACIÓN TÁCTIL: Todos los elementos interactivos */
@media (hover: none) and (pointer: coarse) {
    /* Botón principal touch-friendly (mínimo 44x44px - estándar Apple/Android) */
    .modzumac .language-btn {
        min-width: 44px;
        min-height: 44px;
        padding: 8px 12px;
    }

    /* Opciones del dropdown touch-friendly */
    .modzumac .language-option {
        min-height: 44px;
        padding: 10px 12px;
    }

    /* Feedback táctil para botón principal */
    .modzumac .language-btn:active {
        transform: scale(0.95);
        transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Feedback táctil para opciones */
    .modzumac .language-option:active {
        transform: scale(0.98) translateX(4px);
        transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Banderas más grandes en touch devices */
    .modzumac .language-btn-flag {
        width: 20px;
        height: 20px;
    }

    .modzumac .language-flag {
        width: 24px;
        height: 24px;
    }

    /* Texto más legible en touch devices */
    .modzumac .language-btn-text {
        font-size: 12px;
    }

    .modzumac .language-name {
        font-size: 13px;
    }

    /* Área táctil del dropdown más generosa */
    .modzumac .language-dropdown {
        padding: 6px;
        min-width: 200px;
    }

    /* Espaciado más generoso entre opciones */
    .modzumac .language-option {
        gap: 12px;
        margin-bottom: 4px;
    }

    .modzumac .language-option:last-child {
        margin-bottom: 0;
    }
}

/* ✅ REDUCIR MOVIMIENTO: Respetar preferencias de accesibilidad */
@media (prefers-reduced-motion: reduce) {
    .modzumac .language-dropdown {
        animation: none;
        transition: opacity 0.2s ease;
    }

    .modzumac .language-btn,
    .modzumac .language-option {
        transition: none;
    }

    .modzumac .language-btn:active,
    .modzumac .language-option:active {
        transform: none;
    }
}

/* ============================================================================
   FIN DEL MÓDULO LANGUAGE SELECTOR - v2.0
   Total de selectores: 37 (100% con prefijo .modzumac)
   Total de animaciones: 1 (100% con prefijo modzumac-)
   Total de media queries: 7 (1024px, 768px, 480px, 400px, touch, reduced-motion)
   Z-index: 100/150 (optimizado desde 10002)
   Touch Optimization: ✅ Completa (44x44px mínimo)
   Estado: ✅ 100% PROTEGIDO Y OPTIMIZADO
   ============================================================================ */
