:root {
  --ink: #1d1a16;
  --muted: #70695f;
  --line: #e6ded0;
  --paper: #fbf8f1;
  --panel: #fffdf8;
  --moss: #31473a;
  --clay: #a6532d;
  --gold: #c8943f;
}

* { 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);
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 68px;
  padding: 0 28px;
  border-bottom: 1px solid rgba(29, 26, 22, .12);
  background: rgba(251, 248, 241, .9);
  backdrop-filter: blur(14px);
}

.brand, .nav, .hero-actions, .buy-row, .chips, .summary-line {
  display: flex;
  align-items: center;
}

.brand { gap: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--moss);
  box-shadow: 0 0 0 1px rgba(29, 26, 22, .08);
}
.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.top-search {
  display: grid;
  grid-template-columns: minmax(116px, 150px) minmax(260px, 1fr) 48px;
  flex: 1 1 680px;
  max-width: 760px;
  margin: 0 22px;
}
.top-search select, .top-search input {
  min-width: 0;
  border: 1px solid var(--line);
  background: white;
  padding: 10px 12px;
}
.top-search select {
  border-right: 0;
  border-radius: 6px 0 0 6px;
  background-color: #f4eee4;
  color: var(--muted);
  cursor: pointer;
  padding-right: 34px;
  background-position: right 12px center;
}
.top-search input {
  border-right: 0;
  border-radius: 0;
}
.top-search button {
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0 6px 6px 0;
  background: var(--moss);
  color: white;
  cursor: pointer;
}
.top-search svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
}

.nav { gap: 8px; color: var(--muted); font-size: 15px; white-space: nowrap; }
.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  gap: 8px;
  border-radius: 999px;
  padding: 7px 10px;
}
.nav a:hover { background: rgba(49, 71, 58, .08); color: var(--ink); }
.cart-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--moss);
  color: white;
  font-size: 12px;
  line-height: 1;
}

main { width: min(1180px, calc(100% - 36px)); margin: 0 auto; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
  gap: 40px;
  align-items: center;
  min-height: calc(100vh - 138px);
  padding: 48px 0 36px;
}

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

h1 {
  max-width: 760px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(44px, 7vw, 84px);
  line-height: .94;
  font-weight: 500;
}

.hero-copy {
  max-width: 580px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.55;
}

.hero-actions { gap: 12px; margin-top: 30px; }
.button, .search button, .buy-row button {
  border: 0;
  border-radius: 6px;
  background: var(--ink);
  color: white;
  padding: 12px 18px;
  font-weight: 800;
  cursor: pointer;
}
.button.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.button.full { width: 100%; margin-top: 18px; }
.button.center { display: block; text-align: center; }

.hero-art {
  position: relative;
  min-height: 520px;
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(140deg, rgba(49,71,58,.92), rgba(29,26,22,.78)),
    url("https://images.unsplash.com/photo-1519681393784-d120267933ba?auto=format&fit=crop&w=1200&q=80") center/cover;
  box-shadow: 0 30px 80px rgba(29, 26, 22, .22);
}
.hero-art span {
  position: absolute;
  border: 1px solid rgba(255,255,255,.5);
  transform: rotate(45deg);
}
.hero-art span:nth-child(1) { width: 180px; height: 180px; left: 70px; top: 70px; }
.hero-art span:nth-child(2) { width: 90px; height: 90px; right: 88px; bottom: 112px; }
.hero-art span:nth-child(3) { width: 260px; height: 260px; right: -80px; top: 170px; }

.filters {
  display: grid;
  gap: 18px;
  padding: 28px 0 20px;
  border-top: 1px solid var(--line);
}
.search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}
.search input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  padding: 13px 14px;
}
.chips { gap: 8px; flex-wrap: wrap; }
.chips a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  background: var(--panel);
}
.chips a.active { border-color: var(--ink); color: var(--ink); }
.chips span { color: var(--clay); }

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

.product {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}
.product-image { aspect-ratio: 4 / 3; background: #e9dfcf; }
.product-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.placeholder {
  display: grid;
  place-items: center;
  height: 100%;
  font-family: Georgia, serif;
  font-size: 84px;
  color: rgba(49,71,58,.45);
}
.product-body { display: grid; gap: 10px; padding: 18px; }
.product h2 { margin: 0; font-family: Georgia, serif; font-size: 25px; font-weight: 500; }
.product p { margin: 0; color: var(--muted); line-height: 1.5; }
.options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.options label, .coupon-label, .admin-login label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.options select, .coupon-row input, .admin-login input, .admin-panel input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  padding: 10px 11px;
}
.buy-row { justify-content: space-between; gap: 14px; margin-top: auto; }
.buy-row button { background: var(--moss); white-space: nowrap; }

.drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  justify-content: flex-end;
  background: rgba(29, 26, 22, .36);
}
.drawer.open { display: flex; }
.drawer-panel {
  width: min(420px, 100%);
  min-height: 100%;
  padding: 24px;
  background: var(--panel);
  box-shadow: -20px 0 60px rgba(29,26,22,.18);
}
.icon {
  float: right;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.cart-line {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.cart-line h3 { margin: 0 0 4px; font-size: 16px; }
.cart-line p { margin: 0; color: var(--muted); }
.qty { display: flex; gap: 8px; align-items: center; }
.qty button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: white;
  cursor: pointer;
}
.remove-line {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}
.remove-line:hover { background: rgba(29, 26, 22, .08); }

.message-page, .cart-page { padding: 80px 0; }
.message-page h1, .cart-page h1 { font-size: clamp(42px, 6vw, 72px); }
.cart-shell {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 34px;
  margin-top: 28px;
}
.summary {
  align-self: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 20px;
}
.summary p { color: var(--muted); line-height: 1.5; }
.summary-line { justify-content: space-between; margin-top: 18px; font-size: 18px; }
.coupon-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 10px;
}
.coupon-row button {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--muted);
  background: #f0eadf;
}

.footer {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 34px 18px 42px;
  color: rgba(112,105,95,.55);
  font-size: 12px;
}
.footer a:hover { color: var(--muted); }

.admin-page { padding: 80px 0; }
.admin-page h1 {
  max-width: 760px;
  font-size: clamp(44px, 5vw, 72px);
  line-height: .98;
}
.admin-head { display: flex; align-items: start; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.admin-head .button { flex: 0 0 auto; margin-top: 18px; }
.admin-login, .admin-panel {
  max-width: 520px;
  display: grid;
  gap: 14px;
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 20px;
}
.admin-grid {
  display: grid;
  grid-template-columns: minmax(340px, 460px) minmax(0, 1fr);
  gap: 20px;
  margin-top: 28px;
}
.admin-panel { max-width: none; margin: 0; align-content: start; }
.admin-panel h2 { margin: 0; font-family: Georgia, serif; font-weight: 500; }
.admin-panel p, .notice { color: var(--muted); line-height: 1.5; }
.product-editor { grid-row: span 3; }
.product-form, .admin-panel form {
  display: grid;
  gap: 14px;
}
.product-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.product-form input, .product-form textarea, .admin-panel input, .admin-panel textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  padding: 10px 11px;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.product-form textarea { resize: vertical; line-height: 1.5; }
.form-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.form-pair.compact {
  grid-template-columns: minmax(80px, 120px) repeat(2, minmax(0, 1fr));
  align-items: end;
}
.product-form .check {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  padding: 9px 10px;
}
.product-form .check input { width: auto; }
.admin-products { display: grid; gap: 10px; }
.admin-product {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 12px;
}
.admin-product strong, .admin-product small { display: block; }
.admin-product small { margin-top: 4px; color: var(--muted); }
.muted-product { opacity: .55; }
.admin-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-actions a, .admin-actions button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  padding: 7px 10px;
  cursor: pointer;
  font-weight: 700;
}
.admin-actions a:hover, .admin-actions button:hover { background: rgba(49, 71, 58, .08); }
.order-row {
  display: grid;
  grid-template-columns: 90px 110px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.order-row small { color: var(--muted); overflow-wrap: anywhere; }

@media (max-width: 860px) {
  .topbar { padding: 0 18px; }
  .hero, .cart-shell { grid-template-columns: 1fr; }
  .hero { min-height: auto; }
  .hero-art { min-height: 340px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-grid { grid-template-columns: 1fr; }
  .product-editor { grid-row: auto; }
}

@media (max-width: 560px) {
  main { width: min(100% - 24px, 1180px); }
  .topbar { flex-wrap: wrap; padding: 12px; gap: 10px; }
  .top-search { order: 3; flex-basis: 100%; max-width: none; margin: 0; grid-template-columns: minmax(92px, 118px) 1fr 44px; }
  .nav { gap: 12px; font-size: 14px; }
  .grid, .admin-grid { grid-template-columns: 1fr; }
  .search { grid-template-columns: 1fr; }
  .options { grid-template-columns: 1fr; }
  h1 { font-size: 44px; }
  .admin-page { padding: 46px 0; }
  .admin-page h1 { font-size: 42px; }
  .admin-head { display: grid; }
  .order-row { grid-template-columns: 1fr; gap: 4px; }
  .form-pair, .form-pair.compact, .admin-product { grid-template-columns: 1fr; }
  .admin-actions { justify-content: flex-start; }
}
