:root {
  --ink: #172126;
  --muted: #657179;
  --paper: #f7f4ed;
  --surface: #ffffff;
  --line: #ded6c9;
  --blue: #173d4f;
  --brass: #a67a32;
  --green: #3d6a57;
  --danger: #9b3d35;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
}
body.no-scroll { overflow: hidden; }

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 16px clamp(18px, 4vw, 56px);
  background: rgba(247, 244, 237, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.brand {
  color: var(--blue);
  font-weight: 800;
  font-size: 22px;
  text-decoration: none;
}
nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
nav a {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  line-height: 1;
}
nav span:not(.topbar-contact) {
  display: inline-grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  margin-left: 4px;
  border-radius: 999px;
  background: var(--brass);
  color: white;
  font-size: 13px;
}
.topbar-contact {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding-left: 6px;
  color: var(--muted);
  font-size: 14px;
}
.topbar-contact a {
  color: var(--muted);
  font-weight: 700;
}

.hero {
  min-height: 430px;
  display: grid;
  align-items: end;
  padding: 72px clamp(18px, 5vw, 72px);
  color: white;
  background:
    linear-gradient(90deg, rgba(13, 30, 37, .86), rgba(13, 30, 37, .38)),
    url("https://images.unsplash.com/photo-1507525428034-b723cf961d3e?auto=format&fit=crop&w=1800&q=80");
  background-size: cover;
  background-position: center;
}
.hero > div { max-width: 720px; }
.hero h1 {
  margin: 8px 0 18px;
  font-size: clamp(42px, 8vw, 84px);
  line-height: .94;
  letter-spacing: 0;
}
.hero p { max-width: 620px; font-size: 20px; line-height: 1.5; }
.hero-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  align-items: center;
  font-size: 18px;
  font-weight: 800;
}
.hero-contact span {
  color: #f4ead7;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .28);
}
.eyebrow {
  margin: 0 0 8px;
  color: var(--brass);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.hero .eyebrow { color: #dfbd77; }

.section {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 54px clamp(18px, 5vw, 72px);
}
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 24px;
}
.catalog-head {
  align-items: flex-start;
  flex-direction: column;
}
h2, h3 { margin: 0; }
h2 { font-size: clamp(28px, 4vw, 44px); }
h3 { font-size: 22px; margin-bottom: 16px; }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-start; }
.tabs button, .ghost {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 6px;
  padding: 10px 14px;
  font-weight: 700;
}
.tabs button.active { background: var(--blue); color: white; border-color: var(--blue); }
.ghost.danger {
  border-color: rgba(155, 61, 53, .35);
  color: var(--danger);
}
.ghost.danger:hover {
  border-color: var(--danger);
  background: #fff1ee;
}
.catalog-layout {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.catalog-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .62);
}
.catalog-controls label {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.catalog-controls select,
.catalog-controls input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  background: #fffdfa;
}
.catalog-controls .ghost { min-height: 42px; }
.range-filter,
.size-filter {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.range-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.range-fields label {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 6px;
}
.range-sliders {
  position: relative;
  height: 34px;
  border-radius: 999px;
  background:
    linear-gradient(
      90deg,
      var(--line) 0,
      var(--line) var(--range-left, 0%),
      var(--blue) var(--range-left, 0%),
      var(--blue) var(--range-right, 100%),
      var(--line) var(--range-right, 100%),
      var(--line) 100%
    );
}
.catalog-controls input[type="range"] {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 34px;
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: none;
  appearance: none;
}
.catalog-controls input[type="range"]::-webkit-slider-thumb {
  width: 20px;
  height: 20px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .24);
  pointer-events: auto;
  appearance: none;
}
.catalog-controls input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .24);
  pointer-events: auto;
}
.check-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.check-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
}
.check-option input {
  width: auto;
  min-height: auto;
  padding: 0;
}
.catalog-summary {
  margin: 0 0 14px;
  color: var(--muted);
  font-weight: 700;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}
.product-card, .panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.product-card { overflow: hidden; display: flex; flex-direction: column; }
.product-image-button {
  width: 100%;
  padding: 0;
  border: 0;
  background: #eee5d6;
}
.product-image-button:hover img { transform: scale(1.03); }
.product-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #eee5d6;
  transition: transform .18s ease;
}
.product-body { padding: 16px; display: grid; gap: 10px; flex: 1; }
.product-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 14px; }
.product-specs {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.product-specs div { display: flex; justify-content: space-between; gap: 12px; }
.product-specs dt { color: var(--muted); font-size: 13px; font-weight: 800; }
.product-specs dd { margin: 0; text-align: right; font-weight: 800; }
.price { color: var(--blue); font-size: 22px; font-weight: 800; }
.product-actions { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: auto; }
.product-cart-note {
  grid-column: 1 / -1;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}
.quantity-control {
  display: grid;
  grid-template-columns: 34px minmax(44px, 1fr) 34px;
  align-items: stretch;
}
.quantity-control button,
.quantity-control input {
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line);
  background: #fffdfa;
}
.quantity-control button {
  padding: 0;
  color: var(--blue);
  font-size: 20px;
  font-weight: 900;
}
.quantity-control button:first-child {
  border-radius: 6px 0 0 6px;
}
.quantity-control button:last-child {
  border-radius: 0 6px 6px 0;
}
.quantity-control input {
  width: 100%;
  border-left: 0;
  border-right: 0;
  border-radius: 0;
  padding: 9px 4px;
  text-align: center;
}
.product-actions > input, label input, label select, label textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  background: #fffdfa;
}
.primary {
  border: 0;
  border-radius: 6px;
  padding: 12px 16px;
  background: var(--blue);
  color: white;
  font-weight: 800;
}
.primary:hover { background: #0e2d3b; }
.ghost:hover { border-color: var(--blue); }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: start;
}
.cart-section {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 380px);
  gap: 20px;
}
.cart-section > div { min-width: 0; }
.checkout-panel {
  position: sticky;
  top: 92px;
  border-color: #d6c8b7;
  box-shadow: 0 10px 30px rgba(23, 33, 38, .06);
}
.checkout-panel h3 {
  margin-bottom: 18px;
  font-size: 20px;
}
.checkout-panel .primary {
  width: 100%;
  min-height: 46px;
}
.panel { padding: 20px; }
label { display: grid; gap: 7px; color: var(--muted); font-weight: 700; margin-bottom: 14px; }
.cart-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}
.cart-row, .admin-item, .order-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 14px;
}
.cart-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 124px auto auto;
  gap: 14px;
  align-items: center;
  min-height: 62px;
}
.cart-row strong {
  min-width: 0;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.cart-quantity-control { width: 124px; }
.cart-row .line-total {
  justify-self: end;
  white-space: nowrap;
  font-weight: 700;
}
.link-button {
  border: 0;
  background: transparent;
  color: var(--danger);
  font-weight: 800;
}
.total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 18px;
}
.total strong {
  color: var(--blue);
  font-size: 22px;
}
.message { min-height: 22px; color: var(--green); font-weight: 700; }
.message.error { color: var(--danger); }
.login-approval-choice {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.login-approval-choice button:disabled {
  cursor: default;
  opacity: .62;
}
.captcha-question {
  display: inline-block;
  margin: 6px 0;
  color: var(--blue);
  font-weight: 800;
}
.hidden { display: none !important; }
.hint { color: var(--muted); font-size: 14px; }
.admin-page-tabs {
  display: flex;
  gap: 8px;
  margin: -8px 0 22px;
}
.admin-page-tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
}
.admin-page-tabs a.active {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(300px, 430px) 1fr;
  gap: 24px;
  align-items: start;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}
.panel-head h3 { margin-bottom: 4px; }
.admin-product-tools {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 170px;
  gap: 12px;
  margin-bottom: 14px;
}
.admin-order-tools {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 1.2fr) minmax(170px, 220px) minmax(140px, 170px);
  gap: 12px;
  margin-bottom: 16px;
}
.status-filter {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.status-filter legend {
  margin-bottom: 6px;
  font-weight: 800;
}
.status-filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 42px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffdfa;
}
.status-check {
  gap: 6px;
  min-height: 26px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #efe5d3;
  font-size: 13px;
  font-weight: 800;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check {
  display: flex;
  align-items: center;
  color: var(--ink);
}
.check input { width: auto; }
.legal-check {
  align-items: flex-start;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.legal-check a {
  color: var(--blue);
  font-weight: 800;
}
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.image-editor {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
}
.image-editor.hidden { display: none; }
.image-editor-stage {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eee5d6;
  cursor: grab;
  touch-action: none;
}
.image-editor-stage.is-dragging { cursor: grabbing; }
.image-editor-stage img {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: none;
  max-height: none;
  user-select: none;
  pointer-events: none;
  transform-origin: center;
}
.image-editor-controls,
.image-editor-controls label {
  display: grid;
  gap: 8px;
}
.image-editor-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.admin-list, .orders { display: grid; gap: 12px; }
.admin-item {
  display: grid;
  grid-template-columns: 82px 1fr auto;
  gap: 14px;
  align-items: center;
}
.admin-item img { width: 82px; height: 70px; object-fit: cover; border-radius: 6px; background: #eee5d6; }
.admin-item-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: #efe5d3;
  color: var(--blue);
  font-weight: 800;
  font-size: 12px;
}
.orders-panel { margin-bottom: 24px; }
.order-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.order-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.order-card ul { margin: 8px 0 12px; padding-left: 20px; }
.order-controls {
  display: grid;
  grid-template-columns: 220px 1fr auto;
  gap: 10px;
  align-items: end;
}
.order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 21, 27, .82);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}
.image-viewer figure {
  position: relative;
  width: min(92vw, 920px);
  margin: 0;
  padding: 18px;
  border-radius: 8px;
  background: var(--surface);
  transform: translateY(10px) scale(.98);
  transition: transform .22s ease;
}
.image-viewer.is-open {
  opacity: 1;
  pointer-events: auto;
}
.image-viewer.is-open figure {
  transform: translateY(0) scale(1);
}
.image-viewer img {
  display: block;
  width: 100%;
  max-height: 76vh;
  object-fit: contain;
  background: #eee5d6;
  border-radius: 6px;
}
.image-viewer figcaption {
  margin-top: 12px;
  color: var(--ink);
  font-weight: 800;
}
.viewer-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 28px;
  line-height: 1;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 18px;
  padding: 24px clamp(18px, 5vw, 72px) 34px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}
.site-footer a {
  color: var(--blue);
  text-decoration: none;
}
.legal-page {
  max-width: 920px;
}
.legal-page h1 {
  margin: 0 0 18px;
  color: var(--blue);
  font-size: clamp(32px, 5vw, 54px);
  letter-spacing: 0;
}
.legal-page h2 {
  margin-top: 30px;
  font-size: 24px;
}
.legal-page p,
.legal-page li {
  line-height: 1.62;
}
.legal-page ul {
  padding-left: 22px;
}

@media (max-width: 900px) {
  .section-head, .topbar { align-items: flex-start; flex-direction: column; }
  nav { align-items: flex-start; }
  .topbar-contact { align-items: flex-start; flex-direction: column; padding-left: 0; }
  .tabs { justify-content: flex-start; }
  .catalog-layout { grid-template-columns: 1fr; }
  .catalog-controls { position: static; }
  .split, .cart-section, .admin-grid { grid-template-columns: 1fr; }
  .checkout-panel { position: static; }
  .admin-product-tools { grid-template-columns: 1fr; }
  .admin-order-tools { grid-template-columns: 1fr 1fr; }
  .cart-row { grid-template-columns: 1fr 124px; }
  .cart-row .line-total, .cart-row .link-button { justify-self: start; }
  .order-controls { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  nav { gap: 12px; }
  .admin-page-tabs, .admin-order-tools { grid-template-columns: 1fr; }
  .admin-page-tabs { flex-direction: column; }
  .cart-row { grid-template-columns: 1fr 124px; }
  .cart-row .line-total, .cart-row .link-button { justify-self: start; }
}
