/*
 * Geo shipping banner — structural skeleton only.
 *
 * The module ships just enough CSS that the markup holds together and the reveal works: the
 * collapse/reveal mechanics, the flex layout, and the positioning of the close button, the
 * route illustration and the destination chip. Everything visual — colours, typography,
 * backgrounds, borders, spacing — belongs to the active theme
 * (Netstore/default: web/css/source/_geo-banner.less).
 *
 * This file is linked between styles-m and styles-l, so theme rules of equal specificity win
 * over anything declared here — which is exactly the contract: the theme styles the banner,
 * the module only keeps it functional.
 */
.geo-banner,
.geo-banner *,
.geo-banner *::before {
    /* Declared rather than inherited from the theme reset so max-width and padding still add up
       correctly if this module is ever dropped into a theme without one. */
    box-sizing: border-box;
}

.geo-banner {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    position: relative;
    transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.geo-banner--visible {
    max-height: 12rem;
    opacity: 1;
}

.geo-banner__inner {
    align-items: center;
    display: flex;
    justify-content: center;
    position: relative;
}

.geo-banner__content {
    align-items: center;
    display: flex;
    gap: 9px;
    justify-content: center;
    margin: 0;
    text-align: center;
}

.geo-banner__icon {
    flex-shrink: 0;
}

/*
 * Set by geo-banner.js around the detected country name.
 *
 * font-size is pinned to inherit because the Netstore themes ship `strong, dt { font-size:
 * 0.85rem }`, which otherwise shrinks the country in the middle of the headline.
 */
.geo-banner__country {
    font-size: inherit;
    line-height: inherit;
    white-space: nowrap;
}

/* ── Header strip ───────────────────────────────────────── */

.geo-banner--strip {
    width: 100%;
}

.geo-banner--strip .geo-banner__inner {
    margin: 0 auto;
    /* Mirrors the Netstore container ladder (1280 → 1400 → 1600, see the wide screen media
       queries below) so the close button lands on the topbar's own vertical line. */
    max-width: 1280px;
    min-height: 36px;
    /* Symmetric so the message stays optically centred, and wide enough that a long message
       never runs underneath the absolutely positioned close button. */
    padding: 9px 64px;
}

.geo-banner__close {
    align-items: center;
    background: none;
    border: 0;
    cursor: pointer;
    display: flex;
    height: 26px;
    justify-content: center;
    margin: 0;
    padding: 0;
    position: absolute;
    /* Absolute offsets resolve against the padding box, so the inner's padding does not move
       this: the value has to match the topbar's own 24px gutter explicitly. */
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
}

/* ── In content hero card ───────────────────────────────── */

.geo-banner--inline {
    width: 100%;
}

/* The collapsed-to-open transition animates max-height, so it needs a ceiling the card can
   actually reach — the strip's 12rem would clip it to a sliver. */
.geo-banner--inline.geo-banner--visible {
    max-height: 60rem;
}

.geo-banner--inline .geo-banner__inner {
    justify-content: flex-start;
}

.geo-banner--inline .geo-banner__content {
    align-items: flex-start;
    flex-direction: column;
    gap: 0;
    max-width: 560px;
    position: relative;
    text-align: left;
    z-index: 3;
}

/* ── Route illustration ─────────────────────────────────── */

.geo-banner__route {
    bottom: 0;
    pointer-events: none;
    position: absolute;
    right: 0;
    top: 0;
    width: 520px;
    z-index: 2;
}

.geo-banner__route svg {
    height: 100%;
    width: 100%;
}

/* Destination pill, pinned to the end of the route. */
.geo-banner__chip {
    left: 77%;
    position: absolute;
    top: 68%;
    transform: translateX(-50%);
    white-space: nowrap;
}

.geo-banner__chip:empty {
    display: none;
}

/* ── Narrow screens ─────────────────────────────────────── */

/* The illustration needs roughly half the card; below this the headline would be squeezed into
   a column, so the two stack instead. */
@media (max-width: 900px) {
    .geo-banner--inline .geo-banner__inner {
        flex-direction: column;
        min-height: 0;
    }

    .geo-banner--inline .geo-banner__content {
        max-width: 100%;
    }

    .geo-banner__route {
        height: 180px;
        position: relative;
        width: 100%;
    }
}

@media (max-width: 767px) {
    .geo-banner--strip .geo-banner__inner {
        padding: 8px 40px;
    }

    .geo-banner__content {
        gap: 7px;
    }

    /* The truck is decoration; on a narrow screen the words need the room. */
    .geo-banner__icon {
        display: none;
    }

    .geo-banner__close {
        height: 24px;
        right: 10px;
        width: 24px;
    }
}

/* ── Wide screens: follow the Netstore container ladder ─── */

@media only screen and (min-width: 1440px) {
    .geo-banner--strip .geo-banner__inner {
        max-width: 1400px;
    }
}

@media only screen and (min-width: 1920px) {
    .geo-banner--strip .geo-banner__inner {
        max-width: 1600px;
    }
}

/* The slide is decoration, not information. */
@media (prefers-reduced-motion: reduce) {
    .geo-banner,
    .geo-banner__close {
        transition: none;
    }
}
