/* Limited-time sale (sale.js): slim strip at the top of <main>, struck list
   price and an inline sale block on the affected plan. Flat matte black +
   silver per GAMBLE_DESIGN_SYSTEM v2.1: no gradients, glows or looping motion.
   Selectors are scoped to .sale-strip / .sale-inline so the card styles they
   sit in (.plan-option span, .price-card p, ...) cannot restyle them. */

.sale-strip :is(span, b, s, code, strong),
.sale-inline :is(span, b, s, code, strong) {
    display: inline;
    margin: 0;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    letter-spacing: normal;
    text-transform: none;
}

/* ---- Strip ---- */
.sale-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 20px;
    width: min(1200px, calc(100% - 32px));
    box-sizing: border-box;
    margin: 12px auto 0;
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 12px;
    background: #141418;
    color: #a3a6ac;
    font-size: 14px;
    line-height: 1.5;
    animation: saleEnter .2s ease-out both;
}
.sale-strip p {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 12px;
    margin: 0;
    color: inherit;
}
.sale-strip .sale-strip-title {
    color: #ecedef;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.sale-strip .sale-strip-plan { color: #ecedef; }
.sale-strip .sale-price { color: #ecedef; font-weight: 700; }
.sale-strip .sale-was { color: #6c6f76; text-decoration: line-through; }
.sale-strip .sale-strip-ends { color: #a3a6ac; }
.sale-strip .sale-strip-cta {
    flex: none;
    color: #c3c7cd;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}
.sale-strip .sale-strip-cta:hover,
.sale-strip .sale-strip-cta:focus-visible { color: #e7e9ec; text-decoration: underline; }

/* ---- Shared bits ---- */
.sale-strip [data-sale-countdown],
.sale-inline [data-sale-countdown] {
    color: #ecedef;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .92em;
    font-variant-numeric: tabular-nums;
}
.sale-strip .sale-code,
.sale-inline .sale-code {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.sale-strip .sale-code code,
.sale-inline .sale-code code {
    padding: 1px 7px;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 6px;
    background: #0e0e11;
    color: #ecedef;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    letter-spacing: .04em;
}
.sale-strip .sale-copy,
.sale-inline .sale-copy {
    min-height: 26px;
    margin: 0;
    padding: 0 9px;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 6px;
    background: #1b1b20;
    color: #ecedef;
    font: inherit;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}
.sale-strip .sale-copy:hover,
.sale-strip .sale-copy:focus-visible,
.sale-inline .sale-copy:hover,
.sale-inline .sale-copy:focus-visible { background: #24242a; border-color: #c3c7cd; }

/* Struck list price on the plan that is on sale. */
.is-sale-struck {
    color: #6c6f76 !important;
    text-decoration: line-through;
    text-decoration-thickness: 2px;
}

/* ---- Inline sale block (price card / plan option) ---- */
.sale-inline {
    margin: 12px 0 16px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 10px;
    background: #141418;
    color: #a3a6ac;
    font-size: 13px;
    line-height: 1.4;
    text-transform: none;
    letter-spacing: normal;
    animation: saleEnter .2s ease-out both;
}
.sale-inline[hidden] { display: none; }
.sale-inline p { margin: 0; color: inherit; font-size: inherit; line-height: inherit; }
.sale-inline .sale-inline-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
}
.sale-inline .sale-tag {
    padding: 3px 8px;
    border-radius: 999px;
    background: #c3c7cd;
    color: #0b0b0d;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.sale-inline .sale-price { color: #ecedef; font-size: 24px; font-weight: 800; line-height: 1.15; }
.sale-inline .sale-plan { color: #a3a6ac; font-size: 13px; }
.sale-inline .sale-inline-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 12px;
    margin-top: 8px;
}

/* Homepage: the strip lines up with the floating header. */
.home-page .sale-strip { width: calc(100% - 48px); }

/* Homepage price cards (site-polish). */
.home-page .price-card .sale-inline { margin: 14px 0 0; }
.home-page .rental-options + .sale-inline { margin: -10px 0 22px; }
.home-page.site-polish .price-card .sale-inline .sale-price { font-family: var(--p-display, inherit); font-weight: 900; letter-spacing: -.03em; }

/* Dashboard plan options: only on plans this account can buy at list price. */
.plan-option:not([data-available="true"]) .sale-inline,
.plan-option[data-fixed-price="true"] .sale-inline { display: none; }
.plan-option:not([data-available="true"]) .is-sale-struck,
.plan-option[data-fixed-price="true"] .is-sale-struck { color: inherit !important; text-decoration: none; }
.dashboard-page .plan-option .sale-inline { margin: 0; }
.dashboard-page .sale-strip { width: 100%; margin: 0 0 18px; }

@keyframes saleEnter {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

@media (max-width: 640px) {
    .sale-strip { padding: 10px 12px; font-size: 13px; }
    .home-page .sale-strip { width: calc(100% - 24px); }
    /* The code and copy button stay on the plan card; the strip only announces. */
    .sale-strip .sale-code { display: none; }
    .sale-strip p { gap: 4px 10px; }
}

@media (prefers-reduced-motion: reduce) {
    .sale-strip,
    .sale-inline { animation: none; }
    .sale-strip .sale-copy,
    .sale-inline .sale-copy { transition: none; }
}

/* The dashboard is hidden until the session check passes; so is its strip. */
body[data-auth-gated]:not(.is-auth-ready) .sale-strip { visibility: hidden; }
