/**
 * Music To Go - Catalog Enhancer Styles
 * Versión 1.1.0
 * 
 * Compatibilidad Universal Multi-Navegador y Multi-Dispositivo:
 * - 100% Compatible con Google Chrome, Apple Safari (macOS & iOS WebKit), Mozilla Firefox, Microsoft Edge, Opera y Android WebViews.
 * - Modo Incógnito / Navegación Privada garantizado.
 * - Nivelación de altura de tarjetas (Equal Height Cards: min-height 108px desktop, 96px móvil).
 * - Aislamiento estricto de selectores CSS (evita caídas de reglas en navegadores sin soporte :has).
 * - Botón de WhatsApp accesible, con soporte táctil instantáneo y contraste WCAG 2.1 AA.
 */

:root {
    --mtg-btn-bg: #1E8E3E;       /* Verde accesible con contraste WCAG 2.1 AA (4.5:1+) */
    --mtg-btn-hover-bg: #25D366; /* Hover verde oficial brillante WhatsApp */
    --mtg-btn-color: #ffffff;
    --mtg-focus-ring: #000000;
}

/* 1. Nivelación quirúrgica de altura de tarjetas (Equal Height Cards exclusivamente vía CSS) */
.booqable-product-wrapper .bq-details {
    min-height: 108px !important;
    height: auto !important;
    box-sizing: border-box !important;
}

.booqable-product-wrapper.mtg-has-inquiry .bq-details {
    min-height: 108px !important;
    height: auto !important;
}

/* 2. Ocultación limpia y universal de la insignia roja "Unavailable" en tarjetas cotizadas */
.booqable-product-wrapper.mtg-has-inquiry .bq-status {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: none !important;
}

.booqable-product-wrapper.mtg-has-inquiry .bq-unavailable {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: none !important;
}

.booqable-product-wrapper.mtg-has-inquiry [class*="unavailable"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Soporte progresivo para contenedores :has() aislado para no romper navegadores antiguos */
@supports selector(:has(*)) {
    .booqable-product-wrapper.mtg-has-inquiry .fade-enter-done:has(.bq-status) {
        display: none !important;
    }
    .booqable-product-wrapper.mtg-has-inquiry span:has(> .bq-status) {
        display: none !important;
    }
}

/* 3. Regla para ocultar tarjetas completas cuando el precio es $0.00 */
.booqable-product-wrapper.mtg-hidden-card,
.booqable-product-wrapper[style*="display: none"] {
    display: none !important;
}

/* 4. Botón dinámico "Contact for Inquiry" */
.mtg-inquiry-btn {
    display: -webkit-inline-flex !important;
    display: -ms-inline-flexbox !important;
    display: inline-flex !important;
    -webkit-align-items: center !important;
    -ms-flex-align: center !important;
    align-items: center !important;
    -webkit-justify-content: center !important;
    -ms-flex-pack: center !important;
    justify-content: center !important;
    gap: 6px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin-top: 8px !important;
    margin-bottom: 4px !important;
    padding: 5px 10px !important;
    background-color: var(--mtg-btn-bg, #1E8E3E) !important;
    color: var(--mtg-btn-color, #ffffff) !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    letter-spacing: 0.5px !important;
    text-transform: uppercase !important;
    text-decoration: none !important;
    border-radius: 8px !important;
    border: none !important;
    cursor: pointer !important;
    line-height: 1.3 !important;
    -webkit-transition: background-color 0.25s ease, -webkit-transform 0.2s ease !important;
    transition: background-color 0.25s ease, transform 0.2s ease !important;
    box-shadow: none !important;
    z-index: 10 !important;
    position: relative !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    -webkit-tap-highlight-color: transparent !important;
    touch-action: manipulation !important;
}

.mtg-inquiry-btn:hover {
    background-color: var(--mtg-btn-hover-bg, #25D366) !important;
    color: var(--mtg-btn-color, #ffffff) !important;
    text-decoration: none !important;
    -webkit-transform: translateY(-1px) !important;
    transform: translateY(-1px) !important;
    box-shadow: none !important;
}

.mtg-inquiry-btn:focus-visible {
    outline: 3px solid var(--mtg-focus-ring, #000000) !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 4px rgba(37, 211, 102, 0.4) !important;
}

.mtg-inquiry-btn:active {
    -webkit-transform: translateY(0) !important;
    transform: translateY(0) !important;
    box-shadow: none !important;
}

/* 5. Icono SVG oficial de WhatsApp */
.mtg-wa-icon {
    display: inline-block !important;
    vertical-align: middle !important;
    -webkit-flex-shrink: 0 !important;
    flex-shrink: 0 !important;
    fill: currentColor !important;
    stroke: currentColor !important;
    stroke-width: 8px !important;
    pointer-events: none !important;
}

.mtg-inquiry-btn:hover .mtg-wa-icon {
    -webkit-transform: scale(1.08) !important;
    transform: scale(1.08) !important;
}

/* 6. Texto del botón */
.mtg-inquiry-text {
    display: inline-block !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-weight: 800 !important;
    pointer-events: none !important;
}

/* 7. Accesibilidad lectores de pantalla (WCAG 4.1.2) */
.mtg-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* 8. Adaptabilidad Multi-Dispositivo (Smartphones iOS Safari, Android, Tablets, Laptops y PC) */
@media (max-width: 480px) {
    .booqable-product-wrapper .bq-details {
        min-height: 96px !important;
    }
    .mtg-inquiry-btn {
        font-size: 11px !important;
        padding: 5px 8px !important;
        gap: 4px !important;
        letter-spacing: 0.3px !important;
    }
    .mtg-wa-icon {
        width: 14px !important;
        height: 14px !important;
    }
}
