/*
 * Shared storefront foundations.
 *
 * Product pages, the cart drawer and future storefront widgets must reuse
 * these tokens and primitives instead of introducing local copies.
 */

.zsf-page {
  --zsf-color-ink: #080b0f;
  --zsf-color-ink-hover: #23272d;
  --zsf-color-text: #33383f;
  --zsf-color-text-muted: #62676f;
  --zsf-color-text-subtle: #676d74;
  --zsf-color-surface: #ffffff;
  --zsf-color-surface-subtle: #f5f6f7;
  --zsf-color-surface-strong: #eef0f2;
  --zsf-color-border: #dfe2e6;
  --zsf-color-border-strong: #88919a;
  --zsf-color-success: #247a49;
  --zsf-color-success-surface: #f3faf6;
  --zsf-color-telegram: #1479a8;
  --zsf-color-telegram-border: #229ed9;
  --zsf-color-overlay: rgb(4 7 11 / 52%);
  --zsf-color-focus: rgb(8 11 15 / 16%);

  --zsf-container: 1400px;
  --zsf-gutter: clamp(12px, 2.2vw, 28px);
  --zsf-space-1: 4px;
  --zsf-space-2: 8px;
  --zsf-space-3: 12px;
  --zsf-space-4: 16px;
  --zsf-space-5: 20px;
  --zsf-space-6: 24px;
  --zsf-space-8: 32px;
  --zsf-space-10: 40px;
  --zsf-space-12: 48px;
  --zsf-space-16: 64px;
  --zsf-space-20: 80px;

  --zsf-radius-sm: 8px;
  --zsf-radius-md: 12px;
  --zsf-radius-lg: 18px;
  --zsf-radius-xl: 24px;
  --zsf-radius-pill: 999px;

  --zsf-shadow-card: 0 16px 40px rgb(15 19 24 / 8%);
  --zsf-shadow-floating: 0 12px 34px rgb(0 0 0 / 24%);
  --zsf-shadow-overlay: -20px 0 50px rgb(0 0 0 / 15%);

  --zsf-motion-fast: 160ms;
  --zsf-motion-normal: 240ms;
  --zsf-ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --zsf-focus-ring: 0 0 0 3px var(--zsf-color-focus);
  --zsf-tap-target: 44px;
  --zsf-sticky-offset: max(76px, calc((55 * 100vw / 1440) + 16px));
  --zsf-layer-sticky: 10;
  /* Shared public chrome has a legacy mobile CTA at 2147483000. */
  --zsf-layer-floating: 2147483100;
  --zsf-layer-overlay: 2147483200;

  overflow-x: clip;
  background: var(--zsf-color-surface);
  color: var(--zsf-color-ink);
  font-family: Gilroy, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.zsf-page,
.zsf-page * {
  box-sizing: border-box;
}

.zsf-page a {
  color: inherit;
  text-decoration: none;
}

.zsf-page button,
.zsf-page input,
.zsf-page select,
.zsf-page textarea {
  font: inherit;
}

.zsf-page button,
.zsf-page label,
.zsf-page select {
  -webkit-tap-highlight-color: transparent;
}

.zsf-page img {
  max-width: 100%;
}

.zsf-page [hidden] {
  display: none !important;
}

.zsf-container {
  width: min(var(--zsf-container), calc(100% - (2 * var(--zsf-gutter))));
  margin-inline: auto;
}

.zsf-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--zsf-space-2);
  width: 100%;
  min-height: 50px;
  padding: var(--zsf-space-3) var(--zsf-space-5);
  border: 1px solid transparent;
  border-radius: var(--zsf-radius-md);
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition:
    color var(--zsf-motion-fast) var(--zsf-ease-standard),
    background-color var(--zsf-motion-fast) var(--zsf-ease-standard),
    border-color var(--zsf-motion-fast) var(--zsf-ease-standard),
    transform var(--zsf-motion-fast) var(--zsf-ease-standard);
}

.zsf-button--primary {
  border-color: var(--zsf-color-ink);
  background: var(--zsf-color-ink);
  color: var(--zsf-color-surface);
}

.zsf-button--primary:hover {
  background: var(--zsf-color-ink-hover);
}

.zsf-button--secondary,
.zsf-button--outline {
  border-color: var(--zsf-color-border-strong);
  background: var(--zsf-color-surface);
  color: var(--zsf-color-ink);
}

.zsf-button--outline {
  min-height: 46px;
}

.zsf-button--secondary:hover,
.zsf-button--outline:hover {
  border-color: var(--zsf-color-ink);
}

.zsf-button:active:not(:disabled) {
  transform: translateY(1px);
}

.zsf-button:disabled {
  cursor: wait;
  opacity: 0.56;
}

.zsf-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--zsf-tap-target);
  min-width: var(--zsf-tap-target);
  height: var(--zsf-tap-target);
  padding: 0;
  border: 1px solid var(--zsf-color-border);
  border-radius: 50%;
  background: var(--zsf-color-surface);
  color: var(--zsf-color-ink);
  line-height: 1;
  cursor: pointer;
  transition:
    background-color var(--zsf-motion-fast) var(--zsf-ease-standard),
    border-color var(--zsf-motion-fast) var(--zsf-ease-standard);
}

.zsf-icon-button:hover {
  border-color: var(--zsf-color-ink);
  background: var(--zsf-color-surface-subtle);
}

.zsf-control {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid var(--zsf-color-border-strong);
  border-radius: var(--zsf-radius-md);
  outline: none;
  background: var(--zsf-color-surface);
  color: var(--zsf-color-ink);
  transition:
    border-color var(--zsf-motion-fast) var(--zsf-ease-standard),
    box-shadow var(--zsf-motion-fast) var(--zsf-ease-standard);
}

.zsf-control:focus {
  border-color: var(--zsf-color-ink);
  box-shadow: var(--zsf-focus-ring);
}

/* Reusable configurator controls shared by every storefront product. */
.zsf-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--zsf-space-2);
}

.zsf-choice-grid.is-compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.zsf-choice,
.zsf-swatch,
.zsf-switch {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.zsf-choice input,
.zsf-swatch input,
.zsf-switch > input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.zsf-choice > span {
  display: grid;
  align-content: center;
  min-height: 62px;
  padding: 12px 14px;
  border: 1px solid var(--zsf-color-border);
  border-radius: var(--zsf-radius-sm);
  background: var(--zsf-color-surface);
  transition:
    border-color var(--zsf-motion-fast) var(--zsf-ease-standard),
    background-color var(--zsf-motion-fast) var(--zsf-ease-standard),
    box-shadow var(--zsf-motion-fast) var(--zsf-ease-standard);
}

.zsf-choice strong {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
}

.zsf-choice small {
  margin-top: 5px;
  color: var(--zsf-color-text-muted);
  font-size: 12px;
  line-height: 1.35;
}

.zsf-choice--media > span {
  align-content: start;
  min-height: 246px;
  padding: 10px;
}

.zsf-choice-grid.has-media > .zsf-choice:not(.zsf-choice--media) {
  grid-column: 1 / -1;
}

.zsf-choice__media {
  position: relative;
  display: grid;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-bottom: 10px;
  overflow: hidden;
  place-items: center;
  border-radius: calc(var(--zsf-radius-sm) - 4px);
  background: var(--zsf-color-surface-strong);
}

.zsf-choice .zsf-choice__media img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.zsf-choice:hover > span {
  border-color: var(--zsf-color-border-strong);
}

.zsf-choice input:checked + span {
  border-color: var(--zsf-color-ink);
  background: var(--zsf-color-surface-strong);
  box-shadow: inset 0 0 0 1px var(--zsf-color-ink);
}

.zsf-choice input:focus-visible + span,
.zsf-swatch input:focus-visible + span,
.zsf-switch > input:focus-visible + .zsf-switch__body {
  box-shadow: var(--zsf-focus-ring);
}

.zsf-swatch-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px 10px;
}

.zsf-swatch {
  display: grid;
  align-content: start;
  gap: 8px;
}

.zsf-swatch > span {
  display: block;
  width: 100%;
  aspect-ratio: 1.45 / 1;
  overflow: hidden;
  border: 1px solid var(--zsf-color-border);
  border-radius: var(--zsf-radius-sm);
  background-color: var(--zsf-swatch);
  background-position: center;
  background-size: cover;
  box-shadow: inset 0 0 0 3px var(--zsf-color-surface);
  transition:
    border-color var(--zsf-motion-fast) var(--zsf-ease-standard),
    box-shadow var(--zsf-motion-fast) var(--zsf-ease-standard),
    transform var(--zsf-motion-fast) var(--zsf-ease-standard);
}

.zsf-swatch:hover > span {
  border-color: var(--zsf-color-border-strong);
  transform: translateY(-1px);
}

.zsf-swatch input:checked + span {
  border-color: var(--zsf-color-ink);
  box-shadow:
    inset 0 0 0 3px var(--zsf-color-surface),
    0 0 0 2px var(--zsf-color-ink);
}

.zsf-swatch small {
  width: 100%;
  color: var(--zsf-color-text);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  text-align: left;
  overflow-wrap: anywhere;
}

.zsf-number-field {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  font-size: 14px;
  font-weight: 600;
}

.zsf-number-field__control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.zsf-number-field__control .zsf-control {
  padding-right: 56px;
}

.zsf-number-field__control b {
  z-index: 1;
  margin-left: -48px;
  color: var(--zsf-color-text-muted);
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
}

.zsf-number-field > small {
  color: var(--zsf-color-text-muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
}

.zsf-switch {
  display: block;
  margin: 12px 0;
}

.zsf-switch__body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
  padding: 13px 14px;
  border: 1px solid var(--zsf-color-border);
  border-radius: var(--zsf-radius-md);
  background: var(--zsf-color-surface);
  transition:
    border-color var(--zsf-motion-fast) var(--zsf-ease-standard),
    background-color var(--zsf-motion-fast) var(--zsf-ease-standard),
    box-shadow var(--zsf-motion-fast) var(--zsf-ease-standard);
}

.zsf-switch__copy {
  display: grid;
  min-width: 0;
}

.zsf-switch__copy strong {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.zsf-switch__copy small {
  margin-top: 4px;
  color: var(--zsf-color-text-muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
}

.zsf-switch__copy em {
  margin-top: 6px;
  color: var(--zsf-color-text-muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 600;
  line-height: 1.2;
}

.zsf-switch__on {
  display: none;
  color: var(--zsf-color-success);
}

.zsf-switch__control {
  position: relative;
  width: 48px;
  min-width: 48px;
  height: 28px;
  border-radius: var(--zsf-radius-pill);
  background: var(--zsf-color-ink);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 16%);
  transition: background-color var(--zsf-motion-fast) var(--zsf-ease-standard);
}

.zsf-switch__control::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--zsf-color-surface);
  box-shadow: 0 1px 4px rgb(0 0 0 / 28%);
  content: '';
  transition: transform var(--zsf-motion-fast) var(--zsf-ease-standard);
}

.zsf-switch:hover .zsf-switch__body {
  border-color: var(--zsf-color-border-strong);
}

.zsf-switch > input:checked + .zsf-switch__body {
  border-color: var(--zsf-color-success);
  background: var(--zsf-color-success-surface);
}

.zsf-switch > input:checked + .zsf-switch__body .zsf-switch__control {
  background: var(--zsf-color-success);
}

.zsf-switch > input:checked + .zsf-switch__body .zsf-switch__control::after {
  transform: translateX(20px);
}

.zsf-switch > input:checked + .zsf-switch__body .zsf-switch__off {
  display: none;
}

.zsf-switch > input:checked + .zsf-switch__body .zsf-switch__on {
  display: inline;
}

.zsf-quantity {
  display: grid;
}

.zsf-stepper {
  display: grid;
  grid-template-columns: 48px minmax(72px, 104px) 48px;
  width: max-content;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--zsf-color-border-strong);
  border-radius: var(--zsf-radius-md);
  background: var(--zsf-color-surface);
  transition: border-color var(--zsf-motion-fast) var(--zsf-ease-standard);
}

.zsf-stepper:focus-within {
  border-color: var(--zsf-color-ink);
}

.zsf-stepper--compact {
  grid-template-columns: var(--zsf-tap-target) minmax(54px, 64px) var(--zsf-tap-target);
}

.zsf-stepper button {
  min-width: 48px;
  min-height: 48px;
  padding: 0;
  border: 0;
  background: var(--zsf-color-surface-subtle);
  color: var(--zsf-color-ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition:
    color var(--zsf-motion-fast) var(--zsf-ease-standard),
    background-color var(--zsf-motion-fast) var(--zsf-ease-standard),
    opacity var(--zsf-motion-fast) var(--zsf-ease-standard);
}

.zsf-stepper button:hover:not(:disabled) {
  background: var(--zsf-color-surface-strong);
}

.zsf-stepper button:disabled {
  color: var(--zsf-color-text-subtle);
  cursor: default;
  opacity: 0.42;
}

.zsf-stepper--compact button {
  min-width: var(--zsf-tap-target);
  min-height: var(--zsf-tap-target);
}

.zsf-stepper input {
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0 8px;
  border: 0;
  border-right: 1px solid var(--zsf-color-border-strong);
  border-left: 1px solid var(--zsf-color-border-strong);
  outline: 0;
  background: var(--zsf-color-surface);
  color: var(--zsf-color-ink);
  font-weight: 600;
  text-align: center;
  appearance: textfield;
}

.zsf-stepper input:focus-visible {
  box-shadow: inset 0 0 0 1px var(--zsf-color-ink);
}

.zsf-stepper--compact input {
  height: var(--zsf-tap-target);
  padding-inline: 5px;
}

.zsf-stepper input::-webkit-inner-spin-button,
.zsf-stepper input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.zsf-price-breakdown,
.zsf-cart__item-breakdown {
  display: grid;
  gap: 8px;
  margin: 16px 0;
  padding: 13px 0;
  border-top: 1px solid var(--zsf-color-border);
  border-bottom: 1px solid var(--zsf-color-border);
}

.zsf-price-breakdown > div,
.zsf-cart__item-breakdown > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 12px;
}

.zsf-price-breakdown dt,
.zsf-price-breakdown dd,
.zsf-cart__item-breakdown dt,
.zsf-cart__item-breakdown dd {
  min-width: 0;
  margin: 0;
  font-size: 12px;
  line-height: 1.3;
}

.zsf-price-breakdown dt,
.zsf-cart__item-breakdown dt {
  color: var(--zsf-color-text-muted);
}

.zsf-price-breakdown dd,
.zsf-cart__item-breakdown dd {
  font-weight: 600;
  text-align: right;
}

.zsf-price-breakdown dd.is-pending,
.zsf-cart__item-breakdown dd.is-pending,
.zsf-price-breakdown dd.is-not-selected,
.zsf-cart__item-breakdown dd.is-not-selected {
  color: var(--zsf-color-text-muted);
  font-weight: 500;
}

.zsf-cart__item-breakdown {
  gap: 5px;
  margin: 9px 0;
  padding: 8px 0;
}

.zsf-cart__item-breakdown dt,
.zsf-cart__item-breakdown dd {
  font-size: 11px;
}

.zsf-button:focus-visible,
.zsf-icon-button:focus-visible,
.zsf-stepper button:focus-visible,
.zsf-page a:focus-visible,
.zsf-page input:focus-visible,
.zsf-page select:focus-visible,
.zsf-page textarea:focus-visible,
.zsf-page [role="tab"]:focus-visible {
  outline: 2px solid var(--zsf-color-ink);
  outline-offset: 3px;
}

.zsf-stepper button:focus-visible {
  outline-offset: -3px;
}

.zsf-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 760px) {
  .zsf-page {
    --zsf-sticky-offset: 60px;
  }

  .zsf-button {
    min-height: 52px;
  }

  .zsf-control {
    font-size: 16px;
  }

  .zsf-choice-grid,
  .zsf-choice-grid.is-compact,
  .zsf-swatch-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .zsf-choice > span {
    min-height: 58px;
  }

  .zsf-switch__body {
    min-height: 72px;
  }
}

@media (max-width: 390px) {
  .zsf-choice-grid:not(.is-compact) {
    grid-template-columns: 1fr;
  }

  .zsf-choice-grid.has-media:not(.is-compact) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .zsf-page *,
  .zsf-page *::before,
  .zsf-page *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
