/* Lifted from public/sites/templates/bloom/css/locations.css. Only the rules
   needed to render the map + pins + the split layout used by location-selection.tpl. */

/* Split layout pinned to the full viewport (escapes the legacy #main /
   .content-wrapper nesting). Header bar/footer chrome is hidden while the
   layout is mounted. */
.location-select-map-layout {
    --nova-location-border: rgba(226, 232, 240, 0.34);
    --nova-location-border: color-mix(in srgb, var(--nova-title) 30%, transparent);
    position: fixed;
    inset: 0;
    display: flex;
    background: var(--nova-inner);
    color: var(--nova-body);
    font-family: var(--nova-body-font);
    z-index: 100;
}

.location-select-map-layout > .locations-list {
    width: clamp(390px, 42vw, 620px);
    max-width: 620px;
    min-width: 390px;
    flex-shrink: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 22px 28px;
    scroll-padding-top: 12px;
    box-sizing: border-box;
    background: var(--nova-inner);
    border-right: 1px solid var(--nova-border);
    color: var(--nova-body);
}

.locations-list-header {
    padding: 20px 2px 14px;
    margin-bottom: 12px;
}
.locations-list-header:has(.locations-list-logo-shell) {
    align-items: center;
    column-gap: 20px;
    display: grid;
    grid-template-columns: minmax(104px, max-content) minmax(0, 1fr);
    row-gap: 0;
}

.locations-list-restaurant {
    color: var(--nova-title);
    font-family: var(--nova-display-font);
    margin: 0 0 14px;
    font-size: 28px;
    font-weight: 800;
    line-height: 1.2;
}
.locations-list-logo-shell {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    margin: 0 0 12px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    box-shadow: none;
    box-sizing: border-box;
}
.locations-list-header:has(.locations-list-logo-shell) .locations-list-logo-shell {
    grid-column: 1;
    grid-row: 1 / span 2;
    justify-content: flex-start;
    margin: 0;
}
.locations-list-logo {
    display: block;
    max-height: 72px;
    max-width: 240px;
    object-fit: contain;
    width: auto;
}
.locations-list-header:has(.locations-list-logo-shell) .locations-list-logo {
    max-height: 64px;
    max-width: 160px;
}
.locations-list-restaurant-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.locations-list-subtitle {
    margin: 0;
    font-size: 14px;
    color: var(--nova-muted);
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
}
.locations-list-header:has(.locations-list-logo-shell) .locations-list-subtitle {
    grid-column: 2;
}

.locations-list-title {
    color: var(--nova-title);
    font-family: var(--nova-display-font);
    font-size: 30px;
    line-height: 1.04;
    margin: 0 0 8px;
}
.locations-list-header:has(.locations-list-logo-shell) .locations-list-title {
    grid-column: 2;
    margin: 0;
}

/* Keep the selector list stacked tightly in the side column. */
.location-select-map-layout .items-container,
.location-select-map-layout .locations-list {
    display: block;
    gap: 0;
}

.location-select-map-layout .locations-list > .locationSelector,
.location-select-map-layout .menuItemContainer.locationSelector {
    cursor: pointer;
    margin: 0;
}

/* Bump specificity past `#menuView .menuItem` so the negative side-margins
   from main.css don't cancel the new padding. */
#menuView .location-select-map-layout .menuItemContainer.locationSelector .menuItem,
.location-select-map-layout .menuItemContainer.locationSelector .menuItem {
    border: 1px solid var(--nova-location-border);
    border-radius: 8px;
    background: var(--nova-tile);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
    color: var(--nova-body);
    margin: 0 0 14px;
    padding: 20px;
    min-height: 0;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.location-select-map-layout .coupon.locationSelector {
    border: 1px solid var(--nova-location-border);
    border-radius: 8px;
    background: var(--nova-tile);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
    color: var(--nova-body);
    margin: 0 0 14px;
    padding: 20px;
    min-height: 0;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.location-select-map-layout .coupon.locationSelector .left {
    float: none;
    width: 100%;
}
.location-select-map-layout .coupon.locationSelector .right {
    display: none;
}
.location-card-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: 20px;
    align-items: center;
    float: none !important;
    width: 100% !important;
    padding: 0 !important;
    box-sizing: border-box;
}
.location-card-details {
    min-width: 0;
}
.location-card-side {
    align-items: flex-end;
    align-self: center;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}
.location-select-map-layout .menuItem h2,
.location-select-map-layout .menuItem h3,
.location-select-map-layout .coupon h2 {
    color: var(--nova-title);
    font-family: var(--nova-display-font);
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 18px;
    line-height: 1.18;
}
.location-select-map-layout .menuItemContainer.locationSelector .right {
    display: none;
}

/* Hover is a thin border. Selection gets the stronger ring below. */
#menuView .location-select-map-layout .menuItemContainer.locationSelector:hover .menuItem,
.location-select-map-layout .menuItemContainer.locationSelector:hover .menuItem,
#menuView .location-select-map-layout .menuItemContainer.locationSelector:focus-visible .menuItem,
.location-select-map-layout .menuItemContainer.locationSelector:focus-visible .menuItem,
#menuView .location-select-map-layout .menuItemContainer.locationSelector.is-hover-active .menuItem,
.location-select-map-layout .menuItemContainer.locationSelector.is-hover-active .menuItem,
.location-select-map-layout .coupon.locationSelector:hover,
.location-select-map-layout .coupon.locationSelector:focus-visible,
.location-select-map-layout .coupon.locationSelector.is-hover-active {
    border-color: var(--nova-brand);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18);
    background-color: var(--nova-tile);
}

#menuView .location-select-map-layout .menuItemContainer.locationSelector.is-selected .menuItem,
.location-select-map-layout .menuItemContainer.locationSelector.is-selected .menuItem,
.location-select-map-layout .coupon.locationSelector.is-selected {
    border-color: var(--nova-brand);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.62), 0 16px 34px rgba(0, 0, 0, 0.22);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--nova-brand) 74%, transparent), 0 16px 34px rgba(0, 0, 0, 0.22);
    background-color: var(--nova-tile);
}

/* Address / phone / status formatting in the card. */
.location-address-line,
.location-city-line,
.location-phone {
    margin: 0;
    font-size: 13px;
    line-height: 1.35;
    color: var(--nova-muted);
}
.location-address-line {
    color: var(--nova-title);
    font-size: 14px;
    font-weight: 500;
}
.location-phone {
    color: var(--nova-muted);
    font-size: 0.8rem;
}
.location-status {
    align-items: center;
    background: var(--nova-soft);
    border: 1px solid var(--nova-border);
    border-radius: 999px;
    color: var(--nova-title);
    display: inline-flex;
    margin-top: 0;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    padding: 5px 9px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.location-status.is-open,
.location-status.is-closing-soon,
.location-status.is-closed {
    border-color: var(--nova-border);
    color: var(--nova-title);
}

.location-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 0;
}
.location-card-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 11px;
    border: 1px solid var(--nova-brand);
    border-radius: 8px;
    color: var(--nova-title);
    background: transparent;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.location-card-action:link,
.location-card-action:visited {
    color: var(--nova-title);
    text-decoration: none;
}
.location-card-action:hover,
.location-card-action:focus-visible {
    background: var(--nova-soft);
    text-decoration: none;
}
.location-card-action-primary,
.location-card-action-primary:link,
.location-card-action-primary:visited {
    background: var(--nova-brand);
    border-color: var(--nova-brand);
    color: #fff;
}
.location-card-action-primary:hover,
.location-card-action-primary:focus-visible {
    background: var(--nova-link);
    border-color: var(--nova-link);
    color: #fff;
}
/* Active pin (hover from card, or from address search). */
.store-location-marker {
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.store-location-marker.is-active {
    transform: translate(-50%, -50%) scale(1.3);
    border-color: var(--nova-brand);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
    z-index: 2;
}
.store-location-marker.is-selected {
    transform: translate(-50%, -50%) scale(1.36);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.62), 0 8px 20px rgba(0, 0, 0, 0.45);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--nova-brand) 74%, transparent), 0 8px 20px rgba(0, 0, 0, 0.45);
    z-index: 3;
}

/* One-time pulse to draw the user's eye to the nearest pin after an
   address search or geolocation. The animation overrides the static `.is-active`
   transform; once the class is removed via JS, the static scale resumes. */
@keyframes location-pin-pulse {
    0%   { transform: translate(-50%, -50%) scale(1.3); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35); }
    25%  { transform: translate(-50%, -50%) scale(1.55); box-shadow: 0 0 0 12px rgba(0, 0, 0, 0); }
    50%  { transform: translate(-50%, -50%) scale(1.3); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35); }
    75%  { transform: translate(-50%, -50%) scale(1.55); box-shadow: 0 0 0 12px rgba(0, 0, 0, 0); }
    100% { transform: translate(-50%, -50%) scale(1.3); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35); }
}
.store-location-marker.is-search-result {
    animation: location-pin-pulse 2.4s ease-in-out 1;
}

/* Distance text. Hidden by default, becomes visible once JS measures it
   from a user-supplied address or geolocation. */
.location-distance {
    align-items: center;
    background: var(--nova-soft);
    border: 1px solid var(--nova-border);
    border-radius: 999px;
    color: var(--nova-title);
    display: none;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    margin: 8px 0 0;
    padding: 5px 9px;
}
.location-distance.is-visible {
    display: inline-flex;
}

.location-phone a,
.location-phone a:link,
.location-phone a:visited {
    color: inherit;
    text-decoration: none;
}
.location-phone a:hover { text-decoration: underline; }

/* Floating search bar inside .map-partial. */
.map-search-floating {
    position: absolute;
    top: 18px;
    left: 18px;
    right: 76px;
    max-width: 620px;
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 46px;
    gap: 10px;
    align-items: center;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    z-index: 20;
    overflow: visible;
}
.map-search-input,
input.map-search-input,
.map-search-input.pac-target-input {
    flex: 1;
    height: 46px !important;
    border: 1px solid rgba(226, 232, 240, 0.34) !important;
    border-color: var(--nova-location-border) !important;
    border-radius: 999px !important;
    outline: none;
    padding: 0 20px !important;
    font-size: 16px;
    font-weight: 600;
    background: var(--nova-tile) !important;
    background-image: none !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24) !important;
    color: var(--nova-title) !important;
    -webkit-text-fill-color: var(--nova-title) !important;
    caret-color: var(--nova-title) !important;
    min-width: 0;
    width: 100%;
    box-sizing: border-box !important;
    appearance: none;
    -webkit-appearance: none;
}
.map-search-input::placeholder,
input.map-search-input::placeholder {
    color: var(--nova-muted) !important;
    -webkit-text-fill-color: var(--nova-muted) !important;
    font-weight: 500;
}
.map-search-input:focus,
input.map-search-input:focus,
.map-search-input.pac-target-input:focus {
    border-color: var(--nova-brand) !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.26), 0 12px 32px rgba(0, 0, 0, 0.28) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--nova-brand) 32%, transparent), 0 12px 32px rgba(0, 0, 0, 0.28) !important;
}
.map-search-geolocate {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid var(--nova-brand);
    border-radius: 999px;
    background: var(--nova-brand);
    cursor: pointer;
    color: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.2);
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
}
.map-search-geolocate:hover {
    background: var(--nova-link);
    border-color: var(--nova-link);
    transform: translateY(-1px);
}
.map-search-geolocate-icon {
    position: relative;
    display: block;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-radius: 999px;
    box-sizing: border-box;
}
.map-search-geolocate-icon::before,
.map-search-geolocate-icon::after {
    content: "";
    position: absolute;
    background: currentColor;
    border-radius: 999px;
}
.map-search-geolocate-icon::before {
    width: 2px;
    height: 22px;
    left: 5px;
    top: -5px;
}
.map-search-geolocate-icon::after {
    width: 22px;
    height: 2px;
    left: -5px;
    top: 5px;
}
.map-search-geolocate.is-loading {
    opacity: 0.6;
    pointer-events: none;
}
.map-search-geolocate.is-error {
    background: #8a1f11;
}
.map-search-status {
    position: absolute;
    top: 72px;
    left: 18px;
    max-width: 620px;
    margin: 0;
    padding: 7px 11px;
    border-radius: 6px;
    background: rgba(17, 24, 32, 0.92);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    z-index: 20;
    display: none;
}
.map-search-status.is-visible {
    display: block;
}

/* .map-partial needs to be the positioning context for the floating search. */
.location-select-map-layout > .map-partial {
    position: relative;
}

/* Google Places Autocomplete dropdown. It needs to stack above the fixed map layout. */
.pac-container {
    z-index: 100000 !important;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    margin-top: 4px;
}

.location-select-map-layout .menuItemContainer.locationSelector .menuItem .preview {
    min-height: 0;
}

.location-select-map-layout > .map-partial {
    flex-grow: 1;
    height: 100%;
    min-width: 0;
}

.map-full {
    width: 100%;
    height: 100%;
}

/* While this page is showing, hide the legacy chrome that would otherwise
   peek through behind the fixed overlay. */
body:has(.location-select-map-layout) {
    margin: 0;
    overflow: hidden;
}
body:has(.location-select-map-layout) #headerBar,
body:has(.location-select-map-layout) #footer,
body:has(.location-select-map-layout) #stickyBottom {
    display: none !important;
}

/* Marker rendering (StoreLocationMarker overlay). */
.store-location-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 999px;
    background: var(--nova-tile);
    border: 2px solid #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    font: inherit;
    color: #ffffff;
}

.store-location-marker img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    pointer-events: none;
}

.store-location-marker:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.marker-label {
    transform: translate(-50%, 18px);
    white-space: nowrap;
    background: rgb(0, 0, 0);
    border: 1px solid rgb(57, 57, 57);
    color: #fff;
    padding: 3px 7px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.25s ease;
    text-align: center;
    pointer-events: none;
    user-select: none;
}

/* Google Maps internals leak some default img sizing. Keep tiles correct. */
.gm-style img { max-width: none; }
.gm-style div { margin: 0; }

@media (max-width: 800px) {
    .location-select-map-layout {
        flex-direction: column;
    }
    .location-select-map-layout > .map-partial {
        width: 100%;
        height: 48%;
        order: -1;
        flex-grow: 0;
    }
    .location-select-map-layout > .locations-list {
        width: 100%;
        max-width: none;
        min-width: 0;
        height: 52%;
        padding: 0 14px 18px;
    }
    .locations-list-title {
        font-size: 24px;
    }
    .locations-list-logo {
        max-height: 58px;
        max-width: 200px;
    }
    .map-search-floating {
        top: calc(18px + constant(safe-area-inset-top));
        top: calc(18px + env(safe-area-inset-top));
        left: 12px;
        right: 12px;
        max-width: none;
        grid-template-columns: minmax(0, 1fr) 44px;
        gap: 8px;
    }
    .map-search-status {
        top: calc(72px + constant(safe-area-inset-top));
        top: calc(72px + env(safe-area-inset-top));
        left: 12px;
        right: 60px;
        max-width: none;
    }
}


/* Nova standalone page shell. */
body {
    overflow: hidden;
}

.nova-location-page {
    background: var(--nova-page);
    color: var(--nova-body);
    font-family: var(--nova-body-font);
    min-height: 100vh;
}
