/**
 * Motor de reservas — UX móvil Fase 1
 * Solo @media (max-width: 767.98px); PC sin cambios.
 */

/* Utilidades responsive (equivalente Bootstrap, solo booking) */
@media (max-width: 767.98px) {
    .d-md-none {
        display: inline !important;
    }
    .d-none.d-md-inline,
    .d-none.d-md-inline-flex {
        display: none !important;
    }
}
@media (min-width: 768px) {
    .d-md-none {
        display: none !important;
    }
    .d-none.d-md-inline {
        display: inline !important;
    }
    .d-none.d-md-inline-flex {
        display: inline-flex !important;
    }
}

@media (max-width: 767.98px) {
    /* ---- Flotantes: un solo visible, safe-area, teclado ---- */
    body.motor-page {
        --motor-safe-bottom: env(safe-area-inset-bottom, 0px);
        --motor-dock-h: 0px;
        --motor-float-gap: 8px;
    }

    body.motor-cart-mobile-dock-visible {
        --motor-dock-h: 72px;
    }

    body.motor-movil-keyboard-open .motor-whatsapp-float,
    body.motor-movil-keyboard-open .motor-float-btn-compare,
    body.motor-movil-keyboard-open .motor-scroll-top-float {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    .motor-whatsapp-float {
        width: 44px;
        height: 44px;
        left: max(12px, env(safe-area-inset-left, 0px));
        bottom: calc(12px + var(--motor-safe-bottom) + var(--motor-dock-h) + var(--motor-float-gap));
        z-index: 405;
    }

    .motor-whatsapp-float svg {
        width: 22px;
        height: 22px;
    }

    body.motor-page-habitaciones.motor-cart-mobile-dock-visible .motor-float-btn-compare {
        display: none !important;
    }

    body.motor-page-habitaciones:not(.motor-cart-mobile-dock-visible) .motor-whatsapp-float {
        display: none !important;
    }

    body.motor-page-habitaciones:not(.motor-cart-mobile-dock-visible) .motor-float-btn-compare {
        display: inline-flex !important;
        right: max(12px, env(safe-area-inset-right, 0px));
        bottom: calc(12px + var(--motor-safe-bottom));
        z-index: 400;
    }

    body.motor-page-habitaciones.motor-cart-mobile-dock-visible {
        padding-bottom: calc(var(--motor-dock-h) + var(--motor-safe-bottom) + 56px) !important;
    }

    body.motor-page-habitaciones:not(.motor-cart-mobile-dock-visible) {
        padding-bottom: calc(72px + var(--motor-safe-bottom)) !important;
    }

    .motor-cart-mobile-dock {
        bottom: calc(8px + var(--motor-safe-bottom));
        left: max(0.75rem, env(safe-area-inset-left, 0px));
        right: max(0.75rem, env(safe-area-inset-right, 0px));
    }

    .motor-cart-mobile-dock-cta {
        min-height: 44px;
    }

    .motor-btn-add-cart,
    .motor-btn-anadir {
        min-height: 44px;
    }

    /* ---- Precio tarjeta habitación ---- */
    .motor-room-type-price-label {
        display: none !important;
    }

    .motor-room-type-precio.d-none.d-md-block {
        display: none !important;
    }

    .motor-room-type-precio-mobile {
        display: block !important;
        margin: 0;
        font-weight: 700;
        font-size: 1.05rem;
        color: var(--motor-color-primario, #0e4b5a);
        line-height: 1.3;
    }

    .motor-room-badge-available {
        display: none !important;
    }

    /* ---- Modal añadir: steppers táctiles ---- */
    .motor-modal-anadir-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .motor-modal-anadir-row .motor-stepper-control {
        display: flex;
        width: 100%;
        max-width: none;
    }

    .motor-modal-anadir-row .motor-stepper-btn {
        flex: 1;
        min-height: 44px;
        min-width: 44px;
    }

    .motor-modal-anadir-row .motor-stepper-value {
        flex: 0 0 3rem;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
    }

    /* ---- Hero inicio ---- */
    .motor-banner-hero-overlay {
        background: linear-gradient(
            to top,
            rgba(0, 0, 0, 0.78) 0%,
            rgba(0, 0, 0, 0.42) 42%,
            rgba(0, 0, 0, 0.12) 100%
        ) !important;
    }

    .motor-banner-hero-arrow {
        display: none !important;
    }

    .motor-banner-hero--carrusel,
    .motor-banner-hero {
        min-height: 220px !important;
    }

    .motor-banner-hero-content {
        padding: 1.25rem 1rem 1.5rem;
    }

    .motor-banner-hero-title {
        font-size: 1.65rem !important;
    }

    /* ---- Sobre el hotel: line-clamp ---- */
    .motor-sobre-texto-clamp {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
        overflow: hidden;
    }

    .motor-sobre-texto-clamp.is-expanded {
        -webkit-line-clamp: unset;
        display: block;
        overflow: visible;
    }

    .motor-sobre-ver-mas {
        margin-top: 0.5rem;
        padding: 0.35rem 0;
        border: none;
        background: none;
        color: var(--motor-color-primario, #0e4b5a);
        font-weight: 600;
        font-size: 0.95rem;
        text-decoration: underline;
        text-underline-offset: 3px;
        cursor: pointer;
        min-height: 44px;
    }

    /* ---- Datos reserva: formulario arriba, resumen colapsable ---- */
    .motor-datos-reserva-resumen {
        order: 2 !important;
    }

    .motor-datos-reserva-form-section {
        order: 1 !important;
    }

    .motor-datos-resumen-mobile-bar {
        display: block;
        margin-bottom: 0.5rem;
    }

    .motor-datos-resumen-mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        width: 100%;
        min-height: 48px;
        padding: 0.65rem 0.85rem;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        background: #fff;
        color: #0f172a;
        font-size: 0.88rem;
        font-weight: 600;
        text-align: left;
        cursor: pointer;
        box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
    }

    .motor-datos-resumen-mobile-toggle i {
        color: var(--motor-color-primario, #0e4b5a);
        flex-shrink: 0;
    }

    .motor-datos-resumen-detail.is-collapsed .motor-cart-sidebar-card {
        display: none;
    }

    .motor-form-row-2col {
        gap: 1rem !important;
    }

    .motor-form-actions {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 0.75rem;
    }

    .motor-form-actions .motor-btn-secondary.d-none.d-md-inline-flex {
        display: none !important;
    }

    .motor-link-volver-mobile {
        display: block;
        width: 100%;
        min-height: 44px;
        line-height: 44px;
        text-align: center;
        color: var(--motor-color-primario, #0e4b5a);
        font-weight: 600;
        text-decoration: underline;
        text-underline-offset: 3px;
    }

    .motor-form-actions .motor-btn-primary {
        min-height: 48px;
    }

    .motor-tel-trigger,
    .motor-form-input,
    .motor-form-radio span {
        min-height: 44px;
    }

    .motor-tel-input {
        min-height: 44px;
    }
}

@media (min-width: 768px) {
    .motor-datos-resumen-mobile-bar,
    .motor-room-type-precio-mobile,
    .motor-sobre-ver-mas,
    .motor-link-volver-mobile {
        display: none !important;
    }
}

/* Fase 1.3 — descubrimiento API/reserva dentro del footer (visible, discreto) */
.motor-footer .motor-ia-discoverability {
    box-sizing: border-box;
    font-size: 0.6875rem;
    line-height: 1.5;
    color: color-mix(in srgb, currentColor 70%, transparent);
    margin: 0 auto;
    max-width: 1100px;
    width: 100%;
    padding: 0.55rem 1rem 0.7rem;
    border-top: 1px solid color-mix(in srgb, currentColor 20%, transparent);
    overflow-wrap: anywhere;
    word-break: break-word;
    text-align: left;
}
.motor-footer .motor-ia-discoverability--in-footer {
    margin-top: 0.15rem;
}
.motor-footer .motor-ia-discoverability-title {
    margin: 0 0 0.35rem;
    font-size: inherit;
    font-weight: 600;
    line-height: 1.45;
    color: inherit;
}
.motor-footer .motor-ia-discoverability-template {
    margin: 0.22rem 0 0.3rem;
}
.motor-footer .motor-ia-discoverability-label {
    display: block;
    margin: 0 0 0.1rem;
    font-size: inherit;
    font-weight: 400;
    color: inherit;
}
.motor-footer .motor-ia-discoverability-code {
    display: block;
    margin: 0;
    padding: 0.2em 0.35em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.625rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
    word-break: break-word;
    background: color-mix(in srgb, currentColor 12%, transparent);
    border-radius: 3px;
    color: inherit;
}
.motor-footer .motor-ia-discoverability-groups {
    margin: 0.4rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.motor-footer .motor-ia-discoverability-group {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.2rem 0.35rem;
    line-height: 1.45;
    color: inherit;
}
.motor-footer .motor-ia-discoverability-group-label {
    flex: 1 1 100%;
    font-size: inherit;
}
@media (min-width: 480px) {
    .motor-footer .motor-ia-discoverability-group-label {
        flex: 0 1 auto;
    }
}
.motor-footer .motor-ia-discoverability-link {
    display: inline-block;
    padding: 0.35rem 0.15rem;
    min-height: 2rem;
    line-height: 1.25;
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.motor-footer .motor-ia-discoverability-sep {
    color: inherit;
    opacity: 0.55;
    user-select: none;
    padding: 0 0.05rem;
}
.motor-rt-sin-fechas-hint {
    max-width: 1100px;
    margin: 0 auto 0.75rem;
    padding: 0 1rem;
    font-size: 0.9rem;
    color: #0e4b5a;
    font-weight: 500;
}
