:root {
  color-scheme: light;
  --page: #ffffff;
  --ink: #050505;
  --muted: #f6f2ee;
  --line: #e9e9e9;
  --field: #fafafa;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.14);
  --type-size: 16px;
  --nav-x: 18px;
  --nav-y: 22px;
  --nav-size: 32px;
  font-family: Arial, "Helvetica Neue", Helvetica, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-size: var(--type-size);
}

body :where(a, button, input, textarea, label, span, p, h1, h2, h3, strong, small, dt, dd) {
  font-size: var(--type-size) !important;
}

body.is-detail {
  overflow: hidden;
}

body.is-detail .topbar {
  display: none;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 56px;
  padding: 16px 22px 10px;
  pointer-events: none;
}

.brand {
  justify-self: center;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
  pointer-events: auto;
}

.cart-indicator {
  display: inline-flex;
  justify-self: end;
  align-items: center;
  min-height: var(--nav-size);
  gap: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-weight: 600;
  line-height: 1;
  pointer-events: auto;
}

.cart-indicator span,
.detail-cart span {
  display: inline-grid;
  min-width: 1ch;
  height: 18px;
  place-items: center;
  line-height: 1;
}

#cartCount[hidden],
#detailCartCount[hidden],
#checkoutCartCount[hidden] {
  display: none;
}

.cart-indicator svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.catalog-shell {
  width: 100%;
  padding: 24px 24px 116px;
}

.lab-board {
  position: relative;
  width: min(1250px, calc(100vw - 48px));
  min-height: 1840px;
  margin: 0 auto;
}

.product-card {
  position: absolute;
  left: calc(var(--x) * 1px);
  top: calc(var(--y) * 1px);
  width: calc(var(--w) * 1px);
}

.product-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.product-visual {
  display: block;
  width: 100%;
  height: calc(var(--h) * 1px);
  background: var(--muted);
  background-position: center;
  background-size: cover;
  overflow: hidden;
}

.product-visual.has-image {
  background-color: transparent;
}

.product-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-visual img[hidden] {
  display: none;
}

.product-title {
  display: none;
}

.product-button:hover .product-visual,
.product-button:focus-visible .product-visual {
  opacity: 0.62;
}

.product-detail {
  position: relative;
  display: grid;
  grid-template-columns: minmax(88px, 1fr) minmax(280px, 620px) minmax(88px, 1fr);
  grid-template-rows: minmax(54px, 1fr) auto auto minmax(54px, 1fr);
  align-items: center;
  min-height: 100dvh;
  padding: 18px 22px 26px;
  background: #ffffff;
}

.product-detail[hidden] {
  display: none;
}

.detail-icon,
.detail-cart,
.detail-arrow,
.detail-add {
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #050505;
  line-height: 1;
}

.detail-icon,
.icon-button {
  border-radius: 999px;
}

.detail-icon,
.detail-cart {
  position: fixed;
  top: var(--nav-y);
  z-index: 30;
  width: var(--nav-size);
  height: var(--nav-size);
}

.detail-back {
  left: var(--nav-x);
}

.detail-cart {
  right: var(--nav-x);
  grid-auto-flow: column;
  gap: 5px;
  width: auto;
  min-width: var(--nav-size);
  font-weight: 600;
}

.detail-icon svg,
.detail-cart svg,
.detail-arrow svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.detail-cart svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.4;
}

.detail-media {
  position: relative;
  grid-column: 2;
  grid-row: 2;
  justify-self: center;
  width: min(45vw, 588px);
  min-width: min(78vw, 392px);
  aspect-ratio: 1.22 / 1;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  overflow: hidden;
  overscroll-behavior: contain;
  user-select: none;
}

.detail-media img {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.detail-media img.is-active {
  display: block;
}

.detail-media img[hidden] {
  display: none;
}

.detail-media:not(.has-image)::before {
  position: absolute;
  inset: 8% 18% 10%;
  content: "";
  background: #f5f1ed;
}

.detail-media:not(.has-image)::after {
  position: absolute;
  left: 29%;
  right: 29%;
  bottom: 10%;
  height: 10px;
  content: "";
  background: rgba(0, 0, 0, 0.05);
  filter: blur(12px);
}

.detail-arrow {
  grid-row: 2;
  justify-self: center;
  z-index: 2;
  width: 46px;
  height: 46px;
}

.detail-arrow-prev {
  grid-column: 1;
  justify-self: end;
  margin-right: clamp(-36px, -2vw, -18px);
}

.detail-arrow-next {
  grid-column: 3;
  justify-self: start;
  margin-left: clamp(-36px, -2vw, -18px);
}

.detail-info {
  grid-column: 2;
  grid-row: 3;
  align-self: start;
  display: grid;
  justify-items: center;
  gap: 14px;
  padding-top: 24px;
  text-align: center;
}

.detail-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  min-height: 6px;
}

.detail-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #d8d8d8;
}

.detail-dots span.active {
  background: #050505;
}

.detail-info h2,
.detail-info p {
  margin: 0;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
}

.detail-description {
  max-width: 360px;
  margin-top: -8px !important;
  color: #444444;
  font-weight: 400 !important;
  line-height: 1.35 !important;
}

.detail-arrow[hidden],
.detail-dots[hidden] {
  display: none;
}

.detail-add {
  width: auto;
  min-width: 88px;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  font-weight: 600;
  text-transform: none;
}

.price,
.dialog-price {
  margin: 0;
  color: var(--ink);
  line-height: 1.3;
}

.order-dialog {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
}

.order-dialog::backdrop {
  background: #ffffff;
}

.order-form {
  position: relative;
  min-height: 100dvh;
  padding: 56px clamp(24px, 11vw, 220px) 34px;
  background: #ffffff;
}

.close-button {
  position: fixed;
  top: calc(var(--nav-y) - 4px);
  left: calc(var(--nav-x) - 4px);
  z-index: 40;
}

.icon-button {
  display: grid;
  width: var(--nav-size);
  height: var(--nav-size);
  place-items: center;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  line-height: 1;
}

.close-button {
  width: calc(var(--nav-size) + 8px);
  height: calc(var(--nav-size) + 8px);
  border-radius: 999px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.order-dialog.is-scrolled .close-button {
  border-color: rgba(5, 5, 5, 0.08);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.045);
}

.icon-button svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.checkout-main {
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(340px, 0.75fr);
  gap: clamp(46px, 9vw, 124px);
  align-items: start;
}

.checkout-left {
  display: grid;
  gap: 22px;
}

.checkout-main h2,
.checkout-summary h2 {
  margin: 0;
  font-weight: 600;
  line-height: 1;
  text-transform: none;
}

.checkout-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.checkout-fields label {
  display: grid;
  gap: 8px;
  color: #101010;
  font-weight: 400;
}

.checkout-fields label.wide {
  grid-column: 1 / -1;
}

.checkout-fields input,
.checkout-fields textarea {
  width: 100%;
  border: 1px solid #d8d8d8;
  border-radius: 0;
  background: #ffffff;
  color: #101010;
  outline: none;
}

.checkout-fields input {
  min-height: 42px;
  padding: 0 11px;
}

.checkout-fields textarea {
  resize: vertical;
  padding: 11px;
}

.checkout-fields input::placeholder,
.checkout-fields textarea::placeholder {
  color: #777777;
  font-weight: 400;
  opacity: 1;
}

.checkout-fields input:focus,
.checkout-fields textarea:focus {
  border-color: var(--ink);
  background: #ffffff;
}

.checkout-summary {
  display: grid;
  gap: 28px;
}

.summary-item {
  display: grid;
  grid-template-columns: 76px 1fr auto;
  gap: 24px;
  align-items: start;
}

.summary-visual {
  width: 70px;
  height: 70px !important;
  background-size: contain;
  background-repeat: no-repeat;
}

.summary-lines {
  display: grid;
  gap: 8px;
}

.summary-lines p {
  margin: 0;
  font-weight: 600;
  line-height: 1.25;
}

.summary-lines p + p {
  color: #666666;
  font-weight: 400;
}

.summary-qty {
  display: inline-grid;
  grid-template-columns: auto auto auto auto;
  gap: 12px;
  align-items: center;
  width: max-content;
  font-weight: 400;
}

.qty-button {
  display: inline-grid;
  width: 22px;
  height: 28px;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 22px !important;
  font-weight: 400;
  line-height: 1;
}

.qty-value {
  min-width: 14px;
  text-align: center;
}

.empty-cart-message,
.order-sent-message {
  margin: 0;
  color: var(--ink);
  font-weight: 400;
  line-height: 1.35;
}

.summary-item[hidden],
.summary-totals[hidden],
.empty-cart-message[hidden],
.order-sent-message[hidden],
.submit-button[hidden] {
  display: none;
}

.summary-totals {
  display: grid;
  gap: 12px;
  margin: 4px 0 0;
}

.summary-totals div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
}

.summary-totals dt,
.summary-totals dd {
  margin: 0;
  font-weight: 600;
  text-transform: none;
}

.form-status {
  min-height: 20px;
  margin: 0;
  color: #666666;
}

.form-status.error {
  color: #9d1d1d;
}

.form-status.success {
  color: #2d684a;
}

.submit-button {
  min-height: 41px;
  min-width: 150px;
  padding: 0;
  border: 1px solid #101010;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  line-height: 1;
  text-transform: none;
}

.submit-button:disabled {
  color: #9a9a9a;
  cursor: wait;
}

@media (max-width: 900px) {
  :root {
    --nav-x: 14px;
    --nav-y: 14px;
    --nav-size: 34px;
  }

  .topbar {
    min-height: 52px;
    padding: var(--nav-y) var(--nav-x) 8px;
  }

  .catalog-shell {
    padding: 78px 14px 72px;
  }

  .lab-board {
    display: grid;
    grid-template-columns: 1fr;
    gap: 38px;
    width: min(520px, 100%);
    min-height: 0;
  }

  .product-card {
    position: static;
    width: 100%;
  }

  .product-visual {
    height: auto;
    aspect-ratio: 1 / 1;
  }

  .product-detail {
    grid-template-columns: 54px minmax(0, 1fr) 54px;
    grid-template-rows: minmax(54px, 1fr) auto auto minmax(54px, 1fr);
    min-height: 100dvh;
    padding: 18px 14px 28px;
  }

  .cart-indicator,
  .detail-cart {
    gap: 4px;
  }

  .detail-media {
    width: calc(100vw - 28px);
    min-width: 0;
    aspect-ratio: 1 / 1;
  }

  .detail-arrow {
    display: none;
    width: var(--nav-size);
    height: var(--nav-size);
  }

  .detail-arrow-prev {
    justify-self: start;
    margin-right: 0;
  }

  .detail-arrow-next {
    justify-self: end;
    margin-left: 0;
  }

  .detail-media.has-gallery {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    touch-action: pan-x;
    -webkit-overflow-scrolling: touch;
  }

  .detail-media.has-gallery::-webkit-scrollbar {
    display: none;
  }

  .detail-media.has-gallery img {
    display: block;
    flex: 0 0 100%;
    scroll-snap-align: center;
  }

  .detail-info {
    gap: 12px;
    padding-top: 22px;
  }

  .detail-dots {
    gap: 6px;
  }

  .detail-description {
    max-width: 280px;
  }

  .order-form {
    padding: 72px 18px 30px;
  }

  .checkout-main {
    grid-template-columns: 1fr;
    gap: 42px;
  }

  .checkout-left {
    gap: 26px;
  }

  .checkout-fields {
    grid-template-columns: 1fr;
  }

  .summary-item {
    grid-template-columns: 64px 1fr;
    gap: 16px;
  }

  .summary-visual {
    width: 60px;
    height: 60px !important;
  }

  .summary-item .dialog-price {
    grid-column: 2;
  }

}
