/* iStore Бушуев — витрина iPhone 17. Раскладка «как у DNS», акцент синий (#0F62FE) вместо оранжевого DNS (#fc8507). */
:root {
  --accent: #0f62fe;
  --accent-dark: #0043ce;
  --accent-light: #4589ff;
  --accent-grad: linear-gradient(0deg, #0f62fe, #4589ff);
  --accent-ring: rgba(15, 98, 254, .22);

  --bg: #f7f7f7;          /* фон страницы у DNS — светло-серый */
  --card: #ffffff;
  --text: #333333;
  --text-2: #4e4e4e;
  --text-3: #8c8c8c;
  --line: #ededed;
  --old: #8c8c8c;
  --stock: #30b25d;

  --radius: 8px;
  --container: 1300px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .06);
  --shadow-hover: 0 6px 20px rgba(0, 0, 0, .12);
  --font: "PT Sans", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.4;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* ---------- Минимальная брендовая полоска ---------- */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: baseline;
  gap: 16px;
}
.logo {
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -.2px;
  display: inline-flex;
  align-items: baseline;
}
.logo__i { color: var(--accent); }
.logo__store { color: var(--text); }
.logo__name { color: var(--text); margin-left: 6px; font-weight: 400; color: var(--text-2); }
.topbar__tag {
  color: var(--text-3);
  font-size: 14px;
}

/* ---------- Обёртка / hero ---------- */
.wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px 48px;
}
.hero { padding: 28px 0 18px; }
.hero__title { font-size: 30px; margin: 0 0 4px; font-weight: 700; }
.hero__sub { margin: 0; color: var(--text-3); font-size: 16px; }

/* ---------- Заголовок секции категории ---------- */
.section-title {
  font-size: 22px;
  font-weight: 700;
  margin: 30px 0 14px;
}
.section-title:first-child { margin-top: 6px; }

/* ---------- Сетка каталога ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.grid__loading { grid-column: 1 / -1; color: var(--text-3); padding: 40px 0; text-align: center; }

/* ---------- Карточка товара ---------- */
.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 16px 18px;
  display: flex;
  flex-direction: column;
  transition: box-shadow .15s ease, border-color .15s ease;
}
.card:hover { box-shadow: var(--shadow-hover); border-color: #e0e0e0; z-index: 2; }

.card__badges {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 6px;
}
.badge {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  line-height: 1.5;
}
.badge--discount { background: var(--accent-grad); color: #fff; }

.card__fav {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #c4c4c4;
  cursor: pointer;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: color .15s ease, background .15s ease;
}
.card__fav:hover { color: var(--accent); background: #f2f6ff; }

.card__img {
  height: 220px;
  display: grid;
  place-items: center;
  margin: 8px 0 10px;
}
.card__photo { max-height: 220px; width: auto; object-fit: contain; }
.card__photo.is-svg { height: 220px; }

/* ---------- Рейтинг ---------- */
.card__rating { display: flex; align-items: center; gap: 6px; min-height: 20px; font-size: 13px; }
.stars {
  --pct: 100%;
  display: inline-block;
  width: 84px;
  height: 14px;
  background:
    linear-gradient(90deg, var(--accent) var(--pct), #d9d9d9 var(--pct));
  -webkit-mask: repeat-x left center / 16.8px 14px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='M7 .8l1.9 3.9 4.3.6-3.1 3 .7 4.3L7 10.6 3.2 12.6l.7-4.3L.8 5.3l4.3-.6z'/%3E%3C/svg%3E");
          mask: repeat-x left center / 16.8px 14px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='M7 .8l1.9 3.9 4.3.6-3.1 3 .7 4.3L7 10.6 3.2 12.6l.7-4.3L.8 5.3l4.3-.6z'/%3E%3C/svg%3E");
}
.rating__val { font-weight: 700; color: var(--text); }
.rating__cnt { color: var(--text-3); }

/* ---------- Заголовок / характеристики ---------- */
.card__title { font-size: 16px; font-weight: 700; margin: 10px 0 4px; }
.card__specs { font-size: 12.5px; color: var(--text-3); margin: 0 0 12px; min-height: 34px; }

/* ---------- Цвета ---------- */
.card__colors { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.swatch {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,.15);
  cursor: pointer;
  padding: 0;
  position: relative;
  outline: none;
  box-shadow: inset 0 0 0 2px #fff;
}
.swatch.is-active { box-shadow: inset 0 0 0 2px #fff, 0 0 0 2px var(--accent); }
.swatch:focus-visible { box-shadow: inset 0 0 0 2px #fff, 0 0 0 3px var(--accent-ring); }

/* ---------- Память ---------- */
.card__storages { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.chip {
  font-size: 13px;
  padding: 5px 11px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  background: #fff;
  color: var(--text-2);
  cursor: pointer;
  transition: border-color .12s ease, color .12s ease, background .12s ease;
}
.chip:hover { border-color: var(--accent-light); }
.chip.is-active { border-color: var(--accent); color: var(--accent); background: #f2f6ff; font-weight: 700; }

/* ---------- Цена ---------- */
.card__price { margin-top: auto; }
.price__old {
  display: inline-block;
  color: var(--old);
  text-decoration: line-through;
  font-size: 13px;
  min-height: 18px;
}
.price__now-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price__now { font-size: 24px; font-weight: 700; color: var(--accent); }
.price__label { font-size: 11px; color: var(--text-3); }
.price__old-inline { text-decoration: line-through; }

.card__stock { color: var(--stock); font-size: 13px; margin: 10px 0 0; }

.tier-note { color: var(--text-3); font-size: 11px; margin-left: 4px; cursor: help; }

/* ---------- Footer ---------- */
.footer { background: #fff; border-top: 1px solid var(--line); margin-top: 24px; }
.footer__inner { max-width: var(--container); margin: 0 auto; padding: 24px 20px; }
.footer__brand { font-weight: 700; font-size: 18px; margin-bottom: 8px; }
.footer__legal { color: var(--text-3); font-size: 12.5px; max-width: 760px; margin: 0 0 6px; }
.footer__upd { color: var(--text-3); font-size: 12px; margin: 0; }

/* ---------- Адаптив ---------- */
@media (max-width: 1080px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 820px)  { .grid { grid-template-columns: repeat(2, 1fr); } .hero__title { font-size: 26px; } }
/* Телефоны — строго одна карточка в ряд */
@media (max-width: 600px)  { .grid { grid-template-columns: 1fr; } .topbar__tag { display: none; } }
