:root {
  --red: #b51717;
  --black: #111;
  --gray: #7d7d7d;
  --line: #ddd;
  --bg: #fff;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'PT Serif', Georgia, serif; color: var(--black); background: var(--bg); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
.osw { font-family: 'Oswald', Arial, sans-serif; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Header */
header { border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 50; }
.hdr { display: flex; align-items: center; gap: 32px; padding: 14px 0; }
.logo { border: 2px solid var(--black); padding: 4px 14px 6px; text-align: center; line-height: 1; }
.logo .l1 { font-family: 'Oswald', sans-serif; font-size: 22px; letter-spacing: 4px; font-weight: 500; }
.logo .l2 { font-family: 'Oswald', sans-serif; font-size: 9px; letter-spacing: 6px; margin-top: 2px; }
nav { display: flex; gap: 22px; flex: 1; }
nav a { font-family: 'Oswald', sans-serif; font-size: 13px; text-transform: uppercase; letter-spacing: 1.5px; padding: 6px 0; border-bottom: 2px solid transparent; }
nav a:hover, nav a.active { border-color: var(--red); }
.hdr-right { display: flex; align-items: center; gap: 18px; }
.hdr-phone { font-family: 'Oswald', sans-serif; font-size: 14px; letter-spacing: 1px; }
.cart-btn { position: relative; font-family: 'Oswald', sans-serif; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; border: 2px solid var(--black); padding: 8px 16px; cursor: pointer; background: #fff; }
.cart-btn:hover { background: var(--black); color: #fff; }
.cart-count { position: absolute; top: -9px; right: -9px; background: var(--red); color: #fff; border-radius: 50%; min-width: 20px; height: 20px; font-size: 12px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.cart-count.hidden { display: none; }

/* Hero */
.hero { background: var(--black); color: #fff; padding: 70px 0; }
.hero h1 { font-family: 'Oswald', sans-serif; font-size: 42px; font-weight: 500; text-transform: uppercase; letter-spacing: 3px; max-width: 700px; line-height: 1.2; }
.hero p { margin-top: 18px; font-size: 18px; color: #ccc; max-width: 560px; }
.hero .btn { margin-top: 30px; }

/* Buttons */
.btn { display: inline-block; font-family: 'Oswald', sans-serif; font-size: 14px; text-transform: uppercase; letter-spacing: 2px; padding: 13px 34px; border: 2px solid var(--red); background: var(--red); color: #fff; cursor: pointer; transition: 0.15s; }
.btn:hover { background: #8f1010; border-color: #8f1010; }
.btn.ghost { background: transparent; color: var(--black); border-color: var(--black); }
.btn.ghost:hover { background: var(--black); color: #fff; }
.btn.white { background: #fff; color: var(--black); border-color: #fff; }
.btn.white:hover { background: var(--red); border-color: var(--red); color: #fff; }
.btn:disabled { opacity: 0.5; cursor: default; }

/* Sections */
.section { padding: 56px 0; }
.section h2 { font-family: 'Oswald', sans-serif; font-size: 28px; font-weight: 500; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 30px; }
.section h2 span { border-bottom: 3px solid var(--red); padding-bottom: 6px; }

/* Category tiles */
.cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.cat-tile { position: relative; display: block; background: var(--black); color: #fff; aspect-ratio: 1; overflow: hidden; }
.cat-tile img { width: 100%; height: 100%; object-fit: cover; opacity: 0.75; transition: 0.2s; }
.cat-tile:hover img { opacity: 0.5; transform: scale(1.04); }
.cat-tile .t { position: absolute; left: 16px; bottom: 14px; right: 16px; font-family: 'Oswald', sans-serif; font-size: 16px; text-transform: uppercase; letter-spacing: 1px; text-shadow: 0 1px 6px rgba(0,0,0,0.7); }
.cat-tile .n { position: absolute; top: 12px; right: 14px; font-family: 'Oswald', sans-serif; font-size: 12px; background: var(--red); padding: 2px 8px; }

/* Product grid */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.card { border: 1px solid var(--line); display: flex; flex-direction: column; transition: 0.15s; }
.card:hover { box-shadow: 0 6px 22px rgba(0,0,0,0.12); }
.card .ph { aspect-ratio: 3/4; overflow: hidden; display: block; }
.card .ph img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 12px 14px 16px; display: flex; flex-direction: column; flex: 1; }
.card .nm { font-size: 14px; line-height: 1.4; height: 58px; overflow: hidden; }
.card .pricerow { margin-top: auto; padding-top: 10px; display: flex; align-items: baseline; gap: 10px; }
.card .pr { font-family: 'Oswald', sans-serif; font-size: 20px; color: var(--red); font-weight: 500; }
.card .old { font-size: 13px; color: var(--gray); text-decoration: line-through; }
.card .add { margin-top: 10px; }
.card .add button { width: 100%; }
.btn.sm { padding: 9px 0; font-size: 12px; }
.oos { color: var(--gray); font-family: 'Oswald', sans-serif; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; text-align: center; padding: 11px 0; border: 2px dashed var(--line); }

/* Catalog layout */
.cat-head { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; margin-bottom: 26px; }
.cat-head h1 { font-family: 'Oswald', sans-serif; font-size: 30px; font-weight: 500; text-transform: uppercase; letter-spacing: 2px; }
.search { flex: 1; min-width: 220px; display: flex; }
.search input { flex: 1; border: 2px solid var(--black); border-right: 0; padding: 10px 14px; font-family: inherit; font-size: 15px; }
.search button { border: 2px solid var(--black); background: var(--black); color: #fff; padding: 0 18px; cursor: pointer; }
.chips { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 28px; }
.chip { font-family: 'Oswald', sans-serif; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; border: 1px solid var(--black); padding: 7px 14px; }
.chip:hover { background: #f2f2f2; }
.chip.active { background: var(--black); color: #fff; }

/* Product page */
.pp { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: start; }
.gallery .main { border: 1px solid var(--line); aspect-ratio: 3/4; }
.gallery .main img { width: 100%; height: 100%; object-fit: contain; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.thumbs img { width: 64px; height: 64px; object-fit: cover; border: 1px solid var(--line); cursor: pointer; }
.thumbs img.sel { border: 2px solid var(--red); }
.pp h1 { font-size: 26px; line-height: 1.3; font-weight: 700; }
.pp .prices { display: flex; align-items: baseline; gap: 14px; margin: 22px 0; }
.pp .pr { font-family: 'Oswald', sans-serif; font-size: 34px; color: var(--red); font-weight: 500; }
.pp .old { font-size: 18px; color: var(--gray); text-decoration: line-through; }
.pp .stock { font-family: 'Oswald', sans-serif; font-size: 13px; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 20px; }
.pp .stock.in { color: #1b7a2f; }
.pp .stock.out { color: var(--gray); }
.pp .desc { margin-top: 34px; line-height: 1.65; font-size: 15px; white-space: pre-line; }
.pp .desc h3, .attrs h3 { font-family: 'Oswald', sans-serif; font-size: 18px; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 14px; font-weight: 500; }
.attrs { margin-top: 30px; }
.attrs table { width: 100%; border-collapse: collapse; font-size: 14px; }
.attrs td { padding: 7px 10px; border-bottom: 1px solid #eee; }
.attrs td:first-child { color: var(--gray); width: 45%; }

/* Cart & checkout */
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table td { padding: 14px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.cart-table img { width: 70px; height: 70px; object-fit: cover; border: 1px solid var(--line); }
.qty { display: inline-flex; border: 1px solid var(--black); }
.qty button { width: 32px; height: 34px; border: 0; background: #fff; font-size: 17px; cursor: pointer; }
.qty button:hover { background: #eee; }
.qty span { width: 40px; display: flex; align-items: center; justify-content: center; font-family: 'Oswald', sans-serif; }
.rm { color: var(--gray); cursor: pointer; background: none; border: 0; font-size: 20px; }
.rm:hover { color: var(--red); }
.total-row { display: flex; justify-content: flex-end; align-items: baseline; gap: 16px; margin: 26px 0; }
.total-row .sum { font-family: 'Oswald', sans-serif; font-size: 30px; color: var(--red); }
.empty { text-align: center; padding: 70px 0; color: var(--gray); font-size: 18px; }

.form { max-width: 560px; }
.form label { display: block; font-family: 'Oswald', sans-serif; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; margin: 18px 0 6px; }
.form input, .form textarea, .form select { width: 100%; border: 2px solid var(--black); padding: 11px 14px; font-family: inherit; font-size: 15px; }
.form .req::after { content: ' *'; color: var(--red); }
.radio-line { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 2px solid var(--line); margin-top: 10px; cursor: pointer; }
.radio-line.sel { border-color: var(--black); }
.radio-line small { color: var(--gray); display: block; margin-top: 3px; }
.note { background: #f7f7f7; border-left: 4px solid var(--red); padding: 14px 18px; margin: 22px 0; font-size: 14px; line-height: 1.5; }

/* Footer */
footer { background: var(--black); color: #bbb; margin-top: 70px; padding: 44px 0; font-size: 14px; }
.ftr { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
footer a { color: #fff; }
footer .logo { border-color: #fff; color: #fff; }

/* Ok page */
.ok-box { text-align: center; padding: 80px 20px; }
.ok-box .num { font-family: 'Oswald', sans-serif; font-size: 44px; color: var(--red); margin: 18px 0; }

@media (max-width: 900px) {
  .cats, .grid { grid-template-columns: repeat(2, 1fr); }
  .pp { grid-template-columns: 1fr; }
  nav { display: none; }
  .hero h1 { font-size: 30px; }
}

/* Chat widget */
#chat-fab { position: fixed; right: 22px; bottom: 22px; width: 56px; height: 56px; border-radius: 50%; border: 0; background: #b51717; color: #fff; font-size: 24px; cursor: pointer; box-shadow: 0 4px 16px rgba(0,0,0,0.3); z-index: 100; }
#chat-fab:hover { background: #8f1010; }
#chat-panel { display: none; position: fixed; right: 22px; bottom: 90px; width: 320px; height: 420px; background: #fff; border: 2px solid #111; flex-direction: column; z-index: 100; box-shadow: 0 8px 30px rgba(0,0,0,0.25); }
.ch-head { font-family: 'Oswald', sans-serif; text-transform: uppercase; letter-spacing: 1px; background: #111; color: #fff; padding: 10px 14px; display: flex; justify-content: space-between; }
.ch-head span { cursor: pointer; font-size: 18px; }
.ch-msgs { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.ch-m { max-width: 85%; padding: 8px 12px; font-size: 14px; line-height: 1.4; }
.ch-m.mgr { background: #f1f1f1; align-self: flex-start; }
.ch-m.cli { background: #b51717; color: #fff; align-self: flex-end; }
.ch-form { display: flex; border-top: 1px solid #ddd; }
.ch-form input { flex: 1; border: 0; padding: 12px; font-family: inherit; font-size: 14px; outline: none; }
.ch-form button { border: 0; background: #111; color: #fff; padding: 0 16px; cursor: pointer; }

/* Carousels */
.carousel-wrap { position: relative; }
.cats-car, .decl-car { display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px; }
.cats-car::-webkit-scrollbar, .decl-car::-webkit-scrollbar { display: none; }
.cats-car .cat-tile { flex: 0 0 262px; aspect-ratio: 1; scroll-snap-align: start; }
.decl-car img { flex: 0 0 200px; height: 280px; object-fit: cover; object-position: top; border: 1px solid var(--line); cursor: zoom-in; scroll-snap-align: start; transition: 0.15s; }
.decl-car img:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.2); }
.car-btn { position: absolute; top: 50%; transform: translateY(-50%); z-index: 5; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--black); color: #fff; font-size: 24px; line-height: 1; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,0.3); }
.car-btn:hover { background: var(--red); }
.car-btn.prev { left: -14px; }
.car-btn.next { right: -14px; }

/* Lightbox */
#lightbox { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 200; align-items: center; justify-content: center; cursor: zoom-out; }
#lightbox img { max-width: 92vw; max-height: 92vh; background: #fff; }

@media (max-width: 900px) {
  .cats-car .cat-tile { flex-basis: 70vw; }
  .decl-car img { flex-basis: 150px; height: 210px; }
}

/* Hero with photo */
.hero { padding: 0; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1fr 440px; gap: 40px; align-items: stretch; }
.hero-text { padding: 80px 0; align-self: center; }
.hero-photo { position: relative; min-height: 420px; }
.hero-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.hero-photo::before { content: ''; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, #111 0%, rgba(17,17,17,0) 22%); }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 0; }
  .hero-text { padding: 46px 0 30px; }
  .hero-photo { min-height: 320px; margin: 0 -20px; }
  .hero-photo::before { background: linear-gradient(180deg, #111 0%, rgba(17,17,17,0) 22%); }
}

/* Видео на странице товара */
.video-row { display: flex; gap: 16px; flex-wrap: wrap; }
.video-row video { width: 300px; max-width: 100%; aspect-ratio: 9/14; background: #000; border: 1px solid var(--line); }

/* Кнопка чата — перламутрово-зелёная, как гель-лак */
#chat-fab {
  background: linear-gradient(135deg, #0e7a52, #3ddc97, #a8f0c6, #17b978, #0e7a52);
  background-size: 300% 300%;
  animation: pearl-green 6s ease-in-out infinite;
  box-shadow: 0 4px 18px rgba(23, 185, 120, 0.55), inset 0 1px 3px rgba(255,255,255,0.6);
}
#chat-fab:hover { filter: brightness(1.08); }
@keyframes pearl-green {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@media (prefers-reduced-motion: reduce) { #chat-fab { animation: none; } }
