:root {
  --green: #1a7a3c;
  --green-dark: #145f2e;
  --red: #ca2424;
  --ink: #1c1c1c;
  --muted: #7a7a7a;
  --line: #e6e6e6;
  --bg-soft: #f5f4f2;
  --radius: 16px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Raleway', sans-serif;
}

body {
  color: var(--ink);
  background: #fff;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

a {
  color: inherit;
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.site-header .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  gap: 20px;
}

.site-header .logo img {
  height: 42px;
  display: block;
  filter: brightness(0);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.main-nav a {
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: 0.2s;
  white-space: nowrap;
}

.main-nav a:hover {
  color: var(--green);
}

.main-nav a.active {
  color: var(--green);
  border-bottom-color: var(--green);
}

.main-nav .nav-inst {
  display: none;
}

.header-icons {
  display: flex;
  align-items: center;
  gap: 18px;
}

.header-icons a {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}

.header-icons .inst img {
  height: 32px;
  width: auto;
  max-width: 220px;
  display: block;
}

.burger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.burger span {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--ink);
  margin: 5px 0;
  transition: 0.3s;
}

/* ---------- Hero ---------- */
.hero {
  background: var(--bg-soft);
  padding: 56px 0;
  text-align: center;
}

.hero h1 {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.hero p {
  margin-top: 14px;
  font-size: 18px;
  color: var(--muted);
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Filters ---------- */
.filters {
  padding: 34px 0 6px;
}

.filters .filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.filter-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 11px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: 0.2s;
}

.filter-btn:hover {
  border-color: var(--green);
  color: var(--green);
}

.filter-btn.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

/* ---------- Toolbar (search / sort / availability) ---------- */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 16px;
  height: 44px;
  min-width: 260px;
  flex: 1;
  max-width: 360px;
  color: var(--muted);
}

.search-box input {
  border: none;
  outline: none;
  font-size: 15px;
  font-family: inherit;
  width: 100%;
  background: transparent;
  color: var(--ink);
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.avail-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.avail-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
  cursor: pointer;
}

.sort-select {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 18px;
  font-size: 15px;
  font-family: inherit;
  font-weight: 600;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.sort-select:focus {
  outline: none;
  border-color: var(--green);
}

.result-count {
  margin-top: 16px;
  font-size: 14px;
  color: var(--muted);
}

@media (max-width: 640px) {
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .search-box {
    max-width: none;
  }
  .toolbar-right {
    justify-content: space-between;
  }
  .sort-select {
    flex: 1;
  }
}

/* ---------- Catalog grid ---------- */
.catalog {
  padding: 30px 0 70px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px;
}

.card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: 0.25s;
}

.card:hover {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  transform: translateY(-3px);
}

.card .thumb {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--bg-soft);
}

.card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: 0.4s;
}

.card:hover .thumb img {
  transform: scale(1.04);
}

.card.is-sold .thumb img {
  filter: grayscale(0.7) brightness(0.96);
}

.badge {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  z-index: 2;
}

.badge.in_stock {
  background: var(--green);
}

.badge.sold {
  background: #6b6b6b;
}

.badge-sale {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: var(--red);
  z-index: 2;
}

.card .body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card .cat {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  font-weight: 700;
}

.card h3 {
  font-size: 20px;
  font-weight: 700;
  margin: 8px 0 10px;
}

.card-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 12px;
  font-size: 14px;
  color: #555;
}

.card-meta .meta-k {
  color: var(--muted);
  font-weight: 600;
}

.price {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: auto;
}

.price .now {
  font-size: 22px;
  font-weight: 800;
}

.price .old {
  font-size: 16px;
  color: var(--muted);
  text-decoration: line-through;
}

.card .btn-row {
  margin-top: 16px;
}

.btn {
  display: inline-block;
  width: 100%;
  text-align: center;
  padding: 13px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: 0.2s;
}

.btn-buy,
.btn-buy:hover,
.btn-buy:focus {
  background: var(--green);
  color: #fff;
}

.btn-buy:hover {
  background: var(--green-dark);
  color: #fff;
}

.btn-order {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--ink);
}

.btn-order:hover,
.btn-order:focus {
  background: var(--ink);
  color: #fff;
}

.empty {
  text-align: center;
  padding: 60px 0;
  color: var(--muted);
  font-size: 18px;
  grid-column: 1 / -1;
}

/* ---------- Product page ---------- */
.product-page {
  padding: 40px 0 70px;
}

.breadcrumbs {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 24px;
}

.breadcrumbs a {
  text-decoration: none;
  color: var(--muted);
}

.breadcrumbs a:hover {
  color: var(--green);
}

.product-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 50px;
}

.gallery .main-img {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-soft);
}

.gallery .main-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery .thumbs {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.gallery .thumbs img {
  width: 78px;
  height: 100px;
  object-fit: cover;
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid transparent;
}

.gallery .thumbs img.active {
  border-color: var(--green);
}

.product-info .cat {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  font-weight: 700;
}

.product-info h1 {
  font-size: 34px;
  font-weight: 800;
  margin: 10px 0 18px;
}

.product-info .price {
  margin: 0 0 22px;
}

.product-info .price .now {
  font-size: 30px;
}

.status-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  margin-bottom: 22px;
  padding: 8px 16px;
  border-radius: 999px;
}

.status-line.in_stock {
  background: rgba(26, 122, 60, 0.12);
  color: var(--green);
}

.status-line.sold {
  background: #ededed;
  color: #6b6b6b;
}

.attrs {
  border-top: 1px solid var(--line);
  margin: 8px 0 24px;
}

.attrs .row {
  display: flex;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.attrs .row .k {
  width: 150px;
  color: var(--muted);
  font-weight: 600;
  flex-shrink: 0;
}

.attrs .row .v {
  font-weight: 600;
}

.product-info .description {
  font-size: 16px;
  line-height: 1.7;
  color: #333;
  margin-bottom: 28px;
  white-space: pre-line;
}

.product-info .actions .btn {
  width: auto;
  min-width: 220px;
  padding: 16px 34px;
  font-size: 16px;
}

/* ---------- Footer (reuse look from main site) ---------- */
.footer {
  background: #e3e3e3;
  padding: 50px 0;
  text-align: center;
}

.footer p {
  margin: 0;
  font-size: 20px;
}

.footer a {
  color: #000;
  text-decoration: none;
  font-weight: bold;
}

.footer img {
  max-width: 200px;
  margin-top: 15px;
}

.footer .offer {
  color: #000;
  display: inline-block;
  margin-top: 20px;
}

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
  .product-layout {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .hero h1 {
    font-size: 34px;
  }
}

@media (max-width: 640px) {
  .main-nav,
  .header-icons .inst {
    display: none;
  }
  .main-nav.open {
    display: flex;
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 8px 20px 16px;
  }
  .main-nav.open a {
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
  }
  .main-nav.open a:last-child {
    border-bottom: none;
  }
  .main-nav.open .nav-inst {
    display: block;
  }
  .burger {
    display: block;
  }
  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .card .body {
    padding: 12px;
  }
  .card h3 {
    font-size: 16px;
  }
  .price .now {
    font-size: 18px;
  }
  .btn {
    padding: 11px 12px;
    font-size: 13px;
  }
  .hero {
    padding: 38px 0;
  }
  .hero h1 {
    font-size: 27px;
  }
  .hero p {
    font-size: 15px;
  }
  .product-info h1 {
    font-size: 26px;
  }
}
