:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --ink: #1c1a17;
  --muted: #7b746d;
  --line: #e8e3dd;
  --accent: #c66a05;
  --accent-dark: #9e5100;
  --green: #188c38;
  --danger: #d51e1e;
  --shadow: 0 12px 35px rgba(32, 25, 17, 0.08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  padding-bottom: 76px;
  color: var(--ink);
  background: var(--bg);
  font-family: Tahoma, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

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

.topbar {
  height: 34px;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.social {
  display: flex;
  direction: ltr;
  gap: 26px;
  font-weight: 700;
}

.social a {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

.social img {
  width: 20px;
  height: 20px;
  display: block;
}

.drawer-social {
  margin-top: 42px;
  color: var(--ink);
}

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 70px;
  display: grid;
  grid-template-columns: 48px 1fr 78px;
  align-items: center;
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 9px;
  direction: ltr;
  text-align: left;
}

.brand-mark {
  color: var(--accent);
  font-size: 30px;
  line-height: 1;
}

.brand strong {
  display: block;
  font-family: Georgia, serif;
  font-size: 15px;
  letter-spacing: 0;
}

.brand small {
  display: block;
  color: var(--accent);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.nav-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.icon-btn, .bag, .link-btn {
  min-width: 38px;
  height: 38px;
  border: 0;
  background: transparent;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.bag {
  position: relative;
  font-size: 24px;
  border: 1px solid transparent;
}

.bag img,
.cart-mini img,
.nav-cart-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
}

.bag span {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
}

.search-btn {
  min-width: 58px;
  height: 58px;
  border-radius: 8px;
  font-size: 52px;
  font-weight: 800;
  line-height: 1;
}

.hero {
  position: relative;
  min-height: min(72vh, 620px);
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #ded8cf;
}

.hero-media {
  position: absolute;
  inset: 0;
  opacity: 0.86;
  filter: saturate(0.95);
}

.hero-copy {
  position: relative;
  z-index: 1;
  color: #fff;
  text-align: center;
  text-shadow: 0 2px 16px rgba(0,0,0,.35);
}

.hero-copy p { margin: 0 0 8px; font-weight: 700; }
.hero-copy h1 { margin: 0 0 22px; font-size: clamp(44px, 10vw, 84px); line-height: 1; }

.shop-hero {
  position: relative;
  height: 170px;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: #fff;
  background: #cfc8bd;
  text-align: center;
}

.shop-hero .product-shot {
  position: absolute;
  inset: 0;
  opacity: .7;
}

.shop-hero h1, .shop-hero p {
  position: relative;
  z-index: 1;
  margin: 0;
  text-shadow: 0 2px 16px rgba(0,0,0,.35);
}

.shop-hero h1 { font-size: 42px; line-height: 1; }

.section, .catalog-layout, .narrow {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.section { padding: 34px 0; }

.section-head, .panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

h1, h2, h3, p { letter-spacing: 0; }
h1, h2 { margin: 0; line-height: 1.25; }

.section-head a, .panel-head a, .crumb span { color: var(--muted); font-size: 13px; }

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

.card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 6px 18px rgba(37, 29, 20, 0.04);
}

.card > a { display: block; }

.product-shot {
  min-height: 190px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-color: #f2f0ed;
}

.image-hero { background-image: url("assets/hero-knife.jpg"); background-size: cover; }
.image-decorative { background-image: url("assets/decorative-dagger.jpg"); }
.image-collector { background-image: url("assets/collector-dagger.jpg"); }
.image-outdoor { background-image: url("assets/outdoor-knife.jpg"); }
.image-custom { background-image: url("assets/custom-knife.jpg"); }
.image-large { background-image: url("assets/product-large.jpg"); }

.card .product-shot { height: 178px; min-height: 178px; }

.badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 3px 8px;
  border-radius: 4px;
  color: #fff;
  background: var(--danger);
  font-size: 11px;
  font-weight: 700;
}

.wish {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.82);
  color: var(--ink);
  font-size: 22px;
}

.wish.active { color: var(--accent); }

.card-body { padding: 13px; }

.card h3 {
  margin: 0 0 5px;
  min-height: 42px;
  font-size: 14px;
  line-height: 1.45;
}

.category, .meta, .empty { color: var(--muted); font-size: 12px; }
.price { margin: 6px 0 10px; color: var(--accent); font-weight: 800; direction: ltr; text-align: right; }
.stock { margin-bottom: 10px; color: var(--green); font-size: 12px; font-weight: 700; }

.btn {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--accent);
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--accent);
  background: #fff;
  font-weight: 700;
}

.btn.primary {
  border-color: var(--accent);
  background: linear-gradient(90deg, var(--accent-dark), var(--accent));
  color: #fff;
}

.btn.ghost { background: transparent; }
.btn.full { width: 100%; }

.card-actions {
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 8px;
}

.cart-mini {
  padding: 0;
  font-size: 20px;
}

.cart-mini img {
  width: 21px;
  height: 21px;
}

.split-band {
  margin: 20px auto 44px;
  width: min(1120px, calc(100% - 32px));
  padding: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.split-band p { max-width: 680px; margin: 10px 0 0; color: var(--muted); }

.footer {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 36px;
  display: flex;
  gap: 20px;
  color: var(--muted);
}

.crumb {
  width: min(1120px, calc(100% - 32px));
  margin: 18px auto 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 12px;
}

.toolbar {
  width: min(1120px, calc(100% - 32px));
  margin: 14px auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

select, input, textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}

textarea {
  min-height: 92px;
  padding-top: 10px;
  resize: vertical;
}

.catalog-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  align-items: start;
}

.filters, .panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.filters {
  position: sticky;
  top: 90px;
  padding: 18px;
}

.filters h2 { font-size: 18px; margin-bottom: 18px; }
.filters h3 { margin: 20px 0 10px; font-size: 13px; }
.check { display: flex; align-items: center; gap: 9px; margin: 9px 0; color: #4b4540; }
.check input { width: 18px; min-height: 18px; accent-color: var(--accent); }

.range-labels {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

input[type="range"] { accent-color: var(--accent); padding: 0; }

.drawer {
  position: fixed;
  z-index: 30;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(390px, 100%);
  padding: 22px;
  overflow-y: auto;
  transform: translateX(-105%);
  transition: transform .22s ease;
  background: #fff;
  box-shadow: 18px 0 42px rgba(0,0,0,.16);
}

.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.drawer nav a { display: flex; justify-content: space-between; padding: 15px 0; border-bottom: 1px solid var(--line); font-weight: 700; }

.drawer[data-search] {
  right: 0;
  left: auto;
  transform: translateX(105%);
  box-shadow: -18px 0 42px rgba(0,0,0,.16);
}

.drawer[data-search].open {
  transform: translateX(0);
}

.drawer[data-search] .product-grid {
  grid-template-columns: 1fr;
  gap: 12px;
}

.drawer[data-search] .card {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  align-items: stretch;
}

.drawer[data-search] .card > a {
  display: contents;
}

.drawer[data-search] .card .product-shot {
  width: 108px;
  height: 100%;
  min-height: 132px;
}

.drawer[data-search] .card .card-body {
  min-width: 0;
  padding: 12px 12px 10px;
}

.drawer[data-search] .card h3 {
  min-height: 0;
  font-size: 13px;
}

.drawer[data-search] .card .card-actions {
  grid-column: 1 / -1;
  grid-template-columns: 1fr 38px;
  padding-top: 0;
}

.drawer[data-search] .badge {
  right: auto;
  left: 10px;
}

.drawer[data-search] .wish {
  top: 8px;
  right: 8px;
  left: auto;
}
.search-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 22px; }
.search-tags button { border: 0; border-radius: 4px; padding: 8px 12px; background: #f2eee9; color: var(--ink); }

.narrow {
  max-width: 720px;
  padding: 28px 0;
}

.panel {
  padding: 22px;
}

.cart-row {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.cart-row .product-shot { min-height: 82px; height: 82px; border-radius: 5px; }
.cart-row h3 { margin: 0 0 4px; font-size: 14px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; direction: ltr; }
.qty button { width: 32px; height: 32px; border: 0; background: #fff; }
.qty span { min-width: 34px; text-align: center; }
.remove { border: 0; background: transparent; color: var(--muted); font-size: 20px; }

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

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.summary-row.total {
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 18px;
  font-weight: 800;
}

.checkout {
  display: grid;
  gap: 14px;
}

.checkout label {
  display: grid;
  gap: 7px;
  font-weight: 700;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

legend { padding: 0 6px; font-weight: 800; }

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 24px;
  color: var(--muted);
}

.steps span {
  min-height: 36px;
  border-bottom: 2px solid var(--line);
  text-align: center;
}

.steps .active {
  color: var(--ink);
  border-color: var(--accent);
  font-weight: 800;
}

.product-detail {
  width: min(1000px, calc(100% - 32px));
  margin: 28px auto;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 28px;
}

.product-gallery {
  position: relative;
  overflow: hidden;
  min-height: 460px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background-color: #fff;
}

.product-info {
  padding: 10px 0;
}

.product-info h1 { font-size: 30px; margin-bottom: 10px; }
.specs { display: grid; gap: 8px; margin: 18px 0; }
.specs div { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 8px; }

.account-card {
  display: grid;
  gap: 16px;
}

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

.metric {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf8;
}

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

.article-grid article {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.article-grid h2 { font-size: 18px; }
.article-grid p, .content-page p { color: var(--muted); }

.bottom-nav {
  position: fixed;
  z-index: 20;
  right: 0;
  bottom: 0;
  left: 0;
  height: 66px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(12px);
}

.bottom-nav a {
  display: grid;
  place-items: center;
  gap: 2px;
  color: #3f3933;
  font-size: 20px;
}

.bottom-nav .nav-cart-icon {
  width: 24px;
  height: 24px;
}

.bottom-nav span { font-size: 11px; }
.bottom-nav .active { color: var(--accent); font-weight: 800; }

.toast {
  position: fixed;
  z-index: 50;
  right: 18px;
  bottom: 86px;
  max-width: calc(100% - 36px);
  padding: 12px 16px;
  border-radius: 7px;
  background: #1d1b18;
  color: #fff;
  box-shadow: var(--shadow);
}

@media (max-width: 760px) {
  body { font-size: 13px; }
  .nav { grid-template-columns: 42px 1fr 88px; padding: 0 12px; }
  .brand strong { font-size: 13px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog-layout { display: block; }
  .filters {
    position: fixed;
    z-index: 25;
    inset: auto 0 66px 0;
    max-height: 74vh;
    overflow: auto;
    border-radius: 16px 16px 0 0;
    transform: translateY(110%);
    transition: transform .22s ease;
  }
  .filters.open { transform: translateY(0); }
  .split-band { display: block; padding: 20px 0; }
  .split-band .btn { margin-top: 18px; }
  .product-detail { display: block; margin-bottom: 88px; }
  .product-gallery { min-height: 360px; margin-bottom: 18px; }
  .article-grid, .account-grid { grid-template-columns: 1fr; }
  .card .product-shot { height: 154px; min-height: 154px; }
  .card h3 { font-size: 13px; }
  .card-body { padding: 10px; }
  .card-actions { grid-template-columns: 1fr 38px; }
  .btn { min-height: 38px; padding: 0 10px; }
}

@media (max-width: 420px) {
  .product-grid { gap: 9px; }
  .image-hero { background-size: cover; }
  .cart-row { grid-template-columns: 72px 1fr; }
  .cart-row .remove { grid-column: 2; justify-self: start; }
}
