/*
 * Everything the design prototype (round2/r1-playerok) did not draw, in its language:
 * utilities, home additions (collapsed grids, widget states), inner pages (catalog, product,
 * order form, order status, documents, errors). Tokens: tokens.css.
 */

/* ---------- utilities ---------- */
.hp, .visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.text-pre { white-space: pre-line; }
.muted { color: var(--text-3); }

/* ---------- home additions ---------- */
/* Two rows of cards until public/js/sections.js takes over (same page size as the script). */
@media (min-width: 1440px) { .grid[data-collapsed] > li:nth-child(n+17) { display: none; } }
@media (min-width: 1280px) and (max-width: 1439px) { .grid[data-collapsed] > li:nth-child(n+15) { display: none; } }
@media (min-width: 1024px) and (max-width: 1279px) { .grid[data-collapsed] > li:nth-child(n+13) { display: none; } }
@media (min-width: 640px) and (max-width: 1023px) { .grid[data-collapsed] > li:nth-child(n+9) { display: none; } }
@media (max-width: 639px) { .grid[data-collapsed] > li:nth-child(n+13) { display: none; } }

.topup__error {
  padding: 10px 12px; border-radius: var(--r-s);
  font-size: 13px; line-height: 1.4; color: #FF8C97;
  background: var(--danger-a); border: 1px solid rgba(255, 97, 112, 0.35);
}
.topup__consent { font-size: 11.5px; line-height: 1.45; color: var(--text-3); text-align: center; }
.topup__consent a, .topup__foot a { color: var(--text-2); text-decoration: underline; text-underline-offset: 2px; }
.topup__unavailable {
  margin-top: 18px; padding: 18px; border-radius: var(--r-m);
  background: var(--field); border: 1px dashed var(--line-3);
  color: var(--text-2); font-size: 14px;
}

/* ---------- buttons shared by inner pages ---------- */
.button {
  min-height: 46px; padding: 0 18px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--r-m);
  background: var(--s2); border: 1px solid var(--line-2);
  color: var(--text); font-weight: 700; font-size: 14px; text-decoration: none; cursor: pointer;
  transition: background var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast);
}
.button:hover { background: var(--s3); border-color: var(--line-3); }
.button:active { transform: scale(0.98); }
.button:disabled { opacity: 0.5; cursor: not-allowed; }
.button--primary {
  background: var(--lime); border-color: var(--lime); color: var(--lime-ink);
  box-shadow: 0 14px 30px -14px rgba(198, 242, 78, 0.8);
}
.button--primary:hover { background: var(--lime-hi); border-color: var(--lime-hi); }
.button--small { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: var(--r-s); }

/* ---------- page heads ---------- */
.page-head { margin: 4px 0 22px; display: grid; gap: 10px; }
.breadcrumbs__list { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--text-3); }
.breadcrumbs__item a { color: var(--text-2); transition: color var(--dur-fast); }
.breadcrumbs__item a:hover { color: var(--lime); }
.breadcrumbs__item + .breadcrumbs__item::before { content: "/"; margin-right: 6px; color: var(--s4); }
.page-title {
  font-family: var(--font-display); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1;
  font-size: clamp(24px, 1rem + 1.4vw, 36px); text-wrap: balance;
}
.page-lead { max-width: 760px; font-size: 15px; color: var(--text-2); }

/* ---------- catalog ---------- */
.catalog-filters {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px;
  padding: 14px; margin-bottom: 14px;
  border-radius: var(--r-l); background: var(--s1); border: 1px solid var(--line);
}
.catalog-filters__field { display: grid; gap: 6px; min-width: 150px; flex: 1 1 150px; }
.catalog-filters__field--search { flex: 3 1 260px; }
.catalog-filters label { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.catalog-filters input, .catalog-filters select, .field__input {
  width: 100%; height: 48px; padding: 0 14px;
  border-radius: var(--r-s); background: var(--field); border: 1px solid var(--line-2);
  color: var(--text); font: inherit; font-size: 15px; outline: 0;
  transition: border-color var(--dur-fast), box-shadow var(--dur);
}
.catalog-filters select, select.field__input {
  appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23808799' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
}
.catalog-filters input:hover, .catalog-filters select:hover, .field__input:hover { border-color: var(--line-3); }
.catalog-filters input:focus, .catalog-filters select:focus, .field__input:focus { border-color: var(--lime-a40); box-shadow: 0 0 0 4px var(--lime-a10); }
.catalog-filters .button { flex: none; height: 48px; }
.catalog-count { margin-bottom: 14px; font-size: 13px; color: var(--text-3); }
.catalog-count b { color: var(--text); }
.empty-state {
  padding: 28px; border-radius: var(--r-l); border: 1px dashed var(--line-3);
  text-align: center; color: var(--text-2);
}
.empty-state a { color: var(--lime); }
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-top: 22px; }
.pagination__pages { display: flex; flex-wrap: wrap; gap: 6px; }
.pagination a, .pagination [aria-current="page"] {
  min-width: 42px; height: 42px; padding: 0 12px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; background: var(--s2); border: 1px solid var(--line-2);
  font-weight: 700; font-size: 14px; color: var(--text-2);
  transition: color var(--dur-fast), border-color var(--dur-fast);
}
.pagination a:hover { color: var(--text); border-color: var(--line-3); }
.pagination [aria-current="page"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.pagination__gap { min-width: 20px; height: 42px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-3); font-weight: 700; }
/* catalog facet chips: links styled as the design's filter chips (shell.css .chip); they wrap on
   wide screens and scroll sideways edge to edge below 1024 px, like the home chips (catalog.css) */
.catalog-facets { display: grid; gap: 10px; margin: -6px 0 18px; min-width: 0; }
@media (min-width: 1024px) { .catalog-facets .chips { flex-wrap: wrap; overflow: visible; } }
.chip[aria-current="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.catalog-count { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }

/* ---------- product ---------- */
.product { display: grid; grid-template-columns: minmax(240px, 340px) minmax(0, 1fr); gap: 24px; align-items: start; }
.product__media {
  position: sticky; top: calc(var(--header-h) + 18px);
  overflow: hidden; isolation: isolate;
  border-radius: var(--r-xl); background: var(--s1); border: 1px solid var(--line-2);
  box-shadow: var(--sh-2);
}
.product__media .product__bg {
  position: absolute; inset: -14%; z-index: -1; width: 128%; height: 128%; max-width: none; object-fit: cover;
  filter: blur(26px) saturate(1.3) brightness(0.45);
}
.product__image { width: 100%; height: auto; }
.product__image--fit { width: auto; max-width: 78%; max-height: 420px; margin: 34px auto; border-radius: 14px; box-shadow: 0 24px 40px -18px rgba(0, 0, 0, 0.9); }
.product__main { display: grid; gap: 14px; min-width: 0; }
.product__title { font-family: var(--font-display); font-size: clamp(24px, 1rem + 1.3vw, 34px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.product__meta { display: flex; flex-wrap: wrap; gap: 6px; }
.product__meta span {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px;
  border-radius: 8px; background: var(--s2); border: 1px solid var(--line-2);
  font-size: 12.5px; font-weight: 600; color: var(--text-2);
}
.product__meta .dlv-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dc); box-shadow: 0 0 8px var(--dc); }
.product__meta .dlv--account { --dc: var(--account); }
.product__meta .dlv--code { --dc: var(--code); }
.product__meta .dlv--gift { --dc: var(--gift); }
.product__lead { font-size: 15px; color: var(--text-2); max-width: 680px; }
.product__sections { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.product__section { padding: 20px; border-radius: var(--r-l); background: var(--s1); border: 1px solid var(--line); }
.product__section h2 { font-family: var(--font-display); font-size: 17px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 10px; }
.product__section p, .product__section li { font-size: 14px; line-height: 1.6; color: var(--text-2); }
.product__section ul { display: grid; gap: 8px; }
.product__section li { position: relative; padding-left: 26px; }
.product__section li::before {
  content: ""; position: absolute; left: 0; top: 3px; width: 17px; height: 17px; border-radius: 6px;
  background: var(--lime-a10) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C6F24E' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 11px no-repeat;
}

/* ---------- order form (blocks/order-form.njk) ---------- */
.order-form {
  position: relative; isolation: isolate;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; max-width: 640px; min-width: 0;
  padding: 20px; border-radius: var(--r-xl);
  background: linear-gradient(180deg, #1A1E28 0%, var(--s1) 46%, #101218 100%);
  border: 1px solid var(--line-2); box-shadow: var(--sh-2);
}
.order-form .field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; min-width: 0; }
.field__label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field__required { color: var(--lime); }
.field__input--short { max-width: 140px; }
.field__help { font-size: 12.5px; line-height: 1.4; color: var(--text-3); }
.field__error, .form-error { font-size: 12.5px; line-height: 1.4; color: #FF8C97; }
.form-error:not([hidden]) { padding: 10px 12px; border-radius: var(--r-s); background: var(--danger-a); border: 1px solid rgba(255, 97, 112, 0.35); }
.field--error .field__input, .field__input[aria-invalid="true"] { border-color: rgba(255, 97, 112, 0.7); background: linear-gradient(0deg, var(--danger-a), var(--danger-a)), var(--field); }
.field--checkbox label { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; font-weight: 500; color: var(--text-2); cursor: pointer; }
.field--checkbox input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--lime); flex: none; }
.field--checkbox a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.order-form__unavailable { padding: 12px 14px; border-radius: var(--r-s); background: var(--field); border: 1px dashed var(--line-3); color: var(--text-2); font-size: 14px; }

.variant-picker { border: 0; padding: 0; margin: 0; display: grid; gap: 12px; min-width: 0; }
.variant-picker__legend { margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.variant-picker__region-title { margin-bottom: 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.variant-picker__options { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 6px; }
.variant-option {
  position: relative; display: grid; gap: 3px; min-height: 64px; padding: 11px 12px;
  border-radius: var(--r-s); background: var(--s2); border: 1px solid var(--line-2); cursor: pointer;
  transition: border-color var(--dur-fast), background var(--dur-fast), transform var(--dur-fast);
}
.variant-option:hover { border-color: var(--line-3); background: var(--s3); }
.variant-option:active { transform: scale(0.98); }
.variant-option input { position: absolute; opacity: 0; pointer-events: none; }
.variant-option__title { font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.variant-option__price { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.variant-option:has(input:checked) { border-color: var(--lime-a40); background: var(--lime-a10); box-shadow: 0 0 0 1px var(--lime-a20) inset; }
.variant-option:has(input:checked) .variant-option__price { color: var(--lime); }
.variant-option:has(input:focus-visible) { outline: 2px solid var(--lime); outline-offset: 2px; }
.variant-option--unavailable { opacity: 0.45; cursor: not-allowed; }

.order-form__total {
  min-height: 1.2em; padding: 12px 14px; border-radius: var(--r-s);
  background: repeating-linear-gradient(90deg, var(--line-3) 0 6px, transparent 6px 11px) top / 100% 1px no-repeat, rgba(255, 255, 255, 0.025);
  font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
}
.order-form__total:empty { display: none; }
.order-form__soon {
  display: grid; gap: 4px; padding: 14px 16px; border-radius: var(--r-m);
  background: var(--lime-a10); border: 1px solid var(--lime-a20);
}
.order-form__soon-title { font-family: var(--font-display); font-size: 16px; font-weight: 700; color: var(--lime); }
.order-form__soon-total { font-weight: 700; color: var(--text); }
.order-form__submit { height: 56px; font-size: 17px; font-weight: 800; }
.order-form__note { font-size: 12.5px; line-height: 1.45; color: var(--text-3); text-align: center; }

/* ---------- order status page ---------- */
.order { display: grid; gap: 16px; max-width: 820px; }
.order__id { font-family: var(--font-body); font-size: 0.6em; font-weight: 700; letter-spacing: 0.04em; color: var(--text-2); }
.order__status {
  justify-self: start; display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px;
  border-radius: 999px; background: var(--s2); border: 1px solid var(--line-2); font-weight: 700; font-size: 14px;
}
.order__status--completed { color: var(--ok); border-color: rgba(94, 224, 160, 0.35); background: rgba(94, 224, 160, 0.08); }
.order__status--failed, .order__status--cancelled { color: #FF8C97; border-color: rgba(255, 97, 112, 0.35); background: var(--danger-a); }
.order__status--awaiting_payment, .order__status--paid, .order__status--fulfilling { color: var(--lime); border-color: var(--lime-a20); background: var(--lime-a10); }
.status-timeline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; counter-reset: step; }
.status-timeline__step {
  position: relative; padding: 12px 12px 12px 40px; border-radius: var(--r-m);
  background: var(--s1); border: 1px solid var(--line); color: var(--text-3); font-size: 13.5px; font-weight: 600;
  counter-increment: step;
}
.status-timeline__step::before {
  content: counter(step); position: absolute; left: 12px; top: 50%; margin-top: -11px;
  width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center;
  font-size: 12px; font-weight: 800; background: var(--s3); color: var(--text-2);
}
.status-timeline__step--done { color: var(--text); }
.status-timeline__step--done::before { background: var(--ok); color: var(--lime-ink); }
.status-timeline__step--current { color: var(--text); border-color: var(--lime-a40); background: var(--lime-a10); }
.status-timeline__step--current::before { background: var(--lime); color: var(--lime-ink); }
.order__summary, .order__payment, .order__delivery {
  padding: 20px; border-radius: var(--r-l); background: var(--s1); border: 1px solid var(--line);
}
.order h2 { font-family: var(--font-display); font-size: 17px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 12px; }
.order__items { display: grid; }
.order__item { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.order__item-price { font-weight: 700; white-space: nowrap; }
.order__total { margin-top: 12px; display: flex; justify-content: space-between; gap: 16px; font-size: 15px; color: var(--text-2); }
.order__total strong { font-family: var(--font-display); font-size: 22px; color: var(--lime); }
.order__date { margin-top: 4px; font-size: 12.5px; color: var(--text-3); }
.order__payment p + p, .order__delivery p + p { margin-top: 8px; }
.order__payment p, .order__delivery p, .order__hint { font-size: 14px; line-height: 1.55; color: var(--text-2); }
.order__payment strong { color: var(--text); }
.order__reference { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--lime) !important; white-space: nowrap; }
.delivery + .delivery { margin-top: 12px; }
.delivery__codes { display: grid; gap: 8px; margin-top: 8px; }
.delivery__code { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.delivery__code code {
  padding: 10px 14px; border-radius: var(--r-s); background: var(--field); border: 1px solid var(--lime-a20);
  font: 700 16px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.04em; color: var(--lime);
  user-select: all; overflow-wrap: anywhere;
}

/* ---------- documents, support, contacts ---------- */
.prose { max-width: 820px; font-size: 15px; line-height: 1.65; color: var(--text-2); }
.prose > * + * { margin-top: 12px; }
.prose h2 { margin-top: 30px; font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; color: var(--text); }
.prose h3 { margin-top: 22px; font-size: 16.5px; font-weight: 700; color: var(--text); }
.prose ul { display: grid; gap: 6px; padding-left: 0; }
.prose ul:not(.contacts) > li { position: relative; padding-left: 18px; }
.prose ul:not(.contacts) > li::before { content: ""; position: absolute; left: 2px; top: 0.7em; width: 6px; height: 6px; border-radius: 50%; background: var(--lime); }
.prose a { color: var(--lime); text-decoration: underline; text-decoration-color: var(--lime-a40); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--lime); }
.prose strong { color: var(--text); }
.prose code { padding: 1px 6px; border-radius: 6px; background: var(--s2); font-size: 0.92em; }
.support-contacts {
  padding: 18px 20px; border-radius: var(--r-l);
  background: radial-gradient(90% 80% at 100% 0%, rgba(42, 171, 238, 0.14), transparent 60%), var(--s1);
  border: 1px solid var(--line-2);
}
.contacts { display: grid; gap: 6px; margin-bottom: 8px; }
.contacts__item { color: var(--text-2); }
.contacts__item a { color: var(--text); font-weight: 600; text-decoration: none; }
.contacts__item a:hover { color: var(--lime); }

/* ---------- flash + errors ---------- */
.flash { margin-bottom: 16px; padding: 12px 16px; border-radius: var(--r-m); font-size: 14px; border: 1px solid var(--line-2); background: var(--s1); }
.flash--ok { color: var(--ok); border-color: rgba(94, 224, 160, 0.35); }
.flash--error { color: #FF8C97; border-color: rgba(255, 97, 112, 0.35); background: var(--danger-a); }
.error-page {
  max-width: 620px; margin: 40px auto; padding: 32px; text-align: center;
  display: grid; gap: 14px; justify-items: center;
  border-radius: var(--r-xl); background: var(--s1); border: 1px solid var(--line-2); box-shadow: var(--sh-2);
}
.error-page__code {
  font: 800 72px/1 var(--font-display); letter-spacing: -0.05em;
  color: var(--lime-a20);
}
.error-page p { color: var(--text-2); }
.error-page__actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.error-page__id { font-size: 12.5px; color: var(--text-3); }

@media (max-width: 1023px) {
  .product { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .product__media { position: relative; top: auto; width: min(100%, 300px); }
  .order-form { padding: 16px; border-radius: var(--r-l); }
  .status-timeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog-filters { padding: 12px; }
  .catalog-filters__field { flex-basis: 140px; }
  .error-page { margin: 20px auto; padding: 24px 18px; }
}
@media (max-width: 639px) {
  .product__media { width: min(100%, 220px); border-radius: var(--r-l); }
  /* The 1023px rule above also shrinks the search field's basis: give it its own row so the
     placeholder and, on the next rows, the selects (sort next to the button) are not cut off. */
  .catalog-filters__field--search { flex-basis: 100%; }
}
