:root {
  --ink: #18191f;
  --muted: #6b7280;
  --line: #e5e7eb;
  --soft: #f7f8fb;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --coral: #e85d75;
  --sun: #f6c85f;
  --blue: #1f4b99;
  --white: #ffffff;
  --shadow: 0 18px 48px rgba(24, 25, 31, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--soft);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

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

.topbar {
  display: flex;
  justify-content: center;
  padding: 8px 16px;
  color: var(--white);
  background: var(--teal-dark);
  font-size: 13px;
}

.topbar p {
  margin: 0;
  text-align: center;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(150px, 220px) minmax(260px, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 16px clamp(18px, 4vw, 56px);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  color: var(--white);
  background: linear-gradient(135deg, var(--teal), var(--blue));
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.05;
}

.brand small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.icon-button,
.cart-button,
.search button {
  display: inline-grid;
  place-items: center;
  border: 0;
  cursor: pointer;
}

.menu-button {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--soft);
}

.menu-button span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
}

.search {
  display: grid;
  grid-template-columns: 1fr 46px;
  align-items: center;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  overflow: hidden;
}

.search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 14px 16px;
  color: var(--ink);
  background: transparent;
}

.search button {
  height: 100%;
  color: var(--white);
  background: var(--teal);
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 700;
}

.cart-button {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  color: var(--ink);
  background: #fff3db;
}

.cart-button span {
  position: absolute;
  right: -5px;
  top: -5px;
  display: grid;
  min-width: 21px;
  height: 21px;
  place-items: center;
  border-radius: 999px;
  color: var(--white);
  background: var(--coral);
  font-size: 12px;
}

.category-strip {
  display: flex;
  gap: 8px;
  padding: 12px clamp(18px, 4vw, 56px);
  overflow-x: auto;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.category-strip a {
  flex: 0 0 auto;
  padding: 9px 13px;
  border-radius: 8px;
  color: #3f4450;
  font-size: 14px;
  font-weight: 650;
}

.category-strip .active {
  color: var(--white);
  background: var(--ink);
}

.category-showcase {
  position: relative;
  padding: 24px 0 10px;
  background:
    linear-gradient(180deg, #ffffff 0%, var(--soft) 100%);
}

.category-showcase__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  padding: 0 clamp(18px, 4vw, 56px) 14px;
}

.category-showcase__header h1 {
  margin: 0;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.15;
}

.category-showcase__header span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
  white-space: nowrap;
}

.category-showcase::before,
.category-showcase::after {
  content: "";
  position: absolute;
  top: 74px;
  bottom: 10px;
  z-index: 3;
  width: clamp(18px, 4vw, 56px);
  pointer-events: none;
}

.category-showcase::before {
  left: 0;
  background: linear-gradient(90deg, #ffffff 0%, rgba(255, 255, 255, 0) 100%);
}

.category-showcase::after {
  right: 0;
  background: linear-gradient(270deg, var(--soft) 0%, rgba(247, 248, 251, 0) 100%);
}

.category-rail {
  display: grid;
  grid-auto-columns: minmax(218px, 238px);
  grid-auto-flow: column;
  gap: 12px;
  padding: 0 clamp(18px, 4vw, 56px) 12px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.category-rail::-webkit-scrollbar {
  display: none;
}

.category-card {
  position: relative;
  display: block;
  height: 140px;
  overflow: hidden;
  border: 1px solid rgba(24, 25, 31, 0.08);
  border-radius: 8px;
  background:
    radial-gradient(circle at 88% 14%, rgba(246, 200, 95, 0.18), transparent 36%),
    linear-gradient(135deg, #ffffff 0%, #fbfbfd 100%);
  box-shadow: 0 10px 24px rgba(24, 25, 31, 0.06);
  scroll-snap-align: start;
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.category-card:hover {
  transform: translateY(-3px);
  border-color: var(--teal);
  box-shadow: 0 18px 34px rgba(24, 25, 31, 0.12);
}

.category-card span {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 2;
  max-width: 132px;
  color: #20242d;
  font-size: 16px;
  font-weight: 850;
  line-height: 1.35;
}

.category-card img {
  position: absolute;
  right: 2px;
  bottom: 0;
  width: 60%;
  height: 82%;
  object-fit: contain;
  filter: drop-shadow(0 10px 12px rgba(24, 25, 31, 0.12));
  transition: transform 180ms ease;
}

.category-card:hover img {
  transform: scale(1.05) translateY(-2px);
}

.category-card:nth-child(2) img,
.category-card:nth-child(6) img {
  width: 54%;
  height: 90%;
}

.category-card:nth-child(4) img {
  width: 68%;
}

.shop-shell {
  display: grid;
  grid-template-columns: 278px minmax(0, 1fr);
  gap: 24px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 18px clamp(18px, 4vw, 56px) 54px;
}

.filters {
  position: sticky;
  top: 150px;
  align-self: start;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.filter-block + .filter-block {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.filter-title {
  margin-bottom: 12px;
  font-weight: 800;
}

.filters label {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 32px;
  color: #374151;
  font-size: 14px;
  cursor: pointer;
}

.filters input {
  accent-color: var(--teal);
}

.products-section {
  min-width: 0;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 14px;
}

.crumbs {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 13px;
}

.toolbar h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 36px);
}

.toolbar-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.toolbar select {
  height: 42px;
  min-width: 160px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--white);
}

.chip-row {
  display: flex;
  gap: 10px;
  margin: 0 0 18px;
  overflow-x: auto;
}

.chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 14px;
  color: #3f4450;
  background: var(--white);
  cursor: pointer;
}

.chip.active {
  border-color: var(--teal);
  color: var(--white);
  background: var(--teal);
}

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

.product-card {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
  min-height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.product-card:hover {
  transform: translateY(-3px);
  border-color: rgba(15, 118, 110, 0.35);
  box-shadow: var(--shadow);
}

.image-wrap {
  position: relative;
  display: grid;
  aspect-ratio: 1 / 1;
  place-items: center;
  background: #f3f6f8;
}

.image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 18px;
  transition: transform 220ms ease;
}

.product-card:hover .image-wrap img {
  transform: scale(1.04);
}

.badge {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--white);
  background: var(--coral);
  font-size: 12px;
  font-weight: 800;
}

.product-info {
  display: grid;
  gap: 9px;
  padding: 14px 14px 4px;
}

.vendor {
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.product-title {
  display: -webkit-box;
  min-height: 47px;
  margin: 0;
  overflow: hidden;
  color: #22252c;
  font-size: 15px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
}

.pill {
  padding: 5px 8px;
  border-radius: 999px;
  color: #515866;
  background: #f2f4f7;
  font-size: 12px;
}

.price-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  min-height: 29px;
}

.price {
  color: var(--ink);
  font-size: 19px;
  font-weight: 850;
}

.old-price {
  color: #9ca3af;
  font-size: 14px;
  text-decoration: line-through;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 42px;
  gap: 8px;
  padding: 12px 14px 14px;
}

.add-button,
.wish-button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.add-button {
  color: var(--white);
  background: var(--ink);
  font-weight: 800;
}

.add-button:hover {
  background: var(--teal-dark);
}

.wish-button {
  display: grid;
  place-items: center;
  color: var(--coral);
  background: #fff0f3;
}

.empty-state {
  display: none;
  margin: 32px 0 0;
  padding: 24px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  color: var(--muted);
  background: var(--white);
  text-align: center;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 30px clamp(18px, 4vw, 56px);
  color: var(--white);
  background: #20242d;
}

.footer p {
  margin: 6px 0 0;
  color: #cfd4de;
}

.footer a {
  color: var(--sun);
  font-weight: 800;
}

@media (max-width: 1120px) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .site-header {
    grid-template-columns: auto 1fr auto;
  }

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

  .category-rail {
    grid-auto-columns: minmax(210px, 236px);
  }

  .category-card {
    height: 144px;
  }

  .shop-shell {
    grid-template-columns: 1fr;
  }

  .filters {
    position: static;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }

  .filter-block + .filter-block {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }

  .toolbar {
    align-items: start;
    flex-direction: column;
  }

  .toolbar-controls {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 680px) {
  .topbar {
    font-size: 12px;
  }

  .site-header {
    gap: 12px;
    padding: 12px 14px;
  }

  .brand small {
    display: none;
  }

  .header-actions > a {
    display: none;
  }

  .category-strip {
    padding-inline: 14px;
  }

  .category-showcase {
    padding-top: 18px;
  }

  .category-showcase__header {
    align-items: start;
    flex-direction: column;
    gap: 4px;
    padding-inline: 14px;
  }

  .category-showcase__header h1 {
    font-size: 26px;
  }

  .category-showcase::before,
  .category-showcase::after {
    top: 92px;
    width: 14px;
  }

  .category-rail {
    grid-auto-columns: minmax(176px, 56vw);
    gap: 10px;
    padding: 0 14px 10px;
  }

  .category-card {
    height: 120px;
  }

  .category-card span {
    max-width: 112px;
    font-size: 14px;
  }

  .category-card img {
    width: 55%;
    height: 76%;
  }

  .shop-shell {
    padding: 22px 14px 42px;
  }

  .filters {
    grid-template-columns: 1fr;
  }

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

  .product-title {
    min-height: 66px;
    font-size: 14px;
    -webkit-line-clamp: 3;
  }

  .card-actions {
    grid-template-columns: 1fr;
  }

  .wish-button {
    display: none;
  }

  .footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 420px) {
  .product-grid {
    grid-template-columns: 1fr;
  }
}
