/* Scoped finishing layer; keep routes, quote calculation and gallery images intact. */
/* A toolbar in document flow leaves the entire map canvas for locations. */
html body.site-shell #map-wrapper .map-catalog-toolbar {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-main);
}
html body.site-shell #map-wrapper .map-catalog-toolbar .map-context {
    position: static !important;
    display: block !important;
    min-width: 0;
    max-width: none;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: inherit;
    pointer-events: auto;
}
html body.site-shell #map-wrapper .map-catalog-toolbar .map-context b { font-size: 14px; line-height: 1.3; color: inherit; }
html body.site-shell #map-wrapper .map-catalog-toolbar .map-discovery-actions {
    position: static !important;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    margin: 0;
}
html body.site-shell #map-wrapper .map-catalog-toolbar .map-discovery-actions button {
    min-height: 44px;
    padding: 8px 10px;
    flex: 0 1 auto;
    box-shadow: none;
    font-size: 12px;
}
html body.site-shell #map-wrapper .map-catalog-toolbar .btn-search-area {
    position: static !important;
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    max-width: none;
    margin: 0;
    transform: none !important;
    min-height: 44px;
    box-shadow: none;
}
html body.site-shell #map-wrapper .map-catalog-toolbar .map-area-status {
    position: static;
    grid-column: 1 / -1;
    padding: 0;
    margin: 0;
    background: none;
    box-shadow: none;
    color: var(--text-muted);
    font-size: 12px;
}
.booking-offer-preview__summary { display: none; }
.booking-request-notice {
    margin: 0 0 14px;
    padding: 10px 12px;
    border-left: 3px solid var(--primary, #c9161d);
    border-radius: 6px;
    background: var(--bg-card, #fff);
    color: var(--text-muted, #536174);
    font-size: 13px;
    line-height: 1.5;
}
body.catalog-reference-upgrade .offer-info .car-card__title { font-size: 24px; line-height: 1.2; }
body.catalog-reference-upgrade .offer-info .car-card__specs { font-size: 14px; line-height: 1.45; }
body.catalog-reference-upgrade .offer-checkout .card-total-price { font-size: 30px; line-height: 1.2; }
body.catalog-reference-upgrade .offer-checkout .card-daily-price { color: var(--text-muted); font-size: 14px; }
body.catalog-reference-upgrade .offer-checkout .card-book-btn { min-height: 46px; font-size: 15px; }
body.catalog-reference-upgrade #rental-destinations { margin-block: 20px; }

/* Match the existing 44px listing action: a visible control must also have a
   usable touch target. Scope overrides to the shared shell, not admin tables. */
html body.site-shell #main-header :is(#theme-btn, #user-badge) {
    min-height: 44px !important;
    min-width: 44px !important;
}
html body.catalog-reference-upgrade .catalog-view-controls button {
    min-height: 44px !important;
}
html body.site-shell #btn-mic { min-width: 44px !important; }

/* Native search/datalist decorations used to collide with the two absolute
   buttons. Keep one clear action and put both real buttons in normal flow
   inside a reserved, fixed-size toolbar. The datalist itself stays intact. */
html body.site-shell #f-search-group #f-search {
    appearance: none;
    -webkit-appearance: none;
    padding-inline-end: 62px !important;
}
html body.site-shell #f-search-group:has(#btn-clear-search:not([hidden])) #f-search {
    padding-inline-end: 110px !important;
}
html body.site-shell #f-search-group .floating-label {
    max-width: calc(100% - 82px);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
html body.site-shell #f-search-group:has(#btn-clear-search:not([hidden])) .floating-label {
    max-width: calc(100% - 130px);
}
html body.site-shell #f-search::-webkit-search-cancel-button,
html body.site-shell #f-search::-webkit-search-decoration,
html body.site-shell #f-search::-webkit-search-results-button,
html body.site-shell #f-search::-webkit-search-results-decoration,
html body.site-shell #f-search::-webkit-calendar-picker-indicator {
    -webkit-appearance: none;
    display: none !important;
}
html body.site-shell #f-search-group .catalog-search-controls {
    position: absolute;
    inset-inline-end: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 5;
}
html body.site-shell #f-search-group .catalog-search-controls > button {
    position: static !important;
    inset: auto !important;
    transform: none !important;
    display: inline-flex;
    flex: 0 0 44px;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px !important;
    min-height: 44px;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    line-height: 1;
    cursor: pointer;
}
html body.site-shell #f-search-group .catalog-search-controls > button[hidden] { display: none !important; }
html body.site-shell #f-search-group .catalog-search-controls > button:hover {
    background: var(--bg-input);
    color: var(--primary);
}
html body.site-shell #f-search-group .catalog-search-controls svg { display: block; flex: none; pointer-events: none; }
html body.site-shell #f-search-group .catalog-search-controls > .recording { color: var(--primary); }

html body.site-shell .catalog-search-assist {
    position: absolute;
    inset-inline: 0;
    top: calc(100% + 22px);
    z-index: 80;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--bg-card);
    color: var(--text-main);
    box-shadow: 0 12px 30px #10255a26;
}
html body.site-shell .catalog-search-assist[hidden] { display: none !important; }
html body.site-shell .catalog-search-assist--above { top: auto; bottom: calc(100% + 8px); }
.catalog-search-assist__heading { padding: 10px 14px; font-size: 12px; font-weight: 800; color: var(--text-muted); }
#catalog-search-options { max-height: min(320px, 42dvh); overflow-y: auto; overscroll-behavior: contain; }
.catalog-search-assist__option { display: grid; gap: 2px; min-height: 52px; box-sizing: border-box; padding: 8px 14px; cursor: pointer; border-top: 1px solid var(--border); }
.catalog-search-assist__option strong { font-size: 15px; overflow-wrap: anywhere; }
.catalog-search-assist__option span { font-size: 11px; color: var(--text-muted); }
.catalog-search-assist__option:hover,
.catalog-search-assist__option[aria-selected='true'] { background: var(--bg-input); outline: 2px solid var(--cm-ui-link); outline-offset: -2px; }
.catalog-search-assist__hint { display: block; padding: 9px 14px; border-top: 1px solid var(--border); font-size: 11px; line-height: 1.4; color: var(--text-muted); }

/* Filter controls scroll independently; closing and applying stay in reach.
   An explicit zero minimum prevents long content expanding the flex sheet. */
html body.site-shell #filtersModal .filters-sheet {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    max-height: min(90dvh, 850px) !important;
    padding: 0 !important;
    overflow: hidden !important;
    overscroll-behavior: contain;
}
html body.site-shell #filtersModal .swipe-indicator { display: none; }
html body.site-shell #filtersModal .filters-sheet__header {
    flex: 0 0 auto;
    margin: 0;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-main);
}
html body.site-shell #filtersModal .filters-sheet__header button {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 10px;
}
html body.site-shell #filtersModal .filters-sheet__fields {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    padding: 20px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}
html body.site-shell #filtersModal .filters-sheet__actions {
    flex: 0 0 auto;
    padding: 14px 20px max(14px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    background: var(--bg-card);
}
html body.site-shell #filtersModal .filters-sheet__actions button { min-height: 48px; }
.catalog-no-results { grid-column: 1 / -1; padding: clamp(20px, 4vw, 40px); text-align: center; color: var(--text-main); background: var(--bg-card); border: 1px solid var(--border); border-radius: 18px; }
.catalog-no-results__icon { display: grid; place-items: center; margin: 0 auto 12px; width: 48px; height: 48px; border-radius: 50%; background: var(--bg-input); color: var(--cm-ui-link); font-size: 32px; }
.catalog-no-results h3 { margin: 0; font-size: clamp(20px, 3vw, 26px); line-height: 1.3; }
.catalog-no-results .empty-catalog-hint { max-width: 560px; margin: 10px auto 18px; color: var(--text-muted); line-height: 1.6; }
.catalog-recovery-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
html body.site-shell .catalog-recovery-actions button { min-height: 48px; padding: 10px 16px; white-space: normal; overflow-wrap: anywhere; border: 1px solid var(--border); background: var(--bg-input); color: var(--text-main); }
html body.site-shell .catalog-recovery-actions button:first-child { background: var(--cm-brand, #1E3A8A); color: #fff; border-color: var(--cm-brand, #1E3A8A); }
.catalog-recovery-actions button:focus-visible, .catalog-waitlist summary:focus-visible { outline: 3px solid var(--cm-ui-link); outline-offset: 3px; }
.catalog-waitlist { max-width: 480px; margin: 24px auto 0; padding-top: 16px; border-top: 1px solid var(--border); text-align: left; }
.catalog-waitlist summary { min-height: 44px; padding: 10px 0; box-sizing: border-box; font-weight: 700; cursor: pointer; }
.catalog-waitlist p { font-size: 14px; line-height: 1.5; color: var(--text-muted); }
.catalog-waitlist form { display: grid; gap: 14px; margin-top: 16px; }
.catalog-waitlist input:not([type='checkbox']) { box-sizing: border-box; width: 100%; min-width: 0; min-height: 48px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-input); color: var(--text-main); font: inherit; }
.catalog-waitlist__consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.5; color: var(--text-main); }
html body.site-shell .catalog-waitlist__consent input { flex: 0 0 20px; width: 20px; height: 20px; margin: 0; }
html body.site-shell .catalog-waitlist .client-booking-action { width: 100%; min-height: 48px; white-space: normal; }
@media (max-width: 500px) { .catalog-recovery-actions { display: grid; } .catalog-recovery-actions button { width: 100%; } }

/* Signed-in names add an extra sign-out control. Let only the name shrink;
   keep the brand and theme button stable on narrow phones. */
@media (max-width: 360px) {
    html body.site-shell #main-header .top-bar { gap: 6px; }
    html body.site-shell #main-header .header-actions--shared { flex: 1 1 auto; min-width: 0; gap: 4px; }
    html body.site-shell #main-header #theme-btn { flex: 0 0 44px; }
    html body.site-shell #main-header .header-account { flex: 1 1 auto; gap: 4px; }
    html body.site-shell #main-header .header-account #user-badge {
        display: block;
        flex: 1 1 auto;
        min-width: 44px !important;
        box-sizing: border-box;
        padding-inline: 4px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    html body.site-shell #main-header #btn-logout { flex: 0 0 auto; }
}
@media (max-width: 700px) {
    html body.site-shell #filtersModal .filters-sheet { max-height: 94dvh !important; }
    html body.site-shell #filtersModal .filters-sheet__header,
    html body.site-shell #filtersModal .filters-sheet__fields { padding: 12px 16px; }
    html body.site-shell #filtersModal .filters-sheet__actions {
        padding: 12px 16px max(12px, env(safe-area-inset-bottom));
    }
}

@media (max-width: 850px) {
    html body.site-shell #main-header { min-height: 58px; }

    /* One scroll owner, even when an already-open desktop modal is narrowed.
       The zero flex basis of the legacy right pane must not collapse a step
       or let its controls extend outside the visible sheet. */
    html body.site-shell #bookingModal .modal-body {
        flex-direction: column;
        overflow-y: auto !important;
        max-height: 96dvh !important;
        overscroll-behavior: contain;
    }
    html body.site-shell #bookingModal .m-left {
        flex: 0 0 auto !important;
        max-height: none !important;
        overflow-y: visible !important;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }
    html body.site-shell #bookingModal .m-right {
        flex: 0 0 auto !important;
        min-height: auto;
        overflow-y: visible !important;
    }
    html body.site-shell #bookingModal .m-right > * { flex-shrink: 0; }
}

@media (max-width: 760px) {
    html body.site-shell #bookingModal .booking-offer-preview {
        display: block !important;
        flex: 0 0 auto !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        margin: 0 0 12px !important;
        padding: 0 !important;
        overflow: visible !important;
        border: 1px solid var(--border, #dce2ea);
        border-radius: 12px;
        background: var(--bg-card, #fff);
    }
    html body.site-shell #bookingModal .booking-offer-preview > summary {
        display: flex;
        align-items: center;
        gap: 12px;
        min-height: 72px;
        padding: 12px;
        list-style: none;
        cursor: pointer;
    }
    .booking-offer-preview > summary::-webkit-details-marker { display: none; }
    .booking-offer-preview__summary img { flex: 0 0 64px; width: 64px; height: 48px; object-fit: contain; }
    .booking-offer-preview__summary > span:not(.booking-offer-preview__arrow) { flex: 1; min-width: 0; }
    .booking-offer-preview__summary strong { display: block; font-size: 17px; line-height: 1.3; overflow-wrap: anywhere; }
    .booking-offer-preview__summary small { display: block; margin-top: 4px; color: var(--text-muted); font-size: 13px; }
    .booking-offer-preview__summary:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
    .booking-offer-preview[open] .booking-offer-preview__arrow { transform: rotate(180deg); }
    .booking-offer-preview__content { padding: 12px; border-top: 1px solid var(--border); }
    html body.site-shell #bookingModal .booking-offer-preview .swipe-gallery-wrapper {
        height: auto !important; min-height: 0 !important; max-height: none !important; overflow: hidden;
    }
    html body.site-shell #bookingModal .booking-offer-preview .swipe-gallery {
        height: auto !important; max-height: none !important; aspect-ratio: 4 / 3;
    }
    html body.site-shell #bookingModal .booking-offer-preview .swipe-gallery img {
        width: 100% !important; height: 100% !important; max-height: none !important;
        padding: 0 !important; object-fit: contain !important;
    }
    .booking-request-notice { font-size: 12px; margin-bottom: 10px; }
}
