/* The sale's banner and pop-up (Pages/Shared/_SaleBanner.cshtml, _SalePopup.cshtml, js/sale.js). Loaded by the layout only while a sale is live.
   Colors are the site's tokens, so night and day both follow (night: dark text on the bright red, 5.6:1; day: white on the deeper red). */

/* ---- the banner: a slim bar at the very top of the page, above the header. Not fixed and not sticky: it scrolls away with the page, so it covers nothing (the header,
   the phone app's top bar, the studio's Back / Next bar and the bottom tabs stay where they are). The whole bar is one link to the buying page. */
:root{--sale-h:40px}
@media (max-width:640px){:root{--sale-h:48px}}
.sale-bar{box-sizing:border-box;display:flex;align-items:center;justify-content:center;gap:4px 14px;height:calc(var(--sale-h) + env(safe-area-inset-top,0px));padding:env(safe-area-inset-top,0px) max(var(--page-x),env(safe-area-inset-right,0px)) 0 max(var(--page-x),env(safe-area-inset-left,0px));background:var(--accent);color:var(--on-accent);font-size:13px;font-weight:700;line-height:1.25;letter-spacing:.01em;text-align:center;text-decoration:none;flex:0 0 auto}
.sale-bar:hover,.sale-bar:focus-visible,.sale-bar:visited{color:var(--on-accent)}
.sale-bar:hover{background:var(--accent2)}
.sale-bar:focus-visible{outline:2px solid var(--on-accent);outline-offset:-4px}
.sale-bar[hidden]{display:none}
.sale-bar-text{text-wrap:balance;min-width:0;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;overflow:hidden;text-transform:uppercase;letter-spacing:.06em}
.sale-bar-text time{font-weight:700}
.sale-bar-go{flex:none;display:inline-flex;align-items:center;gap:6px;padding:5px 12px;border-radius:999px;background:var(--on-accent);color:var(--accent);font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;white-space:nowrap}
.sale-bar-go svg{display:block}
@media (max-width:640px){
  .sale-bar{gap:4px 10px;font-size:12px}
  .sale-bar-text{-webkit-line-clamp:2;letter-spacing:.04em}
  .sale-bar-go{padding:6px 10px}
}
/* the phone app's pages are as tall as the screen minus the top bar: with the bar above, they are that much shorter, so nothing grows past the screen */
@media (max-width:760px){body.is-app.has-sale-bar main.page{min-height:calc(100dvh - 52px - var(--sale-h) - env(safe-area-inset-top,0px))}}
@media print{.sale-bar{display:none}}
/* what is fixed near the top of the screen sits below the part of the banner that is still on screen (js/sale.js keeps --sale-vis current), so it never covers the header or the app's top bar */
.menu-sheet{top:calc(56px + var(--sale-vis,0px));min-height:calc(100vh - 56px - var(--sale-vis,0px));min-height:calc(100dvh - 56px - var(--sale-vis,0px))}
.app-toast{top:calc(64px + env(safe-area-inset-top) + var(--sale-vis,0px))}
@media (max-width:760px){body.is-app .app-hint:not([hidden]){top:calc(60px + env(safe-area-inset-top) + var(--sale-vis,0px))}}

/* ---- the pop-up: the site's own dialog (crm-dialog, site.css) with the sale's words and its live prices ---- */
.sale-dialog{width:min(460px,calc(100% - 32px));max-height:calc(100dvh - 32px);overflow:auto}
.sale-dialog .crm-dialog-form{gap:10px;padding:22px 24px 20px}
.sale-dialog .crm-dialog-kicker{font-size:11px;text-transform:uppercase}
.sale-dialog .crm-dialog-title{font-size:40px;line-height:.98;letter-spacing:.01em;text-wrap:balance;outline:0}
.sale-dialog .crm-dialog-msg{margin:0;color:var(--muted);font-size:15px;line-height:1.5}
.sale-dialog .crm-dialog-msg time{color:var(--text);font-weight:600;white-space:nowrap}
.sale-packs{list-style:none;margin:4px 0 2px;padding:0;border-top:1px solid var(--border2)}
.sale-packs li{display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding:10px 0;border-bottom:1px solid var(--border2)}
.sale-packs .sp-name{min-width:0;font-size:15px;font-weight:600;color:var(--text);overflow-wrap:anywhere}
.sale-packs .sp-price{flex:none;display:inline-flex;align-items:baseline;gap:10px;font-family:var(--mono);white-space:nowrap}
.sale-packs s{font-size:13px;color:var(--muted);text-decoration-thickness:2px;text-decoration-color:var(--accent)}
.sale-packs b{font-family:var(--display);font-weight:400;font-size:28px;line-height:1;letter-spacing:.02em;color:var(--text)}
.sale-dialog .crm-dialog-actions{margin-top:8px}
.sale-dialog .crm-dialog-actions .crm-dialog-ok{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-height:44px;height:42px;padding:0 18px;border:1px solid var(--text);font-family:var(--display);font-size:20px;letter-spacing:.06em;text-transform:uppercase;text-decoration:none;cursor:pointer}
.sale-dialog .crm-dialog-actions .crm-dialog-cancel{min-height:44px}
.sale-dialog .crm-dialog-actions .crm-dialog-ok:hover{background:var(--accent)!important;border-color:var(--accent)!important;color:var(--on-accent)!important}
@media (max-width:480px){
  .sale-dialog .crm-dialog-form{padding:20px 18px 16px}
  .sale-dialog .crm-dialog-title{font-size:36px}
  .sale-dialog .crm-dialog-actions .crm-dialog-ok{width:100%;height:48px;min-height:48px}
}
