/* === STYLE.CSS === */
/* assets/css/style.css */
/* НАЗНАЧЕНИЕ: Премиум-стиль витрины (эстетика "Роскошь"), OKLCH, тёмная/светлая тема */
/* СВЯЗИ: index.php, assets/js/app.js */
/* РАЗМЕР: ~430 строк */

:root {
  /* Палитра (OKLCH) — тёплое золото + глубокий графит */
  --bg: oklch(98% 0.005 90);
  --bg-soft: oklch(95% 0.008 90);
  --surface: oklch(100% 0 0);
  --text: oklch(25% 0.01 60);
  --text-soft: oklch(45% 0.015 60);
  --gold: oklch(68% 0.11 75);
  --gold-deep: oklch(58% 0.12 70);
  --border: oklch(90% 0.008 80);
  --danger: oklch(58% 0.18 25);
  --success: oklch(62% 0.13 150);

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 4px 24px oklch(25% 0.02 60 / 0.08);
  --shadow-lg: 0 12px 48px oklch(25% 0.02 60 / 0.14);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --maxw: 1280px;

  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Crimson Text", Georgia, serif;
  --font-ui: "Helvetica Neue", system-ui, sans-serif;
}

[data-theme="dark"] {
  --bg: oklch(20% 0.012 70);
  --bg-soft: oklch(24% 0.014 70);
  --surface: oklch(26% 0.014 70);
  --text: oklch(94% 0.008 80);
  --text-soft: oklch(72% 0.012 80);
  --gold: oklch(74% 0.12 78);
  --gold-deep: oklch(66% 0.13 74);
  --border: oklch(34% 0.012 70);
  --shadow: 0 4px 24px oklch(0% 0 0 / 0.3);
  --shadow-lg: 0 12px 48px oklch(0% 0 0 / 0.45);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  transition: background 0.3s var(--ease-out-quart), color 0.3s var(--ease-out-quart);
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

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

/* --- Шапка --- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: oklch(from var(--surface) l c h / 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-row { display: flex; align-items: center; gap: 24px; height: 72px; }
.logo {
  font-family: var(--font-display); font-weight: 600; font-size: 28px;
  color: var(--text); text-decoration: none; letter-spacing: 0.3px; white-space: nowrap;
}
.logo span { color: var(--gold); }
.header-search { flex: 1; max-width: 460px; position: relative; }
.header-search input {
  width: 100%; padding: 11px 16px 11px 42px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text); font-family: var(--font-ui); font-size: 15px;
}
.header-search input:focus { outline: none; border-color: var(--gold); }
.header-search::before {
  content: "⌕"; position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-soft); font-size: 20px;
}
.header-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.header-phone {
  font-family: var(--font-ui); font-weight: 600; font-size: 15px;
  color: var(--text); text-decoration: none; white-space: nowrap;
}
.icon-btn {
  position: relative; width: 44px; height: 44px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
  cursor: pointer; display: grid; place-items: center; font-size: 20px;
  transition: border-color 0.2s, transform 0.15s;
}
.icon-btn:hover { border-color: var(--gold); transform: translateY(-1px); }
.cart-count {
  position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px;
  background: var(--gold-deep); color: #fff; border-radius: 10px;
  font-family: var(--font-ui); font-size: 11px; font-weight: 700;
  display: grid; place-items: center; padding: 0 5px;
}
.cart-count:empty, .cart-count[data-count="0"] { display: none; }

/* --- Hero --- */
.hero {
  padding: 64px 0 48px; text-align: center;
  background: linear-gradient(180deg, var(--bg-soft), var(--bg));
}
.hero h1 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(36px, 5vw, 58px); line-height: 1.1; margin-bottom: 16px;
}
.hero h1 em { color: var(--gold); font-style: italic; }
.hero p { font-size: 20px; color: var(--text-soft); max-width: 640px; margin: 0 auto; }
.hero-badges { display: flex; gap: 28px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }
.hero-badge { font-family: var(--font-ui); font-size: 14px; color: var(--text-soft); }
.hero-badge b { color: var(--text); display: block; font-size: 22px; font-family: var(--font-display); }

/* --- Layout каталога --- */
.catalog { display: grid; grid-template-columns: 268px 1fr; gap: 32px; padding: 40px 0 80px; }
.sidebar { position: sticky; top: 96px; align-self: start; }
.filter-tabs { display: flex; gap: 4px; margin-bottom: 16px; background: var(--bg-soft); padding: 4px; border-radius: var(--radius-sm); }
.filter-tab {
  flex: 1; padding: 9px; border: none; background: none; cursor: pointer;
  font-family: var(--font-ui); font-size: 13px; font-weight: 600; color: var(--text-soft);
  border-radius: 6px; transition: all 0.2s;
}
.filter-tab.active { background: var(--surface); color: var(--gold-deep); box-shadow: var(--shadow); }
.cat-list { list-style: none; max-height: 60vh; overflow-y: auto; }
.cat-list li a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 12px; color: var(--text-soft); text-decoration: none;
  font-family: var(--font-ui); font-size: 14px; border-radius: 7px; transition: all 0.15s;
}
.cat-list li a:hover, .cat-list li a.active { background: var(--bg-soft); color: var(--gold-deep); }
.cat-list .cnt { font-size: 12px; color: var(--text-soft); opacity: 0.7; }

/* --- Тулбар --- */
.toolbar { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.toolbar h2 { font-family: var(--font-display); font-weight: 600; font-size: 30px; }
.toolbar .count { font-family: var(--font-ui); font-size: 14px; color: var(--text-soft); }
.sort-select {
  margin-left: auto; padding: 9px 14px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
  font-family: var(--font-ui); font-size: 14px; cursor: pointer;
}

/* --- Сетка товаров --- */
.products-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 22px;
}
.product-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform 0.25s var(--ease-out-quart), box-shadow 0.25s, border-color 0.25s;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--gold); }
.product-img {
  aspect-ratio: 1; background: var(--bg-soft); display: grid; place-items: center; overflow: hidden;
  cursor: pointer;
}
.product-img img { width: 100%; height: 100%; object-fit: contain; padding: 16px; transition: transform 0.3s; }
.product-card:hover .product-img img { transform: scale(1.05); }
.product-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; gap: 10px; }
.product-title {
  font-family: var(--font-body); font-size: 17px; line-height: 1.35; font-weight: 600;
  color: var(--text); cursor: pointer; display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
}
.product-title:hover { color: var(--gold-deep); }
.product-foot { margin-top: auto; display: flex; align-items: center; gap: 12px; }
.product-price { font-family: var(--font-display); font-size: 24px; font-weight: 600; color: var(--gold-deep); white-space: nowrap; }
.product-price small { font-size: 14px; color: var(--text-soft); font-family: var(--font-ui); }
.no-price { font-family: var(--font-ui); font-size: 14px; color: var(--text-soft); }
.btn-add {
  margin-left: auto; padding: 9px 16px; border: none; border-radius: var(--radius-sm);
  background: var(--gold); color: #fff; font-family: var(--font-ui); font-weight: 600;
  font-size: 14px; cursor: pointer; transition: background 0.2s, transform 0.1s;
}
.btn-add:hover { background: var(--gold-deep); }
.btn-add:active { transform: scale(0.96); }
.btn-add:disabled { opacity: 0.5; cursor: not-allowed; }
/* Кнопка-ссылка «Уточнить» для товаров без цены */
.btn-call { text-decoration: none; text-align: center; line-height: 1; display: inline-flex; align-items: center; }
.btn-call:hover { background: var(--gold-deep); color: #fff; }

/* --- Пагинация --- */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 48px; }
.pagination button {
  min-width: 42px; height: 42px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-family: var(--font-ui); cursor: pointer;
  transition: all 0.15s;
}
.pagination button:hover:not(:disabled) { border-color: var(--gold); }
.pagination button.active { background: var(--gold); color: #fff; border-color: var(--gold); }
.pagination button:disabled { opacity: 0.4; cursor: default; }

/* --- Состояния --- */
.skeleton-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 22px; }
.skeleton {
  aspect-ratio: 0.72; border-radius: var(--radius);
  background: linear-gradient(90deg, var(--bg-soft) 25%, var(--border) 50%, var(--bg-soft) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.empty-state { text-align: center; padding: 80px 20px; color: var(--text-soft); }
.empty-state .big { font-size: 56px; margin-bottom: 16px; }

/* --- Подвал --- */
.site-footer {
  border-top: 1px solid var(--border); background: var(--bg-soft);
  padding: 48px 0; margin-top: 40px; font-family: var(--font-ui); font-size: 14px; color: var(--text-soft);
}
.footer-row { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }

/* --- Адаптив --- */
@media (max-width: 900px) {
  .catalog { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  /* Поиск не прячем — выносим отдельной строкой под шапкой (это главный инструмент магазина) */
  .header-search {
    order: 3; flex-basis: 100%; max-width: none;
    margin-top: 10px; padding-bottom: 12px;
  }
  .header-row { flex-wrap: wrap; height: auto; padding-top: 12px; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .header-phone { display: none; }
  .products-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
}
