:root {
  --color-canvas: #f6f3ee;
  --color-surface: #fffdf9;
  --color-surface-muted: #eeeae3;
  --color-ink: #171b1d;
  --color-muted: #657077;
  --color-line: #ddd7ce;
  --color-primary: #a61f2b;
  --color-primary-hover: #7f1720;
  --color-success: #287a50;
  --color-warning: #a76710;
  --color-danger: #b52b31;
  --shadow-raised: 0 12px 30px rgba(33, 29, 24, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--color-canvas);
  color: var(--color-ink);
  font-family: "Source Sans 3", "Arial Narrow", Arial, sans-serif;
}

body.cart-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(166, 31, 43, 0.26);
  outline-offset: 2px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  font-family: "Archivo", "Arial Narrow", Arial, sans-serif;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 70px;
  padding: 8px clamp(14px, 4vw, 40px);
  border-bottom: 1px solid var(--color-line);
  background: rgba(255, 253, 249, 0.95);
  backdrop-filter: blur(14px);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.home-logo-link {
  display: inline-flex;
  align-items: center;
  flex: 0 1 auto;
  border-radius: 8px;
}

.header-logo {
  width: 224px;
  height: 50px;
  object-fit: contain;
}

.cart-button,
.primary-button,
.secondary-button,
.filters-toggle {
  min-height: 46px;
  border-radius: 9px;
  font-weight: 700;
}

.cart-button,
.primary-button {
  border: 0;
  background: var(--color-primary);
  color: white;
}

.cart-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 13px;
}

.cart-button span {
  min-width: 23px;
  padding: 2px 6px;
  border-radius: 999px;
  background: white;
  color: var(--color-primary);
  text-align: center;
}

.primary-button {
  padding: 0 18px;
  box-shadow: 0 8px 18px rgba(166, 31, 43, 0.16);
}

.secondary-button,
.filters-toggle {
  border: 1px solid var(--color-line);
  background: var(--color-surface);
  color: var(--color-ink);
}

.secondary-button {
  padding: 0 16px;
}

.filters-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
}

.filters-toggle span {
  display: grid;
  min-width: 22px;
  min-height: 22px;
  place-items: center;
  border-radius: 999px;
  background: var(--color-surface-muted);
}

.primary-button:hover,
.cart-button:hover {
  background: var(--color-primary-hover);
}

.primary-button:disabled {
  cursor: not-allowed;
  box-shadow: none;
  opacity: 0.5;
}

main {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 20px clamp(14px, 4vw, 40px) 48px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--color-primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.catalog-intro {
  max-width: 760px;
  padding: 18px 0 6px;
}

.catalog-intro h1 {
  margin-bottom: 9px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.catalog-intro > p:last-child {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--color-muted);
  font-size: 16px;
  line-height: 1.5;
}

.category-browser {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-top: 14px;
  padding: 14px 0 4px;
}

.category-browser h2 {
  margin-bottom: 4px;
  font-size: 24px;
}

.category-browser > div > p:last-child {
  margin-bottom: 0;
  color: var(--color-muted);
  font-size: 13px;
}

.category-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.category-tab {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--color-line);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-ink);
  font-weight: 700;
}

.category-tab.is-active {
  border-color: var(--color-ink);
  background: var(--color-ink);
  color: white;
}

.catalog-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 16px;
}

.controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 10px;
  padding: 14px;
  border: 1px solid var(--color-line);
  border-radius: 10px;
  background: var(--color-surface);
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--color-line);
  border-radius: 8px;
  background: white;
  color: var(--color-ink);
  outline: none;
}

.field input,
.field select {
  min-height: 46px;
  padding: 0 12px;
}

.field textarea {
  min-height: 90px;
  padding: 10px 12px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(166, 31, 43, 0.12);
}

.field-error {
  min-height: 16px;
  color: var(--color-danger);
  font-size: 12px;
  font-weight: 600;
}

.catalog-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 11px;
  color: var(--color-muted);
  font-size: 13px;
}

.catalog-summary p {
  margin: 0;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.product-card {
  overflow: hidden;
  border: 1px solid var(--color-line);
  border-radius: 11px;
  background: var(--color-surface);
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.product-card:hover {
  transform: translateY(-2px);
  border-color: #bdb5a9;
  box-shadow: var(--shadow-raised);
}

.model-link {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.product-media {
  aspect-ratio: 1.2 / 1;
  background: var(--color-surface-muted);
}

.product-media img {
  width: 100%;
  height: 100%;
  padding: 10px;
  object-fit: contain;
}

.product-body {
  padding: 13px;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 7px;
  border-radius: 6px;
  background: var(--color-surface-muted);
  color: #465158;
  font-size: 11px;
  font-weight: 700;
}

.product-title {
  margin-bottom: 8px;
  font-size: 18px;
  line-height: 1.25;
}

.model-facts {
  color: var(--color-muted);
  font-size: 13px;
}

.model-facts p {
  margin-bottom: 5px;
}

.model-facts strong {
  color: var(--color-ink);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.details-button {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  margin-top: 4px;
  color: var(--color-primary);
  font-weight: 700;
}

.contact-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--color-line);
  border-left: 3px solid var(--color-primary);
  border-radius: 10px;
  background: var(--color-surface);
}

.contact-strip > div:first-child {
  display: grid;
  gap: 3px;
}

.contact-strip span {
  color: var(--color-muted);
  font-size: 13px;
}

.contact-strip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.contact-strip-actions a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid var(--color-line);
  border-radius: 8px;
  color: var(--color-ink);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.contact-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.empty-state,
.error-state,
.loading-state {
  grid-column: 1 / -1;
  padding: 26px;
  border: 1px solid var(--color-line);
  border-radius: 10px;
  background: var(--color-surface);
  color: var(--color-muted);
}

.error-state {
  border-color: #e5b6b9;
  color: var(--color-danger);
}

.back-link {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border: 1px solid var(--color-line);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-ink);
  font-size: 21px;
  text-decoration: none;
}

.detail-main {
  width: min(1280px, 100%);
  padding-bottom: 110px;
}

.product-detail {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(500px, 1.25fr);
  gap: 28px;
  align-items: start;
}

.detail-gallery {
  position: sticky;
  top: 88px;
}

.detail-main-image {
  display: grid;
  aspect-ratio: 1 / 0.82;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--color-line);
  border-radius: 12px;
  background: var(--color-surface);
}

.detail-main-image img {
  width: 100%;
  height: 100%;
  padding: 16px;
  object-fit: contain;
}

.gallery-thumbnails {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
}

.gallery-thumbnail {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid var(--color-line);
  border-radius: 8px;
  background: var(--color-surface);
}

.gallery-thumbnail.is-active {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(166, 31, 43, 0.12);
}

.gallery-thumbnail img {
  width: 100%;
  height: 100%;
  padding: 5px;
  object-fit: contain;
}

.detail-title {
  margin-bottom: 8px;
  font-size: 32px;
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.detail-summary {
  color: var(--color-muted);
  font-size: 16px;
  line-height: 1.5;
}

.detail-notice {
  margin: 16px 0;
  padding: 12px 14px;
  border-left: 3px solid var(--color-primary);
  background: var(--color-surface-muted);
  color: #465158;
  line-height: 1.45;
}

.detail-variant-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 20px 0 9px;
}

.detail-variant-header h2 {
  margin-bottom: 0;
  font-size: 18px;
}

.detail-variant-header span {
  color: var(--color-muted);
  font-size: 12px;
}

.detail-variant-list {
  display: grid;
  gap: 7px;
}

.detail-variant-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 116px;
  gap: 12px;
  align-items: center;
  min-height: 62px;
  padding: 9px 10px 9px 13px;
  border: 1px solid var(--color-line);
  border-radius: 9px;
  background: var(--color-surface);
}

.detail-flavor {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.detail-flavor strong {
  line-height: 1.3;
}

.detail-stock {
  color: var(--color-success);
  font-size: 11px;
}

.detail-stock.stock-low {
  color: var(--color-warning);
}

.detail-stock.stock-out {
  color: var(--color-danger);
}

.quantity-stepper {
  display: grid;
  grid-template-columns: 38px 1fr 38px;
  overflow: hidden;
  border: 1px solid #cec6bb;
  border-radius: 8px;
  background: white;
  text-align: center;
}

.quantity-stepper button,
.quantity-stepper output {
  display: grid;
  min-height: 38px;
  place-items: center;
  border: 0;
}

.quantity-stepper button {
  background: #f0ece6;
  color: var(--color-primary);
  font-size: 18px;
  font-weight: 700;
}

.quantity-stepper button:disabled {
  cursor: not-allowed;
  color: #a8a19a;
}

.quantity-stepper output {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.selection-feedback {
  margin-top: 12px;
  padding: 13px;
  border: 1px solid #b9d7c5;
  border-radius: 9px;
  background: #eef8f2;
  color: #205d3e;
}

.selection-feedback p {
  margin-bottom: 10px;
  font-weight: 700;
}

.selection-feedback-actions,
.cart-stage-actions {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 8px;
}

.sticky-action-bar {
  position: fixed;
  inset: auto 0 0;
  z-index: 12;
  display: grid;
  grid-template-columns: auto minmax(210px, 360px);
  justify-content: center;
  gap: 18px;
  align-items: center;
  padding: 11px 14px calc(11px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--color-line);
  background: rgba(255, 253, 249, 0.97);
  box-shadow: 0 -12px 30px rgba(33, 29, 24, 0.08);
}

#selectionSummary {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  justify-content: flex-end;
  background: rgba(23, 27, 29, 0.48);
}

.cart-drawer.is-open {
  display: flex;
}

.cart-panel {
  width: min(560px, 100%);
  height: 100%;
  overflow-y: auto;
  background: var(--color-surface);
  box-shadow: var(--shadow-raised);
}

.cart-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--color-line);
  background: var(--color-surface);
}

.cart-header h2 {
  margin-bottom: 0;
}

.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--color-line);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-ink);
  font-size: 25px;
}

.cart-items {
  display: grid;
  gap: 9px;
  padding: 14px 18px;
}

.cart-empty {
  padding: 16px;
  border-radius: 8px;
  background: var(--color-surface-muted);
  color: var(--color-muted);
}

.cart-item {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--color-line);
  border-radius: 9px;
}

.cart-item-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.cart-item h3 {
  margin-bottom: 3px;
  font-size: 15px;
}

.variant-detail {
  margin: 0;
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1.4;
}

.remove-button {
  border: 0;
  background: transparent;
  color: var(--color-danger);
  font-size: 12px;
  font-weight: 700;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cart-item-controls .quantity-stepper {
  width: 116px;
}

.cart-line-total {
  margin: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border-top: 1px solid var(--color-line);
  border-bottom: 1px solid var(--color-line);
  background: #faf7f2;
}

.cart-total strong {
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.cart-help {
  margin: 0;
  padding: 12px 18px;
  color: var(--color-muted);
  font-size: 13px;
  line-height: 1.5;
}

.cart-help a {
  color: var(--color-primary);
  font-weight: 700;
}

.cart-stage-actions {
  position: sticky;
  bottom: 0;
  padding: 12px 18px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--color-line);
  background: var(--color-surface);
  box-shadow: 0 -10px 24px rgba(33, 29, 24, 0.06);
}

.back-to-cart-button {
  margin: 14px 18px 0;
  border: 0;
  background: transparent;
  color: var(--color-primary);
  font-weight: 700;
}

.request-form {
  display: grid;
  gap: 12px;
  padding: 16px 18px 22px;
}

.honeypot-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.submit-status {
  min-height: 18px;
  margin: 0;
  color: var(--color-muted);
  font-size: 13px;
}

.submit-status.is-error {
  color: var(--color-danger);
  font-weight: 700;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.request-preview {
  margin: 0 18px 24px;
  padding: 14px;
  border: 1px solid #b9d7c5;
  border-radius: 9px;
  background: #eef8f2;
}

.request-preview p {
  margin: 0;
  color: #205d3e;
  line-height: 1.5;
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(420px, 1.5fr);
  gap: 30px;
  padding: 28px clamp(14px, 4vw, 40px);
  border-top: 1px solid #313638;
  background: #171b1d;
  color: white;
}

.footer-notice {
  grid-column: 1 / -1;
  margin: 0;
  padding-bottom: 16px;
  border-bottom: 1px solid #3a4144;
  color: #d4d9da;
  font-size: 13px;
  line-height: 1.5;
}

.footer-brand img {
  width: min(300px, 100%);
  display: block;
}

.footer-logo-plate {
  display: inline-flex;
  max-width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--color-surface);
}

.footer-brand p {
  margin: 11px 0 0;
  color: #b9c1c4;
  font-size: 13px;
}

.footer-contact {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.footer-contact > div {
  display: grid;
  align-content: start;
  gap: 6px;
}

.footer-contact a,
.footer-contact span {
  overflow-wrap: anywhere;
  color: #d4d9da;
  font-size: 13px;
  text-decoration: none;
}

@media (max-width: 820px) {
  .category-browser {
    align-items: flex-start;
    flex-direction: column;
  }

  .category-nav {
    justify-content: flex-start;
  }

  .controls {
    grid-template-columns: 1fr;
  }

  .product-detail {
    grid-template-columns: 1fr;
  }

  .detail-gallery {
    position: static;
  }

  .site-footer {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .topbar {
    min-height: 66px;
    padding: 6px 14px;
  }

  .header-logo {
    width: 166px;
    height: 44px;
  }

  main {
    padding: 14px 14px 36px;
  }

  .catalog-intro {
    padding-top: 12px;
  }

  .catalog-intro h1 {
    font-size: 27px;
  }

  .catalog-intro > p:last-child {
    font-size: 14px;
  }

  .category-browser {
    margin-top: 8px;
    gap: 10px;
  }

  .category-browser h2 {
    font-size: 21px;
  }

  .category-nav {
    flex-wrap: nowrap;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .catalog-tools {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .filters-toggle {
    min-height: 46px;
    align-self: end;
  }

  .catalog-summary {
    display: grid;
    gap: 4px;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .product-body {
    padding: 10px;
  }

  .product-meta .tag:not(:first-child) {
    display: none;
  }

  .product-title {
    min-height: 54px;
    font-size: 14px;
    line-height: 1.3;
  }

  .model-facts {
    font-size: 11px;
  }

  .model-facts strong {
    font-size: 14px;
  }

  .details-button {
    display: none;
  }

  .contact-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .detail-main {
    padding-bottom: 105px;
  }

  .detail-main-image {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
  }

  .detail-main-image img {
    padding: 10px;
  }

  .detail-title {
    font-size: 25px;
  }

  .gallery-thumbnails {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 2px 1px 5px;
  }

  .gallery-thumbnail {
    width: 54px;
    height: 54px;
    flex-basis: 54px;
  }

  .detail-variant-row {
    grid-template-columns: minmax(0, 1fr) 108px;
    gap: 8px;
  }

  .quantity-stepper {
    grid-template-columns: 35px 1fr 35px;
  }

  .sticky-action-bar {
    grid-template-columns: auto minmax(180px, 1fr);
    justify-content: stretch;
    gap: 10px;
  }

  .cart-panel {
    width: 100%;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .site-footer {
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
  }

  .footer-contact {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 340px) {
  .catalog-tools {
    grid-template-columns: 1fr;
  }

  .filters-toggle {
    justify-self: start;
  }

  .product-grid {
    gap: 8px;
  }

  .product-body {
    padding: 8px;
  }

  .product-title {
    font-size: 13px;
  }

  .sticky-action-bar {
    grid-template-columns: 1fr;
  }
}

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