/* Truecraft — design tokens */
:root {
  --bg: #f7f6f3;
  --surface: #ffffff;
  --ink: #1a1917;
  --muted: #6e6a62;
  --line: #e6e2d9;
  --teal: #0f6b63;
  --teal-dark: #0b514b;
  --teal-pale: #e7f2f0;
  --sand: #e8dcc8;
  --sand-pale: #f6efe2;
  --danger: #a4342b;
  --radius: 16px;
  --max: 1120px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

/* --------------------------------- header -------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(247, 246, 243, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header .bar {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 64px;
}

.brand {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand .mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  overflow-x: auto;
}

.nav-links a {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
}

.nav-links a:hover { background: #efeee9; color: var(--ink); }
.nav-links a.active { background: var(--teal-pale); color: var(--teal-dark); font-weight: 600; }

.cart-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.cart-link .count {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 0 7px;
  font-size: 12px;
  min-width: 20px;
  text-align: center;
}

/* --------------------------------- layout -------------------------------- */

.page { padding: 28px 0 64px; }

h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
h1 { font-size: 30px; line-height: 1.2; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 36px 0 14px;
}

.section-head p { margin: 0; color: var(--muted); font-size: 13px; }
.link { color: var(--teal); font-weight: 600; font-size: 14px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}

.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.stack { display: grid; gap: 12px; }
.row { display: flex; align-items: center; gap: 12px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tabular { font-variant-numeric: tabular-nums; }

/* --------------------------------- buttons ------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--teal);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn:hover { background: var(--teal-dark); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn.outline {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.btn.outline:hover { background: #efeee9; }
.btn.block { width: 100%; }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 13px; }

/* ---------------------------------- home --------------------------------- */

.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 0;
  overflow: hidden;
  border-radius: 20px;
  background: var(--teal);
  color: #fff;
  margin-top: 22px;
}

.hero-copy { padding: 40px 36px; }
.hero h1 { font-size: 34px; max-width: 15ch; }
.hero p { color: #cfe6e3; margin: 12px 0 22px; max-width: 34ch; }
.hero .btn {
  background: #fff;
  color: var(--teal-dark);
}
.hero .btn:hover { background: #f1efea; }

.hero-art {
  background: linear-gradient(150deg, #0d5c55, #14776d);
  display: grid;
  place-items: center;
  font-size: 84px;
  opacity: 0.95;
  min-height: 220px;
}

.search-row {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

.search-row input {
  flex: 1;
  min-width: 0;
  height: 46px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.chips {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.chip {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}

.chip.is-active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
  font-weight: 600;
}

/* -------------------------------- products ------------------------------- */

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

.product-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.product-card:hover { border-color: #c9c2b3; transform: translateY(-2px); }

.product-card .thumb {
  aspect-ratio: 1 / 1;
  background: var(--sand-pale);
  object-fit: cover;
  width: 100%;
}

.product-card .body { padding: 14px 16px 16px; display: grid; gap: 6px; }
.product-card .shop { font-size: 12px; color: var(--muted); }
.product-card .title { font-size: 15px; font-weight: 600; line-height: 1.35; }
.product-card .price { font-weight: 700; font-variant-numeric: tabular-nums; }
.product-card .price small { font-weight: 500; font-size: 12px; color: var(--muted); margin-left: 6px; }

/* --------------------------------- detail -------------------------------- */

.detail {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 32px;
  margin-top: 24px;
}

.detail-image {
  aspect-ratio: 1 / 1;
  width: 100%;
  object-fit: cover;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--sand-pale);
}

.detail h1 { font-size: 28px; margin-bottom: 8px; }
.price-lg {
  font-size: 26px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin: 14px 0 6px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--sand-pale);
  color: #6b5636;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
}

.trust {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.trust span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--muted);
}

.qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  height: 44px;
}

.qty button {
  width: 42px;
  height: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 17px;
}

.qty span { min-width: 34px; text-align: center; font-variant-numeric: tabular-nums; }

.buy-row { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.buy-row .btn { flex: 1; min-width: 150px; }

/* -------------------------------- checkout ------------------------------- */

.checkout-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 24px;
  align-items: start;
  margin-top: 22px;
}

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; }
.field input,
.field textarea,
.field select {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--surface);
  width: 100%;
}
.field textarea { min-height: 84px; resize: vertical; }

.option-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.option-row:last-child { border-bottom: 0; }
.option-row input { margin-top: 3px; accent-color: var(--teal); }
.option-row .txt { flex: 1; min-width: 0; }
.option-row .name { font-weight: 600; font-size: 14px; }
.option-row .note { font-size: 12px; color: var(--muted); }

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  font-size: 14px;
}
.summary-row.total {
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding-top: 12px;
  font-weight: 700;
  font-size: 16px;
}

.basket-line {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.basket-line:last-child { border-bottom: 0; }
.basket-line img {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--sand-pale);
}

/* --------------------------------- forms --------------------------------- */

.auth-wrap {
  max-width: 440px;
  margin: 40px auto;
}

.auth-wrap h1 { font-size: 26px; margin-bottom: 6px; }
.auth-card { margin-top: 20px; }

.alert {
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  margin-bottom: 14px;
  background: var(--sand-pale);
  color: #6b5636;
  border: 1px solid #e8dcc8;
}
.alert.error { background: #fbeeec; color: var(--danger); border-color: #f0d6d2; }
.alert.ok { background: var(--teal-pale); color: var(--teal-dark); border-color: #cfe6e3; }

/* ------------------------------ confirmation ----------------------------- */

.confirm { max-width: 640px; margin: 30px auto; text-align: center; }
.tick {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: var(--teal-pale);
  color: var(--teal);
  display: grid;
  place-items: center;
  font-size: 30px;
  margin: 0 auto 18px;
}

.tracker { display: grid; gap: 0; text-align: left; margin-top: 8px; }
.tracker .step {
  display: flex;
  gap: 14px;
  padding: 10px 0;
  position: relative;
}
.tracker .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--surface);
  margin-top: 4px;
  flex: none;
}
.tracker .step.done .dot { background: var(--teal); border-color: var(--teal); }

/* -------------------------------- dashboard ------------------------------ */

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.metric { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.metric .label { font-size: 12px; color: var(--muted); }
.metric .value { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 4px; }

.panel-teal {
  background: var(--teal);
  color: #fff;
  border-radius: var(--radius);
  padding: 22px;
}
.panel-teal .label { font-size: 13px; color: #cfe6e3; }
.panel-teal .big { font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; }
.panel-teal .delta { font-size: 13px; color: #bfe0dc; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.table th { font-size: 12px; color: var(--muted); font-weight: 600; }
.table td.num { text-align: right; font-variant-numeric: tabular-nums; }

.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
}

/* --------------------------------- footer -------------------------------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 26px 0 40px;
  color: var(--muted);
  font-size: 13px;
}

.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; }

/* -------------------------------- responsive ----------------------------- */

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art { min-height: 140px; font-size: 64px; }
  .detail { grid-template-columns: 1fr; gap: 20px; }
  .checkout-grid { grid-template-columns: 1fr; }
  .site-header .bar { height: auto; padding: 10px 0; flex-wrap: wrap; }
  .nav-links { margin-left: 0; width: 100%; }
  h1 { font-size: 25px; }
  .hero h1 { font-size: 27px; }
}

@media (max-width: 480px) {
  .grid-products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .product-card .body { padding: 12px; }
  .wrap { padding: 0 16px; }
}
