/*
 * Checkout pop open extras, version 1.1.0 (see checkout-extras-1.1.0.js and
 * catalog/view/theme/default/template/common/checkout_extras.tpl). One sheet for every theme: the colours are the
 * theme's own --ui-* tokens (the same ones its checkout sheet reads), with the lead theme's values as fall-back for a
 * theme that defines none. The "Yes" button gets the theme's Pay button look from the script (--stl-cta-*).
 * A change needs a new version in the file NAME: Cloudflare ignores ?v= on these sites.
 */

/* ---------- phones: the shipping list sits under the address fields, inside the payment card ---------- */
#checkoutModal .payment-details .shipping_methods.co-ship-under {
    background: transparent;
    border: 0;
    border-top: 1px dashed var(--ui-line, #e4e0ea);
    border-radius: 0;
    box-shadow: none;
    margin: 1rem 0 0;
    padding: 1rem 0 0;
}
/* the labels keep the look they have in their own card (pinned by the script before the move) */
#checkoutModal .payment-details .shipping_methods.co-ship-under label {
    font-family: var(--co-ship-font-family);
    font-size: var(--co-ship-font-size);
    font-weight: var(--co-ship-font-weight);
    font-style: var(--co-ship-font-style);
    line-height: var(--co-ship-line-height);
    letter-spacing: var(--co-ship-letter-spacing);
    text-transform: var(--co-ship-text-transform);
    color: var(--co-ship-color);
}

/* ---------- the shipping list: short name, "Estimated Receive By Date", price ---------- */
#checkoutModal .shipping_methods .field-group.co-ship-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .2rem .8rem;
}
#checkoutModal .co-ship-row > label {
    display: grid;
    grid-template-columns: auto auto 1fr;
    align-items: center;
    gap: .15rem .6rem;
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    cursor: pointer;
}
#checkoutModal .co-ship-row > label input[type="radio"] {
    margin: 0;
}
#checkoutModal .co-ship-row .co-ship-eta {
    font-size: .82em;
    font-weight: 400;
    line-height: 1.3;
    color: var(--ui-muted, #7c7c7c);
}
#checkoutModal .co-ship-row .co-ship-eta b {
    font-weight: 700;
    white-space: nowrap;
    color: var(--ui-fg, #1c1522);
}
#checkoutModal .co-ship-row .co-ship-price {
    flex: none;
    white-space: nowrap;
}

/* ---------- Skip the line: the row under the shipping choices ---------- */
#checkoutModal .shipping_methods .stl-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: .3rem .7rem;
}
#checkoutModal .shipping_methods .stl-row.is-on {
    border-color: var(--ui-accent2, #5da309);
}
#checkoutModal .stl-row .stl-label {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    margin: 0;
    padding: 0;
    cursor: pointer;
}
#checkoutModal .stl-row input[type="checkbox"] {
    flex: none;
    width: 20px;
    height: 20px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--ui-accent, #ac44cf);
}
#checkoutModal .stl-row .stl-what {
    font-size: .85em;
    color: var(--ui-accent-lt, #8329a3);
    text-decoration: underline;
    white-space: nowrap;
}
#checkoutModal .stl-row .stl-what:hover,
#checkoutModal .stl-row .stl-what:focus {
    color: var(--ui-accent, #ac44cf);
}
#checkoutModal .stl-row .stl-price {
    margin-left: auto;
    white-space: nowrap;
}
#checkoutModal .totals .total-skip_the_line p:first-child {
    color: var(--ui-accent-lt, #8329a3);
}

/* ---------- Skip the line: the explainer over the checkout ---------- */
#checkoutModal .stl-dialog {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 30;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(12, 8, 18, .62);
}
#checkoutModal .stl-card {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 1.5rem 1.4rem 1.3rem;
    background: var(--ui-panel, #fff);
    color: var(--ui-fg, #1c1522);
    border: 1px solid var(--ui-line, #e4e0ea);
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
    text-align: left;
    outline: none;
}
#checkoutModal .stl-card .stl-x {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--ui-line, #e4e0ea);
    border-radius: 50%;
    background: transparent;
    color: var(--ui-fg, #1c1522);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}
#checkoutModal .stl-card .stl-icon {
    display: block;
    width: 96px;
    height: 44px;
    margin: 0 0 .5rem;
}
#checkoutModal .stl-icon .stl-icon-queue { fill: var(--ui-muted, #7c7c7c); opacity: .4; }
#checkoutModal .stl-icon .stl-icon-from { fill: var(--ui-accent, #ac44cf); opacity: .35; }
#checkoutModal .stl-icon .stl-icon-you { fill: var(--ui-accent, #ac44cf); }
#checkoutModal .stl-icon .stl-icon-arrow { stroke: var(--ui-accent, #ac44cf); }
#checkoutModal .stl-card .stl-title {
    margin: 0 0 .8rem;
    padding: 0;
    border: 0;
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0;
    text-align: center;
    text-transform: none;
    color: var(--ui-fg, #1c1522);
}
#checkoutModal .stl-text p,
#checkoutModal .stl-text li {
    margin: 0 0 .8rem;
    padding: 0;
    font-size: .95rem;
    font-weight: 400;
    line-height: 1.55;
    text-transform: none;
    color: var(--ui-muted, #7c7c7c);
}
#checkoutModal .stl-text ul {
    margin: 0 0 .8rem;
    padding: 0 0 0 1.25rem;
    list-style: disc;
}
#checkoutModal .stl-text li {
    margin-bottom: .45rem;
    list-style: disc;
}
#checkoutModal .stl-text b,
#checkoutModal .stl-text strong {
    font-weight: 700;
    color: var(--ui-fg, #1c1522);
}
#checkoutModal .stl-card .stl-added {
    margin: 1rem 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    color: var(--ui-fg, #1c1522);
}
#checkoutModal .stl-card .stl-added b {
    color: var(--ui-accent, #ac44cf);
}
/* the two buttons stay in view while a long explainer scrolls behind them */
#checkoutModal .stl-card .stl-btns {
    position: sticky;
    bottom: -1.3rem;
    display: flex;
    flex-wrap: wrap;
    gap: .7rem;
    margin: 0 -.2rem -1.3rem;
    padding: .7rem .2rem 1.3rem;
    background: var(--ui-panel, #fff);
    box-shadow: 0 -14px 14px -8px var(--ui-panel, #fff);
}
#checkoutModal .stl-card .stl-yes,
#checkoutModal .stl-card .stl-no {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    min-height: 48px;
    margin: 0;
    padding: .8rem 1.3rem;
    border-radius: var(--stl-cta-radius, 50px);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0;
    text-transform: none;
    cursor: pointer;
}
#checkoutModal .stl-card .stl-yes {
    flex: 1 1 210px;
    border: 0;
    background-color: var(--stl-cta-bg, var(--ui-accent, #ac44cf));
    background-image: var(--stl-cta-img, none);
    color: var(--stl-cta-ink, #fff);
}
#checkoutModal .stl-card .stl-no {
    flex: 0 1 auto;
    border: 2px solid var(--ui-line, #e4e0ea);
    background: transparent;
    color: var(--ui-fg, #1c1522);
}
#checkoutModal .stl-card .stl-yes:hover { filter: brightness(1.08); }
#checkoutModal .stl-card .stl-no:hover { border-color: var(--ui-accent, #ac44cf); }
#checkoutModal .stl-card .stl-x:focus-visible,
#checkoutModal .stl-card .stl-yes:focus-visible,
#checkoutModal .stl-card .stl-no:focus-visible,
#checkoutModal .stl-row .stl-what:focus-visible {
    outline: 2px solid var(--ui-accent, #ac44cf);
    outline-offset: 2px;
}
@media (max-width: 575.98px) {
    /* narrow sheet: name and price share the first line, the date goes under the name */
    #checkoutModal .shipping_methods .field-group.co-ship-row {
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        gap: .2rem .6rem;
    }
    /* the label's parts become cells of the row itself, so the date can use the full width under name and price */
    #checkoutModal .co-ship-row > label {
        display: contents;
    }
    #checkoutModal .co-ship-row .co-ship-eta {
        grid-column: 2 / -1;
        grid-row: 2;
    }
    #checkoutModal .co-ship-row .co-ship-price {
        grid-column: 3;
        grid-row: 1;
    }
    /* narrow sheet: label and price share the first line, the link goes under the label */
    #checkoutModal .shipping_methods .stl-row {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: .15rem .6rem;
    }
    #checkoutModal .stl-row .stl-what {
        grid-column: 1;
        grid-row: 2;
        justify-self: start;
        margin-left: calc(20px + .6rem);
    }
    #checkoutModal .stl-row .stl-price {
        grid-column: 2;
        grid-row: 1;
    }
    #checkoutModal .stl-text p,
    #checkoutModal .stl-text li { font-size: .9rem; margin-bottom: .65rem; }
    #checkoutModal .stl-card .stl-title { font-size: 1.25rem; margin-bottom: .6rem; }
    #checkoutModal .stl-card .stl-icon { width: 78px; height: 36px; }
}
@media (max-width: 420px) {
    #checkoutModal .stl-card { padding: 1.3rem 1.1rem 1.1rem; }
    #checkoutModal .stl-card .stl-btns { bottom: -1.1rem; margin-bottom: -1.1rem; padding-bottom: 1.1rem; }
    #checkoutModal .stl-card .stl-yes { flex: 1 1 100%; }
    #checkoutModal .stl-card .stl-no { flex: 1 1 100%; min-height: 42px; padding-top: .55rem; padding-bottom: .55rem; }
}
