:root {
  --red: #e2231a;
  --red-dark: #c41d15;
  --dark: #1f2329;
  --gray: #7a7f87;
  --line: #e6e8ec;
  --bg: #f4f5f7;
  --green: #179c4e;
  --yellow: #ffb800;
  --radius: 8px;
  --radius-lg: 14px;
  --shadow: 0 2px 10px rgba(0,0,0,.06);
  --shadow-hover: 0 8px 26px rgba(0,0,0,.12);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--dark); font-size: 14px; background: var(--bg); }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; }
img { display: block; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 20px; }

/* ===== Верхняя утилитарная полоса ===== */
.topbar { background: #fff; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--gray); }
.topbar .wrap { display: flex; align-items: center; gap: 22px; height: 38px; }
.topbar a:hover { color: var(--red); }
.topbar .city { display: inline-flex; align-items: center; gap: 5px; }
.topbar .city svg { width: 14px; height: 14px; }
.topbar .sp { flex: 1; }

/* ===== Шапка ===== */
.header { background: #fff; border-bottom: 1px solid var(--line); }
.header .wrap { display: flex; align-items: center; gap: 24px; height: 76px; }
.logo { font-size: 26px; font-weight: 800; line-height: 1; white-space: nowrap; }
.logo span { color: var(--red); }
.logo small { display: block; font-size: 11px; font-weight: 500; color: var(--gray); margin-top: 3px; }
.search { flex: 1; display: flex; max-width: 720px; }
.search input { flex: 1; border: 1px solid var(--line); border-right: none; border-radius: var(--radius) 0 0 var(--radius); padding: 12px 16px; font-size: 15px; outline: none; }
.search input:focus { border-color: var(--red); }
.search button { background: var(--red); color: #fff; font-weight: 600; padding: 0 26px; border-radius: 0 var(--radius) var(--radius) 0; font-size: 15px; }
.search button:hover { background: var(--red-dark); }
.header .acts { display: flex; gap: 22px; margin-left: auto; }
.header .act { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 12px; color: var(--gray); position: relative; }
.header .act:hover { color: var(--red); }
.header .act .ic { display: flex; }
.header .act .ic svg { width: 27px; height: 27px; }
.header .act .count { position: absolute; top: -6px; right: 4px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; min-width: 17px; height: 17px; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }

/* ===== Полоса каталога ===== */
.catbar { background: #fff; border-bottom: 1px solid var(--line); }
.catbar .wrap { display: flex; align-items: center; gap: 8px; height: 52px; }
.cat-btn { background: var(--dark); color: #fff; font-weight: 700; padding: 11px 20px; border-radius: var(--radius); display: flex; align-items: center; gap: 9px; font-size: 15px; }
.cat-btn:hover { background: #000; }
.cat-btn .ic { display: flex; }
.cat-btn .ic svg { width: 19px; height: 19px; }
.catbar nav { display: flex; gap: 22px; margin-left: 10px; font-size: 14px; overflow: hidden; }
.catbar nav a { color: var(--dark); padding: 6px 0; white-space: nowrap; }
.catbar nav a:hover { color: var(--red); }

/* меню-каталог (выпадающее) */
.catmenu { position: absolute; z-index: 50; display: none; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 16px 48px rgba(0,0,0,.16); overflow: hidden; }
.catmenu.open { display: block; }
.cm-body { display: flex; }
.cm-mhead { display: none; }
.cm-side { width: 290px; flex: none; padding: 8px; border-right: 1px solid var(--line); }
.cm-cat { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius); color: var(--dark); font-size: 14px; }
.cm-cat .cm-ico { flex: none; width: 24px; height: 24px; color: var(--red); display: flex; align-items: center; justify-content: center; }
.cm-cat .cm-ico svg { width: 22px; height: 22px; }
.cm-cat .cm-nm { flex: 1; }
.cm-cat .cm-arr { color: var(--gray); font-size: 18px; line-height: 1; }
.cm-cat:hover, .cm-cat.active { background: var(--bg); }
.cm-cat.active .cm-nm { font-weight: 600; }
.cm-main { flex: 1; min-width: 600px; min-height: 380px; padding: 22px 28px; }
.cm-panel { display: none; }
.cm-panel.active { display: block; }
.cm-head { display: inline-block; font-size: 19px; font-weight: 800; color: var(--dark); margin-bottom: 18px; }
.cm-head:hover { color: var(--red); }
.cm-subs { columns: 3; column-gap: 28px; }
.cm-subs a { display: block; break-inside: avoid; padding: 6px 0; color: var(--dark); font-size: 14px; }
.cm-subs a:hover { color: var(--red); }
.cm-subs a i { color: var(--gray); font-style: normal; font-size: 12px; margin-left: 2px; }
.cm-empty { color: var(--gray); font-size: 14px; }

/* ===== Hero / баннер ===== */
.hero { margin: 22px 0; }
.promo-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 22px 0; }
.promo-row .hero-tile { min-height: 130px; }
.hero-main { position: relative; min-height: 290px; border-radius: var(--radius-lg); overflow: hidden; background: linear-gradient(120deg, #fff, #eceef1); border: 1px solid #eef0f3; box-shadow: var(--shadow); }
.hero-slide { position: absolute; inset: 0; padding: 40px 44px; display: flex; align-items: center; color: var(--dark); opacity: 0; visibility: hidden; transition: opacity .45s ease; }
.hero-slide.active { opacity: 1; visibility: visible; }
.hero-text { display: flex; flex-direction: column; align-items: flex-start; position: relative; z-index: 2; }
.hero-art { position: absolute; right: 6%; top: 50%; transform: translateY(-50%); width: 240px; height: 240px; border-radius: 50%; background: radial-gradient(circle, rgba(226,35,26,.12), rgba(226,35,26,.03) 70%); color: var(--red); display: flex; align-items: center; justify-content: center; pointer-events: none; }
.hero-art svg { width: 126px; height: 126px; opacity: .9; }
.hero-main .eyebrow { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--red); margin-bottom: 14px; }
.hero-main h2 { font-size: 40px; line-height: 1.08; font-weight: 800; max-width: 520px; }
.hero-main p { font-size: 17px; margin-top: 14px; color: var(--gray); max-width: 460px; }
.hero-main .hero-cta { align-self: flex-start; margin-top: 26px; background: var(--red); color: #fff; font-weight: 700; font-size: 15px; padding: 13px 26px; border-radius: 10px; }
.hero-main .hero-cta:hover { background: var(--red-dark); }
.hero-dots { position: absolute; bottom: 18px; left: 44px; display: flex; gap: 8px; z-index: 3; }
.hero-dots .dot { width: 9px; height: 9px; border-radius: 50%; background: #c4c8cf; padding: 0; cursor: pointer; transition: .2s; }
.hero-dots .dot.active { background: var(--red); width: 24px; border-radius: 5px; }
.hero-side { display: grid; grid-template-rows: 1fr 1fr; gap: 14px; }
.hero-tile { display: flex; flex-direction: column; border-radius: var(--radius-lg); padding: 22px 24px; border: 1px solid #eef0f3; background: #fff; box-shadow: var(--shadow); transition: box-shadow .18s, transform .18s; }
.hero-tile:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.hero-tile .eyebrow { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--red); margin-bottom: 8px; }
.hero-tile b { font-size: 23px; font-weight: 800; color: var(--dark); line-height: 1.15; }
.hero-tile .go { margin-top: auto; padding-top: 16px; font-size: 14px; color: var(--gray); font-weight: 600; }
.hero-tile.t1 { background: #fff; }
.hero-tile:hover .go { color: var(--red); }

/* ===== Преимущества ===== */
.benefits { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 22px 0; }
.benefit { display: flex; align-items: center; gap: 13px; background: #fff; border: 1px solid #eef0f3; border-radius: var(--radius-lg); padding: 15px 16px; box-shadow: var(--shadow); }
.benefit .bi { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--bg); color: var(--red); display: flex; align-items: center; justify-content: center; }
.benefit .bi svg { width: 23px; height: 23px; }
.benefit b { display: block; font-size: 14px; color: var(--dark); }
.benefit span { font-size: 12px; color: var(--gray); }

/* ===== Секции ===== */
.section { margin: 36px 0; }
.section-head { display: flex; align-items: center; margin-bottom: 18px; }
.section-head h2 { font-size: 24px; }
.section-head a { margin-left: auto; color: var(--red); font-size: 14px; }

/* ===== Сетка категорий-плиток ===== */
.cat-tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.cat-tile { background: #fff; border: 1px solid #eef0f3; border-radius: var(--radius-lg); padding: 18px 14px; text-align: center; transition: box-shadow .18s, transform .18s; box-shadow: var(--shadow); }
.cat-tile:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.cat-tile .ic { width: 56px; height: 56px; margin: 0 auto; border-radius: 50%; background: var(--bg); color: var(--red); display: flex; align-items: center; justify-content: center; }
.cat-tile .ic svg { width: 28px; height: 28px; }
.cat-tile .nm { margin-top: 10px; font-weight: 600; font-size: 14px; }
.cat-tile .cnt { color: var(--gray); font-size: 12px; margin-top: 2px; }

/* ===== Карточки товаров ===== */
.grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.pcard { border: 1px solid #eef0f3; border-radius: var(--radius-lg); padding: 14px; display: flex; flex-direction: column; position: relative; transition: box-shadow .18s, transform .18s; background: #fff; box-shadow: var(--shadow); }
.pcard:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); z-index: 2; }
.pcard .ph { height: 170px; display: flex; align-items: center; justify-content: center; }
.pcard .ph img { max-width: 100%; max-height: 170px; object-fit: contain; }
.pcard .ph .noimg { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: var(--bg); border-radius: var(--radius); color: #c4c8cf; }
.pcard .ph .noimg svg { width: 60px; height: 60px; }
.pcard .sale-badge { position: absolute; top: 12px; left: 12px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; }
.pcard .rating { font-size: 12px; color: var(--yellow); margin: 8px 0 2px; height: 16px; }
.pcard .rating span { color: var(--gray); }
.pcard .name { font-size: 14px; line-height: 1.3; height: 54px; overflow: hidden; color: var(--dark); }
.pcard .name:hover { color: var(--red); }
.pcard .stock { font-size: 12px; margin: 8px 0; }
.pcard .stock.in { color: var(--green); } .pcard .stock.out { color: var(--gray); }
.pcard .price-row { display: flex; align-items: baseline; gap: 8px; margin-top: auto; }
.pcard .price { font-size: 22px; font-weight: 800; }
.pcard .price.sale { color: var(--red); }
.pcard .old { font-size: 14px; color: var(--gray); text-decoration: line-through; }
.pcard .buy { margin-top: 12px; background: var(--red); color: #fff; font-weight: 700; padding: 11px; border-radius: 8px; width: 100%; font-size: 14px; }
.pcard .buy:hover { background: var(--red-dark); }
.pcard .buy.added { background: var(--green); }
.pcard .buy.out, .pcard .buy:disabled { background: var(--bg); color: var(--gray); cursor: not-allowed; }
.pcard .buy.out:hover, .pcard .buy:disabled:hover { background: var(--bg); }

/* ===== Подвал ===== */
footer { background: var(--dark); color: #c9ccd3; margin-top: 50px; padding: 40px 0 30px; }
footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; }
footer h4 { color: #fff; font-size: 15px; margin-bottom: 14px; }
footer a { display: block; color: #c9ccd3; padding: 5px 0; font-size: 13px; }
footer a:hover { color: #fff; }
footer .logo { color: #fff; margin-bottom: 12px; }
footer .copy { border-top: 1px solid #34373f; margin-top: 30px; padding-top: 20px; font-size: 12px; color: var(--gray); }

.toast { position: fixed; bottom: 24px; right: 24px; background: var(--dark); color: #fff; padding: 13px 18px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.25); opacity: 0; transform: translateY(10px); transition: .2s; z-index: 100; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1100px) { .grid { grid-template-columns: repeat(4,1fr); } .cat-tiles { grid-template-columns: repeat(4,1fr); } }
@media (max-width: 1100px) { .benefits { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 800px) { .grid { grid-template-columns: repeat(2,1fr); } .cat-tiles { grid-template-columns: repeat(3,1fr); } .catbar nav, .header .act span:not(.ic):not(.count) { display: none; }
  .hero-main { min-height: 0; } .hero-slide { position: relative; inset: auto; opacity: 1; visibility: visible; display: none; padding: 26px 24px 30px; align-items: center; } .hero-slide.active { display: flex; } .hero-main h2 { font-size: 30px; } .hero-art { display: none; } .hero-dots { display: none; } .promo-row { grid-template-columns: 1fr; } }

@media (max-width: 700px) {
  .wrap { padding: 0 18px; }
  /* шапка: поиск уезжает на отдельную строку, иконки остаются справа от логотипа */
  .header .wrap { flex-wrap: wrap; height: auto; padding: 12px 18px; gap: 10px 14px; }
  .logo { font-size: 22px; }
  .logo small { display: none; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .header .acts { gap: 18px; }
  .header .act .ic svg { width: 25px; height: 25px; }
  /* верхняя полоса: оставляем только город и телефон */
  .topbar .wrap { gap: 14px; }
  .topbar a:not([href^="tel"]) { display: none; }
  /* мега-меню каталога — полноэкранное, drill-in в подкатегории */
  .catbar .wrap { gap: 12px; }
  .catmenu.open { position: fixed; top: 0 !important; left: 0 !important; right: 0; bottom: 0; width: auto; border: none; border-radius: 0; z-index: 200; display: flex; flex-direction: column; }
  .cm-mhead { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); flex: none; }
  .cm-mhead .cm-mtitle { flex: 1; text-align: center; font-weight: 700; font-size: 16px; }
  .cm-mhead .cm-close { width: 44px; height: 44px; background: none; color: var(--gray); font-size: 20px; }
  .cm-mhead .cm-back { display: none; min-height: 44px; padding: 0 8px; background: none; color: var(--dark); font-size: 15px; font-weight: 600; }
  .catmenu.drill .cm-mhead .cm-back { display: block; }
  .catmenu.drill .cm-mhead .cm-close { display: none; }
  .cm-body { flex: 1; overflow-y: auto; }
  .cm-side { width: 100%; border-right: none; padding: 6px; }
  .cm-cat { padding: 14px 14px; }
  .cm-cat .cm-arr { font-size: 22px; }
  .cm-main { display: none; min-width: 0; min-height: 0; padding: 16px; }
  .catmenu.drill .cm-side { display: none; }
  .catmenu.drill .cm-main { display: block; }
  .cm-subs { columns: 1; }
  .cm-subs a { padding: 13px 0; font-size: 15px; }
  .cm-head { font-size: 18px; margin-bottom: 12px; }
  /* подвал */
  footer .cols { grid-template-columns: 1fr 1fr; gap: 22px 18px; }
  h1 { font-size: 24px; }
}

@media (max-width: 460px) {
  .cat-tiles { grid-template-columns: repeat(2,1fr); }
  .section-head h2 { font-size: 20px; }
  footer .cols { grid-template-columns: 1fr; }
}
/* узкие телефоны + крупные тап-зоны */
@media (max-width: 430px) {
  .header .act { min-width: 44px; min-height: 44px; justify-content: center; }
  .search input, .search button, .cat-btn { min-height: 46px; }
  .hero-main { min-height: 0; }
  .hero-slide { padding: 22px 18px 26px; }
  .hero-main h2 { font-size: 24px; }
  .hero-main p { font-size: 14px; margin-top: 10px; }
  .hero-main .hero-cta { margin-top: 18px; padding: 12px 22px; }
  .grid { gap: 10px; }
  .pcard { padding: 11px; }
  .pcard .ph { height: 132px; }
  .pcard .ph img { max-height: 132px; }
  .pcard .name { font-size: 13px; height: 50px; }
  .pcard .price { font-size: 18px; }
  .pcard .buy { padding: 11px; font-size: 13px; }
  .cat-tile .ic { width: 48px; height: 48px; }
  .cat-tile .ic svg { width: 24px; height: 24px; }
}
