:root {
  --ink: #1f2525;
  --muted: #64706f;
  --paper: #fbfaf6;
  --surface: #ffffff;
  --line: #e5dfd6;
  --teal: #0f6f73;
  --ruby: #8f1d2c;
  --marigold: #d9971f;
  --sage: #91a58a;
  --charcoal: #27302f;
  --shadow: 0 18px 45px rgba(39, 48, 47, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
}

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

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

button {
  cursor: pointer;
}

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

[hidden] {
  display: none !important;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 12px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(229, 223, 214, 0.86);
  background: rgba(251, 250, 246, 0.94);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--ruby), var(--teal));
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1rem;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.primary-nav a {
  padding: 9px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
}

.primary-nav a:hover {
  color: var(--ink);
  background: #f0ece4;
}

.cart-nav span {
  display: inline-grid;
  min-width: 24px;
  min-height: 24px;
  margin-left: 5px;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--ruby);
  font-size: 0.78rem;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: var(--ink);
}

.hero {
  position: relative;
  min-height: clamp(500px, calc(100vh - 128px), 620px);
  display: grid;
  align-items: center;
  overflow: hidden;
  color: #fff;
  background: var(--charcoal);
}

.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(20, 21, 20, 0.78), rgba(20, 21, 20, 0.38) 46%, rgba(20, 21, 20, 0.16)),
    linear-gradient(0deg, rgba(31, 37, 37, 0.18), rgba(31, 37, 37, 0.18));
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100% - 36px));
  margin-left: clamp(18px, 6vw, 84px);
  padding: 68px 0 112px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--marigold);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  max-width: 9ch;
  font-size: clamp(3rem, 8vw, 6.8rem);
  line-height: 0.96;
}

.hero p:not(.eyebrow) {
  width: min(580px, 100%);
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(1rem, 2vw, 1.22rem);
}

.hero-actions,
.stock-actions,
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.hero-actions {
  margin-top: 30px;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 800;
}

.button.primary {
  color: #fff;
  background: var(--ruby);
}

.button.secondary {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}

.button.tertiary {
  color: var(--teal);
  background: #edf8f6;
  border-color: #cbe8e3;
}

.button.full {
  width: 100%;
}

.button:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.54;
}

.category-strip,
.shop-section,
.cart-section,
.stock-section {
  padding: clamp(44px, 7vw, 84px) clamp(18px, 4vw, 56px);
}

.section-heading {
  width: min(1160px, 100%);
  margin: 0 auto 24px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.05;
}

.section-heading.wide {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
}

.category-grid {
  display: grid;
  width: min(1160px, 100%);
  margin: 0 auto;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.category-card,
.product-card,
.catalog-summary,
.stock-form,
.stock-table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(39, 48, 47, 0.06);
}

.category-card {
  overflow: hidden;
}

.category-image-button {
  display: block;
  width: 100%;
  height: 220px;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: #eee7dd;
}

.category-image-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 240ms ease;
}

.category-image-button:hover img {
  transform: scale(1.04);
}

.category-card-body {
  padding: 18px;
}

.category-card-body > span,
.product-meta span,
.stock-table span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.category-card h3,
.product-card h3,
.stock-form h2,
.stock-form h3 {
  margin: 6px 0 8px;
  font-size: 1.35rem;
}

.category-card p,
.product-card p,
.site-footer p {
  margin: 0;
  color: var(--muted);
}

.mini-meta {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-top: 14px;
}

.mini-meta strong {
  color: var(--teal);
  font-size: 1.5rem;
}

.tag-list,
.filter-row,
.color-row,
.size-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-list {
  margin-top: 14px;
}

.tag-list span,
.size-row span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--charcoal);
  background: #f3efe7;
  font-size: 0.82rem;
  font-weight: 700;
}

.shop-section {
  background: #f4f0e8;
}

.toolbar {
  justify-content: flex-end;
}

.search-field,
.select-field,
.buy-panel label,
.order-form label,
.stock-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.search-field input,
.select-field select,
.buy-panel select,
.order-form input,
.order-form select,
.order-form textarea,
.stock-form input,
.stock-form select,
.stock-form textarea,
.stock-table input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--ink);
  background: var(--surface);
  outline: 0;
}

.search-field input {
  width: min(360px, 80vw);
}

.filters {
  width: min(1160px, 100%);
  margin: 0 auto 20px;
}

.filter-row {
  margin-top: 10px;
}

.filter-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--muted);
  background: var(--surface);
  font-weight: 800;
}

.filter-button.is-active {
  color: #fff;
  border-color: var(--teal);
  background: var(--teal);
}

.filter-row.compact .filter-button {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 0.9rem;
}

.catalog-layout {
  display: grid;
  width: min(1160px, 100%);
  margin: 0 auto;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.catalog-summary {
  position: sticky;
  top: 94px;
  padding: 18px;
}

.catalog-summary strong,
.catalog-summary span {
  display: block;
}

.catalog-summary > div:first-child strong {
  font-size: 1.4rem;
}

.catalog-summary span {
  color: var(--muted);
}

.summary-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.summary-line span,
.summary-line strong {
  display: inline;
}

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

.product-card {
  overflow: hidden;
}

.product-art {
  position: relative;
  display: grid;
  min-height: 180px;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 22% 18%, rgba(217, 151, 31, 0.24), transparent 28%),
    linear-gradient(135deg, #f9eee1, #dbe9e4 55%, #f7e0e1);
}

.product-art.large {
  min-height: 330px;
  border-radius: var(--radius);
}

.product-photo {
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
}

.product-art span {
  position: relative;
  z-index: 1;
  display: grid;
  width: 86px;
  height: 86px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 50%;
  color: var(--charcoal);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow);
  font-size: 1.7rem;
  font-weight: 900;
}

.fabric-ribbon {
  position: absolute;
  right: 18px;
  bottom: -28px;
  width: 72px;
  height: 156px;
  transform: rotate(34deg);
  border-radius: 999px;
  opacity: 0.86;
}

.product-card-body {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}

.product-card h3 {
  margin: 0;
}

.swatch {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px 4px 5px;
  background: #fff;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.swatch span {
  width: 20px;
  height: 20px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 50%;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}

.product-footer strong {
  font-size: 1.3rem;
}

.buy-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.product-actions,
.dialog-actions,
.order-actions,
.checkout-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stock-pill {
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 0.78rem;
  font-weight: 900;
}

.stock-pill.ok {
  color: #0e5d47;
  background: #dff3ea;
}

.stock-pill.low {
  color: #7a4d00;
  background: #fff1c7;
}

.stock-pill.out {
  color: #7c2531;
  background: #fae1e5;
}

.empty-state {
  grid-column: 1 / -1;
  min-height: 180px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
  font-weight: 800;
}

.cart-section {
  background: var(--paper);
}

.cart-layout {
  display: grid;
  width: min(1160px, 100%);
  margin: 0 auto;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 390px);
  gap: 18px;
  align-items: start;
}

.cart-panel,
.order-form,
.order-confirmation {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(39, 48, 47, 0.06);
}

.order-form {
  display: grid;
  gap: 14px;
  position: sticky;
  top: 94px;
}

.order-form h3 {
  margin: 0;
  font-size: 1.35rem;
}

.cart-item {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 96px 118px 42px;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.cart-item:first-child {
  padding-top: 0;
}

.cart-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.cart-item h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.cart-item p,
.cart-options,
.cart-line-total span,
.order-note,
.empty-cart span {
  color: var(--muted);
}

.cart-thumb {
  position: relative;
  display: grid;
  width: 86px;
  height: 86px;
  place-items: center;
  overflow: hidden;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 22% 18%, rgba(217, 151, 31, 0.24), transparent 28%),
    linear-gradient(135deg, #f9eee1, #dbe9e4 55%, #f7e0e1);
}

.cart-thumb .product-photo {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.cart-thumb > span {
  position: relative;
  z-index: 1;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 50%;
  color: var(--charcoal);
  background: rgba(255, 255, 255, 0.72);
  font-weight: 900;
}

.cart-thumb .fabric-ribbon {
  right: 6px;
  bottom: -38px;
  width: 34px;
  height: 108px;
}

.cart-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 0.9rem;
}

.cart-quantity label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.cart-quantity input {
  width: 84px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
}

.cart-line-total {
  display: grid;
  justify-items: end;
}

.cart-line-total strong {
  font-size: 1.1rem;
}

.order-total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.order-total strong {
  color: var(--teal);
  font-size: 1.5rem;
}

.order-note {
  margin: 0;
  font-size: 0.9rem;
}

.empty-cart {
  display: grid;
  min-height: 220px;
  place-items: center;
  gap: 10px;
  text-align: center;
}

.order-confirmation {
  width: min(1160px, 100%);
  margin: 18px auto 0;
}

.order-confirmation h3 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.order-confirmation pre {
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #f4f0e8;
  white-space: pre-wrap;
}

.status-page {
  min-height: calc(100vh - 72px);
  display: grid;
  place-items: center;
  padding: clamp(32px, 6vw, 72px) 18px;
  background: #f4f0e8;
}

.status-panel {
  width: min(760px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(22px, 5vw, 42px);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.status-panel h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1.04;
}

.status-panel p {
  margin: 16px 0 22px;
  color: var(--muted);
}

.status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.confirmation-summary {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.order-number-panel {
  display: grid;
  gap: 8px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.order-number-panel span,
.confirmation-details dt,
.confirmation-item span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.order-number-panel strong {
  color: var(--teal);
  font-size: clamp(1.8rem, 5vw, 3rem);
  line-height: 1.05;
}

.order-number-panel p {
  margin: 0;
}

.confirmation-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.confirmation-details div {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.confirmation-details dt,
.confirmation-details dd {
  margin: 0;
}

.confirmation-details dd {
  margin-top: 3px;
  font-weight: 800;
}

.confirmation-items h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.confirmation-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.confirmation-item h3,
.confirmation-item p {
  margin: 0;
}

.confirmation-item p,
.confirmation-note {
  color: var(--muted);
}

.confirmation-item > div:last-child {
  display: grid;
  justify-items: end;
  gap: 2px;
}

.loading-line {
  width: 100%;
  height: 18px;
  border-radius: 999px;
  background: #f0ece4;
}

.loading-line.short {
  width: 58%;
}

.stock-section {
  background: var(--paper);
}

.admin-shell {
  min-height: calc(100vh - 72px);
  background: #f4f0e8;
}

.login-panel {
  width: min(440px, calc(100% - 28px));
  margin: clamp(54px, 10vw, 110px) auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-panel h1,
.admin-stock h1,
.stock-form h2 {
  margin: 0;
}

.login-panel h1,
.admin-stock h1 {
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1.05;
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.login-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.login-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--ink);
  background: var(--surface);
  outline: 0;
}

.login-message {
  min-height: 20px;
  margin: 0;
  color: var(--ruby);
  font-weight: 800;
}

.admin-summary {
  display: grid;
  width: min(1160px, 100%);
  margin: 0 auto 18px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.summary-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(39, 48, 47, 0.06);
}

.summary-card span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.summary-card strong {
  display: block;
  margin-top: 4px;
  color: var(--teal);
  font-size: 1.8rem;
}

.stock-layout {
  display: grid;
  width: min(1160px, 100%);
  margin: 0 auto;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.stock-form {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.stock-form h3 {
  margin: 0;
}

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

.stock-table-wrap {
  overflow: auto;
}

.stock-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

.stock-table th,
.stock-table td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.stock-table th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.stock-table td > strong,
.stock-table td > span {
  display: block;
}

.stock-input {
  max-width: 92px;
}

.color-input {
  min-width: 260px;
}

.photo-control {
  display: grid;
  width: 112px;
  gap: 8px;
}

.stock-thumb,
.photo-placeholder {
  width: 86px;
  height: 86px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f3efe7;
}

.stock-thumb {
  object-fit: cover;
}

.photo-placeholder {
  display: grid;
  place-items: center;
  padding: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-align: center;
}

.file-button,
.mini-button {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 10px;
  color: var(--ink);
  background: var(--surface);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: none;
}

.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-weight: 900;
}

.icon-button.danger {
  color: var(--ruby);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px clamp(18px, 4vw, 56px);
  color: #fff;
  background: var(--charcoal);
}

.site-footer p {
  color: rgba(255, 255, 255, 0.72);
}

.site-footer a {
  font-weight: 800;
}

.product-dialog {
  width: min(860px, calc(100% - 28px));
  border: 0;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.product-dialog::backdrop {
  background: rgba(31, 37, 37, 0.62);
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  font-weight: 900;
}

.dialog-product {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.dialog-product h2 {
  margin: 0 0 8px;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.05;
}

.dialog-product h3 {
  margin: 20px 0 10px;
}

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

.detail-list div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
}

.detail-list dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-list dd {
  margin: 3px 0 0;
  font-weight: 800;
}

@media (max-width: 1080px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .primary-nav {
    position: absolute;
    top: calc(100% + 1px);
    right: 18px;
    display: none;
    width: min(260px, calc(100vw - 36px));
    flex-direction: column;
    align-items: stretch;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .primary-nav.is-open {
    display: flex;
  }

  .menu-toggle {
    display: block;
  }

  .section-heading.wide,
  .site-footer {
    align-items: start;
    flex-direction: column;
  }

  .category-grid,
  .catalog-layout,
  .cart-layout,
  .stock-layout,
  .dialog-product,
  .admin-summary {
    grid-template-columns: 1fr;
  }

  .catalog-summary {
    position: static;
  }

  .order-form {
    position: static;
  }

  .cart-item {
    grid-template-columns: 72px minmax(0, 1fr) 82px;
  }

  .cart-thumb {
    width: 72px;
    height: 72px;
  }

  .cart-quantity,
  .cart-line-total,
  .cart-item .icon-button {
    grid-column: 2 / -1;
  }

  .cart-line-total {
    justify-items: start;
  }

  .dialog-product .product-art.large {
    min-height: 240px;
  }
}

@media (max-width: 640px) {
  .site-header {
    min-height: 66px;
    padding-inline: 14px;
  }

  .brand small {
    display: none;
  }

  .hero {
    min-height: clamp(460px, calc(100vh - 118px), 560px);
  }

  .hero-overlay {
    background: linear-gradient(0deg, rgba(20, 21, 20, 0.8), rgba(20, 21, 20, 0.38));
  }

  .hero-content {
    width: calc(100% - 28px);
    margin: 0 auto;
    padding-bottom: 70px;
    align-self: end;
  }

  .hero h1 {
    max-width: 8ch;
  }

  .product-grid,
  .buy-panel,
  .form-grid,
  .detail-list,
  .confirmation-details {
    grid-template-columns: 1fr;
  }

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

  .confirmation-item > div:last-child {
    justify-items: start;
  }

  .toolbar,
  .search-field,
  .select-field,
  .search-field input,
  .select-field select,
  .stock-actions,
  .hero-actions .button {
    width: 100%;
  }

  .category-strip,
  .shop-section,
  .cart-section,
  .stock-section {
    padding-inline: 14px;
  }
}
