/*
 * Page styles: store. Owned by the page agent for this area; loaded after
 * hostsrc.css and hostsrc-cart.css. Scope every rule to the body class
 * .hs-page-<templatefile> (see header.tpl). Order form pages load Standard
 * Cart's all.min.css after this file, so prefix those rules with "html body".
 *
 * Store (products.tpl, .hs-page-products): the games bar, the player switch
 * and the plan tiles as on hostsrc.com's home plans. Order complete
 * (complete.tpl, .hs-page-complete): one column of tiles. Add-ons
 * (addons.tpl, .hs-page-addons) share the games bar, heading and empty state.
 */

/* ---- Store: games bar ------------------------------------------------------ */

html body:is(.hs-page-products, .hs-page-addons) .hs-games { margin: 8px 0 24px; }
html body:is(.hs-page-products, .hs-page-addons) .hs-games ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
html body:is(.hs-page-products, .hs-page-addons) .hs-games a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid var(--c-input);
  border-radius: var(--hs-radius-md, 8px);
  background: var(--c-fill);
  color: var(--c-muted);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}
html body:is(.hs-page-products, .hs-page-addons) .hs-games a:hover { background: var(--c-fill-hover); color: var(--c-fg); }
html body:is(.hs-page-products, .hs-page-addons) .hs-games a[aria-current="page"] {
  background: var(--c-control);
  border-color: var(--c-control);
  color: var(--c-fg);
}
html body:is(.hs-page-products, .hs-page-addons) .hs-games a:focus-visible,
html body:is(.hs-page-products, .hs-page-addons) .hs-link:focus-visible {
  outline: 3px solid var(--hs-ring, #8a8a8a);
  outline-offset: 2px;
}
@media (max-width: 767.98px) {
  /* One scrolling row on phones, so the games don't push the plans down. */
  html body:is(.hs-page-products, .hs-page-addons) .hs-games ul {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin: -6px calc(-1 * var(--hs-store-gutter, 20px)) 0;
    padding: 6px var(--hs-store-gutter, 20px);
    scrollbar-width: none;
  }
  html body:is(.hs-page-products, .hs-page-addons) .hs-games ul::-webkit-scrollbar { display: none; }
  html body:is(.hs-page-products, .hs-page-addons) .hs-games li { flex: none; }
  html body:is(.hs-page-products, .hs-page-addons) .hs-games a { min-height: 44px; white-space: nowrap; }
}

/* ---- Store: heading and bar ---------------------------------------------- */

html body:is(.hs-page-products, .hs-page-addons) .hs-store .hs-store-head {
  align-items: flex-end;
  margin: 0 0 20px;
}
html body:is(.hs-page-products, .hs-page-addons) .hs-store .hs-store-title h1 { text-wrap: balance; }
html body:is(.hs-page-products, .hs-page-addons) .hs-store .hs-store-title p { text-wrap: pretty; }
html body:is(.hs-page-products, .hs-page-addons) .hs-store .hs-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

html body.hs-page-products .hs-store-bar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 24px;
}
html body.hs-page-products .hs-store-bar .hs-note { margin: 0; color: var(--c-muted); font-size: 0.875rem; }
html body.hs-page-products .hs-store-bar .hs-currency { margin: 0; }

/* The switch only shows where CSS :has works (see below). */
html body.hs-page-products .hs-players { display: none; margin: 0; padding: 0; border: 0; min-width: 0; }
html body.hs-page-products .hs-players legend {
  float: none;
  width: auto;
  margin: 0 0 8px;
  padding: 0;
  color: var(--c-fg);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
}
html body.hs-page-products .hs-players-options { display: flex; gap: 8px; }
html body.hs-page-products .hs-players label {
  position: relative;
  margin: 0;
  cursor: pointer;
}
html body.hs-page-products .hs-players input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
html body.hs-page-products .hs-players label span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  height: 44px;
  padding: 0 16px;
  border: 1px solid var(--c-input);
  border-radius: var(--hs-radius-md, 8px);
  color: var(--c-muted);
  font-family: var(--c-mono);
  font-size: 1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}
html body.hs-page-products .hs-players label:hover span { color: var(--c-fg); }
html body.hs-page-products .hs-players input:checked + span {
  background: var(--c-control);
  border-color: var(--c-control);
  color: var(--c-fg);
}
html body.hs-page-products .hs-players input:focus-visible + span {
  outline: 3px solid var(--hs-ring, #8a8a8a);
  outline-offset: 2px;
}

/* ---- Store: tiles --------------------------------------------------------- */

/* One column until three fit, as on the website: no orphan tile at 768. */
@media (max-width: 991.98px) {
  html body.hs-page-products .hs-plans { grid-template-columns: minmax(0, 1fr); }
}

/* Parts that only the switch uses stay hidden without it. */
html body.hs-page-products .hs-plan-price,
html body.hs-page-products .hs-spec-varying,
html body.hs-page-products .hs-order-plan { display: none; }

html body.hs-page-products .hs-plan.is-featured { background: var(--c-control); }

/* Products that are not a plan size (IP Clone): their own tiles under the plans, outside the switch. */
html body.hs-page-products .hs-plans-extra { margin-top: 8px; }
html body.hs-page-products .hs-plan.is-featured .hs-specs > div { border-color: rgb(255 255 255 / 12%); }

html body.hs-page-products .hs-plan-price {
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  margin: 16px 0 0;
  color: var(--c-muted);
}
html body.hs-page-products .hs-plan-price .hs-price {
  color: var(--c-fg);
  font-family: var(--c-mono);
  font-size: 2.75rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
html body.hs-page-products .hs-plan-price .hs-cycle { font-size: 0.9375rem; }
html body.hs-page-products .hs-plan-price .hs-setup { flex-basis: 100%; font-size: 0.875rem; }
html body.hs-page-products .hs-plan-price.is-out .hs-price { color: var(--c-muted); }
html body.hs-page-products .hs-plan-price.is-none { font-size: 0.9375rem; }

html body.hs-page-products .hs-variant .hs-order { justify-content: space-between; gap: 12px; }
html body.hs-page-products .hs-variant .hs-order:focus-visible { outline: 3px solid var(--hs-ring, #8a8a8a); outline-offset: 2px; }
html body.hs-page-products .hs-variant .hs-order.disabled { opacity: 1; color: var(--c-muted) !important; }

@supports selector(:has(*)) {
  html body.hs-page-products .has-switch .hs-players { display: block; }
  html body.hs-page-products .has-switch .hs-plan-from { display: none; }
  html body.hs-page-products .has-switch .hs-plan-price { display: flex; }
  html body.hs-page-products .has-switch .hs-spec-varying { display: flex; }
  html body.hs-page-products .has-switch .hs-order-plan { display: inline; }

  /* Only the chosen player count shows. */
  html body.hs-page-products .has-switch:has(#hs-players-0:checked) .hs-v:not(.hs-v-0),
  html body.hs-page-products .has-switch:has(#hs-players-1:checked) .hs-v:not(.hs-v-1),
  html body.hs-page-products .has-switch:has(#hs-players-2:checked) .hs-v:not(.hs-v-2),
  html body.hs-page-products .has-switch:has(#hs-players-3:checked) .hs-v:not(.hs-v-3),
  html body.hs-page-products .has-switch:has(#hs-players-4:checked) .hs-v:not(.hs-v-4),
  html body.hs-page-products .has-switch:has(#hs-players-5:checked) .hs-v:not(.hs-v-5) { display: none; }

  /* The chosen row becomes the tile's order band, as on the website. */
  html body.hs-page-products .has-switch .hs-variants { padding-top: 28px !important; }
  html body.hs-page-products .has-switch .hs-variant {
    display: block;
    padding: 0;
    border-top: 0;
  }
  html body.hs-page-products .has-switch .hs-variant-what,
  html body.hs-page-products .has-switch .hs-variant-price { display: none; }
  html body.hs-page-products .has-switch .hs-variant .hs-order {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 64px;
    padding: 0 28px;
    border: 0 !important;
    border-radius: 0 0 var(--c-radius) var(--c-radius);
    background: var(--c-control) !important;
    color: var(--c-fg) !important;
    font-size: 1rem;
    font-weight: 600;
    text-align: left;
  }
  html body.hs-page-products .has-switch .hs-variant .hs-order:hover { background: var(--hs-control-hover, #333) !important; }
  html body.hs-page-products .has-switch .hs-variant .hs-order:focus-visible { outline-offset: -3px; }
  html body.hs-page-products .has-switch .is-featured .hs-variant .hs-order:not(.disabled) {
    background: var(--c-primary) !important;
    color: var(--c-ink) !important;
  }
  html body.hs-page-products .has-switch .is-featured .hs-variant .hs-order:not(.disabled):hover { background: oklch(0.922 0 0 / 90%) !important; }
  html body.hs-page-products .has-switch .is-featured .hs-variant .hs-order.disabled { background: var(--hs-card, #262626) !important; }
}

@media (max-width: 575.98px) {
  html body.hs-page-products .hs-plan > * { padding-left: 20px; padding-right: 20px; }
  html body.hs-page-products .hs-plan { padding-top: 20px; }
  html body.hs-page-products .hs-plan-price .hs-price,
  html body.hs-page-products .hs-plan-from .hs-price { font-size: 2.25rem; }
  html body.hs-page-products .has-switch .hs-variant .hs-order { padding: 0 20px; }
  html body.hs-page-products .hs-variant { padding-left: 20px; padding-right: 20px; }
}

/* ---- Store: a group with nothing on sale ---------------------------------- */

html body:is(.hs-page-products, .hs-page-addons) .hs-empty {
  max-width: 40rem;
  padding: 28px;
  background: var(--c-card);
  border-radius: var(--c-radius);
}
html body:is(.hs-page-products, .hs-page-addons) .hs-empty h2 { margin: 0; font-size: 1.5rem; letter-spacing: -0.02em; }
html body:is(.hs-page-products, .hs-page-addons) .hs-empty p { margin: 8px 0 0; color: var(--c-muted); text-wrap: pretty; }
html body:is(.hs-page-products, .hs-page-addons) .hs-empty .btn { margin-top: 20px; min-height: 44px; gap: 10px; }

/* ---- Order complete ------------------------------------------------------- */

html body.hs-page-complete #order-standard_cart.hs-complete { max-width: 44rem; }
html body.hs-page-complete #order-standard_cart .hs-complete-head { margin: 8px 0 24px; }
html body.hs-page-complete #order-standard_cart .hs-complete-head h1 { margin: 0; text-wrap: balance; }
html body.hs-page-complete #order-standard_cart .hs-complete-head p { margin: 8px 0 0; color: var(--c-muted); text-wrap: pretty; }

html body.hs-page-complete #order-standard_cart .hs-complete-board { display: grid; gap: 8px; }
html body.hs-page-complete #order-standard_cart .hs-complete-tile {
  padding: 24px 28px;
  background: var(--c-card);
  border-radius: var(--c-radius);
}
html body.hs-page-complete #order-standard_cart .hs-complete-number .order-confirmation {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--c-fg);
  font-size: 1rem;
  text-align: left;
}
html body.hs-page-complete #order-standard_cart .hs-complete-label { color: var(--c-muted); font-size: 0.875rem; }
html body.hs-page-complete #order-standard_cart .hs-complete-value {
  color: var(--c-fg);
  font-family: var(--c-mono);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
html body.hs-page-complete #order-standard_cart .hs-complete-invoice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 16px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--c-border);
}
html body.hs-page-complete #order-standard_cart .hs-complete-invoice a {
  color: var(--c-fg);
  font-family: var(--c-mono);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgb(255 255 255 / 35%);
  text-underline-offset: 4px;
}
/* The invoice's state, as the theme's status chip (css/hostsrc.css):
   unpaid is waiting, paid is success. */
html body.hs-page-complete #order-standard_cart .hs-complete-status {
  display: inline-block;
  padding: 3px 8px;
  border-radius: var(--hs-radius-sm);
  background: var(--hs-state-waiting-surface);
  color: var(--hs-state-waiting);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 16px;
  white-space: nowrap;
}
html body.hs-page-complete #order-standard_cart .hs-complete-status.is-paid {
  background: var(--hs-state-success-surface);
  color: var(--hs-state-success);
}

/* The unpaid notice is a plain tile: amber is for live state only. */
html body.hs-page-complete #order-standard_cart .hs-complete-unpaid {
  margin: 0;
  padding: 24px 28px;
  background: var(--c-card) !important;
  border: 1px solid var(--c-input) !important;
  border-radius: var(--c-radius);
  color: var(--c-fg) !important;
}
html body.hs-page-complete #order-standard_cart .hs-complete-unpaid p { margin: 0 0 16px; color: var(--c-fg); text-wrap: pretty; }
html body.hs-page-complete #order-standard_cart .hs-complete-unpaid .btn { text-decoration: none; }
html body.hs-page-complete #order-standard_cart .hs-complete-unpaid .btn,
html body.hs-page-complete #order-standard_cart .hs-complete-actions .btn { min-height: 44px; gap: 10px; }

html body.hs-page-complete #order-standard_cart .hs-complete-next h2 { margin: 0 0 16px; font-size: 1rem; letter-spacing: -0.01em; }
html body.hs-page-complete #order-standard_cart .hs-complete-next ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: hs-step;
}
html body.hs-page-complete #order-standard_cart .hs-complete-next li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  column-gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--c-border);
  counter-increment: hs-step;
}
html body.hs-page-complete #order-standard_cart .hs-complete-next li::before {
  content: counter(hs-step);
  grid-row: span 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--c-input);
  border-radius: 999px;
  color: var(--c-fg);
  font-family: var(--c-mono);
  font-size: 0.8125rem;
  font-weight: 600;
}
html body.hs-page-complete #order-standard_cart .hs-complete-next li strong { color: var(--c-fg); font-weight: 600; }
html body.hs-page-complete #order-standard_cart .hs-complete-next li span { color: var(--c-muted); font-size: 0.9375rem; text-wrap: pretty; }
html body.hs-page-complete #order-standard_cart .hs-complete-next li a {
  color: var(--c-fg);
  text-decoration: underline;
  text-decoration-color: rgb(255 255 255 / 35%);
  text-underline-offset: 4px;
}
html body.hs-page-complete #order-standard_cart .hs-complete-help {
  margin: 8px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--c-border);
  color: var(--c-muted);
  font-size: 0.875rem;
}
html body.hs-page-complete #order-standard_cart .hs-complete-actions { margin-top: 16px; }
html body.hs-page-complete #order-standard_cart a:focus-visible { outline: 3px solid var(--hs-ring, #8a8a8a); outline-offset: 2px; }

@media (max-width: 575.98px) {
  html body.hs-page-complete #order-standard_cart .hs-complete-tile { padding: 20px; }
  html body.hs-page-complete #order-standard_cart .hs-complete-actions .btn { width: 100%; justify-content: space-between; }
}
