/* ==========================================================================
   Popup

   Built by assets/js/popup.js. The same builder fills the live preview in
   Marketing > Popup, where the popup carries .tsc-popup--stage and sits
   inside the preview box instead of covering the screen.

   Layers (z-index): the popup uses the highest value a browser accepts
   (2147483647). The TSC cart bar, the variation / address / login modals and
   several themes already sit in the millions, so a smaller number would leave
   the Claim button under the cart bar. The popup is added to the page last, so
   it also wins a tie. Its "Coupons claimed" message is drawn inside the popup
   (.tsc-popup__toast) for the same reason: the site toast would be underneath.

   Hello Elementor, Elementor kits and many themes paint every <button> and
   <a> (pink border, hover fill). Each control below sets every state itself,
   with a selector strong enough to win.
   ========================================================================== */

.tsc-popup {
    --tsc-pop-card: #c81e1e;
    --tsc-pop-accent: #c81e1e;
    --tsc-pop-btn: #161823;
    --tsc-pop-btn-text: #ffffff;
    --tsc-pop-hidden: 0px; /* height the iPhone's browser bars cover; set by popup.js */

    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2147483647;
    margin: 0;
    padding: 0;
    color: #161823;
    font-family: inherit;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.4;
    text-align: start;
    opacity: 0;
    transition: opacity 0.2s ease;
    -webkit-text-size-adjust: 100%;
}
.tsc-popup *,
.tsc-popup *::before,
.tsc-popup *::after {
    box-sizing: border-box;
}
.tsc-popup.is-open {
    opacity: 1;
}
.tsc-popup.is-closing {
    opacity: 0;
    pointer-events: none;
}
.tsc-popup:focus {
    outline: none;
}

/* iPhone Safari: the toolbars grow and shrink, so "100%" can be taller than
   what is visible. 100dvh follows them; popup.js adds --tsc-pop-hidden for
   browsers that still get it wrong. */
@supports (height: 100dvh) {
    @media (max-width: 900px) {
        .tsc-popup:not(.tsc-popup--stage) {
            bottom: auto;
            height: 100dvh;
        }
    }
}

/* Inside the admin preview box. */
.tsc-popup--stage {
    position: absolute;
    z-index: 5;
    opacity: 1;
    transition: none;
}

/* The dimmed page behind the popup: 0 = not dimmed, 1 = solid black. Keep it at
   0.45 or darker: the coupon popup's white title and close button sit straight
   on it and get hard to read on a white page if it is lighter. */
.tsc-popup__overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.8);
}

/* The layer holds the popup, centred. The children centre themselves with
   auto margins (not justify-content) so a popup taller than the screen scrolls
   instead of being cut off at the top. */
.tsc-popup__layer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.tsc-popup:not(.tsc-popup--stage) .tsc-popup__layer {
    padding-top: calc(16px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(16px + var(--tsc-pop-hidden, 0px) + env(safe-area-inset-bottom, 0px));
}
.tsc-popup__figure,
.tsc-popup__card,
.tsc-popup__pc {
    flex: none;
    margin-top: auto;
    margin-bottom: auto;
    transform: translateY(8px) scale(0.98);
    transition: transform 0.2s ease;
}
.tsc-popup.is-open .tsc-popup__figure,
.tsc-popup.is-open .tsc-popup__card,
.tsc-popup.is-open .tsc-popup__pc,
.tsc-popup--stage .tsc-popup__figure,
.tsc-popup--stage .tsc-popup__card,
.tsc-popup--stage .tsc-popup__pc {
    transform: none;
}

/* Buttons and links ------------------------------------------------------- */

.tsc-popup button,
.tsc-popup a {
    letter-spacing: normal;
    text-transform: none;
    text-shadow: none;
    -webkit-tap-highlight-color: transparent;
}
.tsc-popup button {
    margin: 0;
    font: inherit;
    -webkit-appearance: none;
    appearance: none;
}
.tsc-popup button:focus-visible,
.tsc-popup a:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px #161823;
}

/* ---- Image popup ------------------------------------------------------- */

.tsc-popup__figure {
    position: relative;
    max-width: 100%;
}
.tsc-popup .tsc-popup__figure-link {
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    line-height: 0;
    text-decoration: none;
}
.tsc-popup .tsc-popup__img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
}
.tsc-popup__figure.is-box .tsc-popup__img {
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}
.tsc-popup__figure.is-full {
    width: 100%;
}
.tsc-popup__figure.is-full .tsc-popup__figure-link {
    display: flex;
    justify-content: center;
}
.tsc-popup__figure.is-full .tsc-popup__img {
    border-radius: 0;
}

/* Close button, top right of the picture or the card. The tap area is 44px;
   the visible dot is 30px. */
.tsc-popup .tsc-popup__x,
.tsc-popup .tsc-popup__x:hover,
.tsc-popup .tsc-popup__x:focus,
.tsc-popup .tsc-popup__x:active {
    position: absolute;
    top: 2px;
    right: 2px;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    color: #ffffff;
    cursor: pointer;
}
.tsc-popup .tsc-popup__x:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: -2px;
}
.tsc-popup__dot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(22, 24, 35, 0.8);
    color: #ffffff;
    transition: background 0.15s ease;
}
.tsc-popup .tsc-popup__x:hover .tsc-popup__dot,
.tsc-popup .tsc-popup__x:focus-visible .tsc-popup__dot {
    background: rgba(22, 24, 35, 1);
}

/* ---- Image + text popup ------------------------------------------------ */

.tsc-popup__card {
    position: relative;
}
.tsc-popup.is-desktop .tsc-popup__card {
    width: 80%;
    max-width: 520px;
}
.tsc-popup.is-phone .tsc-popup__card {
    width: 86%;
}
.tsc-popup__pt {
    position: relative;
    display: flex;
    width: 100%;
    overflow: hidden;
    border-radius: 14px;
    background: var(--tsc-pop-pt-card, #ffffff);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}
.tsc-popup.is-desktop .tsc-popup__pt {
    flex-direction: row;
}
.tsc-popup.is-phone .tsc-popup__pt {
    flex-direction: column;
}
.tsc-popup__pt-i {
    position: relative;
    background: var(--tsc-pop-pt-card, #dfe7ee);
    overflow: hidden;
}
.tsc-popup.is-desktop .tsc-popup__pt-i {
    flex: 0 0 44%;
    min-height: 260px;
}
.tsc-popup.is-phone .tsc-popup__pt-i {
    aspect-ratio: 4 / 3;
}
@supports not (aspect-ratio: 4 / 3) {
    .tsc-popup.is-phone .tsc-popup__pt-i {
        height: 0;
        padding-top: 75%;
    }
}
.tsc-popup .tsc-popup__pt-img {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    object-fit: cover;
}
.tsc-popup__pt-b {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    min-width: 0;
}
.tsc-popup.is-desktop .tsc-popup__pt-b {
    flex: 1;
    align-items: flex-start;
    padding: 26px 24px;
    text-align: start;
}
.tsc-popup.is-phone .tsc-popup__pt-b {
    align-items: center;
    padding: 20px 18px 22px;
    text-align: center;
}
.tsc-popup__pt-h {
    margin: 0;
    color: var(--tsc-pop-pt-text, #161823);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
    overflow-wrap: anywhere;
}
.tsc-popup__pt-s {
    margin: 0;
    color: var(--tsc-pop-pt-sub, #50575e);
    font-size: 14px;
    line-height: 1.45;
    overflow-wrap: anywhere;
    white-space: pre-line;
}
.tsc-popup a.tsc-popup__cta,
.tsc-popup a.tsc-popup__cta:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    margin: 6px 0 0;
    padding: 0 22px;
    border: 0;
    border-radius: 8px;
    background: var(--tsc-pop-pt-btn, #161823);
    color: var(--tsc-pop-pt-btn-text, #ffffff);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease;
}
.tsc-popup a.tsc-popup__cta:hover,
.tsc-popup a.tsc-popup__cta:focus,
.tsc-popup a.tsc-popup__cta:active {
    background: var(--tsc-pop-pt-btn-hover, #2c2f40);
    color: var(--tsc-pop-pt-btn-text, #ffffff);
    text-decoration: none;
}
.tsc-popup a.tsc-popup__cta:focus-visible {
    outline: 3px solid var(--tsc-pop-pt-text, #161823);
    outline-offset: 2px;
    box-shadow: 0 0 0 2px var(--tsc-pop-pt-card, #ffffff);
}
.tsc-popup.is-phone a.tsc-popup__cta {
    width: 100%;
}

/* A phone turned sideways is only 320-430px tall: a 4:3 picture on top would
   push the button off the screen, so the picture gets a fixed, shorter height. */
@media (orientation: landscape) and (max-height: 520px) {
    .tsc-popup.is-phone .tsc-popup__pt-i {
        aspect-ratio: auto;
        height: 34vh;
        padding-top: 0;
    }
    .tsc-popup.is-phone .tsc-popup__pt-b {
        gap: 6px;
        padding: 14px 18px 16px;
    }
}

/* ---- Coupon popup ------------------------------------------------------ */

.tsc-popup__pc {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 0 6%;
    /* The wrapper is as wide as the screen, so it must not take taps itself:
       only the card and the close button do, and a tap on the dark area around
       them reaches the layer and closes the popup. */
    pointer-events: none;
}
.tsc-popup__pc-card,
.tsc-popup__cx {
    pointer-events: auto;
}
.tsc-popup__pc-hl {
    margin: 0 0 14px;
    color: #ffffff;
    font-size: 28px;
    font-weight: 800;
    line-height: 1.12;
    text-align: center;
    overflow-wrap: anywhere;
}
.tsc-popup.is-desktop .tsc-popup__pc-hl {
    margin-bottom: 10px;
    font-size: 24px;
}
.tsc-popup__pc-card {
    width: 100%;
    max-width: 340px;
    padding: 16px 14px 14px;
    border-radius: 18px;
    background: var(--tsc-pop-card);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28);
    color: var(--tsc-pop-card-text, #ffffff);
}
.tsc-popup.is-desktop .tsc-popup__pc-card {
    max-width: 360px;
    padding: 14px 14px 12px;
}
.tsc-popup__pc-top {
    margin-bottom: 12px;
    text-align: center;
}
.tsc-popup__pc-title {
    font-size: 34px;
    font-weight: 800;
    line-height: 1.1;
    overflow-wrap: anywhere;
}
.tsc-popup.is-desktop .tsc-popup__pc-title {
    font-size: 28px;
}
.tsc-popup__pc-label {
    font-size: 15px;
    overflow-wrap: anywhere;
}
.tsc-popup__pc-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 290px;
    margin: 0 -8px;
    padding: 0 8px 2px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}
.tsc-popup.is-desktop .tsc-popup__pc-list {
    max-height: 250px;
}
@media (max-height: 700px) {
    .tsc-popup.is-phone:not(.tsc-popup--stage) .tsc-popup__pc-list {
        max-height: 200px;
    }
}

/* A ticket: white with a round notch cut out of each side. */
.tsc-popup__tk {
    position: relative;
    flex: none;
    padding: 10px 12px 4px;
    border-radius: 10px;
    background: #ffffff;
    color: #161823;
    text-align: center;
}
.tsc-popup__tk::before,
.tsc-popup__tk::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 14px;
    height: 14px;
    margin-top: -7px;
    border-radius: 50%;
    background: var(--tsc-pop-card);
}
.tsc-popup__tk::before {
    left: -7px;
}
.tsc-popup__tk::after {
    right: -7px;
}
.tsc-popup__tk-n {
    color: var(--tsc-pop-accent);
    font-size: 34px;
    font-weight: 800;
    line-height: 1.1;
    overflow-wrap: anywhere;
}
.tsc-popup__tk-n.is-small {
    font-size: 26px;
    line-height: 1.4;
}
.tsc-popup.is-desktop .tsc-popup__tk-n {
    font-size: 28px;
}
.tsc-popup.is-desktop .tsc-popup__tk-n.is-small {
    font-size: 24px;
}
.tsc-popup__tk-u {
    color: var(--tsc-pop-accent);
    font-size: 17px;
    font-weight: 700;
}
.tsc-popup__tk-c {
    color: #161823;
    font-size: 14px;
    line-height: 1.3;
}
.tsc-popup .tsc-popup__tk-tb,
.tsc-popup .tsc-popup__tk-tb:hover,
.tsc-popup .tsc-popup__tk-tb:focus,
.tsc-popup .tsc-popup__tk-tb:active {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 44px;
    margin: 0;
    padding: 0 10px;
    border: 0;
    border-radius: 6px;
    background: none;
    box-shadow: none;
    color: #6b6c72;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.2;
    text-decoration: underline;
    cursor: pointer;
}
.tsc-popup .tsc-popup__tk-tb:hover {
    color: #161823;
}
.tsc-popup .tsc-popup__tk-tb:focus-visible {
    outline: 3px solid #161823;
    outline-offset: -2px;
    box-shadow: none;
}
.tsc-popup__tk-tx {
    margin: 0 0 8px;
    color: #50575e;
    font-size: 12.5px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}
.tsc-popup__tk-tx[hidden] {
    display: none;
}
.tsc-popup__tk-none {
    padding: 18px 12px;
    border-radius: 10px;
    background: #ffffff;
    color: #161823;
    text-align: center;
}

/* Claim all. The check mark only shows once claimed. */
.tsc-popup .tsc-popup__pc-btn,
.tsc-popup .tsc-popup__pc-btn:hover,
.tsc-popup .tsc-popup__pc-btn:focus,
.tsc-popup .tsc-popup__pc-btn:active {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
    min-height: 48px;
    margin: 12px 0 0;
    padding: 0 16px;
    border: 0;
    border-radius: 999px;
    background: var(--tsc-pop-btn);
    box-shadow: none;
    color: var(--tsc-pop-btn-text);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
}
.tsc-popup .tsc-popup__pc-btn:hover {
    filter: brightness(1.12);
}
.tsc-popup .tsc-popup__pc-btn:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px #161823;
}
.tsc-popup .tsc-popup__pc-btn.is-claimed,
.tsc-popup .tsc-popup__pc-btn.is-claimed:hover {
    cursor: default;
    filter: none;
}
.tsc-popup.is-desktop .tsc-popup__pc-btn {
    min-height: 44px;
    font-size: 16px;
}
.tsc-popup__pc-btn svg {
    display: none;
    flex: none;
}
.tsc-popup__pc-btn.is-claimed svg {
    display: block;
}

/* Close button under the coupon card. */
.tsc-popup .tsc-popup__cx,
.tsc-popup .tsc-popup__cx:hover,
.tsc-popup .tsc-popup__cx:focus,
.tsc-popup .tsc-popup__cx:active {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 0;
    min-height: 0;
    margin: 16px auto 0;
    padding: 0;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
    color: #ffffff;
    cursor: pointer;
}
.tsc-popup.is-desktop .tsc-popup__cx {
    margin-top: 12px;
}
.tsc-popup .tsc-popup__cx:hover {
    background: rgba(255, 255, 255, 0.16);
}
.tsc-popup .tsc-popup__cx:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 3px;
    box-shadow: 0 0 0 3px #161823;
}

/* ---- Notifications ----------------------------------------------------- */

/* Read aloud by screen readers; not drawn. */
.tsc-popup__live {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    border: 0;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

/* "Coupons claimed": the popup draws its own message, in the admin preview and
   on the shop alike, so it can never end up underneath a bar or modal. */
.tsc-popup__toast {
    position: absolute;
    left: 50%;
    bottom: 84px;
    z-index: 20;
    max-width: calc(100% - 32px);
    padding: 10px 18px;
    border-radius: 999px;
    background: rgba(22, 24, 35, 0.95);
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
    visibility: hidden;
    opacity: 0;
    transform: translateX(-50%);
    transition: opacity 0.2s ease;
    pointer-events: none;
}
.tsc-popup.is-desktop .tsc-popup__toast {
    bottom: 28px;
}
.tsc-popup__toast.is-visible {
    visibility: visible;
    opacity: 1;
}

/* "Preview" tag on the storefront preview. */
.tsc-popup__ribbon {
    position: absolute;
    top: calc(12px + env(safe-area-inset-top, 0px));
    left: 12px;
    z-index: 6;
    padding: 4px 12px;
    border-radius: 999px;
    background: #ffffff;
    color: #161823;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    pointer-events: none;
}

/* Shown when a preview has nothing to draw. */
.tsc-popup-notice {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 2147483647;
    max-width: calc(100% - 32px);
    padding: 12px 18px;
    border-radius: 10px;
    background: #161823;
    color: #ffffff;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
    transform: translateX(-50%);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
    .tsc-popup,
    .tsc-popup *,
    .tsc-popup-notice {
        transition: none !important;
        animation: none !important;
    }
    .tsc-popup__figure,
    .tsc-popup__card,
    .tsc-popup__pc {
        transform: none !important;
    }
}
