/* ==========================================================================
   Location System — Landing page + Location bar
   ========================================================================== */

/* ── CSS Custom Properties ───────────────────────────────────────────────── */
:root {
    --location-accent:      #661893;
    --location-bar-height:  38px;
    --panel-transition:     0.65s cubic-bezier(0.4, 0, 0.2, 1);
    --content-transition:   0.45s cubic-bezier(0.4, 0, 0.2, 1);
}


/* ============================================================
   LOCATION BAR
   Sits above the main navigation on every page once a
   location has been chosen.
   ============================================================ */

.location-bar {
    background: rgba(10, 10, 10, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    height: var(--location-bar-height);
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    z-index: 1001;
}

/* Thin coloured underline driven by --location-accent */
.location-bar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--location-accent);
    opacity: 0.6;
}

.location-bar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.location-bar__current {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1;
}

.location-bar__current svg {
    color: var(--location-accent);
    flex-shrink: 0;
}

.location-bar__current strong {
    color: #fff;
    font-weight: 600;
}

.location-bar__switch {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--location-accent);
    text-decoration: none;
    transition: opacity 0.2s ease;
    white-space: nowrap;
    padding: 0.2rem 0;
    border-bottom: 1px solid transparent;
}

.location-bar__switch:hover,
.location-bar__switch:focus-visible {
    opacity: 0.75;
    color: var(--location-accent);
    border-bottom-color: var(--location-accent);
    outline: none;
}


/* ============================================================
   LOCATION LANDING
   Full-viewport split-screen location selector.
   ============================================================ */

.location-landing {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #080808;
    z-index: 9999;
}

/* ── Logo ── */
.location-landing__logo {
    position: absolute;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    pointer-events: none;
    animation: fadeSlideDown 0.8s ease both;
}

.location-landing__logo img {
    height: 48px;
    width: auto;
    filter: brightness(0) invert(1);
}

.location-landing__site-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

/* ── "Choose your location" prompt ── */
.location-landing__heading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    pointer-events: none;
    animation: fadeIn 1s 0.3s ease both;
}

.location-landing__heading p {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
    margin: 0;
    white-space: nowrap;
}

/* Hide heading when a panel is being hovered */
.location-landing__panels.has-hover ~ .location-landing__heading,
.location-landing.has-hover .location-landing__heading {
    opacity: 0;
}

/* ── Panels container ── */
.location-landing__panels {
    position: relative;
    display: flex;
    flex: 1;
    height: 100%;
}

/* ── OR divider badge ── */
.location-landing__divider {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 25;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: rgba(8, 8, 8, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(6px);
    pointer-events: none;
    transition: opacity var(--content-transition), transform var(--content-transition);
    animation: fadeIn 0.9s 0.5s ease both;
}

.location-landing__panels.has-hover .location-landing__divider {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.7);
}

/* ── Individual panel ── */
.location-panel {
    position: relative;
    flex: 1;
    overflow: hidden;
    cursor: pointer;
    transition: flex var(--panel-transition);
    outline: none;
}

/* Panel expands on hover, siblings shrink */
.location-landing__panels.has-hover .location-panel.is-hovered {
    flex: 1.45;
}

.location-landing__panels.has-hover .location-panel:not(.is-hovered) {
    flex: 0.55;
}

/* Keyboard focus visible state */
.location-panel:focus-visible {
    outline: 3px solid var(--location-accent);
    outline-offset: -3px;
}

/* ── Background image ── */
.location-panel__bg {
    position: absolute;
    inset: -6%;
    background-size: cover;
    background-position: center;
    transition: transform var(--panel-transition);
    will-change: transform;
}

.location-panel.is-hovered .location-panel__bg {
    transform: scale(1.07);
}

/* ── Overlays ── */
.location-panel__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.52);
    transition: opacity var(--content-transition);
}

.location-panel.is-hovered .location-panel__overlay {
    opacity: 0.35;
}

.location-panel__gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.85) 0%,
        rgba(0, 0, 0, 0.2) 45%,
        transparent 70%
    );
    transition: opacity var(--content-transition);
}

.location-panel.is-hovered .location-panel__gradient {
    background: linear-gradient(
        to top,
        color-mix(in srgb, var(--location-accent) 60%, black 40%) 0%,
        rgba(0, 0, 0, 0.1) 50%,
        transparent 70%
    );
}

/* ── Content ── */
.location-panel__content {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 3rem 2.5rem;
}

.location-panel__inner {
    color: #fff;
    transform: translateY(6px);
    transition: transform var(--content-transition);
    max-width: 340px;
}

.location-panel.is-hovered .location-panel__inner {
    transform: translateY(0);
}

.location-panel__number {
    display: block;
    font-size: 6rem;
    font-weight: 900;
    line-height: 0.85;
    letter-spacing: -0.06em;
    color: rgba(255, 255, 255, 0.06);
    margin-bottom: -0.5rem;
    transition: color var(--content-transition);
    font-family: inherit;
}

.location-panel.is-hovered .location-panel__number {
    color: rgba(255, 255, 255, 0.09);
}

.location-panel__name {
    font-size: clamp(1.8rem, 2.8vw, 3.2rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin: 0 0 0.6rem;
    color: #fff;
}

.location-panel__tagline {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.65);
    margin: 0 0 0.75rem;
    line-height: 1.5;
    max-width: 260px;
}

.location-panel__address {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.45);
    margin: 0 0 1.75rem;
    line-height: 1.4;
    letter-spacing: 0.01em;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity var(--content-transition) 0.05s,
                transform var(--content-transition) 0.05s;
}

.location-panel__address svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--location-accent);
}

.location-panel.is-hovered .location-panel__address {
    opacity: 1;
    transform: translateY(0);
}

/* ── CTA button ── */
.location-panel__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.7rem 1.6rem;
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
    border-radius: 1px;
    position: relative;
    overflow: hidden;
}

.location-panel:hover .location-panel__cta,
.location-panel.is-hovered .location-panel__cta {
    background: var(--location-accent);
    border-color: var(--location-accent);
}

.location-panel__cta-arrow {
    transition: transform 0.25s ease;
}

.location-panel.is-hovered .location-panel__cta-arrow {
    transform: translateX(4px);
}

/* Spinner — shown on click, hidden by default */
.location-panel__cta-spinner {
    display: none;
    animation: spin 0.7s linear infinite;
}

.location-panel.is-selecting .location-panel__cta-arrow {
    display: none;
}

.location-panel.is-selecting .location-panel__cta-spinner {
    display: block;
}

/* ── Accent line at bottom ── */
.location-panel__line {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--location-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--panel-transition);
}

.location-panel.is-hovered .location-panel__line {
    transform: scaleX(1);
}

/* ── Vertical divider line between panels ── */
.location-landing__panels::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 1px;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 5;
    transition: opacity var(--content-transition);
}

.location-landing__panels.has-hover::before {
    opacity: 0;
}

/* ── Mobile scroll hint ── */
.location-landing__scroll-hint {
    display: none;
}

/* ── Selection transition overlay ── */
.location-panel.is-selecting::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--location-accent);
    z-index: 30;
    animation: panelReveal 0.55s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Panel not selected fades out */
.location-panel.is-fading {
    opacity: 0;
    transition: opacity 0.4s ease;
}


/* ============================================================
   MOBILE — Stacked vertical layout
   ============================================================ */
@media (max-width: 767px) {
    .location-landing {
        position: relative;
        min-height: 100svh;
        overflow-y: auto;
    }

    .location-landing__logo {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        text-align: center;
        padding: 1.75rem 1rem 0;
        animation: none;
        display: flex;
        justify-content: center;
    }

    .location-landing__heading {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        text-align: center;
        padding: 1rem 1rem 0;
        pointer-events: none;
    }

    .location-landing__panels {
        flex-direction: column;
        flex: none;
    }

    .location-panel {
        min-height: 48svh;
        flex: none !important; /* Override JS-driven flex on mobile */
    }

    .location-panel__content {
        align-items: flex-end;
        padding: 2rem 1.5rem;
    }

    .location-panel__name {
        font-size: 2rem;
    }

    .location-panel__address {
        opacity: 1;
        transform: none;
    }

    .location-panel__cta {
        background: var(--location-accent);
        border-color: var(--location-accent);
    }

    /* OR divider on mobile sits between the two stacked cards */
    .location-landing__divider {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        margin: 0 auto;
        flex-shrink: 0;
        background: #080808;
    }

    .location-landing__panels {
        display: grid;
        grid-template-rows: 1fr auto 1fr;
    }

    .location-landing__scroll-hint {
        display: flex;
        justify-content: center;
        padding: 1rem;
        color: rgba(255,255,255,0.3);
        animation: bounceY 1.5s ease infinite;
    }

    .location-landing__panels::before {
        display: none;
    }
}


/* ============================================================
   KEYFRAME ANIMATIONS
   ============================================================ */
@keyframes fadeSlideDown {
    from { opacity: 0; transform: translateX(-50%) translateY(-12px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes panelReveal {
    from { transform: scaleX(0); transform-origin: left; }
    to   { transform: scaleX(1); transform-origin: left; }
}

@keyframes bounceY {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(5px); }
}


/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .location-panel,
    .location-panel__bg,
    .location-panel__cta,
    .location-panel__line,
    .location-landing__divider,
    .location-panel__inner,
    .location-panel__address {
        transition: none !important;
        animation: none !important;
    }

    .location-panel.is-selecting::after {
        animation: none;
        background: var(--location-accent);
    }
}
