:root {
  /* "Хром" — шапка, навигация, подвал — всегда тёмно-синие с золотом,
     не зависят от выбранной темы (см. --text-primary/--surface ниже) */
  --navy-950: #0a121c;
  --navy-900: #0f1a24;
  --navy-800: #16212c;
  --navy-700: #1c2b39;
  --navy-600: #24374a;
  --text-light: #eef1f4;
  --text-muted: #9aa7b3;
  --gold: #d4af6a;
  --gold-bright: #ecd19f;
  --gold-deep: #b8863f;
  --gold-gradient: linear-gradient(135deg, #ecd19f 0%, #d4af6a 45%, #b8863f 100%);

  /* Контентная тема — переключается между светлой (по умолчанию) и тёмной
     через [data-theme="dark"] на <html>. Золото то же самое, но на светлой
     теме берём более тёмный оттенок — иначе на молочном фоне текст потеряется */
  --bg-page:
    radial-gradient(ellipse 1100px 600px at 50% -12%, rgba(150, 112, 42, 0.10), transparent 60%),
    linear-gradient(180deg, #fbf7ee 0%, #f2e8d3 100%);
  --surface: #fffdf9;
  --surface-alt: #f5eddb;
  --divider: rgba(36, 31, 24, 0.1);
  --text-primary: #241f18;
  --text-secondary: #6b6355;
  --content-gold: #96702a;
  --card-shadow: 0 4px 18px rgba(80, 60, 20, 0.12);
  --card-shadow-hover: 0 26px 46px rgba(80, 60, 20, 0.18), 0 0 0 1px rgba(150, 112, 42, 0.22);
  --shine: rgba(255, 255, 255, 0.55);
  --danger-text: #c0392b;
  --alert-error-bg: #fdecea;
  --alert-error-text: #c0392b;
  --alert-error-border: rgba(192, 57, 43, 0.25);
  --alert-success-bg: #eaf7ec;
  --alert-success-text: #237a3d;
  --alert-success-border: rgba(35, 122, 61, 0.25);
  --disabled-bg: #e7e1d2;
  --disabled-text: #a49b89;
  --placeholder-text: #9c9483;
}

:root[data-theme="dark"] {
  --bg-page:
    radial-gradient(ellipse 1200px 640px at 50% -14%, rgba(212, 175, 106, 0.12), transparent 60%),
    linear-gradient(180deg, #050609 0%, #0a0d13 45%, #0c1019 100%);
  --surface: #10141b;
  --surface-alt: #070910;
  --divider: rgba(212, 175, 106, 0.1);
  --text-primary: var(--text-light);
  --text-secondary: var(--text-muted);
  --content-gold: var(--gold);
  --card-shadow: 0 6px 22px rgba(0, 0, 0, 0.55);
  --card-shadow-hover: 0 30px 56px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(212, 175, 106, 0.32), 0 0 28px rgba(212, 175, 106, 0.1);
  --shine: rgba(255, 255, 255, 0.16);
  --danger-text: #e2685c;
  --alert-error-bg: rgba(192, 57, 43, 0.15);
  --alert-error-text: #e2685c;
  --alert-error-border: rgba(192, 57, 43, 0.3);
  --alert-success-bg: rgba(46, 160, 90, 0.15);
  --alert-success-text: #4caf7d;
  --alert-success-border: rgba(46, 160, 90, 0.3);
  --disabled-bg: #232a33;
  --disabled-text: #6c7a87;
  --placeholder-text: #5c6975;
}

/* Плавный переход между темами (фон/поверхности/текст) при клике на
   переключатель — без этого смена [data-theme] моргает мгновенно.
   Анимации наведения/скролла — отдельно, через .reveal/tilt/ripple ниже,
   и все они уважают prefers-reduced-motion (см. в конце файла) */
html {
  scroll-behavior: smooth;
}

body,
.product-card,
.brand-tile,
.filter-form,
.product-detail,
.top-bar,
.site-footer,
.checkout-form,
.order-card,
.location-card,
.cart-table,
.locations-map {
  transition: background-color 0.4s ease, border-color 0.4s ease, color 0.4s ease, box-shadow 0.4s ease;
}

/* === Система движения =====================================================
   .reveal — плавное появление при попадании в область просмотра (см.
   public/motion.js, IntersectionObserver). .ripple-surface — золотая
   "капля" от места клика (тот же скрипт). Обе выключаются полностью для
   пользователей с prefers-reduced-motion — см. блок в самом конце файла */
@keyframes reveal-in {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes ripple-out {
  from { transform: scale(0); opacity: 0.45; }
  to { transform: scale(1); opacity: 0; }
}

@keyframes ken-burns {
  from { transform: scale(1); }
  to { transform: scale(1.07); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212, 175, 106, 0.35); }
  50% { box-shadow: 0 0 0 8px rgba(212, 175, 106, 0); }
}

/* .reveal прячется только когда motion.js реально запустился и готов сам
   же его показать (html.js-motion-ready) — если скрипт не загрузился или
   упал с ошибкой, контент остаётся видимым по умолчанию, а не пропадает
   навсегда */
html.js-motion-ready .reveal {
  opacity: 0;
}

.reveal.is-visible {
  animation: reveal-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.ripple-surface {
  position: relative;
  overflow: hidden;
}

.ripple {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, var(--shine) 0%, transparent 70%);
  pointer-events: none;
  transform: scale(0);
  animation: ripple-out 0.65s ease-out forwards;
}

* {
  box-sizing: border-box;
}

/* Раньше тут было html, body { height: 100% } — жёстко ограничивало
   высоту body ровно одним экраном (viewport). На страницах длиннее
   экрана фон дальше не дорисовывался/начинал повторяться заново — из-за
   этого был виден резкий шов на границе примерно одного экрана вниз.
   min-height: 100vh на body ниже сам по себе даёт и растяжение на весь
   контент, и "прибитый" футер на короткой странице — height: 100% был
   лишним и только мешал */
body {
  font-family: 'Segoe UI', Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

::selection {
  background: rgba(212, 175, 106, 0.35);
  color: var(--navy-950);
}

.container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Контент */
main {
  padding: 40px 0;
  flex: 1 0 auto;
}

.section {
  margin-bottom: 40px;
}

.section h2 {
  font-family: 'Playfair Display', Georgia, serif;
  border-bottom: 2px solid var(--content-gold);
  padding-bottom: 8px;
  margin-bottom: 20px;
  color: var(--text-primary);
}

/* Таблица цен */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid rgba(212, 175, 106, 0.14);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

th, td {
  border-bottom: 1px solid var(--divider);
  padding: 12px 16px;
  text-align: left;
}

th {
  background-color: var(--navy-700);
  color: var(--text-light);
  font-weight: 600;
}

tr:last-child td {
  border-bottom: none;
}

/* Точки */
.locations {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.location-card {
  background: var(--surface);
  border: 1px solid rgba(212, 175, 106, 0.14);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--card-shadow);
  color: var(--text-primary);
}

.location-card p {
  margin: 4px 0;
}

.location-card strong {
  color: var(--content-gold);
}

/* Золотая кнопка-акцент — крупные призывы к действию на главной и т.п.
   ("Смотреть весь каталог"). Тот же язык, что и .add-to-cart-button, но
   в форме пилюли для более заметных мест */
.cta-button {
  position: relative;
  overflow: hidden;
  display: inline-block;
  background: var(--gold-gradient);
  color: var(--navy-950);
  padding: 13px 32px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.2px;
  box-shadow: 0 8px 22px rgba(150, 112, 42, 0.26);
  transition: filter 0.2s, transform 0.15s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.2s;
}

.cta-button:hover {
  filter: brightness(1.06);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(150, 112, 42, 0.36);
}

.cta-button:active {
  transform: translateY(0) scale(0.96);
  transition-duration: 0.08s;
}

.section-cta {
  text-align: center;
  margin-top: 24px;
}

/* Маленькая подпись-"эйбрау" над заголовком секции — витринный,
   бутиковый тон вместо голого заголовка */
.section-kicker {
  display: block;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--content-gold);
  margin-bottom: 8px;
}

/* Диагональный блик, скользящий слева направо при наведении — общий для
   всех золотых кнопок сайта. pointer-events отключены, чтобы не мешать
   клику; сам ripple-эффект от нажатия добавляет motion.js через
   .ripple-surface (см. начало файла) */
.add-to-cart-button::before,
.filter-apply::before,
.cta-button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 40%, var(--shine) 50%, transparent 60%);
  transform: translateX(-120%);
  transition: transform 0.65s ease;
  pointer-events: none;
}

.add-to-cart-button:hover::before,
.filter-apply:hover::before,
.cta-button:hover::before {
  transform: translateX(120%);
}

/* Футер */
.site-footer {
  background-color: var(--navy-950);
  color: var(--text-muted);
  text-align: center;
  padding: 24px 0;
  font-size: 0.85rem;
  border-top: 1px solid rgba(212, 175, 106, 0.1);
}

.footer-legal-links {
  margin-top: 6px;
}

.footer-legal-links a {
  color: var(--text-muted);
  text-decoration: underline;
}

.footer-legal-sep {
  margin: 0 8px;
  opacity: 0.5;
}

.checkout-offer-note {
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.checkout-offer-note a {
  color: var(--content-gold);
}

/* Адаптивность под мобильные */
@media (max-width: 600px) {
  .locations {
    grid-template-columns: 1fr;
  }
}

.back-link {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
}

.back-link:hover {
  color: var(--content-gold);
}

/* Общий блок пустого состояния (корзина/избранное/заказы/поиск) */
.empty-state {
  text-align: center;
  padding: 56px 20px;
  max-width: 460px;
  margin: 0 auto;
}

.empty-state-icon {
  display: inline-block;
  font-size: 2.2rem;
  margin-bottom: 14px;
  opacity: 0.85;
}

.empty-state-title {
  margin: 0 0 10px;
}

.empty-state-text {
  color: var(--text-secondary);
  margin: 0 0 26px;
  line-height: 1.6;
}

/* Страница 404 */
.not-found-section {
  text-align: center;
  padding: 64px 20px 80px;
  max-width: 560px;
  margin: 0 auto;
}

.not-found-icon {
  display: inline-block;
  font-size: 2.4rem;
  color: var(--content-gold);
  margin-bottom: 8px;
}

.not-found-code {
  font-family: 'Playfair Display', serif;
  font-size: 5rem;
  font-weight: 800;
  line-height: 1;
  margin: 0 0 8px;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.not-found-section h2 {
  margin: 0 0 12px;
}

.not-found-text {
  color: var(--text-secondary);
  margin: 0 0 32px;
  line-height: 1.6;
}

.not-found-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.not-found-secondary {
  position: relative;
  overflow: hidden;
  display: inline-block;
  padding: 12px 30px;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 106, 0.4);
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  transition: border-color 0.2s, transform 0.15s, background 0.2s;
}

.not-found-secondary:hover {
  border-color: var(--content-gold);
  background: var(--surface-alt);
  transform: translateY(-2px);
}

.not-found-secondary:active {
  transform: translateY(0) scale(0.96);
}

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

.product-card {
  /* JS (motion.js) подставляет rotateX/rotateY по позиции курсора через
     эти переменные — если JS не запустился, они остаются 0deg, и при
     наведении сохраняется обычный лёгкий подъём без наклона */
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  position: relative;
  background: var(--surface);
  border: 1px solid rgba(212, 175, 106, 0.12);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transform: perspective(900px);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s, border-color 0.35s;
  will-change: transform;
}

.product-card:hover {
  transform: perspective(900px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) translateY(-6px);
  border-color: rgba(212, 175, 106, 0.45);
  box-shadow: var(--card-shadow-hover);
}

/* Золотая полоска снизу, которая "растёт" от центра при наведении — тихий
   акцент вместо кричащей рамки */
.product-card::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--gold-gradient);
  transform: translateX(-50%);
  transition: width 0.35s ease;
}

.product-card:hover::after {
  width: 60%;
}

.product-image {
  width: 100%;
  height: 180px;
  object-fit: contain;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(212, 175, 106, 0.08), transparent 65%),
    var(--surface-alt);
  display: block;
  padding: 10px;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.product-card:hover .product-image {
  transform: scale(1.06);
}

.product-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.product-info {
  padding: 14px 16px 16px;
  border-top: 1px solid var(--divider);
}

.product-name {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0 0 4px;
  word-break: break-word;
}

.product-model {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0 0 8px;
  opacity: 0.8;
}

.product-price {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--content-gold);
  margin: 0;
  letter-spacing: 0.2px;
  transition: transform 0.25s ease;
}

.product-card:hover .product-price {
  transform: translateX(2px);
}

.price-original {
  text-decoration: line-through;
  color: var(--text-secondary);
  font-weight: 400;
  font-size: 0.85em;
  margin-right: 6px;
}

.vip-badge {
  display: inline-block;
  background: var(--gold-gradient);
  color: var(--navy-950);
  font-size: 0.65em;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
  letter-spacing: 0.5px;
}

/* На узких экранах auto-fill из .product-grid схлопывает сетку в одну
   колонку — карточка растягивается на всю ширину экрана и выглядит
   непропорционально огромной. Держим 2 колонки и уменьшаем фото под них */
@media (max-width: 600px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .product-image {
    height: 130px;
  }
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.page-nav {
  padding: 9px 16px;
  background: var(--surface);
  color: var(--text-primary);
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.85rem;
  white-space: nowrap;
  border: 1px solid rgba(212, 175, 106, 0.2);
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.page-nav:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--navy-950);
}

.page-numbers {
  display: flex;
  gap: 4px;
  align-items: center;
}

.page-number {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 6px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-primary);
  background: var(--surface);
  border: 1px solid rgba(212, 175, 106, 0.2);
  font-size: 0.9rem;
  transition: border-color 0.15s;
}

.page-number:hover {
  border-color: var(--gold);
}

.page-number-active {
  background: var(--gold-gradient);
  color: var(--navy-950);
  border-color: transparent;
  font-weight: 700;
  cursor: default;
}

.page-ellipsis {
  padding: 0 4px;
  color: var(--text-secondary);
}

@media (max-width: 600px) {
  .page-nav span,
  .page-nav {
    font-size: 0.8rem;
    padding: 6px 10px;
  }
}

/* Верхняя строка контактов — часть "хрома", всегда тёмная */
.top-bar {
  background: var(--navy-950);
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 8px 0;
  border-bottom: 1px solid rgba(212, 175, 106, 0.12);
}

.top-bar-inner {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.top-bar-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-bar-links-sep {
  color: #555;
}

.top-bar-account-link {
  color: var(--text-muted);
  text-decoration: none;
}

.top-bar-account-link:hover {
  color: var(--gold);
}

.top-bar-logout-form {
  display: inline;
}

.top-bar-logout-button {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
}

.top-bar-logout-button:hover {
  color: var(--gold);
}

.theme-toggle-button {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  background: none;
  border: 1px solid rgba(212, 175, 106, 0.3);
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.theme-toggle-button:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* Иконки солнца/луны наложены друг на друга и перекрещиваются
   поворотом+затуханием при смене data-theme на <html> — JS только
   переключает атрибут, саму анимацию делает CSS */
.theme-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease;
}

.theme-icon-sun {
  opacity: 0;
  transform: rotate(-90deg) scale(0.4);
}

.theme-icon-moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

:root[data-theme="dark"] .theme-icon-sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

:root[data-theme="dark"] .theme-icon-moon {
  opacity: 0;
  transform: rotate(90deg) scale(0.4);
}

/* Шапка (верхняя строка контактов, лого/поиск/корзина, меню разделов)
   шире основного .container, чтобы не тесниться на десктопе */
.header-container {
  max-width: 1200px;
}

/* Основная шапка: лого, поиск, корзина — часть "хрома", всегда тёмная */
.main-header {
  background: linear-gradient(180deg, var(--navy-700) 0%, var(--navy-800) 100%);
  padding: 28px 0;
  position: relative;
}

.main-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.logo-block {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-text {
  color: var(--text-light);
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.search-form {
  display: flex;
  flex: 1 1 300px;
  max-width: 460px;
}

.search-form input {
  flex: 1;
  min-width: 0;
  padding: 13px 16px;
  border: 1px solid transparent;
  border-radius: 6px 0 0 6px;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.96);
}

.search-form input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(212, 175, 106, 0.25);
}

.search-form button {
  padding: 13px 20px;
  border: none;
  background: var(--gold-gradient);
  color: var(--navy-950);
  border-radius: 0 6px 6px 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 1.05rem;
  transition: filter 0.15s;
}

.search-form button:hover {
  filter: brightness(1.08);
}

.cart-widget {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--gold-gradient);
  color: var(--navy-950);
  padding: 12px 22px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(212, 175, 106, 0.22);
  transition: transform 0.15s, box-shadow 0.15s;
}

.cart-widget:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(212, 175, 106, 0.32);
}

/* Избранное и корзина — единая группа, чтобы не расползались по шапке */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* На десктопе группа прибита к правому краю шапки, а не идёт
   последней в узкой центрированной колонке .container */
@media (min-width: 701px) {
  .header-actions {
    position: absolute;
    top: 50%;
    right: 24px;
    transform: translateY(-50%);
  }

  /* Раз корзина с избранным больше не в потоке (см. выше), строку поиска
     больше некому останавливать через space-between. Раньше это решали
     через flex-grow: 0 — но тогда поле поиска не росло вообще, застревало
     на ~300px и текст плейсхолдера не помещался. Вместо этого резервируем
     под корзину/избранное справа (see .header-actions — 24px + ~254px
     ширины, с запасом на более длинную сумму в корзине) — тогда поле
     поиска может свободно расти (см. flex-grow в базовом .search-form) до
     max-width: 460px и не будет заезжать под абсолютно спозиционированный
     блок */
  .main-header-inner {
    justify-content: flex-start;
    padding-right: 320px;
  }
}

/* Нижнее меню разделов — часть "хрома", всегда тёмное */
.main-nav {
  background: var(--navy-900);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-inner {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  padding: 16px 0;
}

.main-nav a {
  position: relative;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 600;
  padding-bottom: 4px;
  transition: color 0.15s;
}

.main-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--gold);
  transition: width 0.2s ease;
}

.main-nav a:hover {
  color: var(--gold);
}

.main-nav a:hover::after {
  width: 100%;
}

/* Форма "в корзину" на карточке товара */
.add-to-cart-form {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.qty-input {
  width: 50px;
  padding: 5px;
  border: 1px solid rgba(212, 175, 106, 0.2);
  border-radius: 4px;
  background: var(--surface-alt);
  color: var(--text-primary);
}

.add-to-cart-button {
  position: relative;
  overflow: hidden;
  flex: 1;
  padding: 8px 10px;
  background: var(--gold-gradient);
  color: var(--navy-950);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  transition: filter 0.2s, transform 0.15s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.2s;
}

.add-to-cart-button:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(150, 112, 42, 0.3);
}

.add-to-cart-button:active {
  transform: translateY(0) scale(0.96);
  transition-duration: 0.08s;
}

/* Страница корзины */
.cart-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid rgba(212, 175, 106, 0.14);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.cart-table th, .cart-table td {
  border-bottom: 1px solid var(--divider);
  padding: 10px;
  text-align: left;
  vertical-align: middle;
}

.cart-item-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cart-item-thumb-link {
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  display: block;
}

.cart-item-thumb {
  width: 64px;
  height: 64px;
  object-fit: contain;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(212, 175, 106, 0.08), transparent 65%),
    var(--surface-alt);
  padding: 6px;
  display: block;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cart-item-thumb-link:hover .cart-item-thumb {
  transform: scale(1.08);
}

.cart-item-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 0.62rem;
  text-align: center;
  line-height: 1.2;
  padding: 4px;
}

.cart-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.cart-item-name-link {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
}

.cart-item-name-link:hover {
  color: var(--content-gold);
  text-decoration: underline;
}

.cart-item-variant {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.update-qty-form {
  display: flex;
  gap: 6px;
}

.update-qty-form button {
  padding: 6px 12px;
  background: var(--surface-alt);
  color: var(--text-primary);
  border: 1px solid rgba(212, 175, 106, 0.2);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: border-color 0.2s, transform 0.15s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.update-qty-form button:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
}

.update-qty-form button:active {
  transform: scale(0.94);
  transition-duration: 0.08s;
}

.remove-button {
  position: relative;
  overflow: hidden;
  background: #c0392b;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.15s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.remove-button:active {
  transform: scale(0.94);
  transition-duration: 0.08s;
}

.remove-button:hover {
  background: #8f2418;
}

.cart-total {
  text-align: right;
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: 16px;
  color: var(--content-gold);
}

.search-results-info {
  color: var(--text-secondary);
  margin-bottom: 12px;
}

@media (max-width: 700px) {
  .main-header-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .search-form {
    max-width: none;
    flex: 0 1 auto;
    width: 100%;
  }

  /* Плейсхолдер на узких экранах не помещался и обрезался ("...или мод")
     — несколько плотнее паддинги/шрифт у поля и кнопки, без потери
     читаемости */
  .search-form input {
    padding: 13px 12px;
    font-size: 0.92rem;
  }

  .search-form button {
    padding: 13px 16px;
  }

  .header-actions {
    justify-content: center;
  }

  .cart-widget {
    justify-content: center;
  }

  .favorites-widget {
    width: auto;
    padding: 8px 24px;
  }
}

.logo-img {
  width: 84px;
  height: 84px;
  object-fit: contain;
  background: #fff;
  border-radius: 50%;
  padding: 4px;
  box-shadow: 0 0 0 2px var(--gold), 0 4px 16px rgba(212, 175, 106, 0.25);
}

/* Слайдер с баннерами новых моделей на главной — сменяет собой прежний
   текстовый hero. Клик по слайду ведёт в каталог с поиском по модели,
   нарисованной на конкретной картинке (см. heroSlides в views/index.ejs) */
.hero-slider {
  position: relative;
  width: 100%;
  /* Ограничиваем именно ширину, не высоту — картинки 1140×380, и только так
     соотношение сторон блока всегда совпадает с соотношением сторон самих
     картинок. Раньше был max-height: на широких экранах блок растягивался
     шире, чем позволяла эта высота, пропорции переставали совпадать с
     картинкой, и object-fit: cover обрезал текст сверху/снизу */
  max-width: 1200px;
  margin: 0 auto;
  aspect-ratio: 1140 / 380;
  min-height: 100px;
  /* body — flex-контейнер (для "прибитого" футера), а внутри слайдера все
     слайды position:absolute — без обычного (в потоке) содержимого flexbox
     схлопывал высоту в 0 раньше, чем успевал сработать aspect-ratio.
     flex-shrink: 0 запрещает это сжатие */
  flex-shrink: 0;
  overflow: hidden;
  background: var(--navy-950);
  margin-top: 16px;
  border-radius: 18px;
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(212, 175, 106, 0.16);
}

@media (max-width: 600px) {
  .hero-slider {
    margin-top: 0;
    border-radius: 0;
    box-shadow: none;
  }
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.9s ease;
}

.hero-slide.active {
  opacity: 1;
  visibility: visible;
}

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Медленное "дыхание" картинки — Кен-Бёрнс. Именно .active (а не просто
   .hero-slide img) — так анимация действительно начинается заново каждый
   раз, когда JS переключает активный слайд (public/hero-slider.js), а не
   отыгрывает один раз при загрузке страницы и застывает на 13 слайдах сразу.
   Длительность равна интервалу автопрокрутки (5s), чтобы зум как раз
   заканчивался к моменту смены кадра */
.hero-slide.active img {
  animation: ken-burns 5s ease-out forwards;
}

.hero-slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: background-color 0.2s, transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hero-slider-arrow:hover {
  background: rgba(0, 0, 0, 0.55);
  transform: translateY(-50%) scale(1.1);
}

.hero-slider-arrow:active {
  transform: translateY(-50%) scale(0.92);
}

.hero-slider-arrow-prev {
  left: 16px;
}

.hero-slider-arrow-next {
  right: 16px;
}

.hero-slider-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 5;
}

.hero-slider-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  padding: 0;
  transition: background-color 0.15s, transform 0.15s;
}

.hero-slider-dot.active {
  background: var(--gold);
  transform: scale(1.25);
}

@media (max-width: 600px) {
  .hero-slider {
    /* Картинки — плотные баннеры 1140×380 с мелким текстом по краям,
       рассчитанные на широкий десктопный блок. При исходном соотношении
       на телефоне высота падает до ~100 px, текст превращается в кашу.
       Более "вертикальное" соотношение делает блок выше и картинку крупнее */
    aspect-ratio: 16 / 9;
  }

  .hero-slide img {
    /* cover обрезал бы края картинки по-разному на каждом из 13 баннеров —
       на части из них срез приходится ровно на середину слова ("САП...").
       contain показывает картинку целиком (с полями сверху/снизу вместо
       обрезки по бокам) — надёжно для любого баннера, ничего не потеряется */
    object-fit: contain;
  }

  .hero-slider-arrow {
    width: 34px;
    height: 34px;
    font-size: 0.95rem;
  }

  .hero-slider-arrow-prev {
    left: 8px;
  }

  .hero-slider-arrow-next {
    right: 8px;
  }
}

.product-card.out-of-stock {
  position: relative;
  opacity: 0.55;
}

.stock-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #c0392b;
  color: #fff;
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.2px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  z-index: 1;
}

.product-card {
  position: relative;
}

.add-to-cart-button:disabled {
  background: var(--disabled-bg);
  color: var(--disabled-text);
  cursor: not-allowed;
  transform: none;
}

.locations-map {
  width: 100%;
  height: 400px;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 24px;
  background: var(--surface);
  border: 1px solid rgba(212, 175, 106, 0.14);
  box-shadow: var(--card-shadow);
}

.services-banner {
  display: block;
  width: 100%;
  max-width: 900px;
  height: auto;
  border-radius: 14px;
  border: 1px solid rgba(212, 175, 106, 0.14);
  box-shadow: var(--card-shadow);
}

/* Плитки разделов/брендов каталога */
.brand-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.brand-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  aspect-ratio: 1;
  padding: 16px;
  background: var(--surface);
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(212, 175, 106, 0.14);
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  text-decoration: none;
  text-align: center;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s, border-color 0.35s;
}

.brand-tile:hover {
  transform: translateY(-6px) scale(1.015);
  border-color: rgba(212, 175, 106, 0.45);
  box-shadow: var(--card-shadow-hover);
}

.brand-tile-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Плитки с фоновым фото товара — подпись прижата книзу на затемнении,
   чтобы бренд читался поверх любой картинки независимо от темы сайта */
.brand-tile-photo {
  align-items: stretch;
  justify-content: flex-end;
  padding: 0;
}

.brand-tile-photo::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 18, 28, 0) 40%, rgba(10, 18, 28, 0.55) 75%, rgba(10, 18, 28, 0.88) 100%);
  transition: background 0.18s;
}

.brand-tile-photo:hover::before {
  background: linear-gradient(180deg, rgba(10, 18, 28, 0.05) 30%, rgba(10, 18, 28, 0.65) 75%, rgba(10, 18, 28, 0.92) 100%);
}

.brand-tile-photo .brand-tile-name {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 14px 16px 16px;
  color: #f7ecd8;
}

@media (max-width: 600px) {
  .brand-tile-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

/* Каталог: сайдбар с фильтрами слева, следующий за прокруткой, + сетка товаров */
.catalog-page {
  max-width: 1100px;
}

.catalog-layout {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}

.catalog-filters {
  width: 240px;
  flex-shrink: 0;
  position: sticky;
  top: 20px;
}

.catalog-results {
  flex: 1;
  min-width: 0;
}

.filter-open-tab,
.filter-close-tab,
.filter-backdrop {
  display: none;
}

.filter-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  background: var(--surface);
  border: 1px solid rgba(212, 175, 106, 0.14);
  padding: 18px;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  margin-bottom: 20px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-group label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.filter-group input,
.filter-group select {
  padding: 9px 12px;
  border: 1px solid rgba(212, 175, 106, 0.2);
  border-radius: 6px;
  font-size: 0.9rem;
  width: 100%;
  background: var(--surface-alt);
  color: var(--text-primary);
}

.filter-group input::placeholder {
  color: var(--placeholder-text);
}

.filter-group input:focus,
.filter-group select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 106, 0.15);
}

.filter-form .filter-apply {
  width: 100%;
}

.filter-apply {
  position: relative;
  overflow: hidden;
  padding: 10px 20px;
  background: var(--gold-gradient);
  color: var(--navy-950);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
  transition: filter 0.2s, transform 0.15s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.2s;
}

.filter-apply:active {
  transform: scale(0.96);
  transition-duration: 0.08s;
}

.filter-apply:hover {
  filter: brightness(1.08);
  box-shadow: 0 10px 22px rgba(150, 112, 42, 0.28);
}

.filter-reset {
  color: var(--danger-text);
  text-decoration: none;
  font-size: 0.85rem;
  align-self: center;
}

.filter-reset:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .catalog-layout {
    flex-direction: column;
  }

  /* Фильтры на мобильных — выезжающая слева панель поверх каталога,
     а не плашка, которая тащится за собой при прокрутке */
  .catalog-filters {
    position: fixed;
    top: 0;
    left: 0;
    width: min(80vw, 300px);
    height: 100%;
    background: var(--surface);
    border-right: 1px solid rgba(212, 175, 106, 0.18);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.3);
    padding: 20px 16px;
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    z-index: 60;
  }

  .catalog-filters.open {
    transform: translateX(0);
  }

  .filter-scroll {
    height: 100%;
    overflow-y: auto;
  }

  .filter-form {
    margin-top: 8px;
  }

  /* Еле заметная стрелочка на левом краю экрана — открывает панель */
  .filter-open-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 56px;
    padding: 0;
    background: var(--surface);
    color: var(--content-gold);
    border: 1px solid rgba(212, 175, 106, 0.65);
    border-left: none;
    border-radius: 0 8px 8px 0;
    opacity: 0.75;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    z-index: 55;
    transition: opacity 0.15s, width 0.15s;
  }

  .filter-open-tab:hover,
  .filter-open-tab:active {
    opacity: 1;
    width: 24px;
  }

  .filter-open-tab.is-hidden {
    display: none;
  }

  /* Стрелочка на правом краю самой панели — сворачивает её обратно */
  .filter-close-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    right: -19px;
    transform: translateY(-50%);
    width: 18px;
    height: 56px;
    padding: 0;
    background: var(--surface);
    color: var(--content-gold);
    border: 1px solid rgba(212, 175, 106, 0.25);
    border-left: none;
    border-radius: 0 8px 8px 0;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
  }

  .catalog-filters.open .filter-close-tab {
    opacity: 1;
    pointer-events: auto;
  }

  .filter-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 50;
  }

  .filter-backdrop.open {
    opacity: 1;
    pointer-events: auto;
  }
}

/* Центрируем конкретный заголовок */
.section-title-centered {
  text-align: center;
}

/* Отзывчивая таблица корзины на мобильных — превращаем строки в карточки */
@media (max-width: 600px) {
  .cart-table thead {
    display: none;
  }

  .cart-table, .cart-table tbody, .cart-table tr, .cart-table td {
    display: block;
    width: 100%;
  }

  .cart-table tr {
    margin-bottom: 16px;
    border: 1px solid rgba(212, 175, 106, 0.14);
    border-radius: 10px;
    padding: 4px 0;
    background: var(--surface);
  }

  .cart-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: right;
    padding: 8px 12px;
    border-bottom: 1px solid var(--divider);
  }

  .cart-table td:last-child {
    border-bottom: none;
  }

  .cart-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-secondary);
    text-align: left;
    margin-right: 8px;
  }

  .cart-table td[data-label=""]::before {
    content: none;
  }
}

/* Центрируем меню разделов и верхнюю строку контактов на мобильных */
@media (max-width: 700px) {
  .nav-inner {
    justify-content: center;
    text-align: center;
  }

  .top-bar-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
  }
}

/* Карточка товара как ссылка */
.product-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.product-card-actions {
  padding: 0 12px 12px;
}

/* Избранное в шапке — часть "хрома" */
.favorites-widget {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(212, 175, 106, 0.08);
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 12px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.05rem;
  transition: background-color 0.15s, color 0.15s;
}

.favorites-widget:hover {
  background: var(--gold);
  color: var(--navy-950);
}

/* Страница товара */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  background: var(--surface);
  border: 1px solid rgba(212, 175, 106, 0.14);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--card-shadow);
}

.product-detail-image {
  /* Без этого блок растягивался на всю высоту грид-ячейки (по высоте
     правой колонки с описанием) — раньше фона у самой обёртки не было,
     и лишнее место было просто незаметно; теперь с фоном/скруглением
     стало видно как пустой блок под картинкой */
  align-self: start;
  border-radius: 12px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(212, 175, 106, 0.1), transparent 65%),
    var(--surface-alt);
}

.product-detail-image img {
  width: 100%;
  object-fit: contain;
  background: transparent;
  cursor: zoom-in;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.product-detail-image:hover img {
  transform: scale(1.04);
}

.image-lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 24px;
  cursor: zoom-out;
  animation: image-lightbox-fade-in 0.15s ease;
}

.image-lightbox-overlay img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  cursor: default;
}

.image-lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.image-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.24);
}

@keyframes image-lightbox-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.product-detail-placeholder {
  height: 320px;
  border-radius: 8px;
}

.product-detail-brand {
  color: var(--content-gold);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin: 0 0 6px;
}

.product-detail-info h1 {
  font-family: 'Playfair Display', Georgia, serif;
  margin: 0 0 8px;
  color: var(--text-primary);
  font-size: 1.7rem;
}

.product-detail-model {
  color: var(--text-secondary);
  margin: 0 0 16px;
}

.product-detail-price {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--content-gold);
  margin: 0 0 16px;
}

.stock-badge-inline {
  position: static;
  display: inline-block;
  margin-bottom: 16px;
}

/* Без этого явный display: inline-block выше перебивает встроенное
   браузерное правило [hidden] { display: none } — элемент с атрибутом
   hidden всё равно оставался бы видимым (сама надпись "нет в наличии"
   не пряталась при переключении размера/цвета, даже когда JS корректно
   выставлял hidden = true) */
.stock-badge-inline[hidden] {
  display: none;
}

/* Выбор размера/цвета на странице товара — только у части ремешков/
   браслетов, у которых есть импортированный размерный ряд */
.product-variants {
  margin-bottom: 16px;
}

.product-variant-group {
  margin-bottom: 14px;
}

.product-variant-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.product-variant-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.product-variant-option {
  padding: 8px 16px;
  border: 1px solid rgba(212, 175, 106, 0.3);
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s, color 0.2s, transform 0.15s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.product-variant-option:hover {
  border-color: var(--content-gold);
  transform: translateY(-1px);
}

.product-variant-option:active {
  transform: scale(0.94);
  transition-duration: 0.08s;
}

.product-variant-option.active {
  background: var(--gold-gradient);
  border-color: transparent;
  color: var(--navy-950);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(150, 112, 42, 0.3);
}

.product-variant-option-oos {
  opacity: 0.5;
}

.product-variant-note {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 4px 0 0;
}

.product-detail-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.product-detail-actions .add-to-cart-form {
  margin-top: 0;
}

.product-detail-actions .add-to-cart-button {
  padding: 12px 24px;
  font-size: 1rem;
}

.favorite-button {
  padding: 12px 20px;
  background: rgba(212, 175, 106, 0.08);
  border: 1px solid var(--content-gold);
  color: var(--content-gold);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: background-color 0.2s, transform 0.15s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.favorite-button:not(.favorite-button-active):hover {
  background: rgba(212, 175, 106, 0.18);
  transform: translateY(-2px);
}

.favorite-button:active {
  transform: scale(0.95);
  transition-duration: 0.08s;
}

.favorite-button-active {
  background: var(--gold-gradient);
  color: var(--navy-950);
  border-color: transparent;
}

.favorite-button-active:hover {
  filter: brightness(1.08);
}

@keyframes heart-pop {
  0% { transform: scale(1); }
  35% { transform: scale(1.16); }
  60% { transform: scale(0.94); }
  100% { transform: scale(1); }
}

.favorite-button.heart-pop {
  animation: heart-pop 0.4s ease;
}

/* Карточка избранного при AJAX-удалении со страницы /favorites —
   плавно уходит перед тем, как пропасть из сетки (см. public/favorites.js) */
.product-card.is-removing {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

/* Строка корзины при AJAX-удалении (см. public/cart.js) — transform на
   <tr> ведёт себя непредсказуемо в разных браузерах, поэтому только opacity */
.cart-table tr.is-removing-row {
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.product-detail-stock {
  border-top: 1px solid var(--divider);
  padding-top: 16px;
  margin-bottom: 16px;
}

.product-detail-stock h3 {
  margin: 0 0 10px;
  color: var(--text-primary);
}

.stock-locations-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stock-location-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.stock-location-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.stock-location-available .stock-location-dot {
  background: var(--alert-success-text);
}

.stock-location-unavailable .stock-location-dot {
  background: var(--danger-text);
  opacity: 0.6;
}

.stock-location-unavailable {
  opacity: 0.6;
}

.stock-location-address {
  flex: 1;
}

.stock-location-status {
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.stock-location-available .stock-location-status {
  color: var(--alert-success-text);
}

.stock-location-unavailable .stock-location-status {
  color: var(--danger-text);
}

.product-detail-description {
  border-top: 1px solid var(--divider);
  padding-top: 16px;
}

.product-detail-description h3 {
  margin: 0 0 8px;
  color: var(--text-primary);
}

.product-detail-description p {
  color: var(--text-secondary);
  line-height: 1.6;
}

.product-detail-description-text {
  white-space: pre-line;
}

@media (max-width: 700px) {
  .product-detail {
    grid-template-columns: 1fr;
  }
}

.checkout-layout {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 24px;
}

.checkout-form {
  background: var(--surface);
  border: 1px solid rgba(212, 175, 106, 0.14);
  padding: 22px;
  border-radius: 14px;
  box-shadow: var(--card-shadow);
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(212, 175, 106, 0.2);
  border-radius: 6px;
  font-size: 0.95rem;
  background: var(--surface-alt);
  color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 106, 0.15);
}

.form-group input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.form-checkbox input {
  margin-top: 3px;
  flex-shrink: 0;
}

.form-checkbox a {
  color: var(--content-gold);
}

/* Текстовые юридические страницы — политика конфиденциальности, оферта.
   Ограничение по ширине и увеличенный line-height нужны только тут: это
   единственные страницы на сайте с длинным сплошным текстом */
.legal-page {
  max-width: 760px;
  margin: 0 auto;
}

.legal-updated {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: -8px;
  margin-bottom: 24px;
}

.legal-content h3 {
  margin-top: 28px;
  margin-bottom: 10px;
  font-size: 1.15rem;
}

.legal-content p,
.legal-content li {
  line-height: 1.6;
  color: var(--text-primary);
}

.legal-content ul,
.legal-content ol {
  padding-left: 22px;
  margin-bottom: 14px;
}

.legal-content a {
  color: var(--content-gold);
}

.payment-method-choice {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group .payment-method-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
  color: var(--text-primary);
  font-size: 0.95rem;
  margin-bottom: 0;
  cursor: pointer;
}

.payment-method-option input[type="radio"] {
  width: auto;
  padding: 0;
  border: none;
  background: none;
  accent-color: var(--gold);
}

.checkout-summary {
  background: var(--surface);
  border: 1px solid rgba(212, 175, 106, 0.14);
  padding: 22px;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  height: fit-content;
}

.checkout-summary-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--divider);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.checkout-summary-total {
  margin-top: 12px;
  font-weight: 700;
  font-size: 1.1rem;
  text-align: right;
  color: var(--content-gold);
}

@media (max-width: 700px) {
  .checkout-layout {
    grid-template-columns: 1fr;
  }
}

/* Вход / регистрация */
.auth-section {
  max-width: 420px;
  margin: 0 auto;
}

.auth-form {
  margin-top: 16px;
}

.auth-error {
  background: var(--alert-error-bg);
  color: var(--alert-error-text);
  border: 1px solid var(--alert-error-border);
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.9rem;
  margin-top: 12px;
}

.auth-success {
  background: var(--alert-success-bg);
  color: var(--alert-success-text);
  border: 1px solid var(--alert-success-border);
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.9rem;
  margin-top: 12px;
}

.auth-switch {
  text-align: center;
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.auth-switch a {
  color: var(--content-gold);
}

.auth-resend-form {
  text-align: center;
  margin-top: 12px;
}

.auth-link-button {
  background: none;
  border: none;
  padding: 0;
  color: var(--content-gold);
  font-size: 0.9rem;
  text-decoration: underline;
  cursor: pointer;
}

/* Личный кабинет */
.account-layout {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 24px;
  align-items: start;
  margin-top: 16px;
}

.account-profile h3,
.account-orders h3 {
  font-family: 'Playfair Display', Georgia, serif;
  margin: 24px 0 12px;
  color: var(--content-gold);
}

.account-profile h3:first-child {
  margin-top: 0;
}

.account-logout-form {
  margin-top: 24px;
}

.admin-panel-link {
  display: inline-block;
  margin: 8px 0 20px;
  padding: 9px 18px;
  border: 1px solid rgba(212, 175, 106, 0.4);
  border-radius: 8px;
  color: var(--content-gold);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: border-color 0.15s, background-color 0.15s;
}

.admin-panel-link:hover {
  border-color: var(--gold);
  background: rgba(212, 175, 106, 0.08);
}

.order-card {
  background: var(--surface);
  border: 1px solid rgba(212, 175, 106, 0.14);
  border-radius: 14px;
  box-shadow: var(--card-shadow);
  padding: 16px;
  margin-bottom: 16px;
}

.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
  gap: 8px;
  flex-wrap: wrap;
}

.order-status {
  background: var(--gold-gradient);
  color: var(--navy-950);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  white-space: nowrap;
}

.order-payment-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  white-space: nowrap;
}

.order-payment-badge-paid {
  background: var(--alert-success-bg);
  color: var(--alert-success-text);
  border: 1px solid var(--alert-success-border);
}

.order-payment-badge-pending {
  background: var(--gold-gradient);
  color: var(--navy-950);
}

.order-payment-badge-canceled {
  background: var(--alert-error-bg);
  color: var(--alert-error-text);
  border: 1px solid var(--alert-error-border);
}

.order-card-items {
  border-top: 1px solid var(--divider);
  padding-top: 10px;
}

.order-card-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding: 4px 0;
}

.order-card-total {
  text-align: right;
  font-weight: 700;
  color: var(--content-gold);
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--divider);
}

.order-card-prepayment {
  text-align: right;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

@media (max-width: 700px) {
  .account-layout {
    grid-template-columns: 1fr;
  }
}

/* Уважаем "уменьшить анимацию" в настройках ОС — выключаем декоративное
   движение полностью (плавную смену темы оставляем: это не "анимация" в
   смысле accessibility, а мгновенная и полезная обратная связь) */
/* Тост "товар добавлен в корзину" — всплывает после /cart/add (см.
   res.locals.cartFlash в server.js) и пульс на иконке корзины в шапке */
.toast-root {
  position: fixed;
  top: 268px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--alert-success-bg);
  border: 1px solid var(--alert-success-border);
  color: var(--alert-success-text);
  border-radius: 12px;
  box-shadow: var(--card-shadow-hover);
  padding: 14px 18px;
  min-width: 240px;
  max-width: 320px;
  opacity: 0;
  transform: translateX(24px) scale(0.96);
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(0) scale(1);
}

.toast.is-leaving {
  opacity: 0;
  transform: translateX(24px) scale(0.96);
}

.toast-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--gold-gradient);
  color: var(--navy-950);
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.toast-text {
  font-size: 0.92rem;
  line-height: 1.35;
}

@media (max-width: 600px) {
  .toast-root {
    top: auto;
    bottom: 20px;
    left: 16px;
    right: 16px;
  }

  .toast {
    max-width: none;
  }

  /* На карточке товара внизу уже сидит липкая панель покупки — поднимаем
     тост над ней, иначе они перекрываются (см. .sticky-buy-bar) */
  body.has-sticky-buy-bar .toast-root {
    bottom: 92px;
  }
}

@keyframes cart-pulse {
  0% { transform: scale(1); }
  35% { transform: scale(1.16); }
  60% { transform: scale(0.96); }
  100% { transform: scale(1); }
}

.cart-widget.pulse {
  animation: cart-pulse 0.5s ease;
}

/* Спиннер на кнопке отправки формы (см. public/loading-buttons.js) —
   текст прячется, вместо него крутится кольцо. Цвет кольца по умолчанию
   тёмный (подходит золотым/светлым кнопкам), для тёмных кнопок (remove-button)
   переопределяется отдельно */
button.is-submitting {
  color: transparent !important;
  pointer-events: none;
  position: relative;
}

button.is-submitting::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  border: 2px solid rgba(10, 18, 28, 0.22);
  border-top-color: rgba(10, 18, 28, 0.85);
  animation: btn-spin 0.7s linear infinite;
}

.remove-button.is-submitting::after {
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
}

@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

/* Липкая панель покупки на карточке товара — видна только на мобильных,
   чтобы не тянуться к кнопке в начале страницы после прокрутки описания */
.sticky-buy-bar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 900;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--divider);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.14);
}

.sticky-buy-bar-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.sticky-buy-bar-name {
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sticky-buy-bar-price {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--content-gold);
}

.sticky-buy-bar .add-to-cart-button {
  flex: none;
  padding: 12px 26px;
  font-size: 0.9rem;
}

@media (max-width: 600px) {
  .sticky-buy-bar {
    display: flex;
  }

  main.has-sticky-bar {
    padding-bottom: 84px;
  }

  /* Липкая панель фиксирована к низу экрана и лежит поверх всего —
     без этого отступа она наслаивалась на футер (копирайт, ссылки на
     политику/оферту) при прокрутке до самого конца страницы */
  body.has-sticky-buy-bar .site-footer {
    padding-bottom: 84px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.js-motion-ready .reveal {
    opacity: 1;
  }

  .reveal.is-visible,
  .hero-slide.active img,
  .product-card,
  .brand-tile,
  .cta-button,
  .add-to-cart-button,
  .filter-apply {
    animation: none !important;
    transition: none !important;
  }

  .ripple {
    display: none;
  }

  .toast {
    transition: none !important;
  }

  .cart-widget.pulse {
    animation: none !important;
  }

  .theme-icon {
    transition: none !important;
  }

  button.is-submitting::after {
    animation: none !important;
  }

  .cart-table tr.is-removing-row {
    transition: none !important;
  }

  .favorite-button.heart-pop {
    animation: none !important;
  }

  .product-card.is-removing {
    transition: none !important;
  }
}
