:root {
  --ink: #343f52;
  --muted: #60697b;
  --line: #e6e8ec;
  --paper: #fefefe;
  --teal: #006778;
  --teal-dark: #005564;
  --footer: #21262c;
  --footer-text: #cacaca;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Manrope, "Segoe UI", sans-serif;
  color: var(--muted);
  background: var(--paper);
  line-height: 1.5;
}
a { color: var(--teal); text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select { font: inherit; }

.bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 4vw;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--line);
}
.logo img { height: 52px; width: auto; }
.links { display: flex; gap: 22px; margin-left: 12px; }
.links a { color: var(--ink); font-weight: 600; }
.links a:hover, .links a.active { color: var(--teal); }
.tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.tool {
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  border-radius: 8px;
}
.tool:hover { background: #f3f5f7; }
.tool svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.burger { display: none; }
.search {
  display: none;
  padding: 10px 4vw 14px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.search.open { display: block; }
.search input, .price input, .sort select {
  width: 100%;
  border: 1px solid #d9dee5;
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
}
.banner { display: block; width: 100%; height: 220px; object-fit: cover; background: #5b3d8a; }

.layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 36px;
  width: min(1180px, calc(100% - 8vw));
  margin: 28px auto 64px;
}
.side h2 { margin: 0 0 12px; color: var(--ink); font-size: 20px; font-weight: 700; }
.side ul { list-style: none; margin: 0 0 28px; padding: 0; }
.side li a { display: block; padding: 7px 0; color: var(--muted); }
.side li a.active, .side li a:hover { color: var(--teal); }
.price { display: flex; align-items: center; gap: 8px; }
.price input { width: 100%; }

.catalog-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 18px;
}
.catalog-head h1 { margin: 0; color: var(--ink); font-size: 28px; }
.catalog-head p { margin: 4px 0 0; }
.sort { min-width: 220px; }

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px 18px;
}
.card { min-width: 0; }
.card figure {
  margin: 0;
  background: #f6f7f9;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 1;
}
.card img { width: 100%; height: 100%; object-fit: cover; }
.card .cat {
  display: block;
  margin-top: 12px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9aa3b2;
}
.card h3 { margin: 4px 0 10px; color: var(--ink); font-size: 18px; font-weight: 700; }
.buy {
  border: 0;
  background: var(--teal);
  color: #fff;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.buy:hover { background: var(--teal-dark); }
.buy svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 1.8; }
.empty { padding: 24px 0; }

.page {
  width: min(860px, calc(100% - 8vw));
  margin: 36px auto 72px;
  color: var(--ink);
}
.page h1 { margin-top: 0; }
.page h2 { font-size: 20px; margin-top: 28px; }
.page table { width: 100%; border-collapse: collapse; }
.page th, .page td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.page th { width: 40%; color: var(--muted); font-weight: 600; }

.foot {
  background: var(--footer);
  color: var(--footer-text);
  padding: 48px 4vw 36px;
}
.foot-grid {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
}
.foot h2 { margin: 0 0 12px; color: #fff; font-size: 18px; }
.foot a { color: var(--footer-text); }
.foot a:hover { color: #fff; }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin: 8px 0; }
.social { display: flex; gap: 14px; margin-top: 12px; }
.social a { color: #fff; }
.social svg { width: 18px; height: 18px; fill: currentColor; }

.tg {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #2aa1dd;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
  z-index: 30;
}
.tg svg { width: 28px; height: 28px; fill: #fff; }

.cookie {
  position: fixed;
  inset: 0;
  background: rgba(20, 24, 28, 0.45);
  display: grid;
  place-items: center;
  z-index: 40;
  padding: 20px;
}
.cookie[hidden] { display: none; }
.cookie-box {
  width: min(460px, 100%);
  background: #fff;
  border-radius: 16px;
  padding: 28px 26px;
  color: var(--muted);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.18);
}
.cookie-box p { margin: 0 0 14px; }
.cookie-box button {
  margin-top: 8px;
  border: 0;
  background: var(--teal);
  color: #fff;
  border-radius: 8px;
  padding: 12px 28px;
  font-weight: 700;
  cursor: pointer;
}

.cart {
  position: fixed;
  top: 0;
  right: 0;
  width: min(380px, 100%);
  height: 100%;
  background: #fff;
  z-index: 45;
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.12);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cart[hidden] { display: none; }
.cart h2 { margin: 0; color: var(--ink); }
.cart ul { list-style: none; margin: 0; padding: 0; overflow: auto; }
.cart li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.cart .sum { font-weight: 700; color: var(--ink); }
.cart a.order {
  display: block;
  text-align: center;
  background: var(--teal);
  color: #fff;
  border-radius: 8px;
  padding: 12px;
  font-weight: 700;
}

@media (max-width: 900px) {
  .burger { display: grid; }
  .links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    margin: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 8px 4vw 14px;
  }
  .links.open { display: flex; }
  .layout, .foot-grid, .grid { grid-template-columns: 1fr; }
  .banner { height: 140px; }
  .catalog-head { flex-direction: column; align-items: stretch; }
  .sort { padding-right: 72px; }
}
@media (min-width: 640px) and (max-width: 900px) {
  .grid { grid-template-columns: 1fr 1fr; }
}
