/* Маркетплейс кирпича — современная вёрстка */
:root {
  --bg-page: #f5f5f7;
  --bg-card: #ffffff;
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --accent: #c44536;
  --accent-hover: #a83a2e;
  --accent-light: rgba(196, 69, 54, 0.08);
  --border-color: #e5e5ea;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --navbar-height: 56px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --radius: 12px;
  --radius-sm: 8px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-primary);
  padding-bottom: 88px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.specs-mono, .price-value { font-family: var(--font-mono); font-size: 0.95em; }
.text-accent { color: var(--accent) !important; }

/* ——— Navbar ——— */
/* Нейтральный тёмный градиент + еле заметный кирпичный паттерн */
.navbar-main {
  position: sticky;
  top: 0;
  z-index: 1030;
  isolation: isolate;
  background-color: #1c1c1e;
  background-image:
    linear-gradient(160deg, #2a2a2c 0%, #1e1e20 45%, #18181a 100%),
    url("data:image/svg+xml,%3Csvg width='28' height='12' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h12v5H0zM14 0h12v5H14zM0 7h12v5H0zM7 7h12v5H7z' fill='%23fff' fill-opacity='0.04'/%3E%3C/svg%3E");
  background-size: 100% 100%, 28px 12px;
  box-shadow: var(--shadow-md);
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  transition: box-shadow 0.25s ease;
}
/* При скролле — стеклянный эффект через псевдоэлемент (размытие контента под навбаром) */
.navbar-main.navbar-scrolled {
  background: transparent;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}
.navbar-main.navbar-scrolled::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(160deg, rgba(42, 42, 44, 0.75) 0%, rgba(28, 28, 30, 0.78) 50%, rgba(22, 22, 24, 0.8) 100%);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.navbar-main .navbar-brand {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}
.navbar-main .nav-link {
  font-weight: 500;
  color: rgba(255,255,255,0.9) !important;
  padding: 0.4rem 0.75rem !important;
  border-radius: var(--radius-sm);
}
.navbar-main .nav-link:hover,
.navbar-main .nav-link:focus {
  color: #fff !important;
  background: rgba(255,255,255,0.1);
}
.navbar-main .nav-link.active {
  color: #fff !important;
  background: var(--accent);
}
.navbar-smeta-badge {
  background-color: var(--accent) !important;
  color: #fff;
  font-weight: 600;
  min-width: 1.5rem;
}
.navbar-smeta-cta .btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.navbar-toggler-light {
  border-color: rgba(255,255,255,0.3);
  color: #fff;
}
.navbar-toggler-light .navbar-toggler-icon {
  filter: invert(1);
}
.navbar-search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9) !important;
  border: none;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease, background 0.15s ease;
}
.navbar-search-trigger:hover,
.navbar-search-trigger:focus {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.1);
}

/* ——— Всплывающая строка поиска ——— */
.search-bar-floating {
  position: fixed;
  top: var(--navbar-height);
  left: 0;
  right: 0;
  z-index: 1040;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0.2s ease, opacity 0.2s ease;
}
.search-bar-floating.search-bar-visible {
  visibility: visible;
  opacity: 1;
}
.search-bar-floating-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
}
.search-bar-inner {
  position: relative;
  padding: 1rem;
}
.search-bar-floating .search-bar-inner {
  max-width: 100%;
}
.search-bar-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  padding: 0.25rem 0.5rem 0.25rem 1rem;
}
.search-bar-input {
  flex: 1;
  min-width: 0;
  border: none !important;
  box-shadow: none !important;
  padding: 0.6rem 0;
  font-size: 1rem;
}
.search-bar-input::-webkit-search-cancel-button {
  display: none;
}
.search-bar-input::-webkit-search-decoration {
  display: none;
}
.search-bar-input::-moz-search-cancel-button {
  display: none;
}
.search-bar-input:focus {
  outline: none;
}
.search-bar-close {
  color: var(--text-secondary) !important;
  text-decoration: none !important;
  min-width: 2.5rem;
  min-height: 2.5rem;
}
.search-bar-close:hover {
  color: var(--text-primary) !important;
}
@media (min-width: 992px) {
  .search-bar-floating .search-bar-inner {
    max-width: 33.33vw;
    margin-left: auto;
    padding-right: calc(var(--bs-gutter-x) * 0.5 + 1rem);
  }
}
@media (max-width: 991.98px) {
  .navbar-search-trigger.d-lg-none {
    min-height: 44px;
  }
}

/* ——— Hero ——— */
/* Нейтральный тёмный градиент + кирпичная сетка (красные линии, еле заметно) */
.hero-block {
  position: relative;
  color: #fff;
  background-color: #1a1a1e;
  
  /* 2. Профессиональный градиент с акцентным свечением */
  background-image: 
    /* Слой 3: Кирпичный паттерн (SVG) - самый верхний */
    url("data:image/svg+xml,%3Csvg width='60' height='30' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23c44536' stroke-width='0.3' opacity='0.3'%3E%3Crect x='1' y='1' width='28' height='13' rx='0.5'/%3E%3Crect x='31' y='1' width='28' height='13' rx='0.5'/%3E%3Crect x='16' y='16' width='28' height='13' rx='0.5'/%3E%3C/g%3E%3C/svg%3E"),
    
    /* Слой 2: Радиальное свечение акцентным цветом */
    radial-gradient(ellipse at 50% 30%, rgba(196, 69, 54, 0.15) 0%, rgba(196, 69, 54, 0.03) 40%, transparent 70%),
    
    /* Слой 1: Глубокий профессиональный градиент */
    linear-gradient(160deg, #1a1a1e 0%, #25252a 25%, #1e1a1c 55%, #151518 100%);
  
  /* Настройка размеров и позиционирования слоёв */
  background-size: 
    90px 45px,    /* Размер кирпичного паттерна */
    100% 100%,    /* Размер свечения */
    100% 100%;    /* Размер основного градиента */
  
  background-position: 
    0 0,          /* Паттерн с начала */
    center top,   /* Свечение по центру сверху */
    0 0;          /* Градиент с начала */
  
  background-repeat: 
    repeat,       /* Паттерн повторяется */
    no-repeat,    /* Свечение не повторяется */
    no-repeat;    /* Градиент не повторяется */
}
.hero-block .container-lg {
  position: relative;
  z-index: 1;
}
.hero-heading {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
  margin-bottom: 0.75rem;
}
.hero-lead {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.88);
  margin-bottom: 1.25rem;
}
.hero-bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem 0;
  color: rgba(255,255,255,0.9);
  font-size: 1rem;
}
.hero-bullets li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 0.35rem;
}
.hero-bullets li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 0.35rem;
  height: 0.35rem;
  background: var(--accent);
  border-radius: 50%;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}
.hero-cta .btn-accent {
  font-weight: 600;
}
.hero-cta-secondary {
  font-weight: 500;
  border-width: 1px;
}
.hero-cta-secondary:hover {
  color: #fff !important;
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.5);
}
.hero-trust {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.75);
  max-width: 42em;
  margin-bottom: 1rem;
  line-height: 1.5;
}
.hero-contact-line {
  color: rgba(255,255,255,0.7);
  margin-bottom: 0;
}

/* ——— Main / Sections ——— */
.main-content {
  flex: 1;
}

/* Стабилизация высоты списка каталога при смене фильтров / пагинации */
.catalog-products-column {
 /* min-height: min(70vh, 900px); */
}
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.catalog-price-note {
  background: var(--accent-light);
  border-left: 3px solid var(--accent);
  color: var(--text-secondary);
}

/* ——— Filters panel ——— */
.filters-sidebar .filters-sticky {
  position: sticky;
  top: calc(var(--navbar-height) + 1rem);
}
.filters-sidebar .card {
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  background: var(--bg-card);
}
.filters-sidebar .card-title {
  font-weight: 600;
  font-size: 0.95rem;
}
.filter-checkboxes .form-check {
  margin-bottom: 0.35rem;
}
.filter-checkboxes .form-check-input:checked {
  background-color: var(--accent);
  border-color: var(--accent);
}
.filter-checkboxes .form-check-label {
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--text-primary);
}
.filter-checkboxes .form-check-input:disabled + .form-check-label {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Раскрывающиеся блоки фильтров */
.filter-block {
  padding: 0;
}
.filter-toggle {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-primary) !important;
  text-decoration: none !important;
  padding: 0.6rem 0 !important;
  cursor: pointer;
  border: none;
  background: none;
  transition: color 0.15s ease;
}
.filter-toggle:hover {
  color: var(--accent) !important;
}
.filter-chevron {
  font-size: 0.75rem;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
  flex-shrink: 0;
  margin-left: 0.5rem;
}
.filter-toggle[aria-expanded="true"] .filter-chevron {
  transform: rotate(180deg);
}
.filter-block .collapse .filter-checkboxes {
  max-height: 200px;
  overflow-y: auto;
}
.filter-block .collapse .filter-checkboxes::-webkit-scrollbar {
  width: 6px;
}
.filter-block .collapse .filter-checkboxes::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}
.filter-block-active {
  background: var(--accent-light);
  border-left: 3px solid var(--accent);
  margin-left: -2px;
  padding-left: 2px;
}

/* ——— Product cards ——— */
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  margin-bottom: 0.75rem;
}
#productsList .product-card:nth-child(even) {
  background: rgba(0, 0, 0, 0.02);
}
.product-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-color);
  transform: translateY(-1px);
}
.product-card .card-body {
  padding: 1.15rem 1.25rem;
}
.product-card-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  min-height: 64px;
}
.product-card-top {
  flex: 1;
  min-width: 0;
}
.product-card-bottom {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}
.product-card-row .product-thumb {
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.product-thumb-desktop {
  width: 52px;
  height: 52px;
  min-width: 52px;
}
.product-thumb-mobile {
  display: none;
}
.product-badges {
  margin-bottom: 0.25rem;
}
.product-badge-popular {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
}
.product-badge-usage {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.2rem 0.5rem;
  background: var(--border-color);
  color: var(--text-secondary);
}
.product-card-row .product-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}
.product-card-row .product-specs {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}
.product-card-row .product-price-wrap {
  text-align: right;
}
.product-card-row .price-per-piece {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent);
  font-size: 1.02rem;
  font-size: 1.05rem;
  color: var(--text-primary);
}
.product-card-row .price-per-pallet {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}
.product-card-row .btn-add-smeta {
  flex-shrink: 0;
  padding: 0.45rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
}
.product-card-row .btn-add-smeta:focus {
  box-shadow: 0 0 0 3px var(--accent-light);
}

/* ——— Product card: мобильный (два блока) ——— */
@media (max-width: 767.98px) {
  .product-card .card-body {
    padding: 1rem;
  }
  .product-card-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    min-height: 0;
  }
  .product-card-top {
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.75rem;
  }
  .product-card-top .product-name {
    font-size: 0.95rem;
    line-height: 1.3;
  }
  .product-card-top .product-specs {
    font-size: 0.75rem;
    margin-top: 0.35rem;
  }
.product-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
  .product-thumb-desktop {
    display: none !important;
  }
  .product-thumb-mobile {
    display: flex !important;
    width: 44px;
    height: 44px;
    min-width: 44px;
    font-size: 1.25rem;
  }
  .product-card-bottom .product-thumb-mobile i {
    font-size: 1.25rem;
  }
  .product-card-bottom .product-price-wrap {
    flex: 1;
    text-align: left;
    min-width: 0;
  }
  .product-card-bottom .price-per-piece {
    font-size: 1rem;
  }
  .product-card-bottom .price-per-pallet {
    font-size: 0.7rem;
  }
  .product-card-bottom .btn-add-smeta {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    white-space: nowrap;
  }
}

/* ——— Buttons ——— */
.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 500;
  border-radius: var(--radius-sm);
}
.btn-accent:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}
#quoteAddMore.btn-outline-primary {
  border-color: var(--accent);
  color: var(--accent);
}
#quoteAddMore.btn-outline-primary:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

/* ——— Floating smeta bar ——— */
.smeta-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--text-primary);
  color: #fff;
  z-index: 1030;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
}
.smeta-bar .btn-outline-light:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border-color: rgba(255,255,255,0.5);
}

/* ——— How it works / Info cards ——— */
.info-card {
  border-radius: var(--radius);
  background: var(--bg-card);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.info-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}
.info-card-icon {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
}

/* ——— Contacts section ——— */
.contacts-section {
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
}
.contacts-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}
.contacts-section a {
  color: var(--text-primary);
}
.contacts-section a:hover {
  color: var(--accent);
}

/* ——— Footer ——— */
.footer-main {
  background: #1d1d1f;
  color: rgba(255,255,255,0.85);
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.footer-tagline {
  font-size: 0.95rem;
  font-weight: 500;
}
.footer-contact-line,
.footer-regions {
  color: rgba(255,255,255,0.65);
  font-size: 0.85rem;
}
.footer-copy {
  color: rgba(255,255,255,0.6);
}

/* ——— Modals ——— */
.modal-content {
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.modal-header, .modal-footer {
  background: var(--bg-card);
  border-color: var(--border-color);
  padding: 1rem 1.25rem;
}
.modal-body {
  padding: 1.25rem;
}
.quote-step { min-height: 140px; }
.quote-intro {
  font-size: 0.95rem;
  line-height: 1.5;
}
.quote-form-block {
  margin-top: 1.25rem;
}
.quote-form-block:first-child {
  margin-top: 0;
}
#quoteFormStep2 > .row .quote-form-block {
  margin-top: 0;
}
.quote-block-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border-color);
}
.quote-form-note {
  font-size: 0.85rem;
}
.quote-step3-positions {
  font-size: 0.95rem;
}
.quote-step3-line-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.quote-step3-line:last-child {
  border-bottom: none !important;
}
.quote-delivery-details {
  margin-top: 0.75rem;
}
.quote-progress .progress {
  background-color: var(--border-color);
  border-radius: 4px;
  height: 6px;
}
.progress-bar.bg-accent { background-color: var(--accent) !important; }

/* ——— Smeta line (wizard) ——— */
.smeta-line {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
}
.smeta-line:last-child { border-bottom: none; }
.smeta-line-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}
.smeta-line .unit-toggle .btn {
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
}

/* ——— Offcanvas (mobile) ——— */
.offcanvas-bottom {
  height: auto;
  max-height: 85vh;
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.12);
}

/* Фильтры на мобиле: панель выше, чтобы помещалось больше пунктов */
@media (max-width: 991.98px) {
  .offcanvas-filters.offcanvas-bottom {
    height: 75vh;
    max-height: 75vh;
  }
  .offcanvas-filters .offcanvas-body {
    overflow-y: auto;
  }
}

/* ——— Pagination ——— */
.pagination .page-link {
  border-radius: var(--radius-sm) !important;
  font-weight: 500;
}
.pagination .page-item.active .page-link {
  background-color: var(--accent);
  border-color: var(--accent);
}

/* ——— Form controls ——— */
.form-control, .form-select {
  border-radius: var(--radius-sm);
  border-color: var(--border-color);
}
.form-control:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

/* ——— Mobile ——— */
@media (max-width: 991.98px) {
  body { padding-bottom: 88px; }
  .product-card-row .btn-add-smeta,
  #navbarOrderBtn:not([disabled]) {
    min-height: 44px;
    padding: 0.5rem 0.75rem;
  }
  .navbar-smeta-cta .btn {
    min-height: 40px;
  }
  .hero-block .py-5 { padding-top: 2rem !important; padding-bottom: 2rem !important; }
}
