/* ============================================================
   Деревянные бусины — стили сайта
   Адаптив, бургер-меню, галерея, лайтбокс с зумом
   ============================================================ */

:root {
  --bg: #faf6ef;
  --bg-soft: #f3ecdf;
  --card: #ffffff;
  --text: #2f2a24;
  --muted: #7a6f60;
  --border: #e6dcc8;
  --wood: #b5793d;
  --wood-dark: #8b5a2b;
  --wood-light: #d9a86b;
  --cta: #3b8b5a;
  --cta-hover: #2f7349;
  --wb: #7f2aa0;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(90, 60, 30, 0.08);
  --shadow-lg: 0 18px 50px rgba(60, 40, 20, 0.22);
  --header-h: 66px;
  --container: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--wood-dark); text-decoration: none; }
a:hover { color: var(--wood); }

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

/* ---------- Шапка и навигация ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 246, 239, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: 16px;
}
.logo {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--wood-dark);
  white-space: nowrap;
}
.logo .logo-mark { color: var(--wood); }

.site-nav ul {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  color: var(--text);
  font-weight: 600;
  padding: 6px 2px;
  position: relative;
}
.site-nav a:hover,
.site-nav a.active { color: var(--wood-dark); }
.site-nav a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--wood);
  border-radius: 2px;
}

/* Бургер */
.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 10px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}
.burger span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
}
.burger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.active span:nth-child(2) { opacity: 0; }
.burger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  text-align: center;
  transition: background .2s, transform .1s, box-shadow .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--cta); color: #fff; }
.btn-primary:hover { background: var(--cta-hover); color: #fff; }
.btn-wb { background: var(--wb); color: #fff; }
.btn-wb:hover { background: #6b2186; color: #fff; }
.btn-outline { background: transparent; border-color: var(--wood); color: var(--wood-dark); }
.btn-outline:hover { background: var(--wood); color: #fff; }
.btn-lg { padding: 15px 30px; font-size: 1.05rem; }

/* ---------- Главная: hero ---------- */
.hero {
  padding: 64px 0 48px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.9rem);
  margin: 0 0 14px;
  color: var(--wood-dark);
  line-height: 1.2;
}
.hero p {
  font-size: 1.12rem;
  color: var(--muted);
  max-width: 620px;
  margin: 0 auto 28px;
}
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- Секции ---------- */
.section { padding: 34px 0; }
.section-title {
  font-size: 1.6rem;
  margin: 0 0 22px;
  color: var(--wood-dark);
}
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }

/* ---------- Сетка товаров ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 22px;
}
.product-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
  display: flex;
  flex-direction: column;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.product-card .thumb {
  aspect-ratio: 1 / 1;
  background: var(--bg-soft);
  display: grid;
  place-items: center;
}
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-card h3 { margin: 0; font-size: 1.05rem; }
.product-card h3 a { color: var(--text); }
.product-card h3 a:hover { color: var(--wood-dark); }
.product-card .price { font-size: 1.3rem; font-weight: 800; color: var(--cta); }
.product-card .meta { color: var(--muted); font-size: .92rem; }

/* ---------- Каталог ---------- */
.page-head { padding: 36px 0 8px; }
.page-head h1 { margin: 0 0 8px; font-size: clamp(1.6rem, 3.4vw, 2.2rem); color: var(--wood-dark); }
.page-head p { color: var(--muted); margin: 0; }

/* ---------- Хлебные крошки ---------- */
.breadcrumbs {
  font-size: .9rem;
  color: var(--muted);
  margin: 16px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  padding: 0;
}
.breadcrumbs li + li::before { content: "›"; margin-right: 6px; color: var(--muted); }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--wood-dark); }
.breadcrumbs li:last-child { color: var(--text); }

/* ---------- Карточка товара ---------- */
.product { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding: 8px 0 40px; }
.product .gallery { position: sticky; top: calc(var(--header-h) + 16px); align-self: start; }

.gallery-main {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-soft);
  cursor: zoom-in;
  aspect-ratio: 1 / 1;
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.gallery-thumbs button {
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: none;
  width: 84px;
  height: 84px;
}
.gallery-thumbs button img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs button.active { border-color: var(--wood); }
.gallery-hint { color: var(--muted); font-size: .85rem; margin-top: 8px; }

.product-info h1 { margin: 0 0 12px; font-size: clamp(1.5rem, 3vw, 2rem); color: var(--wood-dark); line-height: 1.25; }
.price-row { display: flex; align-items: baseline; gap: 14px; margin: 8px 0 18px; }
.price-row .price { font-size: 2rem; font-weight: 800; color: var(--cta); }
.price-row .old-price { color: var(--muted); text-decoration: line-through; }

.specs {
  width: 100%;
  border-collapse: collapse;
  margin: 22px 0;
}
.specs th, .specs td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  font-size: .96rem;
}
.specs th { width: 40%; color: var(--muted); font-weight: 600; }

.buy-block { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 18px 0; }

/* ---------- Похожие товары ---------- */
.related { padding: 30px 0 50px; }

/* ---------- Блог ---------- */
.article-list { display: grid; gap: 18px; }
.article-item {
  display: flex;
  gap: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  transition: transform .2s;
}
.article-item:hover { transform: translateY(-2px); }
.article-item h3 { margin: 0 0 6px; }
.article-item h3 a { color: var(--text); }
.article-item p { margin: 0; color: var(--muted); font-size: .95rem; }

.article-body { max-width: 760px; margin: 0 auto; padding: 16px 0 50px; }
.article-body h2 { color: var(--wood-dark); margin-top: 30px; }
.article-body table { width: 100%; border-collapse: collapse; margin: 18px 0; }
.article-body th, .article-body td { padding: 9px 12px; border: 1px solid var(--border); text-align: left; }
.article-body th { background: var(--bg-soft); }

/* ---------- Подвал ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 30px 0;
  margin-top: 20px;
  color: var(--muted);
  font-size: .92rem;
}
.footer-inner { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; }

/* ---------- Лайтбокс с зумом ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(25, 18, 10, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox-stage {
  max-width: 88vw;
  max-height: 86vh;
  overflow: hidden;
  border-radius: 10px;
}
.lightbox-stage img {
  max-width: 88vw;
  max-height: 86vh;
  object-fit: contain;
  transform: scale(1);
  transition: transform .18s ease-out;
  cursor: zoom-in;
}
.lightbox-stage img.zoomed { cursor: zoom-out; }
.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: none;
  cursor: pointer;
  border-radius: 50%;
  font-size: 1.6rem;
  line-height: 1;
}
.lightbox-close { top: 18px; right: 22px; width: 46px; height: 46px; }
.lightbox-prev, .lightbox-next { top: 50%; transform: translateY(-50%); width: 52px; height: 52px; font-size: 2rem; }
.lightbox-prev { left: 18px; }
.lightbox-next { right: 18px; }
.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  background: rgba(0,0,0,.45);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: .9rem;
}

/* ---------- Утилиты ---------- */
.text-center { text-align: center; }
.muted { color: var(--muted); }

/* ---------- Адаптив ---------- */
@media (max-width: 860px) {
  .burger { display: flex; }
  .site-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    display: none;
  }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; padding: 8px 20px 16px; }
  .site-nav a { display: block; padding: 14px 2px; border-bottom: 1px solid var(--border); }
  .site-nav li:last-child a { border-bottom: none; }

  .product { grid-template-columns: 1fr; gap: 22px; }
  .product .gallery { position: static; }
}

@media (max-width: 480px) {
  .hero { padding: 44px 0 32px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .product-card .body { padding: 12px 13px 14px; }
  .gallery-thumbs button { width: 64px; height: 64px; }
  .price-row .price { font-size: 1.6rem; }
  .footer-inner { flex-direction: column; }
}
