/* Базовые токены. Темы витрин переопределяют их через body.theme-<код>. */
:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --text: #14202e;
  --muted: #5b6b7d;
  --line: #e2e8f0;
  --brand: #1f6feb;
  --brand-ink: #ffffff;
  --accent: #ff8a3d;
  --ok: #1a7f4b;
  --warn: #b26a00;
  --bad: #c0392b;
  --radius: 14px;
  --hero: linear-gradient(135deg, #1f6feb 0%, #4fb3ff 55%, #ffd29d 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
body.theme-team {
  --hero: linear-gradient(135deg, var(--brand) 0%, #14202e 100%);
}
body.theme-sunset {
  --brand: #d9480f;
  --accent: #7048e8;
  --hero: linear-gradient(135deg, #7048e8 0%, #d9480f 60%, #ffc078 100%);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.5; }
a { color: var(--brand); text-decoration: none; }
.logo { display: flex; align-items: center; gap: 8px; }
.logo-img { height: 36px; width: auto; }
.hero-cover { background-size: cover; background-position: center; }
.post-card .cover { aspect-ratio: 16/9; background: var(--hero); border-radius: 10px; overflow: hidden; margin-bottom: 12px; }
.post-card .cover img { width: 100%; height: 100%; object-fit: cover; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

/* Шапка */
.header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header .container { display: flex; align-items: center; gap: 24px; height: 64px; }
.logo { font-weight: 800; font-size: 1.25rem; color: var(--text); white-space: nowrap; }
.logo span { color: var(--brand); }
.nav { display: flex; gap: 18px; flex: 1; }
.nav a { color: var(--text); }
.footer { margin-top: 64px; padding: 32px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }

/* Кнопки и формы */
.btn { display: inline-block; padding: 12px 22px; border-radius: 999px; border: 0; background: var(--brand);
       color: var(--brand-ink); font-weight: 600; font-size: 1rem; cursor: pointer; text-align: center; }
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--brand); border: 1.5px solid var(--brand); }
.btn-accent { background: var(--accent); }
.btn-danger { background: var(--bad); }
.btn-sm { padding: 7px 14px; font-size: .9rem; }
.btn-block { display: block; width: 100%; }
form p { margin: 0 0 14px; }
label { display: block; font-weight: 600; margin-bottom: 4px; font-size: .95rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=search],
select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: #fff;
}
input[type=checkbox] { margin-right: 6px; }
.errorlist { color: var(--bad); margin: 4px 0; padding-left: 18px; font-size: .9rem; }
ul#id_location_ids, div#id_location_ids { list-style: none; padding: 0; }
#id_location_ids label { font-weight: 400; }

/* Карточки */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.product-card { display: flex; flex-direction: column; overflow: hidden; padding: 0; color: var(--text); }
.product-card:hover { text-decoration: none; box-shadow: 0 8px 24px rgba(20, 32, 46, .08); }
.product-card .cover { aspect-ratio: 16/10; background: var(--hero); display: grid; place-items: center;
                       font-size: 3.5rem; overflow: hidden; }
/* Фото закреплено по размеру обложки; у вертикальных кадров люди под крылом ниже центра */
.product-card .cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; }
.product-card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.product-card .price { margin-top: auto; font-weight: 800; font-size: 1.2rem; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600;
         background: #eef2f7; color: var(--muted); }
.badge-ok { background: #e3f6ec; color: var(--ok); }
.badge-warn { background: #fff3db; color: var(--warn); }
.badge-bad { background: #fde7e4; color: var(--bad); }
.badge-brand { background: var(--brand); color: var(--brand-ink); }

/* Главная */
.hero { background: var(--hero); color: #fff; padding: 72px 0 80px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); max-width: 720px; }
.hero p { font-size: 1.2rem; max-width: 600px; opacity: .95; }
.hero .btn { background: #fff; color: var(--brand); margin-top: 12px; }
.section { padding: 48px 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { padding: 8px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.chip.active { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.steps { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.steps .num { font-size: 2rem; font-weight: 800; color: var(--brand); }

/* Страница продукта */
.product-layout { display: grid; gap: 32px; grid-template-columns: 1fr 360px; margin-top: 32px; }
.gallery { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.gallery img { border-radius: 10px; aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.buy-box { position: sticky; top: 16px; align-self: start; }
.buy-box .price { font-size: 2rem; font-weight: 800; }
.prose { white-space: pre-line; }

/* Сообщения */
.messages { list-style: none; padding: 0; margin: 16px 0; }
.messages li { padding: 12px 16px; border-radius: 10px; margin-bottom: 8px; background: #eef2f7; }
.messages .success { background: #e3f6ec; color: var(--ok); }
.messages .error { background: #fde7e4; color: var(--bad); }

/* Таблицы */
.table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: .85rem; color: var(--muted); font-weight: 600; background: #fafbfc; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }

/* Кабинет */
.stats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.stat .value { font-size: 1.8rem; font-weight: 800; }
.stat .label { color: var(--muted); font-size: .9rem; }
.cabinet-header { background: #14202e; }
.cabinet-header .logo, .cabinet-header .nav a { color: #fff; }
.cabinet-header .muted { color: #9fb0c3; }
.cabinet-header select { width: auto; padding: 6px 10px; }

/* Сертификат */
.cert-status { font-size: 1.1rem; padding: 14px 18px; border-radius: 12px; font-weight: 600; }
.cert-ok { background: #e3f6ec; color: var(--ok); }
.cert-bad { background: #fde7e4; color: var(--bad); }
.redeem-box { border: 2px solid var(--brand); }

.print-sheet { max-width: 800px; margin: 24px auto; background: #fff; border-radius: 20px; overflow: hidden;
               box-shadow: 0 10px 40px rgba(20, 32, 46, .12); }
.print-sheet .top { background: var(--hero); color: #fff; padding: 40px; }
.print-sheet .top h1 { font-size: 2.4rem; }
.print-sheet .bottom { display: grid; grid-template-columns: 1fr 220px; gap: 24px; padding: 32px 40px 40px; }
.print-sheet .code { font-family: ui-monospace, Menlo, monospace; font-size: 1.4rem; font-weight: 700; letter-spacing: 2px; }
.print-actions { text-align: center; margin: 16px; }
@media print {
  body { background: #fff; }
  .print-actions, .header, .footer { display: none; }
  .print-sheet { box-shadow: none; margin: 0; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

@media (max-width: 800px) {
  .product-layout { grid-template-columns: 1fr; }
  .buy-box { order: -1; position: static; }
  .print-sheet .bottom { grid-template-columns: 1fr; }
  .header .container { gap: 12px; }
  .nav { gap: 12px; font-size: .95rem; }
  .hide-mobile { display: none; }
}

/* Отзывы */
.stars { color: #f5a524; letter-spacing: 1px; }
.rating { white-space: nowrap; }
.review { margin-bottom: 14px; }
.review-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.review-reply { background: #f6f8fb; border-left: 3px solid var(--brand); padding: 10px 12px; border-radius: 8px; font-size: .95rem; }
.external-reviews { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.review-widget { width: 100%; max-width: 560px; height: 600px; border: 1px solid var(--line); border-radius: var(--radius); margin-top: 12px; }
.hp { position: absolute; left: -9999px; }
.star-picker { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; font-size: 2rem; }
.star-picker input { display: none; }
.star-picker label { color: #d0d7e2; cursor: pointer; font-weight: 400; font-size: 2rem; line-height: 1; margin: 0 2px; }
.star-picker input:checked ~ label, .star-picker label:hover, .star-picker label:hover ~ label { color: #f5a524; }

/* Опции */
fieldset.options { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; }
fieldset.options legend { font-weight: 600; padding: 0 4px; }
label.option { font-weight: 400; display: block; padding: 4px 0; }
.option-list { list-style: none; padding: 0; margin: 8px 0; }
.option-list li { padding: 3px 0; }

/* Шапка сайта команды с иллюстрацией на светлом фоне */
.hero-split { background: linear-gradient(180deg, #eaf6fb 0%, #ffffff 70%); border-bottom: 1px solid var(--line); }
.hero-split .container { display: grid; grid-template-columns: minmax(280px, 2fr) 3fr; align-items: center; gap: 24px; padding-top: 32px; }
.hero-split h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); color: var(--brand); }
.hero-split p { font-size: 1.2rem; color: var(--muted); }
.hero-art { width: 100%; height: auto; mix-blend-mode: multiply; }
@media (max-width: 800px) {
  .hero-split .container { grid-template-columns: 1fr; padding-top: 24px; }
}

/* Сортировка и порядок */
.sort-bar { display: flex; align-items: center; gap: 10px; justify-content: flex-end; margin-bottom: 16px; }
.sort-bar label { margin: 0; font-weight: 400; color: var(--muted); }
.sort-bar select { width: auto; }
.order-list { list-style: none; padding: 0; margin: 0; }
.order-list li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface); }
.order-list li:last-child { border-bottom: 0; }
.order-list .num { width: 1.5em; color: var(--muted); }
.order-list .title { flex: 1; }
.order-list form { display: flex; gap: 6px; }
.order-list button[disabled] { opacity: .3; cursor: default; }
.badge-hit { background: #fff1e6; color: #c2410c; }
.product-card .cover { position: relative; }
.cover-badge { position: absolute; top: 10px; left: 10px; z-index: 1; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.hit-toggle { font-weight: 400; white-space: nowrap; }

/* Карты */
.map-widget { width: 100%; height: 260px; border: 0; border-radius: 10px; margin: 8px 0; }

/* Кнопки категорий с фото */
.category-tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.category-tile { position: relative; aspect-ratio: 4/3; border-radius: var(--radius); overflow: hidden; display: flex;
                 align-items: flex-end; padding: 14px; color: #fff; background: var(--hero) 50% 62%/cover no-repeat;
                 font-weight: 700; font-size: 1.15rem; text-shadow: 0 1px 3px rgba(0,0,0,.4); }
.category-tile:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(20,32,46,.15); }
.category-tile .icon { position: absolute; top: 12px; left: 14px; font-size: 2rem; }
