@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Caveat:wght@600;700&family=Nunito:ital,wght@0,400;0,600;0,700;1,400&display=swap&subset=cyrillic,latin');

:root {
  /* Бумага и чернила — раскраска */
  --bg: #FFFDF7;
  --paper: #FFFFFF;
  --plaster: #ECE7DC;
  --plaster-dark: #D8D1C2;
  --ink: #1F1B16;
  --ink-soft: #6E675C;

  /* Гуашь — насыщенная */
  --paint-coral: #FF5A47;
  --coral-ink: #D8351F;
  --paint-sun: #FFC328;
  --paint-sky: #34ABF2;
  --paint-mint: #38C08A;
  --paint-grape: #9B5FE0;
  --paint-pink: #FF6FA5;

  /* Формы */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  /* Жёсткие «наклеечные» тени-обводки вместо размытых */
  --line: 3px solid var(--ink);
  --pop-sm: 3px 3px 0 var(--ink);
  --pop-md: 5px 5px 0 var(--ink);
  --pop-lg: 8px 8px 0 var(--ink);
  --shadow-sm: var(--pop-sm);
  --shadow-md: var(--pop-md);
  --shadow-lg: var(--pop-lg);

  /* Шрифты */
  --font-display: 'Fredoka', system-ui, sans-serif;
  --font-hand: 'Caveat', cursive;
  --font-body: 'Nunito', system-ui, sans-serif;

  --maxw: 1140px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* Фон-раскраска: бумага в мягкую клетку + цветные пятна-краски по краям */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(31, 27, 22, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 27, 22, 0.04) 1px, transparent 1px);
  background-size: 30px 30px;
}
/* Несколько «капель краски», просочившихся на бумагу — статичные, по углам */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(26vmax 26vmax at -6% -4%, rgba(155, 95, 224, 0.14), transparent 60%),
    radial-gradient(24vmax 24vmax at 104% 8%, rgba(52, 171, 242, 0.13), transparent 60%),
    radial-gradient(28vmax 28vmax at 102% 102%, rgba(56, 192, 138, 0.13), transparent 62%),
    radial-gradient(22vmax 22vmax at -4% 104%, rgba(255, 195, 40, 0.16), transparent 60%);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  margin: 0 0 0.5em;
  color: var(--ink);
}

h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }

a {
  color: var(--coral-ink);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

button {
  font-family: var(--font-body);
  cursor: pointer;
}

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* Видимый фокус для клавиатуры */
:focus-visible {
  outline: 3px solid var(--paint-sky);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- Шапка ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: var(--line);
  transition: transform 0.35s cubic-bezier(.4,0,.2,1);
  will-change: transform;
}
.site-header.is-hidden {
  transform: translateY(-100%);
}
.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 48px;
  height: 48px;
  object-fit: contain;
}
.main-nav {
  display: flex;
  gap: 6px;
  margin-left: auto;
  flex-wrap: wrap;
}
.main-nav a {
  color: var(--ink);
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  border: 2.5px solid transparent;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.main-nav a:hover {
  background: var(--paper);
  border-color: var(--ink);
  text-decoration: none;
}
.main-nav a[aria-current="page"] {
  background: var(--ink);
  color: #fff;
}
.cart-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: var(--paint-coral);
  color: #fff;
  font-weight: 700;
  border: var(--line);
  border-radius: 999px;
  box-shadow: var(--pop-sm);
  text-decoration: none;
  transition: transform 0.12s, box-shadow 0.12s;
}
.cart-link:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); text-decoration: none; }
.cart-link:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.cart-badge {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  background: #fff;
  color: var(--coral-ink);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
}

/* ---------- Подвал ---------- */
.site-footer {
  margin-top: 80px;
  background: var(--ink);
  color: #E9E3D6;
  border-top: var(--line);
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 44px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: space-between;
}
.footer-inner h4 { margin-bottom: 0.4em; color: #fff; }
.footer-col p { margin: 0.2em 0; font-size: 0.95rem; }
.site-footer a { color: var(--paint-sun); }

/* Кнопка-бургер: скрыта на десктопе */
.nav-toggle {
  display: none;
  width: 46px;
  height: 46px;
  margin-left: auto;
  border: var(--line);
  background: var(--paper);
  border-radius: 12px;
  box-shadow: var(--pop-sm);
  padding: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.nav-toggle-bar {
  width: 20px;
  height: 2.5px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.2s;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; order: 2; margin-left: auto; }
  .header-inner { flex-wrap: wrap; row-gap: 0; align-items: center; }
  .logo { order: 1; }
  /* корзина — компактная иконка на своей строке под бургером, справа */
  .cart-link {
    order: 3;
    margin-left: auto;
    margin-top: 10px;
    padding: 0;
    width: 44px;
    height: 44px;
    justify-content: center;
    gap: 0;
    font-size: 1.2rem;
  }
  /* пустой flex-разрыв: занимает всю ширину, толкая корзину на новую строку */
  .header-inner::after {
    content: "";
    order: 2;
    width: 100%;
    height: 0;
  }
  .cart-label { display: none; }
  .cart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    border: 2px solid var(--bg);
  }
  /* меню переносится на свою строку и сворачивается */
  .main-nav {
    order: 4;
    width: 100%;
    margin-left: 0;
    flex-direction: column;
    gap: 4px;
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    transition: max-height 0.3s ease, margin 0.3s ease, visibility 0s linear 0.3s;
  }
  .main-nav.is-open {
    max-height: 320px;
    margin-top: 12px;
    visibility: visible;
    transition: max-height 0.3s ease, margin 0.3s ease, visibility 0s;
  }
  .main-nav a {
    display: block;
    width: 100%;
    padding: 12px 14px;
  }
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 22px;
  border: var(--line);
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  box-shadow: var(--pop-sm);
  text-decoration: none;
  transition: transform 0.12s, box-shadow 0.12s, background 0.2s;
}
.btn:hover { text-decoration: none; transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn-primary {
  background: var(--ink);
  color: #fff;
}
.btn-primary:disabled { background: var(--paint-mint); color: var(--ink); transform: none; box-shadow: var(--pop-sm); }
.btn-ghost {
  background: var(--paper);
  color: var(--ink);
}
.btn-ghost:hover { background: var(--paint-sun); }
.btn-paint {
  background: var(--paint-coral);
  color: #fff;
  font-size: 1.1rem;
  padding: 14px 30px;
}

/* ---------- Фильтры каталога ---------- */
.catalog-head { padding: 40px 0 10px; }
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0 36px;
}
.filter-bar button {
  padding: 9px 18px;
  border: var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  box-shadow: var(--pop-sm);
  transition: transform 0.12s, box-shadow 0.12s, background 0.18s;
}
.filter-bar button:hover { transform: translate(-1px,-1px); box-shadow: 4px 4px 0 var(--ink); }
.filter-bar button:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--ink); }
.filter-bar button.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

/* ---------- Сетка и карточки ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
  padding-bottom: 20px;
}
.product-card {
  background: var(--paper);
  border: var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--pop-md);
  transition: transform 0.16s, box-shadow 0.16s;
  display: flex;
  flex-direction: column;
}
.product-card:hover,
.product-card:focus-within {
  transform: translate(-3px, -3px);
  box-shadow: var(--pop-lg);
}
/* Signature: «до → после». Белая гипсовая заготовка раскрашивается на ховере. */
.card-pad {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  background:
    repeating-linear-gradient(45deg, #fff 0 10px, #F4F1E8 10px 20px);
  border-bottom: var(--line);
  overflow: hidden;
  text-decoration: none;
}
.card-blob {
  position: absolute;
  width: 78%;
  height: 78%;
  fill: var(--paint);
  opacity: 0;
  transform: scale(0.5) rotate(-14deg);
  transition: opacity 0.4s ease, transform 0.5s cubic-bezier(.34,1.56,.64,1);
}
.product-card:hover .card-blob,
.product-card:focus-within .card-blob {
  opacity: 1;
  transform: scale(1) rotate(-3deg);
}
.card-img {
  position: relative;
  width: 72%;
  height: 72%;
  object-fit: contain;
  filter: drop-shadow(2px 3px 0 rgba(31,27,22,0.12));
  transition: transform 0.4s cubic-bezier(.34,1.56,.64,1);
}
.product-card:hover .card-img,
.product-card:focus-within .card-img {
  transform: scale(1.08) rotate(-3deg);
}
/* Подсказка-стикер «раскрась меня» на плашке */
.card-pad::after {
  content: "раскрась!";
  position: absolute;
  top: 10px;
  right: 10px;
  font-family: var(--font-hand);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--paint-sun);
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  padding: 1px 10px;
  transform: rotate(4deg);
  transition: opacity 0.3s ease;
}
.product-card:hover .card-pad::after,
.product-card:focus-within .card-pad::after { opacity: 0; }
.card-body {
  padding: 18px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.card-theme {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}
.card-title { font-size: 1.2rem; margin: 0; font-family: var(--font-display); font-weight: 600; }
.card-title a { color: var(--ink); }
.card-title a:hover { text-decoration: none; color: var(--coral-ink); }
.card-price {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  margin: 2px 0 12px;
}
.card-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}
.card-actions .btn { flex: 1; padding: 10px 12px; font-size: 0.95rem; }

/* ---------- Страница товара ---------- */
.crumbs {
  padding: 28px 0 4px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
  padding: 16px 0 20px;
}
.detail-pad {
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  background: var(--paint);
  border: var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--pop-md);
}
.detail-img {
  width: 82%;
  height: 82%;
  object-fit: contain;
  filter: drop-shadow(3px 4px 0 rgba(31,27,22,0.12));
  transition: transform 0.5s cubic-bezier(.34,1.56,.64,1);
}
.detail-pad:hover .detail-img { transform: scale(1.05) rotate(-3deg); }
.detail-info h1 { margin-top: 6px; }
.detail-price {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2rem;
  color: var(--coral-ink);
  margin: 4px 0 14px;
}
.detail-short { font-size: 1.1rem; color: var(--ink-soft); }
.includes {
  background: var(--paper);
  border: var(--line);
  border-radius: var(--r-md);
  padding: 18px 22px;
  margin: 20px 0;
  box-shadow: var(--pop-sm);
}
.includes h3 { margin-bottom: 0.5em; }
.includes ul { margin: 0; padding-left: 1.2em; }
.includes li { margin: 4px 0; }
.buy-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.qty-control {
  display: inline-flex;
  align-items: center;
  border: var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.qty-control button {
  width: 44px;
  height: 44px;
  border: none;
  background: #fff;
  font-size: 1.4rem;
  color: var(--ink);
  line-height: 1;
}
.qty-control button:hover { background: var(--plaster); }
.qty-control input {
  width: 52px;
  height: 44px;
  border: none;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ink);
  background: #fff;
  -moz-appearance: textfield;
}
.qty-control input::-webkit-outer-spin-button,
.qty-control input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.not-found {
  text-align: center;
  padding: 80px 20px;
}
.not-found-emoji { font-size: 4rem; display: block; margin-bottom: 10px; }

@media (max-width: 760px) {
  .product-detail { grid-template-columns: 1fr; gap: 24px; }
  .detail-pad { aspect-ratio: 3 / 2; }
}

/* ---------- Корзина ---------- */
#cart-view { padding: 40px 0 0; }
.cart-list { display: flex; flex-direction: column; gap: 14px; margin: 24px 0; }
.cart-row {
  display: grid;
  grid-template-columns: 64px 1fr auto auto auto;
  align-items: center;
  gap: 16px;
  background: var(--paper);
  border: var(--line);
  border-radius: var(--r-md);
  padding: 14px 18px;
  box-shadow: var(--pop-sm);
}
.cart-img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  padding: 4px;
  background: var(--paint);
  border: var(--line);
  border-radius: var(--r-sm);
}
.cart-row-info { display: flex; flex-direction: column; gap: 2px; }
.cart-row-name { color: var(--ink); font-weight: 700; }
.cart-row-name:hover { color: var(--coral-ink); text-decoration: none; }
.cart-row-unit { font-size: 0.9rem; color: var(--ink-soft); }
.cart-row-sum {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  white-space: nowrap;
}
.cart-remove {
  width: 38px;
  height: 38px;
  border: var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 50%;
  font-size: 1rem;
  transition: background 0.2s, color 0.2s;
}
.cart-remove:hover { background: var(--paint-coral); color: #fff; }

.cart-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  flex-wrap: wrap;
  padding: 8px 4px 0;
}
.cart-total { display: flex; align-items: baseline; gap: 12px; }
.cart-total span { color: var(--ink-soft); font-weight: 600; }
.cart-total strong {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--ink);
}

.cart-empty, .cart-thanks {
  text-align: center;
  padding: 70px 20px;
}
.cart-empty-emoji, .cart-thanks-emoji {
  font-size: 4rem;
  display: block;
  margin-bottom: 10px;
}

/* ---------- Оформление заказа ---------- */
.checkout-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 28px;
  align-items: start;
  margin-top: 8px;
}
.checkout-form {
  display: grid;
  gap: 18px;
}
.field { display: grid; gap: 6px; }
.field label, .field legend {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.98rem;
}
.field-optional { color: var(--ink-soft); font-weight: 400; font-size: 0.85rem; }
.field-hint { font-size: 0.82rem; color: var(--ink-soft); }
.phone-input {
  display: flex;
  align-items: stretch;
  border: var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--paper);
}
.phone-prefix {
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-family: var(--font-display);
  font-weight: 600;
  background: var(--plaster);
  border-right: var(--line);
  color: var(--ink);
  user-select: none;
}
.phone-input input {
  border: none !important;
  border-radius: 0 !important;
  flex: 1;
  letter-spacing: 0.04em;
}
.phone-input:focus-within {
  outline: 3px solid var(--paint-sky);
  outline-offset: 1px;
}
.phone-input input:focus-visible { outline: none !important; }
.checkout-form input,
.checkout-form textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 11px 14px;
  border: var(--line);
  border-radius: var(--r-md);
  background: var(--paper);
  color: var(--ink);
  width: 100%;
}
.checkout-form textarea { resize: vertical; }
.checkout-form input:focus-visible,
.checkout-form textarea:focus-visible {
  outline: 3px solid var(--paint-sky);
  outline-offset: 1px;
}
.checkout-form input:user-invalid,
.checkout-form input:user-invalid:focus-visible {
  border-color: var(--coral-ink);
  outline-color: var(--coral-ink);
}
.field-radio {
  border: var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin: 0;
  display: grid;
  gap: 10px;
}
.field-radio legend { padding: 0 6px; }
.radio { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.radio input { width: auto; accent-color: var(--paint-coral); transform: scale(1.2); }
.checkout-note {
  font-size: 0.9rem;
  color: var(--ink-soft);
  background: var(--plaster);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  margin: 0;
}
.checkout-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.checkout-actions .btn { flex: 1; min-width: 150px; }
.checkout-summary {
  background: var(--paper);
  border: var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--pop-md);
  padding: 22px 24px;
  position: sticky;
  top: 90px;
}
.checkout-summary h2 { font-size: 1.3rem; margin-bottom: 14px; }
.checkout-items { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.checkout-items li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.95rem;
}
.checkout-items li span:last-child { font-weight: 700; white-space: nowrap; }
.checkout-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-top: 2px dashed var(--plaster-dark);
  padding-top: 14px;
}
.checkout-total strong { font-family: var(--font-display); font-size: 1.5rem; }

@media (max-width: 760px) {
  .checkout-layout { grid-template-columns: 1fr; }
  .checkout-summary { position: static; order: -1; }
}

@media (max-width: 680px) {
  .cart-row {
    grid-template-columns: 56px 1fr auto;
    grid-template-areas:
      "emoji info remove"
      "emoji qty  sum";
    row-gap: 10px;
  }
  .cart-img { grid-area: emoji; width: 56px; height: 56px; }
  .cart-row-info { grid-area: info; }
  .qty-control { grid-area: qty; }
  .cart-row-sum { grid-area: sum; text-align: right; }
  .cart-remove { grid-area: remove; justify-self: end; }
  .cart-foot { justify-content: space-between; }
}

/* ---------- Главная: hero ---------- */
.hero {
  padding: 80px 0 60px;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
}
.hero-inner > * { min-width: 0; }
.hero-eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--paint-sun);
  border: var(--line);
  border-radius: 999px;
  padding: 5px 14px;
  box-shadow: var(--pop-sm);
  margin: 0 0 20px;
  transform: rotate(-1.5deg);
}
.hero h1 {
  font-size: clamp(2.6rem, 6.5vw, 4.4rem);
  line-height: 1.04;
  overflow-wrap: break-word;
  letter-spacing: -0.015em;
}
.brush {
  position: relative;
  display: inline-block;
  white-space: nowrap;
}
.brush-mark {
  position: absolute;
  left: -4%;
  right: -4%;
  bottom: 0.04em;
  height: 0.42em;
  background: var(--paint-coral);
  border-radius: 999px 999px 999px 4px / 999px 999px 999px 4px;
  transform: rotate(-1.2deg);
  transform-origin: left center;
  z-index: -1;
  clip-path: inset(0 100% 0 0);
  animation: brush-reveal 1.1s cubic-bezier(.5,.1,.4,1) 0.5s forwards;
}
@keyframes brush-reveal {
  to { clip-path: inset(0 0 0 0); }
}
.hero-lead {
  font-size: 1.22rem;
  color: var(--ink-soft);
  max-width: 42ch;
}
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 26px; }
.hero-note {
  position: relative;
  font-family: var(--font-hand);
  font-size: 1.55rem;
  color: var(--paint-grape);
  margin: 22px 0 0;
  padding-left: 4px;
  transform: rotate(-1.5deg);
  display: inline-block;
}
.note-arrow {
  position: absolute;
  right: -54px;
  top: -6px;
  width: 48px;
  height: 34px;
  color: var(--paint-grape);
}

/* Демонстрация «гипс → цвет»: фигурки-наклейки раскрашиваются по очереди */
.hero-figures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.hero-fig {
  position: relative;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  background: repeating-linear-gradient(45deg, #fff 0 11px, #F4F1E8 11px 22px);
  border: var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--pop-md);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.fig-art {
  display: block;
  position: relative;
  z-index: 1;
  width: 60%;
  height: 60%;
}
.fig-art path {
  stroke: var(--ink);
  stroke-width: 4;
  stroke-linejoin: round;
}
.fig-num {
  position: absolute;
  top: 8px;
  left: 10px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: 50%;
  line-height: 1;
}
.fig-tag {
  position: absolute;
  bottom: 8px;
  font-family: var(--font-hand);
  font-size: 1.15rem;
  font-weight: 700;
  padding: 0 10px;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  white-space: nowrap;
}
.fig-tag--start { color: var(--ink-soft); transform: rotate(-3deg); }
.fig-tag--done { color: #fff; background: var(--paint-mint); transform: rotate(3deg); }
.hero-fig:hover { transform: translate(-3px,-3px) rotate(-2deg) !important; box-shadow: var(--pop-lg); }
.hero-fig:hover .fig-art { transform: scale(1.06) rotate(-4deg); transition: transform 0.3s ease; }
.hero-fig:nth-child(2) { transform: rotate(-1.5deg); }
.hero-fig:nth-child(3) { transform: rotate(1.5deg); }
.hero-fig:nth-child(4) { transform: rotate(2deg); }
.hero-fig:nth-child(5) { transform: rotate(-1deg); }

/* ---------- Секции главной ---------- */
.section { padding: 60px 0; }
.section-head { margin-bottom: 32px; }
.section-head h2 { margin-bottom: 0.2em; }
.section-head p { color: var(--ink-soft); margin: 0; }

/* Появление при скролле */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(.2,.8,.2,1);
}
.reveal.is-in { opacity: 1; transform: none; }

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.step {
  background: var(--paper);
  border: var(--line);
  border-radius: var(--r-lg);
  padding: 32px 26px;
  text-align: center;
  box-shadow: var(--pop-md);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.step:hover { transform: translate(-3px,-3px); box-shadow: var(--pop-lg); }
.step-num {
  display: inline-grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--plaster);
  border: var(--line);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  margin-bottom: 14px;
  box-shadow: var(--pop-sm);
}
.step:nth-child(1) .step-num { background: var(--paint-sun); }
.step:nth-child(2) .step-num { background: var(--paint-mint); color: #fff; }
.step:nth-child(3) .step-num { background: var(--paint-coral); color: #fff; }
.step h3 { margin-bottom: 0.3em; }
.step p { color: var(--ink-soft); margin: 0; }

/* Секция-палитра: баночки гуаши с обводкой */
.palette {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 18px;
}
.swatch {
  aspect-ratio: 3 / 4;
  border: var(--line);
  border-radius: var(--r-lg);
  display: flex;
  align-items: flex-end;
  padding: 16px;
  color: #fff;
  font-family: var(--font-hand);
  font-size: 1.6rem;
  font-weight: 700;
  text-shadow: 0 1.5px 0 rgba(31,27,22,0.45);
  box-shadow: var(--pop-md);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.swatch:hover { transform: translate(-3px,-3px) rotate(-2deg); box-shadow: var(--pop-lg); }
.swatch:nth-child(1) { background: var(--paint-grape); transform: rotate(-1.5deg); }
.swatch:nth-child(2) { background: var(--paint-sky); transform: rotate(1deg); }
.swatch:nth-child(3) { background: var(--paint-mint); transform: rotate(-1deg); }
.swatch:nth-child(4) { background: var(--paint-sun); color: var(--ink); text-shadow: none; transform: rotate(1.5deg); }
.swatch:nth-child(5) { background: var(--paint-coral); transform: rotate(-1deg); }
.swatch:nth-child(6) { background: var(--paint-pink); transform: rotate(1.5deg); }

@media (prefers-reduced-motion: reduce) {
  .hero-fig, .hero-fig span, .brush::after { animation: none !important; }
  .reveal { opacity: 1; transform: none; }
}

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-figures { max-width: 420px; }
  .palette { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 620px) {
  .steps { grid-template-columns: 1fr; }
  .palette { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Текстовые страницы ---------- */
.text-page { padding: 40px 0 20px; max-width: 820px; }

/* Цветной баннер-заголовок страницы */
.page-banner {
  position: relative;
  background: var(--paint-sun);
  border: var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--pop-md);
  padding: 32px 32px 30px;
  margin: 8px 0 36px;
  overflow: hidden;
}
.page-banner h1 { margin: 0 0 0.3em; }
.page-banner .lead { font-size: 1.18rem; color: var(--ink); margin: 0; max-width: 46ch; }
.page-banner .banner-emoji {
  position: absolute;
  right: 18px;
  bottom: -12px;
  font-size: 6rem;
  line-height: 1;
  transform: rotate(-8deg);
  opacity: 0.9;
}
.text-page h1 { margin-bottom: 0.4em; }
.text-page .lead { font-size: 1.2rem; color: var(--ink-soft); margin-bottom: 1.5em; }
.tips { display: grid; gap: 18px; margin: 24px 0; }
.tip {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  background: var(--paper);
  border: var(--line);
  border-radius: var(--r-md);
  padding: 20px 22px;
  box-shadow: var(--pop-sm);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.tip:hover { transform: translate(-3px,-3px); box-shadow: var(--pop-md); }
.tip:nth-child(1) { border-left: 10px solid var(--paint-grape); }
.tip:nth-child(2) { border-left: 10px solid var(--paint-sky); }
.tip:nth-child(3) { border-left: 10px solid var(--paint-mint); }
.tip:nth-child(4) { border-left: 10px solid var(--paint-coral); }
.tip-step {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: #fff;
  border: var(--line);
  border-radius: 50%;
  flex-shrink: 0;
}
.tip:nth-child(1) .tip-step { background: var(--paint-grape); }
.tip:nth-child(2) .tip-step { background: var(--paint-sky); }
.tip:nth-child(3) .tip-step { background: var(--paint-mint); }
.tip:nth-child(4) .tip-step { background: var(--paint-coral); }
.tip-emoji {
  font-size: 1.8rem;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: var(--paint-sun);
  border: var(--line);
  border-radius: 50%;
  flex-shrink: 0;
}
.tip h3 { margin: 0 0 0.2em; }
.tip p { margin: 0; color: var(--ink-soft); }

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin: 28px 0;
}
.info-block {
  position: relative;
  background: var(--paper);
  border: var(--line);
  border-radius: var(--r-md);
  padding: 22px 24px 24px;
  box-shadow: var(--pop-md);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.info-block:hover { transform: translate(-3px,-3px); box-shadow: var(--pop-lg); }
.info-block h3 { margin-top: 0; }
.info-block p { margin: 0; color: var(--ink-soft); }
.info-icon {
  display: inline-grid;
  place-items: center;
  width: 50px;
  height: 50px;
  font-size: 1.6rem;
  border: var(--line);
  border-radius: 14px;
  margin-bottom: 14px;
}
.info-block:nth-child(1) .info-icon { background: var(--paint-mint); }
.info-block:nth-child(2) .info-icon { background: var(--paint-sky); }
.info-block:nth-child(3) .info-icon { background: var(--paint-sun); }

/* ===== Telegram Mini App ===== */
:root {
  /* Высота шапки Telegram (кнопки закрыть/свернуть). content-safe-area-inset
     заполняется SDK; +52px запас на сами кнопки. */
  --tg-top: calc(var(--tg-content-safe-area-inset-top, 0px) + 52px);
}
body { padding-bottom: 80px; }
/* Отступ сверху, чтобы заголовки не уходили под кнопки Telegram. */
main.container { padding-top: var(--tg-top); }
.screen { display: none; }
.screen.is-active { display: block; }
/* Заголовки страниц в Mini App — компактнее десктопных. */
.screen > h1,
.cart-empty h1,
.catalog-head h1 { font-size: 1.6rem; margin: 4px 0 14px; }
.catalog-head { padding: 0 0 6px; }

/* Каталог: всегда две карточки в ряд, компактные. */
#catalog-grid.product-grid {
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
#catalog-grid .product-card { border-radius: 14px; }
#catalog-grid .card-img {
  width: 100%; height: auto; aspect-ratio: 1 / 1;
  object-fit: contain; padding: 10px 10px 0;
}
#catalog-grid .card-body { padding: 8px 12px 14px; gap: 3px; }
#catalog-grid .card-theme { font-size: 0.62rem; }
#catalog-grid .card-title { font-size: 0.98rem; }
#catalog-grid .card-price { font-size: 1rem; margin: 1px 0 8px; }
#catalog-grid .btn-primary { padding: 7px 10px; font-size: 0.85rem; }

/* Форма оформления — крупнее текст и поля. */
#co-form .field { gap: 7px; margin-bottom: 14px; }
#co-form .field label,
#co-form .field legend { font-size: 1.05rem; font-family: var(--font-display); font-weight: 600; }
#co-form input,
#co-form textarea {
  font-size: 1.05rem; padding: 14px 15px;
  border: var(--line); border-radius: var(--r-md);
  background: var(--paper); color: var(--ink); width: 100%;
  font-family: var(--font-body);
}
#co-form textarea { resize: vertical; }
#co-form input:focus-visible,
#co-form textarea:focus-visible {
  outline: 3px solid var(--paint-sky); outline-offset: 1px;
}
#co-form .phone-input { display: flex; align-items: stretch; border: var(--line);
  border-radius: var(--r-md); overflow: hidden; background: var(--paper); }
#co-form .phone-input input { border: none !important; border-radius: 0 !important; flex: 1; }
#co-form .phone-input:focus-within { outline: 3px solid var(--paint-sky); outline-offset: 1px; }
#co-form .phone-input input:focus-visible { outline: none !important; }
#co-form .phone-prefix { display: flex; align-items: center; padding: 0 13px;
  font-family: var(--font-display); font-weight: 600; font-size: 1.05rem;
  background: var(--plaster); border-right: var(--line); color: var(--ink); user-select: none; }
#co-form .field-hint { font-size: 0.9rem; color: var(--ink-soft); }
#co-form .radio { display: flex; align-items: center; gap: 10px; font-size: 1.02rem; font-weight: 600; }
#co-form .field-radio { display: grid; gap: 10px; }
#co-form .btn { font-size: 1.05rem; padding: 14px; margin-top: 4px; }

/* Корзина: итог сверху, кнопка «Оформить заказ» по центру на всю ширину. */
#cart-view .cart-foot {
  flex-direction: column; align-items: center; justify-content: center; gap: 14px;
}
#cart-view .cart-foot .cart-total { justify-content: center; }
#cart-view .cart-foot #to-checkout { width: 100%; max-width: 360px; }
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  display: flex; background: var(--paint, #fff); border-top: 1px solid #eee;
}
.tabbar button {
  flex: 1; padding: 10px; border: 0; background: none; font: inherit;
  color: #777; display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.tabbar button.is-active { color: var(--brand, #34ABF2); }
/* Иконка вкладки — якорь для бейджа-уведомления. */
.tab-ico { position: relative; display: inline-flex; line-height: 1; font-size: 1.3rem; }
.tab-badge {
  position: absolute; top: -6px; right: -10px;
  font-size: 10px; font-weight: 700; line-height: 16px;
  background: #ff5a47; color: #fff;
  border-radius: 999px; padding: 0 5px; min-width: 16px; height: 16px;
  text-align: center; box-shadow: 0 0 0 2px var(--paint, #fff);
}
.tab-badge.is-empty { display: none; }
.pay-card { background: #f7f7fb; border-radius: 16px; padding: 16px; margin: 12px 0; }
.pay-card .num { font-size: 20px; font-weight: 700; letter-spacing: 1px; }
.timer { font-size: 28px; font-weight: 700; text-align: center; margin: 12px 0; }
.timer.is-low { color: #ff5a47; }
.status-pill { display: inline-block; padding: 4px 12px; border-radius: 999px;
  font-weight: 600; font-size: 14px; }
.status-awaiting_payment { background: #fff3cd; color: #856404; }
.status-under_review { background: #cce5ff; color: #004085; }
.status-paid { background: #d4edda; color: #155724; }
.status-shipped { background: #d1ecf1; color: #0c5460; }
.status-rejected { background: #f8d7da; color: #721c24; }
.status-expired { background: #e2e3e5; color: #383d41; }
.order-card { border: 1px solid #eee; border-radius: 14px; padding: 14px; margin: 10px 0; }
.card-stock { font-size: 0.82rem; margin: 2px 0 8px; font-weight: 600; }
.card-stock.in { color: #2f8a4e; }
.card-stock.out { color: #c0392b; }
.product-card.is-out { opacity: 0.55; filter: grayscale(0.6); }
.product-card.is-out .btn-primary { background: #bbb; cursor: not-allowed; }
