/* ── Header ─────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(247, 244, 240, 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border-soft);
}
.site-header .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-4);
  gap: var(--space-4);
}
/* На мобилках хедеру даём ещё чуть больше воздуха по бокам, чтобы логотип
   и корзина не липли к краю экрана. */
@media (max-width: 720px) {
  .site-header .container { padding-inline: var(--space-6); }
}
.logo {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  letter-spacing: .02em;
  color: var(--text);
}
.nav {
  display: flex;
  gap: var(--space-5);
  font-size: var(--text-sm);
}
.nav a { color: var(--text-muted); }
.nav a.active, .nav a:hover { color: var(--text); }

.cart-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text);
}
.icon-cart {
  width: 22px;
  height: 22px;
  display: block;
}

/* ── Burger / mobile nav ────────────────── */
.burger {
  display: none;
  background: transparent;
  border: 0;
  width: 40px; height: 40px;
  cursor: pointer;
  padding: 0;
  color: var(--text);
}
.burger span, .burger span::before, .burger span::after {
  display: block;
  width: 22px; height: 2px;
  background: currentColor;
  border-radius: 2px;
  position: relative;
  margin: 0 auto;
  transition: transform .2s ease, opacity .2s ease;
}
.burger span::before, .burger span::after { content: ""; position: absolute; left: 0; }
.burger span::before { top: -7px; }
.burger span::after  { top:  7px; }
.burger[aria-expanded="true"] span                   { background: transparent; }
.burger[aria-expanded="true"] span::before           { top: 0; transform: rotate(45deg); }
.burger[aria-expanded="true"] span::after            { top: 0; transform: rotate(-45deg); }

@media (max-width: 720px) {
  .burger { display: block; }
  .nav {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    flex-direction: column;
    background: var(--bg);
    border-bottom: 1px solid var(--border-soft);
    padding: var(--space-4) var(--space-5);
    gap: var(--space-3);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: transform .15s ease, opacity .15s ease;
  }
  .nav.open { transform: none; opacity: 1; pointer-events: auto; }
  .site-header .row { position: relative; }
}
.cart-count {
  min-width: 1.4em;
  height: 1.4em;
  padding: 0 .4em;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: var(--text-xs);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cart-count[data-empty="true"] {
  background: var(--surface-3);
  color: var(--text-muted);
}

/* ── Hero ───────────────────────────────── */
.hero {
  padding: var(--space-10) 0 var(--space-8);
  text-align: center;
}
.hero h1 {
  font-size: clamp(var(--text-4xl), 7vw, var(--text-hero));
  margin-bottom: var(--space-4);
}
.hero p {
  color: var(--text-muted);
  font-size: var(--text-lg);
  max-width: 560px;
  margin: 0 auto var(--space-6);
}

/* ── Hero с видео-фоном ─────────────────── */
.hero-video {
  position: relative;
  min-height: clamp(420px, 80vh, 720px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  isolation: isolate;
}
.hero-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: -2;
}
.hero-media .hero-placeholder {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

/* Исходное видео вертикальное (9:16). Поворачиваем в landscape через CSS:
   задаём размеры "до rotate" так, чтобы "после rotate" оно покрывало ширину viewport. */
.hero-video-el {
  position: absolute;
  top: 50%;
  left: 50%;
  height: 100vw;         /* длинная сторона до rotate = ширина viewport */
  width: auto;
  aspect-ratio: 9 / 16;
  transform: translate(-50%, -50%) rotate(-90deg);
  pointer-events: none;
}
/* На mobile (portrait) крутить не нужно — вертикальный hero тоже portrait. */
@media (orientation: portrait) {
  .hero-video-el {
    top: 0; left: 0;
    width: 100%; height: 100%;
    aspect-ratio: auto;
    transform: none;
    object-fit: cover;
  }
}
.hero-placeholder {
  /* Спокойный градиент в цветах бренда + тонкий шум */
  background:
    radial-gradient(circle at 20% 25%, var(--surface-2) 0, transparent 50%),
    radial-gradient(circle at 80% 70%, var(--accent-light) 0, transparent 55%),
    linear-gradient(135deg, var(--surface) 0%, var(--surface-3) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-placeholder-inner {
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
  padding: var(--space-4);
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  background: rgba(247, 244, 240, 0.55);
  backdrop-filter: blur(2px);
  max-width: 320px;
}
.hero-placeholder-icon {
  display: block;
  font-size: var(--text-2xl);
  color: var(--accent);
  margin-bottom: var(--space-2);
}
.hero-placeholder-text { line-height: 1.4; }

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg,
      rgba(0, 0, 0, 0.45) 0%,
      rgba(0, 0, 0, 0.55) 50%,
      rgba(0, 0, 0, 0.65) 100%);
}
.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: var(--space-10) var(--space-5);
  color: #fff;
}
.hero-content h1 {
  font-size: clamp(var(--text-4xl), 7vw, var(--text-hero));
  margin-bottom: var(--space-4);
  color: #fff;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.45);
  overflow-wrap: anywhere;
}
.hero-content p {
  color: #fff;
  font-size: var(--text-lg);
  max-width: 560px;
  margin: 0 auto var(--space-6);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

/* ── Композиция главной: 2 блока в строку ── */
.pair-row,
.social-feed-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  align-items: start;
}
.social-feed-row { grid-template-columns: minmax(260px, 340px) 1fr; }
/* На любых grid-элементах внутри: min-width: 0, чтобы intrinsic size
   дочерних элементов не разрывал сетку шире viewport. */
.pair-row > *,
.social-feed-row > * { min-width: 0; }
@media (max-width: 900px) {
  .pair-row,
  .social-feed-row { grid-template-columns: 1fr; }
}

/* ── Маркеты (ярмарки / фестивали) ────────── */
.markets-panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  text-align: center;
  height: 100%;
}
.markets-panel h2 { margin-bottom: var(--space-2); }
.markets-panel > .muted { margin-bottom: var(--space-5); }
.markets-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}
.empty-inline {
  list-style: none;
  color: var(--text-muted);
  font-size: var(--text-sm);
  padding: var(--space-4);
}
.market-card {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-3) var(--space-5);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: left;
}
.market-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: var(--space-2);
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  color: var(--accent);
}
.market-day {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  line-height: 1;
}
.market-month {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: .12em;
}
.market-info { display: flex; flex-direction: column; gap: 2px; }
.market-name {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--text);
}
.market-place {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* ── Соцсети ──────────────────────────────── */
.socials-panel {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  text-align: center;
  height: 100%;
}
/* Компактная версия — узкая колонка с социальными карточками в столбик */
.socials-compact .socials-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.socials-compact .social-card {
  flex-direction: row;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  text-align: left;
}
.socials-compact .social-texts {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.socials-compact .social-label { font-size: var(--text-base); }
.socials-panel h2 { margin-bottom: var(--space-2); }
.socials-panel > .muted { margin-bottom: var(--space-5); }
.socials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}
@media (max-width: 600px) { .socials-grid { grid-template-columns: 1fr; } }
.social-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-5) var(--space-3);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}
.social-card:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}
.social-label {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  margin-top: var(--space-1);
}
.social-handle {
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.social-card:hover .social-handle { color: var(--accent); }

/* ── Офлайн-магазины ─────────────────────── */
.shops-panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  text-align: center;
  height: 100%;
}
.shops-panel h2 { margin-bottom: var(--space-2); }
.shops-panel > .muted { margin-bottom: var(--space-5); }
.shops-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.shops-list a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.shop-pin {
  flex: 0 0 auto;
  color: var(--accent);
}
.shops-list a:hover .shop-pin { color: var(--accent); }
.shop-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  text-align: left;
}
.shops-list a:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}
.shop-name {
  font-family: var(--font-display);
  font-size: var(--text-xl);
}
.shop-addr {
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.shops-list a:hover .shop-addr { color: var(--accent); }

/* ── Мастер-классы / сертификаты / обжиг ─────── */
.workshops-section,
.faq-section {
  padding-top: var(--space-8);
}
.workshops-page {
  padding-bottom: var(--space-10);
}
.section-kicker {
  margin: 0 0 var(--space-2);
  color: var(--accent);
  font-size: var(--text-sm);
  font-weight: 500;
}
.workshops-section .section-head .muted {
  max-width: 720px;
  margin-inline: auto;
}
.workshop-list {
  display: grid;
  gap: var(--space-3);
}
.workshop-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 150px 1fr auto;
  gap: var(--space-5);
  align-items: center;
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px var(--shadow);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.workshop-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 8px 22px var(--shadow-md);
}
.workshop-type {
  min-height: 104px;
  padding: var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: 1.1;
}
.workshop-body h2,
.workshop-body h3,
.studio-option h2,
.studio-option h3 {
  margin-bottom: var(--space-2);
  font-size: var(--text-2xl);
  overflow-wrap: anywhere;
}
.workshop-body p,
.studio-option p {
  margin-bottom: var(--space-2);
  color: var(--text);
  line-height: 1.6;
}
.workshop-body p:last-of-type,
.studio-option p:last-of-type {
  margin-bottom: 0;
}
.workshop-meta,
.option-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}
.workshop-meta span,
.option-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: 1.35;
}
.workshop-cta {
  white-space: nowrap;
}
.studio-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-5);
}
.studio-option {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px var(--shadow);
}
.studio-option-wide {
  grid-column: 1 / -1;
}
.studio-option .option-meta {
  margin-bottom: var(--space-4);
}
.studio-option .btn {
  margin-top: auto;
}
.studio-option .kiln-table + .btn {
  margin-top: var(--space-5);
}
.kiln-table {
  width: 100%;
  margin-top: var(--space-4);
  border-collapse: collapse;
  overflow: hidden;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
}
.kiln-table th,
.kiln-table td {
  padding: var(--space-3);
  border: 1px solid var(--border);
  text-align: center;
}
.kiln-table thead th {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
}
.kiln-table tbody th {
  background: var(--bg);
  color: var(--text);
  font-weight: 500;
}
.kiln-table td {
  background: rgba(247, 244, 240, 0.55);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* ── FAQ ───────────────────────────────── */
.faq-list {
  display: grid;
  gap: var(--space-3);
  max-width: 920px;
  margin: 0 auto;
}
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px var(--shadow);
  overflow: hidden;
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  color: var(--text);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: var(--text-lg);
  line-height: 1;
}
.faq-item[open] summary {
  color: var(--accent);
}
.faq-item[open] summary::after {
  content: "−";
  background: var(--accent);
  color: var(--accent-text);
}
.faq-answer {
  padding: 0 var(--space-5) var(--space-5);
  color: var(--text);
}
.faq-answer p {
  max-width: 780px;
  margin-bottom: var(--space-3);
  line-height: 1.65;
}
.faq-answer p:last-child { margin-bottom: 0; }

/* ── Telegram-лента ─────────────────────── */

/* Панель-«карточка канала». Без фиксированного max-width — ширину задаёт
   родительская сетка/контейнер; иначе панель сама «распирает» себя
   до своей intrinsic max-content ширины из-за горизонтального скроллера. */
.tg-panel {
  width: 100%;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: 0 2px 12px var(--shadow);
  overflow: hidden; /* scroller сам держит горизонтальную прокрутку */
}
.tg-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}
.tg-panel-id {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.tg-panel-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.tg-panel-icon svg { transform: translate(-1px, 1px); }
.tg-panel-handle {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--text);
  line-height: 1.1;
}
.tg-panel-handle:hover { color: var(--accent); }
.tg-panel-sub {
  color: var(--text-muted);
  font-size: var(--text-sm);
  margin-top: 2px;
}
.tg-panel-cta { white-space: nowrap; }

/* Scroller */
.tg-scroller-wrap {
  position: relative;
  min-width: 0;
}
.tg-scroller {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, calc((100% - 2 * var(--space-4)) / 3));
  gap: var(--space-4);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 4px;
  padding: 4px 4px var(--space-4);
  -webkit-overflow-scrolling: touch;
  min-width: 0;

  /* Тонкий брендовый scrollbar */
  scrollbar-color: var(--accent) var(--border-soft);
  scrollbar-width: thin;
}
.tg-scroller > * {
  scroll-snap-align: start;
}
.tg-scroller::-webkit-scrollbar { height: 8px; }
.tg-scroller::-webkit-scrollbar-track {
  background: var(--border-soft);
  border-radius: 999px;
  margin: 0 var(--space-4);
}
.tg-scroller::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 999px;
}
.tg-scroller::-webkit-scrollbar-thumb:hover { background: var(--accent-hover); }

/* Стрелки */
.tg-arrow {
  position: absolute;
  top: calc(50% - var(--space-3));
  transform: translateY(-50%);
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px var(--shadow-md);
  transition: background .15s ease, color .15s ease, transform .15s ease, opacity .15s ease;
  z-index: 2;
  padding: 0;
}
.tg-arrow:hover {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
  transform: translateY(-50%) scale(1.05);
}
.tg-arrow:disabled {
  opacity: 0;
  pointer-events: none;
}
.tg-arrow-left  { left:  -22px; }
.tg-arrow-right { right: -22px; }

@media (max-width: 900px) {
  .tg-panel { padding: var(--space-4); border-radius: var(--radius); }
  .tg-panel-head { gap: var(--space-3); }
  .tg-panel-cta { width: 100%; }
  .tg-arrow { display: none; }
}
@media (max-width: 760px) {
  .tg-scroller { grid-auto-columns: 82%; }
}
.tg-post {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 2px var(--shadow);
  color: var(--text);
  height: 420px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.tg-post:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px var(--shadow-md);
  border-color: var(--accent);
  color: var(--text);
}
.tg-post-media {
  flex: 0 0 auto;
  height: 200px;
  background: var(--surface-3);
  overflow: hidden;
}
.tg-post-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tg-post-body {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  flex: 1;
}
.tg-post-text {
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--text);
  white-space: pre-line;
  /* Ограничиваем 5-ю строками */
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tg-post-meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.tg-badge {
  background: var(--accent-light);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.tg-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

/* ── Reveal-анимации на скролле ─────────── */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s ease-out, transform .6s ease-out;
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
/* Поэтапная анимация дочерних элементов (карточки в grid) */
.reveal-children > * {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .5s ease-out, transform .5s ease-out;
}
.reveal-children.is-visible > * { opacity: 1; transform: none; }
.reveal-children.is-visible > *:nth-child(2) { transition-delay: .08s; }
.reveal-children.is-visible > *:nth-child(3) { transition-delay: .16s; }
.reveal-children.is-visible > *:nth-child(4) { transition-delay: .24s; }
.reveal-children.is-visible > *:nth-child(5) { transition-delay: .32s; }
.reveal-children.is-visible > *:nth-child(n+6) { transition-delay: .40s; }

/* Уважаем системную настройку пользователя */
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-children > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ── Buttons ────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
}
.btn-secondary:hover { background: var(--surface-3); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--text); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Badge ──────────────────────────────── */
.badge {
  display: inline-block;
  padding: .25em .75em;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: .02em;
}

/* ── Product grid ───────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-5);
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  overflow: hidden;
  box-shadow: 0 1px 2px var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px var(--shadow-md);
  background: var(--surface-2);
}
.card-media {
  aspect-ratio: 4 / 5;
  background: var(--surface-3);
  overflow: hidden;
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .55s ease;
  will-change: transform;
}
.card:hover .card-media img {
  transform: scale(1.06);
}
.card-body {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1;
}
.card-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  margin: 0;
}
.card-sub {
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.card-footer {
  margin-top: auto;
  padding-top: var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

/* Карточка «Кастомизация изделия» — псевдо-товар в каталоге */
.card-custom {
  text-decoration: none;
  color: var(--text);
  border-color: var(--accent);
  border-style: dashed;
}
.card-custom:hover { color: var(--text); }
.card-custom .card-media {
  background:
    radial-gradient(circle at 30% 20%, var(--surface-2), transparent 55%),
    radial-gradient(circle at 75% 75%, var(--accent-light), transparent 55%),
    var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-custom-icon {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 600;
  background: rgba(247, 244, 240, 0.8);
}
.card-custom .card-sub { font-size: var(--text-sm); color: var(--text-muted); line-height: 1.5; }
.price {
  color: var(--accent);
  font-weight: 600;
  font-size: var(--text-lg);
  white-space: nowrap;
}

/* ── Категории на главной ───────────────── */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);  /* десктоп — 4 в ряд */
  gap: var(--space-4);
}
@media (max-width: 720px) {
  .cat-grid {
    grid-template-columns: repeat(2, 1fr);  /* мобила — строго 2×2 */
  }
}
.cat-card {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-3);
  color: var(--accent-text);
  text-decoration: none;
  isolation: isolate;
  box-shadow: 0 1px 4px var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease;
}
.cat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px var(--shadow-md);
  color: var(--accent-text);
}
.cat-card-media {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
}
.cat-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s ease;
}
.cat-card:hover .cat-card-media img { transform: scale(1.06); }
.cat-card::after {
  /* затемнение снизу для читаемости текста */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    180deg,
    rgba(58, 53, 48, 0)   0%,
    rgba(58, 53, 48, 0)   45%,
    rgba(58, 53, 48, 0.55) 80%,
    rgba(58, 53, 48, 0.78) 100%
  );
}
.cat-card-body {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: var(--space-4) var(--space-5);
}
.cat-card-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  line-height: 1.1;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.cat-card-sub {
  margin-top: var(--space-1);
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: .02em;
}
.cat-card.is-empty {
  pointer-events: auto;  /* всё ещё кликабельна — каталог покажет «не найдено» */
}
.cat-card.is-empty::after {
  background: linear-gradient(180deg,
    rgba(58, 53, 48, 0)   0%,
    rgba(58, 53, 48, 0.35) 70%,
    rgba(58, 53, 48, 0.65) 100%);
}
.cat-card.is-empty .cat-card-media img { filter: grayscale(.4) brightness(.85); }
.cat-card.is-empty .cat-card-sub {
  color: rgba(255, 255, 255, 0.7);
}
/* Карточка без фото — спокойный градиент в брендовых тонах */
.cat-card.no-img {
  background:
    radial-gradient(circle at 30% 20%, var(--surface-2), transparent 55%),
    radial-gradient(circle at 80% 70%, var(--accent-light), transparent 50%),
    var(--surface);
  color: var(--text);
}
.cat-card.no-img::after { background: none; }
.cat-card.no-img .cat-card-title { color: var(--text); text-shadow: none; }
.cat-card.no-img .cat-card-sub   { color: var(--text-muted); }

/* ── Filters ────────────────────────────── */
.filters {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: var(--space-5);
  margin-bottom: var(--space-6);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-4);
  align-items: end;
}
.filters label {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-2);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.filters select, .filters input[type="number"] {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
}
.filters input[type="checkbox"] {
  accent-color: var(--accent);
  margin-right: var(--space-2);
}

/* ── Product page ───────────────────────── */
.product {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  padding: var(--space-8) 0;
}
@media (max-width: 760px) {
  .product { grid-template-columns: 1fr; gap: var(--space-5); }
}
.product-gallery { display: flex; flex-direction: column; gap: var(--space-3); }
.product-gallery .main {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--surface-3);
}
.thumbs { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.thumbs button {
  width: 64px; height: 64px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  cursor: pointer;
  overflow: hidden;
}
.thumbs button img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbs button.active { border-color: var(--accent); }
.product-meta { display: flex; flex-direction: column; gap: var(--space-4); }
.product-meta h1 { font-size: var(--text-3xl); }
.product-price { font-size: var(--text-2xl); color: var(--accent); font-weight: 600; }
.tag-list { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.product-notes {
  list-style: none;
  margin: var(--space-5) 0 0;
  padding: var(--space-4) var(--space-5);
  background: var(--accent-light);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  color: var(--text);
}
.product-notes li {
  position: relative;
  padding-left: var(--space-4);
  margin-bottom: var(--space-2);
  line-height: 1.5;
}
.product-notes li:last-child { margin-bottom: 0; }
.product-notes li::before {
  content: "·";
  position: absolute;
  left: 4px;
  color: var(--accent);
  font-weight: 700;
}

/* ── Cart ───────────────────────────────── */
.cart-list { display: flex; flex-direction: column; gap: var(--space-3); }
.cart-row {
  display: grid;
  grid-template-columns: 80px 1fr auto auto auto;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-3);
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
}
.cart-row img {
  width: 80px; height: 80px; object-fit: cover;
  border-radius: var(--radius-sm);
}
.qty {
  display: inline-flex; align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.qty button {
  background: var(--bg);
  border: 0;
  width: 2rem; height: 2rem;
  cursor: pointer;
  color: var(--text);
}
.qty button:hover { background: var(--surface-2); }
.qty span {
  min-width: 2rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.cart-summary {
  margin-top: var(--space-6);
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-5);
  flex-wrap: wrap;
}
.cart-total { font-size: var(--text-2xl); color: var(--accent); font-weight: 600; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
.form-grid label { display: block; margin-bottom: var(--space-2); font-size: var(--text-sm); color: var(--text-muted); }
.form-grid input, .form-grid textarea {
  width: 100%;
  padding: var(--space-3);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  color: var(--text);
}
.form-grid textarea { min-height: 100px; resize: vertical; }
.form-grid .span-2 { grid-column: span 2; }
@media (max-width: 600px) { .form-grid .span-2 { grid-column: auto; } }

/* Способ связи */
.channel-choice {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.ch-opt {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
  user-select: none;
  font-size: var(--text-sm);
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
  margin: 0;
  transition: background .15s ease, border-color .15s ease;
}
.ch-opt:hover { background: var(--surface-2); }
.ch-opt input[type="radio"] {
  accent-color: var(--accent);
  margin: 0;
}
.ch-opt:has(input:checked) {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 500;
}
.req {
  color: var(--accent);
  font-weight: 600;
  margin-left: 2px;
}

/* ── Footer ─────────────────────────────── */
.site-footer {
  margin-top: var(--space-10);
  padding: var(--space-6) 0;
  border-top: 1px solid var(--border-soft);
  color: var(--text-muted);
  font-size: var(--text-sm);
}
.site-footer .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
}
.social { display: flex; gap: var(--space-4); }

/* ── Toast ──────────────────────────────── */
.toast {
  position: fixed;
  bottom: var(--space-5);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius);
  box-shadow: 0 6px 18px var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 100;
}
.toast.show { opacity: 1; }

/* Empty state */
.empty {
  text-align: center;
  padding: var(--space-10) 0;
  color: var(--text-muted);
}

/* ── Prose (about / privacy) ─────────────── */
.prose {
  max-width: 680px;
  margin: 0 auto;
  padding: var(--space-8) 0;
}
.prose h1 { font-size: clamp(var(--text-3xl), 5vw, var(--text-4xl)); }
.prose h2 { margin-top: var(--space-8); font-size: var(--text-2xl); }
.prose h3 { margin-top: var(--space-6); font-size: var(--text-xl); }
.prose p, .prose li { color: var(--text); font-size: var(--text-lg); line-height: 1.65; }
.prose .lead { color: var(--text-muted); font-size: var(--text-lg); }
.prose ul { padding-left: var(--space-5); }
.prose ul li { margin-bottom: var(--space-2); }

/* About — коллаж фото */
.about-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin: var(--space-6) 0;
}
.about-gallery img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius);
}
@media (max-width: 600px) { .about-gallery { grid-template-columns: repeat(2, 1fr); } }

/* Thank-you */
.thank-you {
  text-align: center;
  padding: var(--space-10) var(--space-5);
  max-width: 540px;
  margin: 0 auto;
}
.thank-you .thankyou-img {
  display: block;
  width: 220px;
  height: 220px;
  object-fit: cover;
  border-radius: 50%;
  margin: 0 auto var(--space-5);
  box-shadow: 0 8px 24px var(--shadow-md);
}
.thank-you h1 { font-size: var(--text-3xl); }
.thank-you p { font-size: var(--text-lg); color: var(--text); }
.thank-you .order-id {
  display: inline-block;
  margin-top: var(--space-3);
  padding: var(--space-2) var(--space-4);
  background: var(--accent-light);
  color: var(--accent);
  border-radius: var(--radius);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ── Stats bar (цифры мастерской на главной) ──────── */
.stats-wrap {
  padding-top: var(--space-8);
}
.stats-bar {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-5);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
  align-items: center;
  text-align: center;
  box-shadow: 0 2px 14px var(--shadow);
}
.stat-cell {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  border-right: 1px solid var(--border-soft);
}
.stat-cell:last-child { border-right: none; }
.stat-num {
  font-family: var(--font-display);
  font-size: clamp(var(--text-2xl), 3vw, var(--text-3xl));
  color: var(--accent);
  font-weight: 600;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.stat-label {
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

/* Заголовок секции (над featured / categories). */
.section-head {
  text-align: center;
  margin-bottom: var(--space-5);
}
.section-head h1,
.section-head h2 {
  margin-bottom: var(--space-1);
  font-size: clamp(var(--text-2xl), 4vw, var(--text-3xl));
  overflow-wrap: anywhere;
}
.section-head .muted {
  margin: 0;
}

@media (max-width: 760px) {
  .stats-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: var(--space-5);
    padding: var(--space-5) var(--space-4);
  }
  .stat-cell { border-right: none; border-bottom: none; }
  .stat-cell:nth-child(odd)  { border-right: 1px solid var(--border-soft); }
  .stat-cell:nth-child(-n+2) { border-bottom: 1px solid var(--border-soft); padding-bottom: var(--space-4); }
}
@media (max-width: 420px) {
  .stats-bar { grid-template-columns: 1fr; gap: var(--space-3); }
  .stat-cell { border-right: none !important; border-bottom: none !important; padding: var(--space-2) 0; }
}

@media (max-width: 900px) {
  .workshop-card {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
  .workshop-type {
    min-height: 0;
    justify-self: start;
  }
  .workshop-cta {
    width: 100%;
  }
}
@media (max-width: 760px) {
  .studio-options {
    grid-template-columns: 1fr;
  }
  .studio-option-wide {
    grid-column: auto;
  }
  .faq-item summary {
    align-items: flex-start;
    font-size: var(--text-lg);
    padding: var(--space-4);
  }
  .faq-answer {
    padding: 0 var(--space-4) var(--space-4);
  }
  .workshop-card,
  .studio-option {
    padding: var(--space-4);
  }
}

/* ── Mobile polish ─────────────────────────
   Общие правки для телефонов / маленьких таблеток. */
@media (max-width: 720px) {
  /* Сокращаем макро-отступы между секциями */
  .hero-content { padding: var(--space-8) var(--space-4); }
  .hero-content h1 { font-size: clamp(var(--text-3xl), 10vw, var(--text-4xl)); }
  .hero-content p  { font-size: var(--text-base); }

  /* Панельки на главной — одинаковая сетка по горизонтали */
  .markets-panel,
  .socials-panel,
  .shops-panel { padding: var(--space-4); }

  /* Карточки товаров — пусть занимают всю ширину с одним столбцом при очень узких экранах */
  .grid { gap: var(--space-4); }

  /* Корзина: фото + название в первой строке, количество + цена + удалить — во второй */
  .cart-row {
    grid-template-columns: 64px 1fr auto;
    gap: var(--space-2) var(--space-3);
    padding: var(--space-3);
  }
  .cart-row > img                  { width: 64px; height: 64px; grid-row: 1 / 3; }
  .cart-row > :nth-child(2)        { grid-column: 2 / 4; }                    /* name + subtitle */
  .cart-row > .qty                 { grid-column: 2; grid-row: 2; }
  .cart-row > .price               { grid-column: 3; grid-row: 2; text-align: right; white-space: nowrap; }
  .cart-row > .btn-ghost           { grid-column: 3; grid-row: 1; justify-self: end; }

  /* Футер — колонкой */
  .site-footer .row { flex-direction: column; align-items: flex-start; gap: var(--space-3); }

  /* Уменьшаем макро-отступы main */
  main > section { padding-top: var(--space-5) !important; padding-bottom: var(--space-5); }
}

@media (max-width: 480px) {
  /* Логотип — не даём откусить */
  .logo { font-size: var(--text-lg); }
  /* Под TG-ленту чуть свободнее */
  .tg-scroller { grid-auto-columns: 86%; }
  .tg-post { height: 380px; }
  .tg-post-media { height: 170px; }
  /* Категории 2x2 — шрифт уменьшим */
  .cat-card-title { font-size: var(--text-xl); }
  .cat-card-body { padding: var(--space-3) var(--space-4); }
  /* Фильтры */
  .filters { padding: var(--space-4); }
}
