/* ============================================================
   Сады Уильямс - витрина природных материалов
   Эстетика: БОТАНИЧЕСКИЙ ГЕРБАРИЙ
   Образец = карточка: номер, латынь, уголки-метки крепления,
   сезонная пометка. Выдержанная бумага + резкий акцент-штамп.
   ============================================================ */

:root {
  --paper:    #f4efe2;   /* гербарная бумага      */
  --paper-2:  #ebe3d0;   /* чуть темнее           */
  --card:     #faf7ee;   /* лист образца (светлее)*/
  --ink:      #232a1d;   /* ботаническая тушь     */
  --ink-soft: #5b6450;   /* приглушённый          */
  --forest:   #38492d;   /* глубокая зелень       */
  --sage:     #93a07e;   /* шалфей                */
  --rust:     #a8482b;   /* сиена - штамп/акцент  */
  --ochre:    #b07a3c;   /* охра, сухоцвет        */
  --bark:     #8a7558;   /* кора - латынь/цена    */
  --line:     #d8d0bc;   /* линии                 */
  --line-ink: #c0b69c;   /* метки/уголки          */
  --shadow:   0 18px 40px -24px rgba(44, 56, 41, 0.45);

  --display: "Cormorant Garamond", Georgia, serif;
  --body:    "Inter", system-ui, sans-serif;

  --maxw: 1180px;
  --radius:    16px;   /* скругление карточек */
  --radius-sm: 11px;   /* скругление окна образца */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 16% 10%, rgba(147,160,126,0.10), transparent 44%),
    radial-gradient(circle at 88% 82%, rgba(176,122,60,0.07), transparent 48%);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-weight: 400;
}

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

/* ---------- лёгкая зернистость бумаги ---------- */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 9999;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* =================== ШАПКА =================== */
/* Шапка с логотипом НЕ липкая - уезжает вверх при прокрутке.
   Закрепляется только панель .controls (поиск + сезоны) ниже. */
.topbar {
  background: rgba(244, 239, 226, 0.82);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 96px; padding-top: 8px; padding-bottom: 8px;
}
.brand-mark {
  font-family: var(--display);
  font-size: 1.95rem; font-weight: 700; letter-spacing: 0.01em;
  color: var(--forest);
}
.brand-mark span { color: var(--rust); padding: 0 1px; }

/* логотип «Сады Уильямс» (вертикально: цветы сверху, название под ними) */
.brand-logo { display: inline-flex; align-items: center; line-height: 0; }
.brand-logo img {
  height: 82px; width: auto; display: block;
  transition: opacity 0.25s;
}
.brand-logo:hover img { opacity: 0.78; }
.brand-logo--footer img { height: 104px; }
@media (max-width: 560px) {
  .brand-logo img { height: 70px; }
  .brand-logo--footer img { height: 84px; }
}
.nav { display: flex; gap: 30px; }
.nav a {
  color: var(--ink-soft); text-decoration: none;
  font-size: 0.74rem; letter-spacing: 0.18em; text-transform: uppercase;
  position: relative; padding: 4px 0;
  transition: color 0.25s;
}
.nav a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px; background: var(--rust);
  transform: scaleX(0); transform-origin: left; transition: transform 0.3s ease;
}
.nav a:hover { color: var(--forest); }
.nav a:hover::after { transform: scaleX(1); }

/* =================== ГЕРОЙ / ФРОНТИСПИС =================== */
.hero { padding: 24px 0 18px; }
.hero__inner { position: relative; padding: 8px 4px; }

.hero .eyebrow {
  font-family: var(--display); font-style: italic;
  font-size: 1.05rem; letter-spacing: 0.02em;
  color: var(--rust); margin-bottom: 14px;
}
.hero h1 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  line-height: 1.0; letter-spacing: -0.015em;
  color: var(--forest);
  max-width: 16ch;
}
.hero h1 em { font-style: italic; font-weight: 400; color: var(--ochre); }
.hero .lead {
  margin-top: 30px; max-width: 46ch;
  font-size: 1.2rem; color: var(--ink-soft);
}
.hero .meta {
  margin-top: 40px; display: flex; flex-wrap: wrap; gap: 14px 38px;
  font-size: 0.78rem; letter-spacing: 0.1em; color: var(--ink-soft);
  text-transform: uppercase;
}
.hero .meta b { font-family: var(--display); color: var(--forest); font-weight: 600; }

/* инковый штамп-печать */
.stamp {
  position: absolute; top: 30px; right: 6px;
  display: flex; flex-direction: column; align-items: center;
  gap: 3px; padding: 14px 18px;
  border: 2px solid var(--rust); border-radius: 6px;
  color: var(--rust); transform: rotate(-5deg);
  opacity: 0.78; mix-blend-mode: multiply; text-align: center;
  box-shadow: inset 0 0 0 1px rgba(168,72,43,0.35);
}
.stamp::after {
  content: ""; position: absolute; inset: 4px;
  border: 1px solid rgba(168,72,43,0.45); border-radius: 4px; pointer-events: none;
}
.stamp__top { display: block; width: 168px; height: auto; margin-bottom: 2px; }
.stamp__mid { font-style: italic; font-size: 0.74rem; }
.stamp__bot { font-size: 0.6rem; letter-spacing: 0.18em; text-transform: uppercase; }

/* декоративная веточка-разделитель */
.rule {
  display: flex; align-items: center; gap: 18px;
  color: var(--sage); margin: 8px 0 4px;
}
.rule::before, .rule::after {
  content: ""; height: 1px; background: var(--line); flex: 1;
}
.rule svg { width: 26px; height: 26px; opacity: 0.85; }

/* =================== КАТАЛОГ =================== */
.catalog { padding: 14px 0 92px; }
.section-no {
  font-size: 0.7rem; letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--rust); margin-bottom: 8px;
}
.section-no--light { color: var(--ochre); }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; flex-wrap: wrap; margin-bottom: 14px;
}
.section-head h2 {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(2.1rem, 4vw, 3rem); line-height: 1.02; color: var(--forest);
}
.section-head p { color: var(--ink-soft); max-width: 40ch; font-size: 0.98rem; }

/* панель управления - фильтры + поиск, прилипает под шапкой */
.controls {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px 24px;
  margin: 24px -28px 16px;
  padding: 10px 28px;
  background: rgba(244, 239, 226, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

/* фильтры - вкладки указателя журнала */
.filters {
  display: flex; flex-wrap: wrap; gap: 6px 18px;
}
.filters button {
  font-family: var(--body);
  background: none; border: 0;
  border-bottom: 2px solid transparent;
  color: var(--ink-soft);
  padding: 8px 2px 9px;
  font-size: 0.92rem; letter-spacing: 0.04em;
  cursor: pointer; transition: color 0.2s, border-color 0.2s;
}
.filters button:hover { color: var(--forest); }
.filters button.active {
  color: var(--forest); border-bottom-color: var(--rust);
}

/* поиск по каталогу - справа в панели */
.search {
  position: relative; display: flex; align-items: center;
  margin-left: auto;
}
.search__icon {
  position: absolute; left: 12px; width: 16px; height: 16px;
  color: var(--bark); pointer-events: none;
}
.search__input {
  font-family: var(--body); font-size: 0.9rem; color: var(--ink);
  width: 210px; max-width: 60vw;
  padding: 9px 30px 9px 36px;
  background: var(--card);
  border: 1px solid var(--line); border-radius: 999px;
  transition: border-color 0.2s, box-shadow 0.2s, width 0.2s;
}
.search__input::placeholder { color: var(--bark); opacity: 0.8; }
.search__input:focus {
  outline: none; border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(147, 160, 126, 0.18);
}
/* убираем родной крестик у type=search - свой */
.search__input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.search__clear {
  position: absolute; right: 8px;
  width: 22px; height: 22px; border: 0; border-radius: 50%;
  background: var(--paper-2); color: var(--ink-soft);
  font-size: 1.05rem; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
  transition: background 0.2s, color 0.2s;
}
.search__clear:hover { background: var(--rust); color: #fff; }

/* сезонные секции */
.season-group { margin-top: 50px; }
.season-group:first-child { margin-top: 4px; }
.season-head {
  display: flex; align-items: baseline; gap: 16px; margin-bottom: 24px;
}
.season-head h2 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(2rem, 3.8vw, 2.8rem); color: var(--forest); white-space: nowrap;
  letter-spacing: 0.005em;
}
.season-head .season-rule { flex: 1; height: 1px; background: var(--line); }
.season-head .season-count {
  font-size: 0.78rem; color: var(--bark); font-weight: 600; letter-spacing: 0.04em; white-space: nowrap;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 22px;
}

/* ---------- КАРТОЧКА (фото-витрина) ---------- */
.card {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  opacity: 0; transform: translateY(16px);
  animation: rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
  animation-delay: calc(var(--i) * 45ms);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
@keyframes rise { to { opacity: 1; transform: translateY(0); } }
.card:hover { transform: translateY(-4px); box-shadow: 0 26px 50px -26px rgba(44, 56, 41, 0.5); }

/* окно снимка */
.thumb { position: relative; aspect-ratio: 4 / 5; background: var(--paper-2); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* плейсхолдер «фото добавим» (пока снимков нет) */
.noimg {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; color: var(--sage);
  background: repeating-linear-gradient(45deg, var(--paper-2), var(--paper-2) 11px, #eae3d2 11px, #eae3d2 22px);
}
.noimg svg { width: 34px; height: 34px; opacity: 0.55; }
.noimg span { font-size: 0.74rem; letter-spacing: 0.04em; text-align: center; }

/* пилюля сезона на снимке */
.season-tag {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  background: rgba(44, 56, 41, 0.82); color: #f3efe4;
  font-size: 0.66rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 5px 11px; border-radius: 999px; backdrop-filter: blur(2px);
}

/* счётчик фото */
.photo-count {
  position: absolute; bottom: 10px; right: 10px; z-index: 2;
  display: flex; align-items: center; gap: 5px;
  background: rgba(43, 51, 40, 0.78); color: #f3efe4;
  font-size: 0.66rem; font-weight: 600; letter-spacing: 0.04em;
  padding: 4px 9px; border-radius: 999px; backdrop-filter: blur(2px);
}
.photo-count svg { width: 12px; height: 12px; }

/* лента миниатюр */
.strip { display: flex; gap: 6px; padding: 8px 8px 0; overflow-x: auto; scrollbar-width: thin; }
.strip::-webkit-scrollbar { height: 5px; }
.strip::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.strip img {
  flex: 0 0 auto; width: 44px; height: 44px; object-fit: cover; border-radius: 7px;
  cursor: pointer; border: 2px solid transparent; opacity: 0.7; transition: 0.18s;
}
.strip img:hover { opacity: 1; }
.strip img.active { border-color: var(--ochre); opacity: 1; }

.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-body h3 { font-family: var(--body); font-size: 1.06rem; font-weight: 600; color: var(--ink); line-height: 1.25; }
.latin { font-family: var(--display); font-style: italic; font-size: 1rem; color: var(--bark); }
.note {
  margin-top: 8px; font-size: 0.74rem; line-height: 1.35; color: #9a7a3f;
  background: #faf4e6; border: 1px solid #ecdfc2; border-radius: 8px; padding: 6px 9px;
}

.card-meta {
  margin-top: auto; padding-top: 12px;
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--line);
}
.unit { font-size: 0.78rem; color: var(--ink-soft); }
.unit b { color: var(--forest); font-weight: 600; }
.price { font-size: 0.82rem; color: var(--bark); font-weight: 600; letter-spacing: 0.02em; }
.price.has-price { color: #fff; background: var(--forest); padding: 4px 11px; border-radius: 999px; }

/* наличие - метка на снимке (значения только из catalog.js) */
.stock {
  position: absolute; bottom: 10px; right: 10px; z-index: 2;
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(43, 51, 40, 0.78); color: #f3efe4;
  font-size: 0.62rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; backdrop-filter: blur(2px);
}
.stock::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.stock-in::before  { background: #9fd17a; }
.stock-low::before { background: #e3b25a; }
.stock-out::before { background: #e08a6a; }

.empty { color: var(--ink-soft); font-style: italic; padding: 40px 0; }

/* =================== КАК ЗАКАЗАТЬ =================== */
.order { background: var(--forest); color: var(--paper); padding: 86px 0; }
.order .wrap { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: center; }
.order h2 { font-family: var(--display); font-weight: 500; font-size: clamp(2.2rem, 4vw, 3.4rem); margin-bottom: 18px; }
.order p { color: #d9e0cf; font-size: 1.1rem; max-width: 44ch; }
.steps { display: grid; gap: 22px; }
.step { display: flex; gap: 18px; align-items: flex-start; }
.step .num {
  font-family: var(--display); font-size: 1.5rem; color: var(--ochre);
  border: 1px solid rgba(244,239,226,0.3); width: 46px; height: 46px;
  border-radius: 50%; display: grid; place-items: center; flex: none;
}
.step .txt b { display: block; font-size: 1.08rem; margin-bottom: 2px; }
.step .txt span { color: #cdd5c1; font-size: 0.96rem; }
.cta {
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 30px; background: var(--ochre); color: #fff;
  padding: 15px 28px; border-radius: 100px; text-decoration: none;
  font-size: 0.96rem; letter-spacing: 0.04em;
  transition: transform 0.2s, background 0.2s;
}
.cta:hover { transform: translateY(-2px); background: #c2814a; }
.order-phone { margin-top: 16px; font-size: 0.96rem; color: #cdd5c1; }
.order-phone a { color: #f3efe4; text-decoration: none; border-bottom: 1px solid rgba(243,239,228,0.4); transition: border-color 0.2s; }
.order-phone a:hover { border-bottom-color: var(--ochre); }

/* =================== ПОДВАЛ =================== */
footer { padding: 60px 0 70px; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; align-items: flex-end; }
footer .brand-mark { font-size: 1.8rem; }
footer .tag { color: var(--ink-soft); font-size: 0.92rem; max-width: 34ch; margin-top: 8px; }
footer .where { text-align: right; color: var(--ink-soft); font-size: 0.9rem; line-height: 1.9; }
footer .where a { color: var(--forest); text-decoration: none; border-bottom: 1px solid var(--line); transition: border-color 0.2s; }
footer .where a:hover { border-bottom-color: var(--ochre); }

.draft-note {
  background: var(--paper-2); border: 1px dashed var(--ochre);
  color: var(--ink-soft); border-radius: 12px;
  padding: 12px 18px; font-size: 0.88rem; margin: 26px auto 0;
  max-width: var(--maxw); text-align: center;
}

/* =================== ПЛАВАЮЩАЯ КНОПКА TELEGRAM =================== */
.tg-float {
  position: fixed; right: 22px; bottom: 22px; z-index: 200;
  display: inline-flex; align-items: center; gap: 0;
  height: 56px; padding: 0 16px;
  background: var(--forest); color: var(--paper);
  border-radius: 100px; text-decoration: none;
  box-shadow: 0 14px 30px -10px rgba(44, 56, 41, 0.6);
  overflow: hidden;
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
}
.tg-float svg { flex: none; }
.tg-float__label {
  max-width: 0; opacity: 0; white-space: nowrap;
  font-size: 0.92rem; letter-spacing: 0.02em;
  transition: max-width 0.3s ease, opacity 0.25s ease, margin-left 0.3s ease;
}
.tg-float:hover {
  background: #2f3d26; transform: translateY(-2px);
  box-shadow: 0 18px 36px -10px rgba(44, 56, 41, 0.7);
}
.tg-float:hover .tg-float__label { max-width: 220px; opacity: 1; margin-left: 10px; }

@media (max-width: 760px) {
  .nav { display: none; }
  /* меню скрыто - логотип по центру шапки только на телефоне */
  .topbar .wrap { justify-content: center; }
  .stamp { display: none; }
  .hero__inner { padding: 6px 2px 0; }
  .order .wrap { grid-template-columns: 1fr; gap: 36px; }
  .hero { padding: 12px 0 10px; }
  .hero .lead { margin-top: 18px; }
  .hero .meta { margin-top: 22px; }
  .catalog { padding: 6px 0 72px; }
  /* панель на телефоне: сезоны - одной строкой (свайп вбок), поиск - строкой ниже */
  .controls { flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 8px; }
  .filters {
    flex-wrap: nowrap; overflow-x: auto; gap: 0 16px;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .filters::-webkit-scrollbar { display: none; }
  .filters button { white-space: nowrap; }
  .search { margin-left: 0; width: 100%; }
  .search__input { width: 100%; max-width: none; }
  .tg-float { right: 16px; bottom: 16px; padding: 0; width: 56px; justify-content: center; }
  .tg-float:hover .tg-float__label { max-width: 0; opacity: 0; margin-left: 0; }
}

/* уважение к настройке «меньше движения» */
@media (prefers-reduced-motion: reduce) {
  .tg-float, .tg-float__label { transition: none; }
  .tg-float:hover { transform: none; }
}

/* уважение к настройке «меньше движения» */
@media (prefers-reduced-motion: reduce) {
  .card { animation: none; opacity: 1; transform: none; }
  .card:hover { transform: none; }
  html { scroll-behavior: auto; }
}
