/**
 * «Берегиня Алтая» — единая дизайн-система
 * Принцип: один бренд — одна палитра. Бирюза (природа, вода, доверие) + мёд (традиция, тепло).
 * Нейтрали только тёплые (крем, пергамент), без холодного серого. Тени с тёплым подтоном.
 */

/* ========== 1. VARIABLES ========== */
:root {
  /* Основной бренд: спокойная бирюза «алтайская вода / травы» — кнопки, ссылки, фокус */
  --color-primary:         #1a7f8c;
  --color-primary-hover:     #156a75;
  --color-primary-dark:      #0d4a52;
  --color-primary-2:         #3aa4b3;
  --color-primary-2-light:   #e5f4f6;

  /* Акцент заказчика: мёд / янтарь — подзаголовки, hero, вторичные CTA, декор */
  --color-accent:            #c9a227;
  --color-accent-hover:      #a6841c;
  --color-accent-light:      #fdf6e8;
  --color-accent-ink:        #6b5610;

  /* Фоны: крем и пергамент, визуально одна семья */
  --color-bg:                #faf8f3;
  --color-bg-warm:           #f2ebe0;
  --color-bg-section:        #e8dfd2;
  --color-surface:           #ffffff;

  /* Текст: тёплый «чернильный», не чистый #000 */
  --color-text:              #2a2319;
  --color-text-muted:        #6d6558;
  --color-text-light:        #9a9286;

  /* Границы */
  --color-border:            #ddd2c4;
  --color-border-light:      #e9e2d8;
  --color-border-focus:      var(--color-primary);

  /* Статусы: приглушённые, но различимые */
  --color-success:           #1d6e4f;
  --color-success-bg:        #dff3e9;
  --color-danger:            #b42318;
  --color-danger-bg:         #fdeceb;
  --color-warning:           #9a5f0a;
  --color-warning-bg:        #fff4e0;
  --color-info:              var(--color-primary);

  /* Футер: тот же холодный подтон, что и primary-dark (не «левый» синий) */
  --color-footer-bg:         #153a40;
  --color-footer-accent:     rgba(255, 255, 255, 0.09);
  /* Смещение иконки телефона: глиф выглядит ниже оптического центра с двумя строками. */
  --footer-phone-icon-y:     -0.3125rem; /* 5px при 16px root */

  /* Hero: только жёлто-песочная растяжка (Golden Sand + «мел» Oasis Sand, без бирюзы в фоне) */
  --color-hero-sand-deep:    #b8860c;
  --color-hero-sand-rich:    #e7b744;
  --color-hero-sand-honey:   #f1b85e;
  --color-hero-sand-soft:    #f1d581;
  --color-hero-sand-chalk:   #fcedc5;

  /* RGB для фокуса и Bootstrap (без «вшитых» rgba в десятках мест) */
  --color-primary-rgb:       26, 127, 140;
  --color-shadow-rgb:        42, 36, 28;

  /* Тени: тёплый серо-коричневый, не холодный сине-серый */
  --shadow-xs:   0 1px 2px rgba(var(--color-shadow-rgb), 0.06);
  --shadow-sm:   0 1px 5px rgba(var(--color-shadow-rgb), 0.08);
  --shadow-md:   0 4px 18px rgba(var(--color-shadow-rgb), 0.11);
  --shadow-lg:   0 10px 30px rgba(var(--color-shadow-rgb), 0.14);
  --shadow-soft: 0 2px 14px rgba(var(--color-shadow-rgb), 0.08);

  /* Radii */
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-pill: 100px;

  /* Spacing */
  --space-section: 5.5rem;
  --space-card:    1.5rem;

  /* Typography */
  --font-sans:    "Inter", "Manrope", system-ui, sans-serif;
  --font-heading: "Playfair Display", Georgia, serif;

  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  2rem;
  --text-4xl:  2.625rem;

  /* Motion */
  --transition-fast: 140ms ease;
  --transition-base: 220ms ease;
  --transition-slow: 350ms ease;
}

/* Bootstrap bridge */
[data-bs-theme="light"] {
  --bs-primary:           var(--color-primary);
  /* Совпадает с --color-primary-rgb (Bootstrap ожидает три числа через запятую) */
  --bs-primary-rgb:       26, 127, 140;
  --bs-body-bg:           var(--color-bg);
  --bs-body-color:        var(--color-text);
  --bs-border-color:      var(--color-border);
  --bs-link-color:        var(--color-primary);
  --bs-link-hover-color:  var(--color-primary-hover);
}

/* ========== 2. BASE ========== */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  font-size: var(--text-base);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.22;
}

h1, .h1 { font-size: clamp(1.9rem, 4vw, var(--text-4xl)); letter-spacing: -0.02em; }
h2, .h2 { font-size: clamp(1.45rem, 3vw, var(--text-3xl)); letter-spacing: -0.01em; }
h3, .h3 { font-size: var(--text-xl); }

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--color-primary-hover); }
a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: 2px;
}

.text-muted    { color: var(--color-text-muted) !important; }
.text-primary  { color: var(--color-primary)    !important; }
.text-accent   { color: var(--color-accent)     !important; }

/* ========== 3. BUTTONS ========== */
.btn {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: var(--text-sm);
  border-radius: var(--radius-md);
  letter-spacing: 0.01em;
  transition:
    background-color var(--transition-base),
    border-color     var(--transition-base),
    box-shadow       var(--transition-base),
    transform        var(--transition-base);
}
.btn:hover  { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-lg { padding: 0.72rem 1.6rem; font-size: var(--text-base); }
.btn-sm { padding: 0.3rem 0.85rem; font-size: var(--text-xs); }

/* Primary */
.btn-primary {
  background-color: var(--color-primary);
  border-color:     var(--color-primary);
  color: #fff;
}
.btn-primary:hover {
  background-color: var(--color-primary-hover);
  border-color:     var(--color-primary-hover);
  color: #fff;
  box-shadow: var(--shadow-md);
}
.btn-primary:focus-visible {
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.32);
}

/* Outline primary */
.btn-outline-primary {
  border-color: var(--color-primary);
  color:        var(--color-primary);
  background:   transparent;
}
.btn-outline-primary:hover {
  background-color: var(--color-primary-2-light);
  border-color:     var(--color-primary);
  color:            var(--color-primary-hover);
  box-shadow: none;
}

/* Accent */
.btn-accent {
  background-color: var(--color-accent);
  border-color:     var(--color-accent);
  color: #fff;
}
.btn-accent:hover {
  background-color: var(--color-accent-hover);
  border-color:     var(--color-accent-hover);
  color: #fff;
  box-shadow: var(--shadow-md);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  padding: 0.4rem 0.7rem;
}
.btn-ghost:hover {
  color: var(--color-text);
  background: var(--color-bg-warm);
  transform: none;
}

/* ========== 4. CARDS ========== */
.card {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  background: var(--color-surface);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
  overflow: hidden;
}
.card:hover { box-shadow: var(--shadow-md); }
.card.border-0 { border: none !important; box-shadow: var(--shadow-soft); }
.card-body { padding: var(--space-card); }

/* ── Product card (Pinterest style) ── */
.product-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-surface);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  cursor: pointer;
}
.product-card .card-actions {
  cursor: default;
}
.product-card .card-actions a,
.product-card .card-actions .btn,
.product-card .card-actions form {
  cursor: pointer;
}
.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}
.product-card .product-img-wrap {
  position: relative;
  overflow: hidden;
  background: var(--color-bg-warm);
}
.product-card .card-img-top {
  width: 100%;
  height: 260px;
  object-fit: cover;
  transition: transform 0.45s ease;
  display: block;
}
.product-card:hover .card-img-top { transform: scale(1.04); }

.product-card .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.1rem 1.2rem 1.2rem;
  gap: 0;
  min-height: 0;
}
/* Верхний блок: одинаковая «высота этажей» в сетке (категория, заголовок, описание). */
.product-card__align {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 0 1 auto;
  min-height: 0;
}
.product-card__category-line {
  flex-shrink: 0;
  min-height: 1.05rem;
  line-height: 1.35;
}
.product-card .product-category {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-primary);
}
.product-card .card-title {
  font-family: var(--font-sans);
  font-size: 0.93rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  min-height: 2.604rem;
  overflow-wrap: break-word;
}
.product-card .card-desc-wrap {
  flex: 0 0 auto;
  min-height: 3.6rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.product-card .card-desc {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}
.product-card .card-desc--empty {
  visibility: hidden;
}
.product-card .card-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: auto;
}
.product-card .price {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.01em;
}
.product-card .stock-badge {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--color-success);
  background: var(--color-success-bg);
  border-radius: var(--radius-pill);
  padding: 0.2em 0.65em;
  white-space: nowrap;
}
.product-card .card-actions {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.75rem;
  flex-shrink: 0;
}
.product-card .card-actions .btn {
  flex: 1;
  font-size: 0.78rem;
  padding: 0.42rem 0.6rem;
  border-radius: var(--radius-md);
}

/* Степпер количества: корзина, карточка товара */
.qty-stepper {
  display: inline-flex;
  align-items: stretch;
  vertical-align: middle;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface);
}
.qty-stepper__value {
  min-width: 2.5rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-sans);
  color: var(--color-text);
  padding: 0 0.35rem;
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
}
.qty-stepper__btn {
  min-width: 2.4rem;
  padding: 0.35rem 0.5rem;
  line-height: 1;
  font-size: 1.1rem;
  font-weight: 500;
  border: none;
  background: var(--color-bg-warm);
  color: var(--color-text);
  transition: background var(--transition-fast), color var(--transition-fast);
}
.qty-stepper__btn:hover:not(:disabled) {
  background: var(--color-border-light);
  color: var(--color-text);
}
.qty-stepper__btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  z-index: 1;
}
.qty-stepper__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.qty-stepper--product {
  box-shadow: var(--shadow-xs);
}
.qty-stepper--product .qty-stepper__btn {
  min-width: 2.6rem;
  padding: 0.48rem 0.7rem;
}
#js-cart-tbody[aria-busy="true"] {
  opacity: 0.65;
  pointer-events: none;
}

/* ========== 5. FORMS ========== */
.form-control,
.form-select {
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  padding: 0.55rem 0.85rem;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-text);
  background: var(--color-surface);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.form-control:hover,
.form-select:hover  { border-color: var(--color-primary-2); }
.form-control:focus,
.form-select:focus  {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.16);
  background: var(--color-surface);
}
.form-control::placeholder { color: var(--color-text-light); }

.form-label {
  font-weight: 500;
  font-size: var(--text-sm);
  color: var(--color-text);
  margin-bottom: 0.38rem;
}

.form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.2);
}
.form-check-input:checked {
  background-color: var(--color-primary);
  border-color:     var(--color-primary);
}

/* ========== 6. BADGES ========== */
.badge {
  font-weight: 500;
  padding: 0.3em 0.65em;
  border-radius: var(--radius-sm);
  font-size: 0.7em;
}
.badge-teal {
  background: var(--color-primary-2-light);
  color: var(--color-primary-dark);
}
.badge-gold {
  background: var(--color-accent-light);
  color: var(--color-accent-hover);
}
.bg-success-subtle { background-color: var(--color-success-bg) !important; }
.text-success      { color: var(--color-success)               !important; }

/* ========== 7. NAVBAR ========== */
.navbar-theme {
  background: rgba(246, 245, 242, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-border);
  padding: 0.6rem 0;
  transition:
    background   var(--transition-slow),
    box-shadow   var(--transition-slow);
}
.navbar-theme.scrolled {
  background: rgba(246, 245, 242, 0.99);
  box-shadow: var(--shadow-sm);
}

.navbar-theme .navbar-brand {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-primary) !important;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.navbar-brand-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-accent);
  flex-shrink: 0;
  margin-bottom: -1px;
}
.navbar-logo-img {
  height: 36px;
  width: auto;
  flex-shrink: 0;
  object-fit: contain;
}
.navbar-brand-text {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-primary);
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.navbar-theme .nav-link {
  color: var(--color-text) !important;
  font-size: var(--text-sm);
  font-weight: 500;
  padding: 0.42rem 0.8rem !important;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background var(--transition-fast);
}
.navbar-theme .nav-link:hover {
  color: var(--color-primary) !important;
  background: var(--color-primary-2-light);
}
.navbar-theme .navbar-toggler {
  border-color: var(--color-border);
  border-radius: var(--radius-sm);
}
.navbar-theme .navbar-toggler:focus {
  box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), 0.28);
}
.navbar-theme .btn-outline-primary { border-width: 1.5px; }

/* ========== 8. FOOTER ========== */
.footer-theme {
  background: var(--color-footer-bg);
  color: rgba(255, 255, 255, 0.82);
  padding: 3.5rem 0 0;
  margin-top: var(--space-section);
}
/* Центрирует группу колонок в подвале; текст в колонках остаётся с обычным (левым) выравниванием. */
.footer-theme .footer-theme-inner {
  max-width: 58rem;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}
.footer-theme .footer-brand-name {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  display: block;
  margin-bottom: 0.5rem;
}
.footer-theme .footer-tagline {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.82rem;
  line-height: 1.6;
  max-width: 240px;
}
.footer-theme .footer-col-label {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 1rem;
  display: block;
}
.footer-theme .footer-accent-bar {
  width: 28px;
  height: 2px;
  background: var(--color-accent);
  border-radius: 2px;
  margin-bottom: 1.1rem;
}
/* Do not use brightness(0) invert(1) here: logo.png has a white matte; that filter flattens the whole bitmap to solid white */
.footer-theme .footer-logo-img {
  height: 44px;
  width: auto;
  max-width: min(100%, 260px);
  object-fit: contain;
  object-position: left center;
  flex-shrink: 0;
}
.footer-theme a {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.85rem;
  display: block;
  margin-bottom: 0.5rem;
  transition: color var(--transition-fast);
}
.footer-theme a:hover { color: #fff; }
.footer-theme p {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
  line-height: 1.55;
}
.footer-theme .footer-phone-icon {
  flex-shrink: 0;
  line-height: 1;
  display: block;
  transform: translateY(var(--footer-phone-icon-y));
}
.footer-theme .footer-bottom {
  border-top: 1px solid var(--color-footer-accent);
  margin-top: 2.5rem;
  padding: 1.1rem 0;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.38);
  text-align: center;
}

/* ========== 9. TABLES ========== */
.table-theme {
  --bs-table-bg: var(--color-surface);
  --bs-table-border-color: var(--color-border);
}
.table-theme thead th {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.72rem;
  color: var(--color-text-muted);
  border-bottom-width: 1px;
  padding: 0.75rem 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.table-theme tbody td {
  padding: 0.9rem 1rem;
  vertical-align: middle;
  font-size: var(--text-sm);
}
.table-theme tbody tr:hover { background: var(--color-bg); }

/* ========== 10. PAGINATION ========== */
.pagination .page-link {
  border-radius: var(--radius-sm) !important;
  border-color: var(--color-border);
  color: var(--color-primary);
  padding: 0.45rem 0.9rem;
  font-size: var(--text-sm);
  transition: background var(--transition-fast), color var(--transition-fast);
}
.pagination .page-link:hover {
  background: var(--color-primary-2-light);
  border-color: var(--color-border);
  color: var(--color-primary-hover);
}
.pagination .page-item.active .page-link {
  background-color: var(--color-primary);
  border-color:     var(--color-primary);
}

/* ========== 11. ALERTS ========== */
.alert {
  border: none;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  font-size: var(--text-sm);
}
.alert-success { background: var(--color-success-bg); color: var(--color-success); }
.alert-danger  { background: var(--color-danger-bg);  color: var(--color-danger);  }
.alert-warning { background: var(--color-warning-bg);   color: var(--color-warning); }
.alert-info    { background: var(--color-primary-2-light); color: var(--color-primary-dark); }

/* ========== 12. LIST GROUP ========== */
.list-group-item {
  border-color: var(--color-border);
  padding: 0.75rem 1rem;
  font-size: var(--text-sm);
}
.list-group-item:first-child {
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

/* ========== 13. UTILITIES ========== */
.bg-soft-primary  { background-color: var(--color-primary-2-light) !important; }
.bg-soft-accent   { background-color: var(--color-accent-light)     !important; }
.bg-warm          { background-color: var(--color-bg-warm)          !important; }
.bg-section       { background-color: var(--color-bg-section)       !important; }

.shadow-soft      { box-shadow: var(--shadow-soft)  !important; }
.rounded-theme    { border-radius: var(--radius-lg) !important; }
.rounded-theme-sm { border-radius: var(--radius-md) !important; }
.rounded-pill-custom { border-radius: var(--radius-pill) !important; }

.section-label {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent-ink);
  display: block;
  margin-bottom: 0.6rem;
}
.section-heading {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3vw, var(--text-3xl));
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--color-text);
  line-height: 1.2;
}
.section-subheading {
  color: var(--color-text-muted);
  font-size: var(--text-lg);
  margin-bottom: 2.5rem;
  max-width: 520px;
  line-height: 1.6;
}
.content-prose p {
  margin-bottom: 1rem;
}
.content-prose p:last-child {
  margin-bottom: 0;
}

/* ========== 14. HERO ========== */
.hero-theme {
  /* Растяжка только по оттенкам жёлтого → меловой песок (#FCEDC5) */
  background: linear-gradient(
    118deg,
    var(--color-hero-sand-deep) 0%,
    var(--color-hero-sand-rich) 22%,
    var(--color-hero-sand-honey) 45%,
    var(--color-hero-sand-soft) 70%,
    var(--color-hero-sand-chalk) 100%
  );
  color: #fff;
  padding: 5.5rem 0 6rem;
  position: relative;
  overflow: hidden;
}
.hero-theme::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 62% 75% at 10% 15%, rgba(255, 232, 160, 0.42) 0%, transparent 55%),
    radial-gradient(ellipse 46% 55% at 28% 88%, rgba(241, 184, 94, 0.22) 0%, transparent 58%),
    radial-gradient(ellipse 54% 70% at 90% 75%, rgba(252, 237, 197, 0.5) 0%, transparent 58%),
    radial-gradient(ellipse 48% 60% at 85% 22%, rgba(231, 183, 68, 0.28) 0%, transparent 62%);
  pointer-events: none;
}
.hero-theme::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='50' cy='50' r='1.2' fill='%23ffffff' fill-opacity='0.05'/%3E%3C/svg%3E");
  pointer-events: none;
  opacity: 0.6;
}
.hero-content { position: relative; z-index: 1; }
.hero-eyebrow {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 10px rgba(90, 55, 8, 0.28);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.1rem;
}
.hero-eyebrow::before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 3px;
  background: linear-gradient(90deg, var(--color-accent-light), var(--color-accent));
  border-radius: 2px;
  box-shadow: 0 0 14px rgba(201, 162, 39, 0.45);
}
.hero-theme h1 {
  font-family: var(--font-heading);
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.13;
  letter-spacing: -0.02em;
  margin-bottom: 1.35rem;
  text-shadow: 0 1px 18px rgba(90, 55, 8, 0.38);
}
.hero-theme .hero-lead {
  font-size: 1.05rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.9);
  max-width: 430px;
  margin-bottom: 2.2rem;
  text-shadow: 0 1px 12px rgba(90, 55, 8, 0.28);
}
.hero-cta-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
}
.btn-hero-primary {
  background: linear-gradient(
    180deg,
    var(--color-accent-light) 0%,
    #ffe8a8 45%,
    #f0cf6a 100%
  );
  color: var(--color-accent-ink) !important;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: 0.78rem 1.8rem;
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-family: var(--font-sans);
  box-shadow: 0 6px 22px rgba(201, 162, 39, 0.38);
  transition: transform var(--transition-base), box-shadow var(--transition-base), color var(--transition-base), filter var(--transition-base);
  text-decoration: none;
  display: inline-block;
}
.btn-hero-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(201, 162, 39, 0.48);
  color: #3d2f08 !important;
  filter: saturate(1.06);
}
.btn-hero-outline {
  background: transparent;
  color: rgba(255, 255, 255, 0.88) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.38);
  padding: 0.78rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-family: var(--font-sans);
  font-weight: 500;
  transition: all var(--transition-base);
  text-decoration: none;
  display: inline-block;
}
.btn-hero-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.7);
  color: #fff !important;
}
.hero-img-col { position: relative; z-index: 1; }
.hero-img {
  border-radius: var(--radius-xl);
  box-shadow:
    0 24px 60px rgba(var(--color-shadow-rgb), 0.22),
    0 0 0 1px rgba(255, 220, 160, 0.4),
    0 0 40px rgba(201, 162, 39, 0.25);
  width: 100%;
  max-height: 360px;
  object-fit: cover;
}
.hero-floating-badge {
  position: absolute;
  bottom: 1.25rem;
  left: -0.5rem;
  background: linear-gradient(135deg, rgba(255, 252, 245, 0.99) 0%, rgba(255, 248, 230, 0.98) 100%);
  border-radius: var(--radius-md);
  padding: 0.7rem 1rem;
  border: 1px solid rgba(201, 162, 39, 0.4);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  color: var(--color-text);
  font-weight: 500;
  backdrop-filter: blur(8px);
}
.hero-floating-badge .hfb-icon { font-size: 1.5rem; }
.hero-floating-badge .hfb-label {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  display: block;
  font-weight: 400;
}

/* ========== 15. FEATURE STRIP ========== */
/* Flex вместо grid+fr: при height:auto у контейнера fr-строки дают нестабильную высоту и «ломают» блок в части браузеров */
.feature-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 0;
  min-height: 280px;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-light);
  overflow: hidden;
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}
.feature-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
/* Явная высота зоны: иначе при flex + min-height:0 у карточки медиа-блок даёт 0px и overflow:hidden на .feature-card полностью скрывает картинку */
.feature-card-media {
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 3 / 2;
  min-height: 120px;
  position: relative;
  background: var(--color-bg-warm);
  overflow: hidden;
}
.feature-card-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.feature-card-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 1rem 1.05rem 1.15rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.feature-icon-wrap {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  background: var(--color-primary-2-light);
  color: var(--color-primary);
  font-size: 1.45rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.1rem;
}
.feature-card .feature-card-body h6 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--color-text);
  margin-bottom: 0.35rem;
}
.feature-card .feature-card-body p {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.55;
}

/* Вариант карточки: иконка + текст (контакты, не пропорции media/body) */
.feature-card.feature-card--stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 0;
  padding: 1.35rem 1.25rem;
  text-align: left;
}
.feature-card.feature-card--stat .feature-icon-wrap {
  margin: 0 0 1rem 0;
  width: 50px;
  height: 50px;
  font-size: 1.35rem;
}
.feature-card.feature-card--stat h6 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text);
  margin-bottom: 0.45rem;
}
.feature-card.feature-card--stat p,
.feature-card.feature-card--stat a {
  font-size: var(--text-sm);
  line-height: 1.55;
}
.feature-card.feature-card--stat a[href^="tel:"] {
  word-break: break-all;
}

/* Блок преимуществ: одна колонка на xs, аккуратные отступы */
.feature-strip .row {
  --bs-gutter-y: 1rem;
}
@media (min-width: 576px) {
  .feature-strip .row {
    --bs-gutter-y: 1.25rem;
  }
}

/* Телефон: преимущества сетка 2×2, компактные карточки */
@media (max-width: 767.98px) {
  .feature-strip .feature-card:not(.feature-card--stat) {
    min-height: 0;
  }
  .feature-strip .feature-card-media {
    aspect-ratio: 1 / 1;
    min-height: 0;
  }
  .feature-strip .feature-card-body {
    padding: 0.55rem 0.5rem 0.6rem;
  }
  .feature-strip .feature-card .feature-card-body h6 {
    font-size: 0.78rem;
    margin-bottom: 0.2rem;
  }
  .feature-strip .feature-card .feature-card-body p {
    font-size: 0.7rem;
    line-height: 1.42;
  }
}

/* Пустые состояния каталога и корзины */
.catalog-empty-state {
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
  border: 1px dashed var(--color-border);
  background: var(--color-surface);
}
.empty-state-card {
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
}
.empty-state-card .feature-icon-wrap {
  margin-left: auto;
  margin-right: auto;
}

/* Всплывающие сообщения: воздух до контента */
.flash-stack {
  padding-top: 0.35rem;
}

/* Секция страницы после hero */
.page-content-section {
  padding-bottom: 3rem;
}
.layout-narrow {
  max-width: 52rem;
}
@media (max-width: 767.98px) {
  .page-content-section {
    padding-bottom: 2.25rem;
  }
}

/* Corporate orders: intro + gallery */
.corporate-intro {
  max-width: 42rem;
  line-height: 1.75;
  font-size: var(--text-base);
}
.corporate-gallery-item {
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--color-bg-warm);
}
.corporate-gallery-item img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ========== 16. CATALOG TOOLBAR ========== */
.catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1.1rem;
  margin-bottom: 1.75rem;
}
.catalog-toolbar .form-control,
.catalog-toolbar .form-select {
  background: var(--color-bg);
}
.catalog-toolbar__search {
  min-width: 160px;
}
.catalog-toolbar__category {
  min-width: 180px;
  max-width: 240px;
}
@media (max-width: 767.98px) {
  .catalog-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .catalog-toolbar .btn {
    width: 100%;
  }
  .catalog-toolbar__search,
  .catalog-toolbar__category {
    min-width: 0;
    width: 100%;
    max-width: none;
  }
}

/* Форма «в корзину» на карточке товара */
.product-detail-cart {
  flex-direction: column;
  align-items: stretch;
}
@media (min-width: 576px) {
  .product-detail-cart {
    flex-direction: row;
    align-items: center;
  }
}
.product-detail-cart__submit {
  width: 100%;
}
@media (min-width: 576px) {
  .product-detail-cart__submit {
    width: auto;
    flex: 1;
    max-width: 20rem;
  }
}

/* Category pills */
.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.75rem;
}
@media (max-width: 575.98px) {
  .category-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.35rem;
    margin-left: -0.25rem;
    margin-right: -0.25rem;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
    scrollbar-width: thin;
  }
  .category-pills::-webkit-scrollbar {
    height: 4px;
  }
}
.category-pill {
  padding: 0.32rem 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}
.category-pill:hover,
.category-pill.active {
  border-color: var(--color-primary);
  background: var(--color-primary-2-light);
  color: var(--color-primary);
}

/* ========== 17. PRODUCT GRID ========== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}
@media (max-width: 1199.98px) {
  .products-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 767.98px) {
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 0.85rem; }
}
@media (max-width: 479.98px) {
  .products-grid { grid-template-columns: 1fr; }
}

/* ========== 18. PAGE CONTAINER ========== */
.main-container {
  min-height: calc(100vh - 200px);
  padding-top: 4.75rem;
  padding-bottom: 2.5rem;
}

/* ========== 19. STICKY SUMMARY ========== */
.summary-sticky {
  position: sticky;
  top: 5.25rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
@media (max-width: 991.98px) {
  /* Иначе блок «Итого» перекрывает контент при прокрутке на планшете/телефоне */
  .summary-sticky {
    position: static;
    top: auto;
  }
}

/* ========== 20. PRODUCT GALLERY ========== */
.product-gallery {
  background: var(--color-bg-warm);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.product-gallery-img {
  height: 440px;
  object-fit: cover;
  width: 100%;
}
@media (max-width: 991.98px) {
  .product-gallery-img { height: 300px; }
}
@media (max-width: 575.98px) {
  .product-gallery-img {
    height: min(52vw, 240px);
    min-height: 200px;
  }
}
.carousel-control-prev-icon,
.carousel-control-next-icon { filter: invert(1); }

/* Thumbnail strip */
.product-thumb-strip {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  overflow-x: auto;
  background: var(--color-bg-warm);
}
.product-thumb-strip img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color var(--transition-fast);
}
.product-thumb-strip img.active,
.product-thumb-strip img:hover {
  border-color: var(--color-primary);
}

/* ========== 21. PAGE HEADER BAND ========== */
.page-hero {
  background: linear-gradient(180deg, var(--color-bg-warm) 0%, var(--color-bg) 100%);
  border-bottom: 1px solid var(--color-border);
  padding: 3rem 0 2.75rem;
  margin-bottom: 3rem;
}
.page-hero .page-hero-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent-ink);
  margin-bottom: 0.5rem;
}
.page-hero h1 {
  font-size: clamp(1.65rem, 3.5vw, 2.4rem);
  margin-bottom: 0.5rem;
}
.page-hero p {
  color: var(--color-text-muted);
  font-size: var(--text-lg);
  margin: 0;
}

/* ========== 22. AUTH CARD ========== */
.auth-wrap {
  max-width: 460px;
  margin: 0 auto;
}
.auth-logo-badge {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  background: var(--color-primary-2-light);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  flex-shrink: 0;
}
.auth-logo-badge__img {
  display: block;
  width: 32px;
  height: 32px;
  object-fit: contain;
  object-position: center;
}
.auth-logo-badge .bi {
  /* запас, если снова поставим иконку: шрифт иконок должен рисовать ::before */
  line-height: 1;
  display: block;
  font-size: 1.35rem;
}

/* ========== 23. CART ITEM ========== */
.cart-item-img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  background: var(--color-bg-warm);
}

/* ========== 24. QUANTITY CONTROL ========== */
.qty-control {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.1rem 0.3rem;
  background: var(--color-surface);
}
.qty-control button {
  border: none;
  background: none;
  color: var(--color-text-muted);
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background var(--transition-fast), color var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}
.qty-control button:hover {
  background: var(--color-bg);
  color: var(--color-text);
}
.qty-control input {
  width: 2.8rem;
  text-align: center;
  border: none;
  background: none;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}

/* Back link on product page */
.product-back-link {
  transition: color var(--transition-fast);
}
.product-back-link:hover {
  color: var(--color-primary) !important;
}

/* ========== 25. SCROLLBAR ========== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: var(--color-text-light); }

/* ========== 26. RESPONSIVE ========== */
@media (max-width: 767.98px) {
  :root { --space-section: 4rem; }
  .main-container { padding-top: 4.25rem; }
  .hero-theme { padding: 3.75rem 0 4.25rem; }
  .hero-theme h1 { font-size: 2rem; }
  .hero-theme .hero-lead { font-size: 0.95rem; }
  .section-heading { font-size: var(--text-2xl); }
  .product-card .card-img-top { height: 210px; }
  .auth-wrap .card-body { padding: 1.75rem; }
  .page-hero { padding: 2rem 0 1.75rem; margin-bottom: 2rem; }
  .page-hero p { font-size: var(--text-base); }
  .hero-floating-badge {
    left: 0.25rem;
    max-width: calc(100% - 0.5rem);
  }
  /* Кнопки в карточках каталога: удобнее нажатие одним пальцем */
  .product-card .card-actions .btn {
    min-height: 2.75rem;
  }
  .product-card .card-actions {
    flex-direction: column;
  }
  .product-card .card-actions .btn:first-child {
    width: 100%;
  }
  .feature-card:not(.feature-card--stat) {
    min-height: 0;
  }
}
