:root {
  --green: #009966;
  --blue: #1b8fcf;
  --sky: #91d9f0;
  --coral: #ff8562;
  --ink: #111;
  --muted: #666;
  --line: #e3e3e3;
  --bg: #fff;
  --bg-soft: #f0f0f0;
  --radius: 14px;
  --font: 'Jost', 'Futura', 'Helvetica Neue', Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}
body.no-scroll { overflow: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

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

/* ---------- header ---------- */
.site-header { text-align: center; padding: 24px 16px 8px; }
.logo { display: inline-block; }
.logo img { width: 260px; margin: 0 auto; }
.cat-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 20px; margin-top: 8px; font-size: 15px; }
.cat-nav a { text-decoration: none; color: var(--muted); padding: 4px 0; border-bottom: 2px solid transparent; }
.cat-nav a:hover, .cat-nav a[aria-current] { color: var(--green); border-color: var(--green); }

/* ---------- home ---------- */
.welcome { padding: 40px 16px 60px; }
.welcome__box {
  max-width: 640px; margin: 0 auto; padding: 48px 56px;
  border: 3px solid var(--green); color: var(--green);
  font-weight: 500; font-size: 18px; line-height: 1.65;
}
.welcome__box p { margin: 0; }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; padding-bottom: 70px; }
.tile {
  position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden;
  box-shadow: 0 0 24px rgba(145, 217, 240, .7); text-decoration: none;
}
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.tile:hover img { transform: scale(1.05); }
.tile span {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; text-align: center;
  color: #fff; font-size: 26px; font-weight: 500; line-height: 1.15;
  text-shadow: 0 0 8px rgba(0, 0, 0, .75), 0 0 2px #000;
}

.reviews { background: #eee; padding: 100px 0; }
.review { display: flex; align-items: flex-start; gap: 24px; margin: 0 0 48px; }
.review:last-child { margin-bottom: 0; }
.review--right { flex-direction: row-reverse; }
.review img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; flex: none; }
.review blockquote {
  margin: 0; background: #fff; border-radius: 8px; padding: 20px 24px; font-size: 14px; line-height: 1.6;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .04); flex: 1;
}
.review figcaption { font-weight: 600; margin-bottom: 8px; }
.review p { margin: 0; }

/* ---------- info / contacts / footer ---------- */
.info { background: var(--bg-soft); padding: 120px 0; text-align: center; font-size: 20px; }
.eyebrow { font-size: 14px; letter-spacing: .04em; text-transform: uppercase; font-weight: 600; margin: 0 0 40px; }
.info .accent { color: var(--coral); font-weight: 600; font-size: 22px; }
.info a { color: var(--coral); }

.contacts { padding: 100px 0 60px; text-align: center; }
.phone { font-size: 24px; text-decoration: none; }
.contacts p { font-size: 14px; margin: 12px 0 20px; }
.socials { display: flex; justify-content: center; gap: 10px; list-style: none; padding: 0; margin: 0; }
.socials a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #000; transition: background .2s; }
.socials a:hover { background: var(--green); }
.socials svg { width: 22px; height: 22px; fill: #fff; }
.site-footer { text-align: center; font-size: 14px; padding: 40px 16px 120px; color: var(--muted); }

/* ---------- catalog ---------- */
.category { padding-top: 40px; padding-bottom: 80px; }
.category h1, .product h1 { font-weight: 600; line-height: 1.2; }
.category h1 { text-align: center; font-size: 40px; margin: 0 0 16px; }
.lead { text-align: center; max-width: 720px; margin: 0 auto 48px; color: #333; }

.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px 24px; }
.card { display: flex; flex-direction: column; }
.card__img { position: relative; display: block; aspect-ratio: 1; overflow: hidden; border-radius: var(--radius); background: #f6f6f6; }
.card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card__img:hover img { transform: scale(1.04); }
.card__title { font-size: 17px; font-weight: 500; line-height: 1.3; margin: 14px 0 6px; }
.card__title a { text-decoration: none; }
.card__price { margin-bottom: 12px; }
.card__actions { margin-top: auto; display: flex; align-items: center; gap: 16px; }

.mark {
  position: absolute; top: 10px; left: 10px; z-index: 1;
  background: var(--green); color: #fff; font-size: 12px; font-weight: 600; text-transform: uppercase;
  border-radius: 999px; padding: 3px 10px; letter-spacing: .03em;
}
.price { font-weight: 600; font-size: 18px; }
.price-old { color: var(--muted); font-size: 15px; margin-left: 4px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--green); color: #fff; border: 0; border-radius: 999px;
  padding: 10px 22px; font-weight: 500; font-size: 15px; cursor: pointer; text-decoration: none;
  transition: background .2s, transform .1s;
}
.btn:hover { background: #007a52; }
.btn:active { transform: scale(.98); }
.btn:disabled { background: #9bbfb2; cursor: default; }
.btn--lg { padding: 14px 32px; font-size: 17px; }
.btn--block { width: 100%; }
.link { font-size: 15px; color: var(--muted); }
.link:hover { color: var(--green); }

/* ---------- product ---------- */
.product { padding-top: 24px; padding-bottom: 80px; }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 24px; }
.crumbs a { color: inherit; }
.product__layout { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.gallery__main { position: relative; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: #f6f6f6; }
.gallery__main img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.gallery__thumbs button { padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; cursor: pointer; background: none; width: 72px; height: 72px; }
.gallery__thumbs button[aria-current] { border-color: var(--green); }
.gallery__thumbs img { width: 100%; height: 100%; object-fit: cover; }
.product h1 { font-size: 30px; margin: 0 0 12px; }
.product__price { margin-bottom: 20px; }
.product__price .price { font-size: 24px; }
.product__descr, .product__text { color: #333; }
.product__descr { margin-bottom: 20px; }
.product__text { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 15px; }
.product__text ul { padding-left: 20px; }

/* ---------- forms ---------- */
.field { display: block; margin: 0 0 16px; border: 0; padding: 0; min-width: 0; }
.field > span, .field > legend { display: block; font-size: 14px; margin-bottom: 6px; padding: 0; }
.field small { color: var(--muted); }
.field input:not([type=radio]):not([type=checkbox]), .field select, .field textarea {
  width: 100%; border: 1px solid #000; border-radius: 0; padding: 10px 12px; background: #fff;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--green); outline-offset: -1px; }
.product .field { max-width: 320px; }
.radio, .checkbox { display: flex; gap: 10px; align-items: baseline; font-size: 15px; margin: 6px 0; cursor: pointer; }
.radio input, .checkbox input { accent-color: var(--green); }
.field__error { display: block; color: #d33; font-size: 13px; margin-top: 4px; }

/* ---------- cart ---------- */
.cart-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 50; width: 72px; height: 72px; border-radius: 50%;
  background: #fff; border: 0; box-shadow: 0 4px 20px rgba(0, 0, 0, .2); cursor: pointer; color: var(--ink);
  display: grid; place-items: center;
}
.cart-fab svg { width: 34px; height: 34px; }
.cart-fab__count {
  position: absolute; right: 2px; bottom: 2px; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 13px;
  background: var(--green); color: #fff; font-size: 13px; font-weight: 600; display: grid; place-items: center;
}

.cart { position: fixed; inset: 0; z-index: 100; }
.cart__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); }
.cart__panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: #fff;
  overflow-y: auto; padding: 32px 32px 48px; animation: slide-in .25s ease;
}
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } }
.cart__panel h2 { margin: 0 0 20px; font-size: 26px; font-weight: 600; }
.cart__close { position: absolute; top: 16px; right: 16px; border: 0; background: none; font-size: 32px; line-height: 1; cursor: pointer; padding: 4px 10px; }
.cart__empty { color: var(--muted); }
.cart__items { list-style: none; margin: 0 0 16px; padding: 0; }
.cart-item {
  display: grid; grid-template-columns: 64px 1fr auto auto auto; gap: 12px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.cart-item img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }
.cart-item__info { display: flex; flex-direction: column; font-size: 15px; line-height: 1.3; min-width: 0; }
.cart-item__info a { text-decoration: none; }
.cart-item__info small { color: var(--muted); font-size: 13px; }
.cart-item__sum { font-size: 15px; white-space: nowrap; }
.cart-item__remove { border: 0; background: none; font-size: 22px; color: var(--muted); cursor: pointer; padding: 0 4px; }
.qty { display: flex; align-items: center; gap: 6px; }
.qty button { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.qty span { min-width: 18px; text-align: center; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; margin: 0 0 8px; }
.totals dt, .totals dd { margin: 0; }
.totals dd { text-align: right; }
.totals__total { font-weight: 600; font-size: 20px; padding-top: 6px; }
.hint { color: var(--green); font-size: 14px; margin: 0 0 16px; }
.order-form { margin-top: 24px; }
.cart__success { padding: 20px 0; }
.cart__success-title { font-size: 22px; font-weight: 600; color: var(--green); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60;
  background: #111; color: #fff; border-radius: 999px; padding: 10px 12px 10px 20px; font-size: 15px;
  display: flex; gap: 14px; align-items: center; box-shadow: 0 6px 24px rgba(0, 0, 0, .25); max-width: calc(100% - 32px);
}
.toast button { background: var(--green); color: #fff; border: 0; border-radius: 999px; padding: 6px 14px; cursor: pointer; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .logo img { width: 200px; }
  .welcome__box { padding: 28px 22px; font-size: 16px; }
  .tiles { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .tile span { font-size: 18px; }
  .reviews, .info { padding: 64px 0; }
  .info { font-size: 17px; }
  .info .accent { font-size: 18px; }
  .review, .review--right { gap: 14px; }
  .review img { width: 56px; height: 56px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 28px 14px; }
  .category h1 { font-size: 30px; }
  .card__title { font-size: 15px; }
  .card__actions { flex-direction: column; align-items: stretch; gap: 8px; text-align: center; }
  .product__layout { grid-template-columns: 1fr; gap: 24px; }
  .product h1 { font-size: 24px; }
  .cart__panel { padding: 24px 16px 40px; }
  .cart-item { grid-template-columns: 52px 1fr auto; grid-template-areas: 'img info rm' 'img qty sum'; row-gap: 8px; }
  .cart-item img { width: 52px; height: 52px; grid-area: img; }
  .cart-item__info { grid-area: info; }
  .cart-item .qty { grid-area: qty; }
  .cart-item__sum { grid-area: sum; text-align: right; }
  .cart-item__remove { grid-area: rm; }
  .cart-fab { right: 16px; bottom: 16px; width: 60px; height: 60px; }
}
