/* The "No code needed" card on every deal page (src/_includes/promo/savings-card.njk), and the one-line
   "add $X more" note in the cart drawer (assets/js/cart-savings.js).

   The card is a ticket: white, generous space, one accent colour (the site's blue), the saving in large
   type, and a dashed tear line between the offer and its small print. Loaded by the card itself on the
   deal pages, and by cart-savings.js on any other page once the cart shows the note. Uses the site's
   tokens (assets/css/style.css :root). */

/* ---- The section around a card ---- */
.savings-section {
    --savings-ground: var(--surface-alt);
    padding: 72px 0;
    border-top: 1px solid var(--border);
    background: var(--savings-ground);
    scroll-margin-top: 120px;
}

/* ---- The card ---- */
.savings-card {
    --savings-ground: var(--surface-alt);
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
    max-width: 1080px;
    margin: 0 auto;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 14px 44px rgba(0, 0, 0, 0.06);
    color: var(--ink);
    text-align: left;
    scroll-margin-top: 150px;
}
.savings-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-width: 0;
    padding: 48px 48px 44px;
}
.savings-side {
    position: relative;
    min-width: 0;
    padding: 48px 48px 44px;
    border-left: 2px dashed var(--border-strong);
}
/* The two notches where the stub tears off. */
.savings-side::before,
.savings-side::after {
    content: '';
    position: absolute;
    left: -15px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--savings-ground);
}
.savings-side::before { top: -14px; }
.savings-side::after { bottom: -14px; }

.savings-eyebrow {
    margin-bottom: 14px;
    padding: 5px 12px;
    border-radius: 100px;
    background: var(--accent-tint);
    color: var(--accent-deep);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.09em;
    line-height: 1.3;
    text-transform: uppercase;
}
.savings-headline {
    margin: 0 0 10px;
    color: var(--ink);
    font-size: clamp(27px, 3.1vw, 38px);
    font-weight: 750;
    letter-spacing: -0.035em;
    line-height: 1.1;
}
.savings-second {
    margin: 0 0 16px;
    color: var(--accent-deep);
    font-size: clamp(18px, 2vw, 22px);
    font-weight: 650;
    letter-spacing: -0.02em;
    line-height: 1.25;
}
.savings-body {
    margin: 0;
    color: var(--ink-body);
    font-size: 16.5px;
    line-height: 1.55;
}
/* Military / first responder / teacher / senior: the thank-you, and why there is no code. */
.savings-thanks {
    margin: 16px 0 0;
    padding: 14px 16px;
    border: 1px solid var(--accent-tint-border);
    border-radius: 14px;
    background: var(--accent-wash);
    color: var(--ink-body);
    font-size: 14.5px;
    line-height: 1.55;
}
.savings-actions {
    margin-top: 26px;
}
.savings-actions .gs-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* ---- The stub: how it works, and the fine print ---- */
.savings-subhead {
    margin: 0 0 14px;
    color: var(--ink);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.3;
}
.savings-steps {
    margin: 0 0 30px;
    padding: 0;
    list-style: none;
    counter-reset: savings-step;
}
.savings-steps li {
    position: relative;
    margin: 0 0 12px;
    padding-left: 38px;
    color: var(--ink-body);
    font-size: 14.5px;
    line-height: 1.55;
    counter-increment: savings-step;
}
.savings-steps li:last-child {
    margin-bottom: 0;
}
.savings-steps li::before {
    content: counter(savings-step);
    position: absolute;
    top: -1px;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: var(--accent-tint);
    color: var(--accent-deep);
    font-size: 12.5px;
    font-weight: 700;
}
.savings-fine {
    margin: 0;
    padding: 0;
    list-style: none;
}
.savings-fine li {
    position: relative;
    margin: 0 0 8px;
    padding-left: 14px;
    color: var(--ink-secondary);
    font-size: 12.5px;
    line-height: 1.55;
}
.savings-fine li:last-child {
    margin-bottom: 0;
}
.savings-fine li::before {
    content: '';
    position: absolute;
    top: 0.72em;
    left: 0;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--border-strong);
}

/* ---- Inside the Black Friday event page ("Even more ways to save.") ---- */
.bf-more .savings-card {
    max-width: none;
    margin: 0 0 24px;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.04);
}

/* ---- The note in the cart drawer, under the minimum ---- */
.cart-saving-note {
    margin: 2px 0;
    padding: 7px 10px;
    border: 1px solid var(--accent-tint-border);
    border-radius: 8px;
    background: var(--accent-wash);
    color: var(--ink-body);
    font-size: 12.5px;
    line-height: 1.45;
}
.cart-saving-note[hidden] {
    display: none;
}
.cart-saving-note strong {
    color: var(--ink);
    font-weight: 700;
}

/* ---- Small screens ---- */
@media (max-width: 860px) {
    .savings-section {
        padding: 52px 0;
    }
    .savings-card {
        grid-template-columns: minmax(0, 1fr);
    }
    .savings-main {
        padding: 34px 26px 30px;
    }
    .savings-side {
        padding: 30px 26px 32px;
        border-top: 2px dashed var(--border-strong);
        border-left: 0;
    }
    .savings-side::before,
    .savings-side::after {
        top: -15px;
        bottom: auto;
    }
    .savings-side::before { left: -14px; }
    .savings-side::after { left: auto; right: -14px; }
}
@media (max-width: 480px) {
    .savings-main {
        padding: 30px 20px 26px;
    }
    .savings-side {
        padding: 28px 20px 28px;
    }
    .savings-actions,
    .savings-actions .gs-btn {
        width: 100%;
    }
}
