:root {
  --ink: #111111;
  --muted: #686868;
  --line: #e7e7e7;
  --soft: #f7f7f7;
  --accent: #a00000;
  --accent-dark: #790000;
  --green: #0e6f4f;
  --shadow: 0 16px 45px rgba(0, 0, 0, 0.12);
  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: #ffffff;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(190px, 250px) minmax(220px, 1fr) auto auto;
  gap: 16px;
  align-items: center;
  padding: 6px clamp(14px, 4vw, 64px);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.05);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  font-weight: 800;
  letter-spacing: 0;
}

.brand strong,
.brand em {
  display: block;
  line-height: 1;
}

.brand strong {
  font-size: 20px;
}

.brand em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.search-box {
  display: flex;
  align-items: center;
  height: 34px;
  padding: 0 12px;
  border: 1px solid #d9d9d9;
  border-radius: 999px;
  color: #8a8a8a;
  background: #fafafa;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
}

.call-link,
.primary-link,
.checkout-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  color: #ffffff;
  background: var(--ink);
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}

.call-link {
  padding: 0 14px;
  border-radius: 3px;
}

.cart-button {
  display: inline-grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 0 12px;
  color: #ffffff;
  border: 0;
  border-radius: 3px;
  background: #000000;
  font-weight: 800;
}

.cart-count {
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  color: #000000;
  background: #ffffff;
  border-radius: 50%;
  font-size: 12px;
}

main {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 30px 0 70px;
}

.shop-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 0 18px;
}

.shop-intro h1 {
  margin: 2px 0 8px;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1;
  letter-spacing: 0;
}

.shop-intro p {
  max-width: 650px;
  margin: 0;
  color: var(--muted);
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.primary-link,
.checkout-button {
  padding: 0 18px;
  border-radius: 4px;
}

.category-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 0 28px;
  scrollbar-width: thin;
}

.category-button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  background: #ffffff;
}

.category-button.active {
  color: #ffffff;
  border-color: var(--ink);
  background: var(--ink);
}

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

.product-card {
  position: relative;
  display: grid;
  gap: 12px;
  min-width: 0;
  text-align: center;
}

.image-wrap {
  position: relative;
  display: grid;
  place-items: center;
  height: 255px;
  overflow: hidden;
  background: #ffffff;
}

.image-wrap img {
  width: min(100%, 247px);
  height: 100%;
  object-fit: contain;
  transition: transform 180ms ease;
}

.product-card:hover img {
  transform: translateY(-4px);
}

.discount-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 5px 8px;
  color: #ffffff;
  background: var(--green);
  border-radius: 3px;
  font-size: 11px;
  font-weight: 800;
}

.product-brand {
  margin: 0;
  color: #555555;
  font-size: 12px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.product-name {
  min-height: 40px;
  margin: 4px 0 0;
  color: #41415a;
  font-size: 16px;
  line-height: 1.25;
}

.description {
  min-height: 54px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.38;
}

.price-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  align-items: baseline;
  min-height: 22px;
  font-weight: 800;
}

.old-price {
  color: #8b8b8b;
  font-weight: 500;
  text-decoration: line-through;
}

.price {
  color: var(--accent);
}

.price.range {
  color: #000000;
}

.add-button {
  justify-self: center;
  width: min(100%, 190px);
  min-height: 36px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  color: var(--ink);
  background: #ffffff;
  font-weight: 800;
}

.add-button:hover {
  color: #ffffff;
  background: var(--ink);
}

.empty-state {
  padding: 40px 0;
  color: var(--muted);
  text-align: center;
}

.cart-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 40;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: min(420px, 100%);
  height: 100dvh;
  padding: 22px;
  background: #ffffff;
  box-shadow: var(--shadow);
  transform: translateX(110%);
  transition: transform 180ms ease;
}

.cart-panel.open {
  transform: translateX(0);
}

.cart-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.cart-header h2 {
  margin: 4px 0 0;
  font-size: 30px;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  font-weight: 800;
}

.cart-items {
  display: grid;
  align-content: start;
  gap: 14px;
  overflow: auto;
  padding: 18px 0;
}

.cart-item {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 12px;
  align-items: center;
}

.cart-item img {
  width: 68px;
  height: 82px;
  object-fit: contain;
  background: var(--soft);
}

.cart-item h3 {
  margin: 0 0 6px;
  font-size: 14px;
  line-height: 1.25;
}

.cart-item p {
  margin: 0;
  color: var(--accent);
  font-weight: 800;
}

.quantity-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.qty-button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  font-weight: 800;
}

.remove-button {
  margin-left: auto;
  border: 0;
  color: var(--muted);
  background: transparent;
  text-decoration: underline;
}

.cart-footer {
  display: grid;
  gap: 14px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.cart-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 18px;
}

.checkout-button {
  min-height: 44px;
  background: var(--accent);
}

.checkout-button:hover {
  background: var(--accent-dark);
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  background: rgba(0, 0, 0, 0.34);
}

.overlay.show {
  display: block;
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .search-box {
    grid-column: 1 / -1;
    order: 3;
  }

  .call-link {
    display: none;
  }

  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .topbar {
    gap: 10px;
    padding: 8px 14px;
  }

  .brand strong {
    font-size: 17px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
  }

  .cart-button {
    min-width: 112px;
    padding: 0 8px;
    font-size: 12px;
  }

  .shop-intro {
    display: grid;
    align-items: start;
  }

  .primary-link {
    width: max-content;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 42px 18px;
  }

  .image-wrap {
    height: 205px;
  }

  .product-name {
    font-size: 15px;
  }
}

@media (max-width: 430px) {
  main {
    width: min(100% - 18px, 1180px);
  }

  .product-grid {
    gap: 36px 10px;
  }

  .description {
    display: none;
  }

  .image-wrap {
    height: 170px;
  }

  .add-button {
    width: 100%;
  }
}
