/* Общие стили сайта: токены, шапка, кнопки, карточки постеров, подвал. */

:root {
  --ink:       #0D0D0D;
  --ink2:      #3A3A3A;
  --ink-hover: #2A2A2A;   /* тёмные кнопки при наведении */
  /* Вторичный текст. #767676 проходит 4.5:1 только на белом, а основной фон
     бумажный — поэтому темнее: 4.9:1 на --bg, 5.3:1 на белом. */
  --muted:     #6B6B6B;
  --border:    #E0DDD8;
  --hairline:  rgba(0,0,0,0.07);
  --bg:        #F8F6F3;
  --bg-glass:  rgba(248,246,243,0.82);
  --white:     #FFFFFF;
  --paper:     #E8E4DE;
  --accent:    #1A56A0;
  --wall:      #2C2A27;   /* тёмная «стена» за постером в первом экране */
  --wall-deep: #161514;
  --frame-mat: #F4F1EC;
  --frame-edge:#0F0F0F;
  --scrim:     rgba(0,0,0,0.55);
  --nav-row:   58px;
  --nav-h:     var(--nav-row);
  --tap:       44px;      /* минимальная область нажатия */
  --gutter:    48px;
  --max-w:     1360px;
  --f-display: 'Unbounded', sans-serif;
  --f-body:    'Inter', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; scrollbar-color: #C9C4BC transparent; }
body {
  font-family: var(--f-body); background: var(--bg); color: var(--ink);
  min-height: 100vh; overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: var(--f-body); }
::selection { background: var(--ink); color: var(--bg); }
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-thumb { background: #C9C4BC; border: 2px solid var(--bg); border-radius: 4px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }

.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 300;
  padding: 12px 18px; background: var(--ink); color: var(--white);
  font-size: 13px; border-radius: 3px;
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

/* Мелкие текстовые ссылки остаются визуально мелкими, но область нажатия
   у них не меньше 44 px по высоте */
.nav-cta, .btn-ghost, .sec-link, .sec-title--dark a { position: relative; }
.nav-cta::before, .btn-ghost::before, .sec-link::before, .sec-title--dark a::before {
  content: ''; position: absolute; left: -4px; right: -4px;
  top: 50%; height: var(--tap); transform: translateY(-50%);
}

/* ══ NAV ══ */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--nav-h);
  display: flex; align-items: center;
  padding: 0 var(--gutter);
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--hairline);
}
.nav-logo {
  font-family: var(--f-display); font-weight: 900; font-size: 13px;
  letter-spacing: 0.14em; text-transform: uppercase; flex-shrink: 0;
  display: flex; align-items: center; min-height: var(--tap);
}
.nav-center { flex: 1; display: flex; justify-content: center; gap: 36px; }
.nav-center a, .nav-right a:not(.nav-cta) {
  font-size: 12px; letter-spacing: 0.03em; color: var(--muted);
  position: relative; transition: color .2s;
  display: flex; align-items: center; min-height: var(--tap);
}
.nav-center a::after {
  content: ''; position: absolute; bottom: 12px; left: 0; right: 0;
  height: 1px; background: var(--ink);
  transform: scaleX(0); transform-origin: left; transition: transform .25s ease;
}
.nav-center a:hover, .nav-right a:not(.nav-cta):hover { color: var(--ink); }
.nav-center a:hover::after { transform: scaleX(1); }
.nav-center .nav-extra { display: none; }
.nav-right { display: flex; align-items: center; gap: 20px; margin-left: auto; }
.nav-cta {
  font: 500 12px/1 var(--f-body); letter-spacing: 0.04em;
  padding: 7px 16px; background: var(--ink); color: var(--white);
  border-radius: 3px; transition: background .2s;
  display: inline-flex; align-items: center; gap: 6px;
}
.nav-cta:hover { background: var(--ink-hover); }
/* SVG-стрелка в кнопках и ссылках: при наведении сдвигается, как у .btn-primary */
.i-arrow { flex-shrink: 0; transition: transform .2s; }
.nav-cta:hover .i-arrow, .sec-link:hover .i-arrow { transform: translateX(3px); }

/* ══ BUTTONS ══ */
.btn-primary {
  font: 600 12px/1 var(--f-display); letter-spacing: 0.06em; text-transform: uppercase;
  padding: 16px 32px; background: var(--ink); color: var(--white);
  border: none; border-radius: 3px;
  display: inline-flex; align-items: center; gap: 10px;
  transition: background .2s, transform .15s;
}
.btn-primary:hover { background: var(--ink-hover); transform: translateY(-1px); }
.btn-primary svg { transition: transform .2s; }
.btn-primary:hover svg { transform: translateX(3px); }
.btn-ghost {
  font: 400 13px/1 var(--f-body); color: var(--muted);
  border-bottom: 1px solid var(--border); padding-bottom: 2px;
  transition: color .2s, border-color .2s;
}
.btn-ghost:hover { color: var(--ink); border-color: var(--ink); }

/* ══ SECTIONS ══ */
.section {
  max-width: var(--max-w); margin: 0 auto;
  padding: 88px var(--gutter);
  border-top: 1px solid var(--border);
}
.section--compact { padding-top: 64px; padding-bottom: 64px; }
.sec-header {
  display: grid; grid-template-columns: 1fr auto;
  align-items: baseline; margin-bottom: 48px;
}
.section--compact .sec-header { margin-bottom: 32px; }
.sec-title {
  font-family: var(--f-display); font-size: 11px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.sec-title--dark { color: var(--ink); font-size: 14px; letter-spacing: -0.01em; text-transform: none; }
.sec-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--muted);
  border-bottom: 1px solid var(--border); padding-bottom: 1px;
  transition: color .2s, border-color .2s;
}
.sec-link:hover { color: var(--ink); border-color: var(--ink); }

/* ══ POSTER IMAGE ══ */
.poster-img {
  width: 100%; aspect-ratio: 0.707;
  background: var(--paper); border-radius: 3px;
  overflow: hidden; position: relative;
}
.poster-img img, .poster-img .poster-placeholder {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s cubic-bezier(.2,.7,.3,1);
}
.poster-img img { display: block; }
/* Постер каталога может быть любых пропорций. В превью он заполняет карточку
   целиком (края, не попавшие в пропорцию карточки, обрезаются) — без серых
   полей. Целиком картинка видна на странице постера. */
.poster-img img.poster-fit, .hero-frame img.poster-fit { object-fit: cover; }
/* Заглушка вместо картинки: градиент по оттенку постера + название */
.poster-placeholder {
  display: flex; align-items: flex-end;
  padding: 12%;
  background:
    radial-gradient(120% 80% at 20% 10%, hsl(var(--h) 45% 62%) 0%, transparent 60%),
    linear-gradient(160deg, hsl(var(--h) 35% 38%), hsl(calc(var(--h) + 40) 40% 16%));
  color: rgba(255,255,255,0.92);
}
.poster-placeholder span {
  font-family: var(--f-display); font-weight: 700;
  font-size: clamp(11px, 1.3vw, 18px); line-height: 1.15; letter-spacing: -0.02em;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical;
}

/* ══ FOOTER ══ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 64px var(--gutter) 40px;
  max-width: var(--max-w); margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px;
}
.f-brand {
  font-family: var(--f-display); font-weight: 900; font-size: 13px;
  letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 16px;
}
.f-desc { font-size: 13px; color: var(--muted); line-height: 1.75; max-width: 280px; font-weight: 300; }
.f-col h2 {
  font-size: 10px; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 6px;
}
.f-col ul { list-style: none; display: flex; flex-direction: column; }
.f-col a {
  display: inline-block; padding: 6px 0;
  font-size: 13px; color: var(--muted); transition: color .2s; font-weight: 400;
}
.f-col a:hover { color: var(--ink); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 20px var(--gutter); max-width: var(--max-w); margin: 0 auto;
  font-size: 11px; color: var(--muted); letter-spacing: 0.03em;
}
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.footer-bottom a {
  display: inline-flex; align-items: center; min-height: var(--tap); margin: -14px 0;
  text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px;
  transition: color .2s;
}
.footer-bottom a:hover { color: var(--ink); }

/* ══ RESPONSIVE ══ */
@media (max-width: 1200px) {
  :root { --gutter: 32px; }
  .section { padding-top: 72px; padding-bottom: 72px; }
}
@media (max-width: 900px) {
  /* Категории переезжают во второй ряд шапки и прокручиваются вбок */
  :root { --nav-h: calc(var(--nav-row) + var(--tap) + 2px);  /* + 2 линии */ }
  .site-nav { flex-wrap: wrap; height: auto; }
  .nav-logo, .nav-right { height: var(--nav-row); }
  .nav-center {
    order: 3; flex: 0 0 calc(100% + 2 * var(--gutter));
    margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter);
    justify-content: flex-start; gap: 24px;
    overflow-x: auto; scrollbar-width: none;
    border-top: 1px solid var(--hairline);
    -webkit-mask-image: linear-gradient(to right, #000 85%, transparent);
            mask-image: linear-gradient(to right, #000 85%, transparent);
  }
  .nav-center::-webkit-scrollbar { display: none; }
  .nav-center a { white-space: nowrap; flex-shrink: 0; }
  .nav-center a:last-child { padding-right: 40px; }
  .site-footer { grid-template-columns: 1fr 1fr; gap: 32px; }
  .f-col a { padding: 14px 0; }
}
@media (max-width: 640px) {
  :root { --gutter: 20px; }
  .nav-right a:not(.nav-cta):not(.nav-cart) { display: none; }
  .nav-center .nav-extra { display: flex; }
  .section { padding-top: 52px; padding-bottom: 52px; }
  .site-footer { grid-template-columns: 1fr; padding-top: 40px; padding-bottom: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn-primary:hover, .btn-primary:hover svg, .i-arrow { transform: none !important; }
  .poster-img img, .poster-img .poster-placeholder { transition: none; }
}
#main:focus { outline: none; }

/* ══ COOKIE CONSENT ══
   Плашка в углу, не перекрывает страницу и не мешает работать с сайтом.
   «Принять» и «Отказаться» одного размера: отказ не прячем. */
.cookie-consent {
  position: fixed; left: 24px; bottom: 24px; z-index: 250;
  width: min(420px, calc(100vw - 48px));
  padding: 20px 22px;
  background: var(--white); color: var(--ink2);
  border: 1px solid var(--border); border-radius: 6px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.06);
  opacity: 0; transform: translateY(12px);
  transition: opacity .3s cubic-bezier(.2,.7,.3,1), transform .3s cubic-bezier(.2,.7,.3,1);
}
.cookie-consent.is-visible { opacity: 1; transform: none; }
.cookie-title {
  font-family: var(--f-display); font-size: 13px; font-weight: 700;
  letter-spacing: -0.01em; color: var(--ink); margin-bottom: 8px;
}
.cookie-text { font-size: 13px; line-height: 1.6; }
.cookie-text a {
  color: var(--ink); text-decoration: underline;
  text-decoration-color: var(--border); text-underline-offset: 3px;
}
.cookie-text a:hover { text-decoration-color: var(--ink); }
.cookie-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.cookie-btn {
  min-height: var(--tap); padding: 0 16px;
  font: 500 13px/1 var(--f-body); letter-spacing: 0.02em;
  background: var(--white); color: var(--ink);
  border: 1px solid var(--ink); border-radius: 3px;
  transition: background .2s, color .2s;
}
.cookie-btn:hover { background: var(--bg); }
.cookie-btn--accept { background: var(--ink); color: var(--white); }
.cookie-btn--accept:hover { background: var(--ink-hover); }

.footer-legal { display: inline-flex; flex-wrap: wrap; gap: 0 20px; }
.footer-cookie {
  min-height: var(--tap); margin: -14px 0; padding: 0;
  background: none; border: none; color: inherit; font: inherit; letter-spacing: inherit;
  text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px;
  transition: color .2s;
}
.footer-cookie:hover { color: var(--ink); }

@media (max-width: 640px) {
  .cookie-consent { left: 12px; right: 12px; bottom: 12px; width: auto; padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .cookie-consent { transition: none; transform: none; }
}

/* Плашка-предупреждение категории («Курение вредит вашему здоровью») на
   странице постера: чёрный текст на белом в чёрной рамке, как на упаковке */
.health-warning {
  margin: 0; padding: 10px 14px;
  background: #fff; color: #000; border: 2px solid #000;
  font-family: Inter, Arial, sans-serif; font-weight: 700; font-size: 15px;
  line-height: 1.25; text-align: center; text-transform: uppercase; letter-spacing: .02em;
}

/* Счётчик корзины в шапке (обе шапки сайта) */
.nav-cart-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; margin-left: 6px; padding: 0 5px;
  border-radius: 9px; background: var(--ink, #0d0d0d); color: #fff;
  font: 600 11px/1 Inter, Arial, sans-serif; font-variant-numeric: tabular-nums;
}
