:root {
  --ink: #22201d;
  --muted: #726e68;
  --soft: #f7f5f1;
  --paper: #ffffff;
  --line: #e4dfd7;
  --accent: #1f5d72;
  --accent-dark: #173f4f;
  --green: #2e7565;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--soft);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
}

a,
button {
  font: inherit;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 230px minmax(240px, 1fr) auto;
  gap: 20px;
  align-items: center;
  min-height: 72px;
  padding: 0 32px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 760;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #fff;
  background: var(--accent-dark);
  border-radius: 50%;
  font-size: 14px;
}

.search {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.search-label {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.search input {
  width: min(320px, 38vw);
  min-width: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font: inherit;
  font-size: 14px;
}

.search input::placeholder {
  color: var(--muted);
}

.top-action,
.contact a,
.order-box a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  color: #fff;
  background: var(--accent-dark);
  border-radius: 6px;
  font-weight: 740;
}

.intro {
  display: grid;
  grid-template-columns: minmax(320px, 1.2fr) minmax(300px, 0.8fr);
  gap: 30px;
  padding: 44px 32px 34px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.intro h1 {
  max-width: 820px;
  margin: 0 0 12px;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.02;
  letter-spacing: 0;
}

.intro p {
  max-width: 850px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.62;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.intro-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-self: end;
}

.intro-stats div {
  min-height: 96px;
  padding: 18px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.intro-stats strong {
  display: block;
  font-size: 24px;
}

.intro-stats span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.catalog-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 28px;
  padding: 28px 32px 54px;
}

.filters {
  position: sticky;
  top: 92px;
  align-self: start;
  padding: 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.filters h2 {
  margin: 0 0 16px;
  font-size: 20px;
}

.filter {
  width: 100%;
  min-height: 42px;
  margin-bottom: 8px;
  padding: 0 12px;
  text-align: left;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
}

.filter[hidden] {
  display: none;
}

.filter.active,
.filter:hover {
  background: var(--soft);
  border-color: var(--line);
}

.product-card.is-hidden {
  display: none;
}

.filter-note {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.filter-note strong {
  color: var(--ink);
}

.products {
  min-width: 0;
}

.products-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.products-head h2 {
  margin: 0;
  font-size: 30px;
}

.count {
  color: var(--muted);
  font-size: 14px;
}

.search-empty {
  margin: 0 0 18px;
  padding: 14px 16px;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(210px, 1fr));
  gap: 18px;
}

.product-card,
.empty-card {
  min-width: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.card-button {
  width: 100%;
  padding: 0;
  text-align: left;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.card-image {
  position: relative;
  aspect-ratio: 4 / 5;
  background: #edf0ef;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 180ms ease;
}

.card-button:hover .card-image img {
  transform: scale(1.035);
}

.badge {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 6px 9px;
  color: #fff;
  background: var(--green);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 760;
}

.card-info {
  padding: 14px 14px 16px;
}

.category {
  display: block;
  margin-bottom: 7px;
  color: var(--green);
  font-size: 12px;
  font-weight: 780;
  text-transform: uppercase;
}

.card-info h3 {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.25;
}

.card-info p {
  min-height: 44px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.price-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.price-row span {
  color: var(--muted);
}

.price-row strong {
  color: var(--ink);
  font-weight: 780;
  text-align: right;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.meta span {
  padding: 6px 8px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
}

.card-sizes {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.empty-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 380px;
  padding: 24px;
  color: var(--muted);
}

.empty-card h3 {
  margin: 0 0 10px;
  color: var(--ink);
}

.contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 46px 32px;
  color: #fff;
  background: var(--accent-dark);
}

.contact div {
  max-width: 820px;
}

.contact h2 {
  margin: 0 0 10px;
  font-size: 34px;
}

.contact p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.6;
}

.contact a {
  background: #fff;
  color: var(--accent-dark);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
}

.modal.open {
  display: block;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(22, 25, 27, 0.62);
}

.modal-panel {
  position: absolute;
  inset: 32px;
  display: grid;
  grid-template-columns: minmax(380px, 1.1fr) minmax(360px, 0.9fr);
  gap: 28px;
  max-width: 1260px;
  margin: auto;
  padding: 24px;
  background: var(--paper);
  border-radius: 10px;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.close {
  position: absolute;
  right: 18px;
  top: 14px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--soft);
  cursor: pointer;
  font-size: 24px;
}

.detail-gallery {
  min-width: 0;
}

.detail-image-stack {
  display: grid;
  gap: 14px;
}

.detail-image-stack img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  background: #edf0ef;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.detail-image-stack + .main-photo,
.detail-image-stack ~ .thumbs {
  display: none;
}

.main-photo {
  display: grid;
  place-items: center;
  min-height: 580px;
  background: #edf0ef;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.main-photo img {
  width: 100%;
  max-height: 760px;
  object-fit: contain;
}

.thumbs {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.thumbs button {
  aspect-ratio: 1;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
  cursor: pointer;
}

.thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-info {
  padding: 18px 8px 8px;
}

.detail-info h2 {
  margin: 0 0 10px;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.05;
}

.style-no {
  margin: 0 0 18px;
  color: var(--muted);
  font-weight: 720;
}

.detail-copy {
  color: var(--muted);
  line-height: 1.65;
}

.detail-specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0;
}

.detail-specs div {
  padding: 14px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.detail-specs span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
}

.detail-specs strong {
  display: block;
  margin-top: 6px;
}

.product-info-block {
  margin: 0 0 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.info-lines {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
}

.info-lines div {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.info-lines div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.info-lines span,
.attribute-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
}

.info-lines strong,
.attribute-grid strong {
  font-size: 15px;
}

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

.attribute-grid div {
  padding: 12px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.attribute-grid strong {
  display: block;
  margin-top: 6px;
}

.available-sizes {
  margin: 0 0 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.available-sizes > span {
  display: block;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
}

.available-sizes div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.available-sizes strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 34px;
  padding: 0 10px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
}

.size-stock {
  margin: 0 0 22px;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 10px;
}

.section-title h3 {
  margin: 0;
  font-size: 18px;
}

.section-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.size-chart-image {
  margin: 0 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.size-translation {
  margin: 0 0 12px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
}

.size-translation strong {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
}

.size-translation p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.size-translation ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 13px;
}

.size-chart-image img {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  background: #fff;
}

.size-stock table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  background: #ffffff;
}

.size-stock th,
.size-stock td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.size-stock th {
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
  text-transform: uppercase;
}

.size-stock tr:last-child td {
  border-bottom: 0;
}

.size-stock th:last-child,
.size-stock td:last-child {
  display: none;
}

.table-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.order-box {
  padding: 20px;
  background: #f3f7f5;
  border: 1px solid #d4e3dc;
  border-radius: 8px;
}

.order-box h3 {
  margin: 0 0 12px;
}

.order-box ul {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.45;
}

@media (max-width: 1120px) {
  .grid {
    grid-template-columns: repeat(3, minmax(210px, 1fr));
  }
}

@media (max-width: 920px) {
  .topbar,
  .intro,
  .catalog-shell,
  .modal-panel {
    grid-template-columns: 1fr;
  }

  .topbar {
    gap: 12px;
    padding: 14px 20px;
  }

  .catalog-shell,
  .intro,
  .contact {
    padding-left: 20px;
    padding-right: 20px;
  }

  .search {
    width: 100%;
  }

  .search input {
    width: 100%;
  }

  .filters {
    position: static;
  }

  .grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .modal-panel {
    inset: 14px;
    max-height: calc(100dvh - 28px);
    overflow-x: hidden;
    overflow-y: auto;
  }

  .section-title {
    align-items: start;
    flex-direction: column;
  }

  .info-lines div,
  .attribute-grid {
    grid-template-columns: 1fr;
  }

  .main-photo {
    min-height: 420px;
  }
}

@media (max-width: 620px) {
  .intro-stats,
  .detail-specs,
  .grid {
    grid-template-columns: 1fr;
  }

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

  .thumbs {
    display: flex;
    grid-template-columns: none;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

  .thumbs button {
    flex: 0 0 72px;
  }

  .modal-panel {
    inset: 0;
    width: 100dvw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    padding: 14px;
    border-radius: 0;
    overflow-x: hidden;
    overflow-y: auto;
    touch-action: pan-y;
  }

  .detail-gallery,
  .detail-info,
  .size-stock,
  .product-info-block,
  .order-box {
    min-width: 0;
    max-width: 100%;
  }

  .main-photo {
    min-height: 0;
    aspect-ratio: 3 / 4;
  }

  .main-photo img {
    height: 100%;
    max-height: none;
  }

  .detail-info {
    padding: 14px 0 20px;
  }

  .detail-info h2 {
    font-size: 28px;
  }

  .table-wrap {
    max-width: 100%;
    touch-action: pan-x pan-y;
  }

  .size-stock table {
    min-width: 860px;
  }
}
