/* ==========================================================================
   LS Fabrication — wrong-store prompt, lsfab.com ⇄ lsfab.ca  (.ls-geo)
   Rendered by inc/lsfab-geo-banner.php, driven by js/geo-banner.js.

   A fixed card, bottom-left on desktop, full width on phones. Hidden until
   the script decides the visitor is on the wrong store, then slides up. The
   accent is the brand red→coral rule along the TOP edge of the card.
   ========================================================================== */

.ls-geo {
    position: fixed;
    left: var(--ls-space-5);
    bottom: var(--ls-space-5);
    z-index: 590;                       /* under the sticky cart bar (600) and its sheet */
    width: min(400px, calc(100vw - (var(--ls-space-5) * 2)));
    margin: 0;
    padding: 0;
    font-family: var(--ls-font-body);
    color: var(--ls-text);
    pointer-events: none;
}
.ls-geo[hidden] {
    display: none;
}

.ls-geo__card {
    position: relative;
    box-sizing: border-box;
    padding: var(--ls-space-5);
    background: var(--ls-surface-1);
    border: 1px solid var(--ls-hairline);
    border-radius: var(--ls-radius-lg);
    box-shadow:
        0 24px 48px -12px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .32s ease, transform .38s cubic-bezier(.2, .8, .2, 1);
}
.ls-geo__card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--ls-gradient-ui);
}
.ls-geo.is-in .ls-geo__card {
    opacity: 1;
    transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
    .ls-geo__card {
        transition: opacity .2s ease;
        transform: none;
    }
}

/* --- Close ---------------------------------------------------------------- */

.ls-geo__close {
    position: absolute;
    top: var(--ls-space-2);
    right: var(--ls-space-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: var(--ls-radius-sm);
    color: var(--ls-text-soft);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}
.ls-geo__close:hover {
    color: var(--ls-text);
    background: rgba(255, 255, 255, 0.06);
}
.ls-geo__close:focus-visible {
    outline: 2px solid var(--ls-red);
    outline-offset: 2px;
}

/* --- Head: mark + eyebrow ------------------------------------------------- */

.ls-geo__head {
    display: flex;
    align-items: center;
    gap: var(--ls-space-3);
    margin: 0 0 var(--ls-space-3);
    padding-right: var(--ls-space-7);   /* clear the × */
}
.ls-geo__mark {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 0, 68, 0.12);
    color: var(--ls-red);
    box-shadow: inset 0 0 0 1px rgba(255, 0, 68, 0.35);
}
.ls-geo__flag,
.ls-geo__globe,
.ls-geo__star { display: none; }
.ls-geo[data-state="ca"]   .ls-geo__flag  { display: block; }
.ls-geo[data-state="intl"] .ls-geo__globe { display: block; }
.ls-geo[data-state="us"]   .ls-geo__star  { display: block; }

/* Canada gets the real flag, not an icon in a chip: a 40x20 (2:1) flag with a
   hairline so the white field has an edge against the card. */
.ls-geo[data-state="ca"] .ls-geo__mark {
    width: 40px;
    height: 20px;
    border-radius: 3px;
    background: none;
    box-shadow: inset 0 0 0 1px var(--ls-hairline);
    overflow: hidden;
}
.ls-geo__flag {
    width: 40px;
    height: 20px;
}

.ls-geo__eyebrow {
    margin: 0 !important;
    padding: 0 !important;
    font-family: var(--ls-font-display);
    font-size: var(--ls-micro);
    font-weight: 600;
    line-height: var(--ls-leading-snug);
    letter-spacing: var(--ls-tracking-eyebrow);
    text-transform: uppercase;
    color: var(--ls-red);
}

/* --- Copy ----------------------------------------------------------------- */

/* !important on the margins: the theme's heading rules give every h2 a
   48px margin-top, which has no business inside a card. */
.ls-geo__title {
    margin: 0 0 var(--ls-space-2) !important;
    padding: 0 !important;
    font-family: var(--ls-font-display);
    font-size: var(--ls-h3);
    font-weight: 700;
    line-height: var(--ls-leading-h3);
    letter-spacing: .01em;
    text-transform: uppercase;
    color: var(--ls-text);
}
.ls-geo__body {
    margin: 0 0 var(--ls-space-4) !important;
    padding: 0 !important;
    font-size: var(--ls-small);
    line-height: var(--ls-leading-small);
    color: var(--ls-text-muted);
}
.ls-geo__body strong {
    color: var(--ls-text);
    font-weight: 600;
}

/* --- Actions -------------------------------------------------------------- */

.ls-geo__actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--ls-space-2);
}
.ls-geo__go {
    width: 100%;
    justify-content: center;
}
.ls-geo__go svg {
    margin-left: var(--ls-space-2);
    transition: transform .2s ease;
}
.ls-geo__go:hover svg {
    transform: translateX(3px);
}

/* "Stay" is deliberately quiet: a text control, not a second button, so the
   hierarchy reads at a glance. Still a 44px tap target. */
.ls-geo__stay {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    margin: 0 0 -4px;               /* text sits optically 24px off the card edge */
    padding: 0 var(--ls-space-2);
    background: transparent;
    border: 0;
    border-radius: var(--ls-radius-sm);
    font-family: var(--ls-font-display);
    font-size: var(--ls-small);
    font-weight: 600;
    letter-spacing: var(--ls-tracking-caps);
    text-transform: uppercase;
    color: var(--ls-text-soft);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: color .15s ease;
}
.ls-geo__stay:hover {
    color: var(--ls-text);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.ls-geo__stay:focus-visible {
    outline: 2px solid var(--ls-red);
    outline-offset: 2px;
}

/* --- Phones and tablets --------------------------------------------------- */

@media (max-width: 767px) {
    .ls-geo {
        left: var(--ls-space-3);
        right: var(--ls-space-3);
        bottom: calc(var(--ls-space-3) + env(safe-area-inset-bottom, 0px));
        width: auto;
    }
    .ls-geo__card {
        padding: var(--ls-space-4);
    }
    .ls-geo__head {
        margin-bottom: var(--ls-space-2);
    }
}

/* Product pages on phones carry the sticky add-to-cart bar (65px + safe area);
   sit above it rather than on it. */
@media (max-width: 980px) {
    body.ls-sticky-cart-on .ls-geo {
        bottom: calc(77px + env(safe-area-inset-bottom, 0px));   /* 65px bar + the same 12px the sides get */
    }
}
