/**
 * Zone Sidebar Component Styles
 * Map-view zone accordion (BS-3442). Layout/positioning as a flex child of
 * .map-view-container lives in HotelGrid.css; this file is the component's own look.
 */

.zone-sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--event-surface-primary-color);
    border: 1px solid var(--event-hairline-color);
    border-radius: 8px;
    padding: 20px;
    overflow: hidden;
}

/* The template and rebuild() hide the panel via the `hidden` attribute when the event has no
   zones; the author display:flex above would otherwise beat the UA [hidden] rule (BS-3442 QA). */
.zone-sidebar[hidden] {
    display: none;
}

.zone-sidebar__header {
    /* BS-6090 (Figma 798:18719): the header sits on the white panel, no grey block behind it. */
    background: transparent;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
}

.zone-sidebar__title {
    font-family: var(--event-type-subhead-m-family);
    font-weight: var(--event-type-subhead-m-weight);
    font-size: var(--event-type-subhead-m-size);
    line-height: var(--event-type-subhead-m-line-height);
    color: var(--event-text-primary-color);
}

.zone-sidebar__count {
    font-family: var(--event-type-body-s-regular-family);
    font-weight: var(--event-type-body-s-regular-weight);
    font-size: var(--event-type-body-s-regular-size);
    line-height: var(--event-type-body-s-regular-line-height);
    color: var(--event-text-secondary-color);
    white-space: nowrap;
}

.zone-sidebar__list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.zone-sidebar__zone {
    background: var(--event-surface-primary-color);
    border: 1px solid var(--event-hairline-color);
    border-radius: 4px;
}

.zone-sidebar__zone-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    cursor: pointer;
    list-style: none;
}

.zone-sidebar__zone-summary::-webkit-details-marker {
    display: none;
}

/* Jordan (17 Sep, mirrors .hotel-sidebar__strip-btn): a mouse-clicked zone summary kept the
   browser's default focus ring (a 2px blue box around the whole row); only keyboard focus
   should draw one. */
.zone-sidebar__zone-summary:focus:not(:focus-visible) {
    outline: none;
}

.zone-sidebar__zone-summary:focus-visible {
    outline: 2px solid var(--event-primary-color);
    outline-offset: 2px;
}

.zone-sidebar__zone-label {
    flex: 1 1 auto;
    min-width: 0;
    font-family: var(--event-type-body-l-medium-family);
    font-weight: var(--event-type-body-l-medium-weight);
    font-size: var(--event-type-body-l-medium-size);
    line-height: var(--event-type-body-l-medium-line-height);
    color: var(--event-text-primary-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.zone-sidebar__zone-count {
    flex: 1 1 auto;
    min-width: 0;
    text-align: right;
    white-space: nowrap;
    font-family: var(--event-type-body-s-regular-family);
    font-weight: var(--event-type-body-s-regular-weight);
    font-size: var(--event-type-body-s-regular-size);
    line-height: var(--event-type-body-s-regular-line-height);
    color: var(--event-text-secondary-color);
}

.zone-sidebar__chevron {
    flex: 0 0 auto;
    color: var(--event-text-secondary-color);
    transition: transform 0.2s ease;
}

.zone-sidebar__zone[open] .zone-sidebar__chevron {
    transform: rotate(180deg);
}

.zone-sidebar__zone-body {
    display: flex;
    flex-direction: column;
    padding: 0 12px 12px;
}

.zone-sidebar__zone-body:empty {
    display: none;
}

/* Venue row (BS-6090): a venue-only zone body renders these as its whole content; a zone with
   both hotels and venues gets hotel cards first, then these. */
.zone-sidebar__venue {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 8px 0;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    color: inherit;
    font: inherit;
}

.zone-sidebar__venue + .zone-sidebar__venue {
    border-top: 1px solid var(--event-hairline-color);
}

.zone-sidebar__venue:hover {
    background: var(--event-surface-secondary-color);
}

/* Jordan (17 Sep, mirrors .hotel-sidebar__strip-btn): a tapped venue row keeps the browser
   focus ring; only keyboard focus should draw one. */
.zone-sidebar__venue:focus:not(:focus-visible) {
    outline: none;
}

.zone-sidebar__venue:focus-visible {
    outline: 2px solid var(--event-primary-color);
    outline-offset: 2px;
}

.zone-sidebar__venue-pin {
    flex: 0 0 auto;
    color: var(--event-map-venue-pin-color);
}

.zone-sidebar__venue-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
}

.zone-sidebar__venue-name {
    font-family: var(--event-type-body-m-medium-family, var(--event-font-family));
    font-weight: 500;
    font-size: 14px;
    line-height: 1.4;
    color: var(--event-text-primary-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.zone-sidebar__venue-address {
    font-size: 12px;
    line-height: 1.4;
    color: var(--event-text-secondary-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/*
 * Zone-focused card (pin click → hotel-map:zone-focus) reuses the existing map-highlighted look
 * AND gets a visible focus ring (Figma 798:18734 / BS-6090): the box-shadow alone isn't reliably
 * visible against the compact row's white surface at ≥769, so pin an explicit outline too.
 */
.zone-sidebar__zone-body .hotel-card.map-highlighted {
    border-color: var(--event-cta-color);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--event-cta-color, #4323FF) 32%, transparent);
    outline: 2px solid var(--event-primary-color);
    outline-offset: 2px;
}

/*
 * Compact zone-row card (BS-3442 QA follow-up, Figma 798:18570).
 * Cards re-parented here are the v2 AJAX render's `.hotel-card--grid` markup — HotelCard.css's
 * `.hotel-card--map` compact layout never matches them (that class isn't applied by the v2
 * render) — so this scopes directly to `.hotel-card` regardless of its variant class. Same
 * row-with-small-photo shape `.hotel-card--map` uses, sized to the Figma row spec (96x72 photo,
 * not --map's 140x130). Desktop only: below 769px the zone accordion keeps the full grid card.
 */
@media (min-width: 769px) {
    .zone-sidebar__zone-body .hotel-card {
        display: flex;
        flex-direction: row;
        height: auto;
        min-height: 0;
        max-height: none;
        gap: 12px;
        padding: 8px 0 12px;
        /* BS-6090 (Figma 798:18734 r2): 8px, not the card's own 16px. */
        border-radius: 8px;
    }

    .zone-sidebar__zone-body .hotel-card__image-container {
        width: 110px;
        height: 98px;
        flex-shrink: 0;
        border-radius: 8px;
        margin: 0;
    }

    .zone-sidebar__zone-body .hotel-card__content {
        padding: 0;
        display: flex;
        flex-direction: column;
        flex: 1;
        min-width: 0;
        justify-content: center;
    }

    /* BS-6090: the name overlay is absolutely positioned over the photo for the grid card
       (see HotelCard.css); here it's the first item in the text column instead — name, then
       rating, then price, then the CTA — same as the venue rows below it. */
    .zone-sidebar__zone-body .hotel-card__name-overlay {
        position: static;
        padding: 0;
        pointer-events: auto;
    }

    .zone-sidebar__zone-body .hotel-card__info {
        margin-bottom: 6px;
    }

    /* BS-6090: no city or distance in the compact row, only the rating. */
    .zone-sidebar__zone-body .hotel-card__location,
    .zone-sidebar__zone-body .hotel-card__distance {
        display: none;
    }

    .zone-sidebar__zone-body .hotel-card__title {
        font-family: var(--event-type-body-l-medium-family, var(--event-font-family));
        font-weight: 500;
        font-size: 14px;
        line-height: 1.5;
        margin-bottom: 4px;
        min-height: 0;
        color: var(--event-text-primary-color);
    }

    .zone-sidebar__zone-body .hotel-card__title-link,
    .zone-sidebar__zone-body .hotel-card__title-text {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 100%;
    }

    .zone-sidebar__zone-body .hotel-card__details {
        gap: 4px 8px;
    }

    /* BS-6090: text is text-primary, never the accent/warning token — the star icon svg fill
       follows currentColor so it matches, instead of HotelCard.css's hardcoded grid-card
       rating colour. */
    .zone-sidebar__zone-body .hotel-card__rating {
        font-size: 12px;
        color: var(--event-text-primary-color);
    }

    .zone-sidebar__zone-body .hotel-card__rating svg {
        width: 12px;
        height: 12px;
        fill: currentColor;
    }

    .zone-sidebar__zone-body .hotel-card__price-container {
        margin-top: 0;
        padding-top: 8px;
        border-top: 1px solid var(--event-hairline-color);
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        min-height: 0;
    }

    .zone-sidebar__zone-body .hotel-card__price-label {
        font-size: 12px;
        color: var(--event-text-primary-color);
        font-weight: 500;
        margin-bottom: 2px;
    }

    .zone-sidebar__zone-body .hotel-card__price {
        font-size: 16px;
        font-weight: 700;
        line-height: 1.5;
        color: var(--event-text-primary-color);
        margin-bottom: 0;
    }

    /* BS-6090: "per night" doesn't fit the compact row. */
    .zone-sidebar__zone-body .hotel-card__price-period {
        display: none;
    }

    /* BS-6090 r2: the site's secondary button look (.booking-action-btn--secondary in
       BookingCheckout/BookingActions/BookingActions.css), mapped to the same event-scoped
       tokens rather than the class itself — that component's CSS isn't guaranteed to load on
       the public search/map page, but its declarations resolve to these same values. */
    .zone-sidebar__zone-body .hotel-card__cta-button,
    .zone-sidebar__zone-body .hotel-card__cta-button:hover {
        background: var(--event-surface-tertiary-color);
        color: var(--event-text-secondary-color);
        border: 1px solid var(--event-surface-border-color);
        border-radius: var(--event-button-radius);
        padding: 4px 16px;
        font-size: 14px;
        font-weight: 500;
        line-height: 1.4;
        height: auto;
        min-height: 0;
        flex-shrink: 0;
        margin-left: 0;
    }

    /* The secondary button has no icon (see booking-actions.php's "Back" button); the
       compact row drops the chevron the grid card's filled CTA uses. */
    .zone-sidebar__zone-body .hotel-card__cta-button svg {
        display: none;
    }

    .zone-sidebar__zone-body .hotel-card__gallery-nav,
    .zone-sidebar__zone-body .hotel-card__gallery-counter {
        display: none;
    }

    .zone-sidebar__zone-body .hotel-card__badge--private,
    .zone-sidebar__zone-body .hotel-card__badge--sold-out {
        top: 8px;
        padding: 3px 6px;
        font-size: 8px;
    }
}
