/* =========================================
   Search glass / pill de búsqueda de habitaciones
   (Vista booking con token - debajo del banner hero)
   ========================================= */

.motor-page .motor-booking-search-wrap {
    position: sticky;
    top: 0;
    z-index: 20;
    width: 100%;
    margin: 0;
    padding: 24px 24px 32px;
    display: flex;
    justify-content: center;
    margin-top: -48px;
    margin-bottom: 24px;
}

@media (min-width: 769px) {
    .motor-page .motor-booking-search-wrap {
        top: 72px; /* PC: debajo del header fijo */
    }
}

.motor-page .search-glass-container {
    width: clamp(320px, 86vw, 980px);
    min-height: 96px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 0 14px;
    gap: 8px;
    margin: 0 auto;
}

.motor-page button.search-segment {
    background: transparent;
    border: none;
    font-family: inherit;
    font-size: 1rem;
    color: #2D3748;
    cursor: pointer;
    display: flex;
    flex-direction: row;
    align-items: center;
    height: 64px;
    padding: 0 16px;
    border-radius: 32px;
    transition: background 0.2s;
    text-align: left;
    white-space: nowrap;
    margin: 0;
}

.motor-page button.search-segment:hover {
    background: rgba(255, 255, 255, 0.4);
}

.motor-page .motor-booking-search-wrap .divider {
    width: 1px;
    height: 32px;
    background: rgba(30, 30, 30, 0.15);
    flex: 0 0 auto;
    margin: 0 4px;
}

.motor-page .motor-booking-search-wrap .divider.desktop-only {
    display: block;
}

.motor-page .search-segment.date-segment {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    flex: 0 1 auto;
    width: auto;
    min-width: 200px;
    max-width: 420px;
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: flex-start;
    padding: 0 24px;
    height: 64px;
}

.motor-page .search-segment.date-segment:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.motor-page #dates-text {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    font-weight: 500;
}

.motor-page #guests-trigger,
.motor-page #rooms-trigger {
    flex: 0 0 auto;
    color: #1a202c;
    font-weight: 500;
    gap: 10px;
    height: 64px;
}

.motor-page .motor-booking-search-wrap .segment-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.motor-page .search-btn-primary {
    background: #87AEB0;
    color: #fff;
    border: none;
    min-width: 120px;
    height: 64px;
    border-radius: 999px;
    padding: 0 32px;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    flex: 0 0 auto;
    transition: transform 0.2s, background 0.2s;
    margin-left: 8px;
}

.motor-page .search-btn-primary:hover {
    background: #769a9c;
    transform: translateY(-1px);
}

.motor-page .motor-booking-search-wrap .btn-text {
    display: inline-block;
}

.motor-page .motor-booking-search-wrap svg {
    stroke-width: 2px;
}

/* Responsive: pill apilado en móvil */
@media (max-width: 768px) {
    .motor-page .motor-booking-search-wrap {
        position: sticky;
        top: 72px; /* debajo del header fijo (no tapar) */
        z-index: 30;
        padding: 8px 12px 16px;
        margin-top: 0;
        margin-bottom: 8px;
    }

    .motor-page .search-glass-container {
        flex-direction: row;
        width: 100%;
        max-width: 100%;
        min-height: auto;
        height: 52px;
        border-radius: 999px;
        padding: 0 6px 0 2px;
        gap: 4px;
        background: rgba(255, 255, 255, 0.82);
        backdrop-filter: blur(20px);
        box-shadow: 0 6px 22px rgba(0, 0, 0, 0.22);
        align-items: center;
        justify-content: space-between;
    }

    .motor-page .motor-booking-search-wrap .divider.desktop-only {
        display: none;
    }

    .motor-page .motor-booking-search-wrap button.search-segment {
        flex: 1;
        width: auto;
        height: 44px;
        background: #fff;
        border: 1px solid #eee;
        border-radius: 999px;
        padding: 0 14px;
        justify-content: center;
        color: #2D3748;
        margin: 0;
    }

    .motor-page .search-segment.date-segment {
        max-width: none;
        width: auto;
        box-shadow: none;
        background: transparent;
        height: 44px;
    }

    .motor-page #dates-text {
        text-align: center;
        width: 100%;
    }

    .motor-page .motor-booking-search-wrap .segment-icon {
        width: 20px;
        margin-right: 8px;
        color: #0E4B5A;
    }

    /* Ocultar huéspedes y habitaciones para ganar espacio */
    .motor-page #rooms-trigger,
    .motor-page #guests-trigger {
        display: none;
    }

    /* Botón Buscar compacto solo con icono en móvil */
    .motor-page .search-btn-primary {
        flex: 0 0 auto;
        width: 44px;
        min-width: 44px;
        height: 44px;
        border-radius: 50%;
        margin: 0;
        justify-content: center;
        padding: 0;
    }

    .motor-page .motor-booking-search-wrap .btn-text {
        display: none;
    }
}

/* =========================================
   Popovers y modal (calendario, huéspedes, habitaciones)
   ========================================= */

.motor-page .search-glass-overlay.hidden,
.motor-page .search-glass-popover.hidden,
.motor-page .mobile-modal-overlay.hidden {
    display: none !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
}

.motor-page #popover-overlay {
    position: fixed;
    inset: 0;
    width: auto;
    height: auto;
    background: rgba(0, 0, 0, 0.35);
    z-index: 1098;
    cursor: pointer;
}

.motor-page .search-glass-popover.popover {
    position: fixed;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12);
    padding: 24px;
    min-width: 280px;
    z-index: 1100;
    border: 1px solid #e2e8f0;
}

.motor-page .search-glass-popover .popover-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.motor-page .search-glass-popover .counter-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.motor-page .search-glass-popover .counter-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #E2E8F0;
    background: #fff;
    color: #0E4B5A;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.motor-page .search-glass-popover .counter-btn:hover {
    background: #f0f0f0;
}

.motor-page .search-glass-popover .counter-value {
    font-weight: 600;
    min-width: 1.5em;
    text-align: center;
}

/* Calendario desktop */
.motor-page #calendar-popover-desktop {
    width: auto;
}

.motor-page .calendar-wrapper {
    display: flex;
    gap: 32px;
}

.motor-page .calendar-month {
    width: 280px;
}

/* Calendario móvil: usar todo el ancho disponible */
.motor-page .calendar-month.mobile-view-month {
    width: 100%;
    max-width: 100%;
}

.motor-page .month-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.motor-page .month-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: #1a202c;
}

.motor-page .month-nav {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #0E4B5A;
    padding: 4px 8px;
}

.motor-page .weekdays-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.85rem;
    color: #a0aec0;
    margin-bottom: 8px;
}

.motor-page .days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    row-gap: 8px;
}

.motor-page .day-cell {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
    font-size: 0.9rem;
}

.motor-page .day-cell:hover {
    background: #edf2f7;
}

.motor-page .day-cell.day-cell-disabled {
    color: #cbd5e0;
    cursor: default;
    pointer-events: none;
}

.motor-page .day-cell.day-cell-disabled span {
    background: transparent !important;
    color: #cbd5e0;
}

.motor-page .day-cell.selected-start,
.motor-page .day-cell.selected-end {
    background: transparent;
    color: #0E4B5A;
}

.motor-page .day-cell.in-range {
    background: rgba(14, 75, 90, 0.15);
}

/* Indicador circular perfecto para el número del día seleccionado */
.motor-page .day-cell span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.motor-page .day-cell.selected-start span,
.motor-page .day-cell.selected-end span {
    background: #0E4B5A;
    color: #fff;
}

/* Modal calendario móvil */
.motor-page .mobile-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.motor-page .mobile-modal-sheet {
    background: #fff;
    width: 100%;
    max-width: 100%;
    max-height: 90vh;
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.motor-page .mobile-modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.motor-page .mobile-modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.motor-page .mobile-close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    color: #333;
}

.motor-page .mobile-calendar-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px 16px 0 16px;
}

.motor-page .mobile-modal-footer {
    padding: 20px 24px;
    border-top: 1px solid #eee;
    background: #fff;
}

.motor-page .selected-range-info {
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
    color: #0E4B5A;
    margin-bottom: 12px;
}

.motor-page .btn-primary {
    background: #0E4B5A;
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.motor-page .btn-primary:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
}

.motor-page .full-width {
    width: 100%;
}

/* Validación: buscar sin rango de fechas */
@keyframes motor-shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-6px); }
    40%       { transform: translateX(6px); }
    60%       { transform: translateX(-4px); }
    80%       { transform: translateX(4px); }
}

@keyframes motor-pulse-border {
    0%, 100% { box-shadow: 0 0 0 0 rgba(14, 75, 90, 0); }
    50%       { box-shadow: 0 0 0 4px rgba(14, 75, 90, 0.45); }
}

.motor-page .motor-shake {
    animation: motor-shake 0.4s ease;
}

.motor-page .motor-date-highlight {
    animation: motor-pulse-border 0.6s ease 2;
}

.motor-page .search-segment.date-segment.needs-dates {
    box-shadow: 0 0 0 2px #0E4B5A, 0 2px 8px rgba(0, 0, 0, 0.08);
    background: #fff;
}

.motor-page .search-dates-hint {
    display: none;
    position: fixed;
    z-index: 1200;
    margin: 0;
    padding: 8px 16px;
    border-radius: 999px;
    background: #0E4B5A;
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    box-shadow: 0 8px 22px rgba(14, 75, 90, 0.28);
    pointer-events: none;
    transform: translate(-50%, -100%);
}

.motor-page .search-dates-hint::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -6px;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #0E4B5A;
}

.motor-page .search-dates-hint.search-dates-hint-below {
    transform: translate(-50%, 0);
}

.motor-page .search-dates-hint.search-dates-hint-below::after {
    bottom: auto;
    top: -6px;
    border-top-color: transparent;
    border-bottom-color: #0E4B5A;
}

.motor-page .search-dates-hint.is-visible {
    display: inline-flex;
}

.motor-page .search-dates-hint.is-visible.is-parked {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .motor-page .motor-shake,
    .motor-page .motor-date-highlight {
        animation: none;
    }
}

@media (max-width: 768px) {
    .motor-page .search-segment.date-segment.needs-dates {
        border-color: #0E4B5A;
        box-shadow: 0 0 0 2px #0E4B5A;
    }

    .motor-page .search-dates-hint {
        font-size: 0.75rem;
        max-width: calc(100vw - 24px);
        white-space: normal;
        text-align: center;
    }
}
