:root {
  --bg: #f5f6f2;
  --surface: #ffffff;
  --surface-soft: #eef3ef;
  --ink: #19211d;
  --muted: #647066;
  --line: #dce3dc;
  --green: #23785b;
  --green-soft: #e3f2eb;
  --amber: #a9631d;
  --amber-soft: #f7ead5;
  --blue: #315d8a;
  --blue-soft: #e3edf7;
  --red: #b54242;
  --red-soft: #fae7e5;
  --yellow: #f3ca62;
  --shadow: 0 18px 48px rgba(24, 35, 30, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Aptos, "Segoe UI Variable", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: rgba(245, 246, 242, 0.92);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 850;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--yellow);
  color: var(--ink);
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-weight: 700;
}

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

.hero {
  min-height: 520px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  align-items: center;
  gap: 28px;
  padding: 44px 0 28px;
}

.hero-copy {
  padding: 32px 0;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(42px, 6vw, 72px);
  line-height: 0.98;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 640px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.primary-button,
.secondary-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 10px 15px;
  font-weight: 800;
}

.primary-button {
  background: var(--green);
  color: #fff;
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.hero-card .product-card {
  box-shadow: var(--shadow);
}

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

.stats div,
.contact,
.catalog-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.stats div {
  padding: 18px;
}

.stats strong {
  display: block;
  font-size: 34px;
}

.stats span {
  color: var(--muted);
  font-weight: 700;
}

.catalog-section {
  padding: 20px;
}

.section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-heading h2,
.contact h2 {
  margin: 0;
  font-size: 28px;
}

.result-count {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 11px;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 850;
}

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(4, minmax(130px, 0.28fr));
  gap: 10px;
  margin-bottom: 18px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

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

.catalog-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
}

.category-panel {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-soft);
}

.category-panel-header {
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.category-list {
  display: grid;
  gap: 7px;
}

.category-button {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  font-weight: 800;
}

.category-button strong {
  min-width: 28px;
  min-height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  padding: 2px 7px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
}

.category-button.active {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}

.category-button.active strong {
  background: var(--green);
  color: #fff;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.product-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.product-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: contain;
  padding: 10px;
  background: #fff;
}

.product-image.placeholder {
  display: grid;
  place-items: center;
  padding: 18px;
  background: linear-gradient(135deg, #1d2923, #315d8a);
  color: #fff;
  font-weight: 850;
}

.product-body {
  padding: 14px;
}

.badges,
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.badge {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 850;
}

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

.badge.amber {
  color: var(--amber);
  background: var(--amber-soft);
}

.badge.blue {
  color: var(--blue);
  background: var(--blue-soft);
}

.badge.red {
  color: var(--red);
  background: var(--red-soft);
}

.product-card h3 {
  margin: 10px 0 4px;
  font-size: 18px;
}

.muted,
.product-card p,
.meta,
.contact p {
  color: var(--muted);
}

.price-stack {
  display: grid;
  gap: 5px;
  margin: 10px 0 8px;
}

.price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.price-row span {
  color: var(--muted);
  font-size: 13px;
}

.price-row strong {
  white-space: nowrap;
}

.list-price strong {
  color: var(--muted);
  font-size: 15px;
  text-decoration: line-through;
}

.sale-price strong {
  color: var(--red);
  font-size: 22px;
  font-weight: 850;
}

.product-card p {
  margin: 10px 0 0;
  font-size: 13px;
}

.order-button {
  width: 100%;
  margin-top: 14px;
}

.card-size-control {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 13px;
}

.card-size-control span {
  color: var(--ink);
  font-weight: 850;
}

.card-size-control select {
  min-height: 44px;
  border-color: var(--green);
  font-size: 15px;
  font-weight: 800;
}

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

.card-actions .primary-button,
.card-actions .secondary-button {
  width: 100%;
  padding-inline: 8px;
}

.buy-now-button,
.add-cart-button {
  min-height: 46px;
  font-size: 15px;
}

.order-button:disabled,
.card-actions button:disabled,
#checkout-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 22, 18, 0.5);
}

.order-modal {
  width: min(520px, 100%);
  display: grid;
  gap: 12px;
  border-radius: 8px;
  padding: 20px;
  background: #fff;
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.modal-header h2,
.modal-header p {
  margin: 0;
}

.icon-button {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  font-weight: 850;
}

.form-message {
  min-height: 22px;
  margin: 0;
  color: var(--green);
  font-weight: 800;
}

.cart-panel {
  position: fixed;
  right: 14px;
  top: var(--cart-y, 50vh);
  transform: translateY(-50%);
  z-index: 60;
  width: 92px;
  pointer-events: none;
  display: grid;
  justify-items: end;
  gap: 10px;
}

.cart-toggle,
.cart-box {
  pointer-events: auto;
}

.cart-toggle {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: 8px;
  padding: 0;
  background: var(--ink);
  color: #fff;
  font-size: 42px;
  font-weight: 850;
  box-shadow: var(--shadow);
}

.cart-toggle span {
  position: absolute;
  top: -12px;
  right: -12px;
  min-width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--ink);
  padding: 0 9px;
  font-size: 17px;
  line-height: 1;
}

.cart-box {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: min(360px, calc(100vw - 28px));
  max-height: min(680px, calc(100vh - 110px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fff;
  box-shadow: var(--shadow);
}

.cart-panel.open .cart-box {
  display: grid;
  gap: 12px;
}

.cart-header,
.cart-total,
.cart-item,
.checkout-items div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cart-item {
  align-items: flex-start;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.cart-item > div:first-child {
  display: grid;
  gap: 2px;
}

.cart-item span,
.empty-cart {
  color: var(--muted);
  font-size: 13px;
}

.qty-control {
  display: inline-grid;
  grid-template-columns: 30px 28px 30px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.qty-control button {
  height: 30px;
  background: var(--surface-soft);
  color: var(--ink);
  font-weight: 850;
}

.qty-control span {
  text-align: center;
  color: var(--ink);
  font-weight: 850;
}

.cart-total {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.cart-notes,
.checkout-notes {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff8e1;
  color: #5a4312;
  font-size: 13px;
  line-height: 1.45;
}

.cart-notes p,
.checkout-notes p {
  margin: 0;
}

.checkout-items {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.checkout-items div {
  align-items: flex-start;
}

.empty-state {
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
}

.contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 20px 0 34px;
  padding: 24px;
}

.contact p {
  max-width: 620px;
  margin: 8px 0 0;
}

@media (max-width: 920px) {
  .hero,
  .filters,
  .stats,
  .catalog-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 0;
  }

  .category-panel {
    position: static;
  }

  .category-list {
    display: flex;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .category-button {
    min-width: 150px;
  }

  .contact,
  .section-heading {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 640px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  main {
    width: min(100% - 28px, 1180px);
  }

  h1 {
    font-size: 40px;
  }

  .cart-panel {
    right: 14px;
    top: auto;
    bottom: 18px;
    transform: none;
    width: 82px;
  }

  .cart-toggle {
    width: 78px;
    height: 78px;
    font-size: 36px;
  }

  .cart-box {
    top: auto;
    bottom: calc(100% + 10px);
    width: min(360px, calc(100vw - 28px));
  }
}
