/* ==========================================================================
   ЦВЕТОВАЯ ПАЛИТРА И ПЕРЕМЕННЫЕ ИЗ ДИЗАЙН-СИСТЕМЫ
   ========================================================================== */
:root {
  /* Primary & Accents */
  --primary-red: #E52727;
  --hover-red: #BC2042;
  --active-red: #A01A2E;
  --electric-blue: #3858E9;
  
  /* Neutral Scale */
  --charcoal-black: #000000;
  --dark-gray: #282828;
  --medium-gray: #444444;
  --body-gray: #626262;
  --lighter-gray: #333333;
  
  /* Surfaces & Borders */
  --white-primary: #FFFFFF;
  --light-surface: #F4F4F4;
  --border-gray: #D8D8D8;
  --reduced-border: #EBEBEB;
  
  /* Шрифтовые стеки */
  --font-system: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono-list: Verdana, Geneva, sans-serif;
}

/* ==========================================================================
   БАЗОВЫЕ НАСТРОЙКИ И СЕТКА
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-system);
  background-color: var(--white-primary);
  color: var(--medium-gray);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

.container {
  max-width: 1270px;
  margin: 0 auto;
  padding: 0 40px;
}

.section-gap {
  padding: 48px 0;
}

.bg-alt {
  background-color: var(--light-surface);
}

/* ==========================================================================
   ТИПОГРАФИКА
   ========================================================================== */
h1 {
  font-family: var(--font-system);
  font-size: 40px;
  font-weight: 500;
  line-height: 48px;
  color: var(--charcoal-black);
}

h2 {
  font-family: var(--font-system);
  font-size: 28px;
  font-weight: 700;
  line-height: 33.6px;
  color: var(--charcoal-black);
  margin-bottom: 24px;
}

h5 {
  font-family: var(--font-system);
  font-size: 20px;
  font-weight: 500;
  line-height: 24px;
  color: var(--charcoal-black);
}

.body-text {
  font-size: 16px;
  font-weight: 400;
  line-height: 20px;
  color: var(--medium-gray);
}

.text-small {
  font-size: 12px;
  font-weight: 400;
  color: var(--body-gray);
}

a {
  color: var(--charcoal-black);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-red);
}

/* ==========================================================================
   КОМПОНЕНТЫ: КНОПКИ И ИНПУТЫ
   ========================================================================== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--primary-red);
  color: var(--white-primary);
  font-size: 16px;
  font-weight: 600;
  height: 50px;
  padding: 0 50px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-primary:hover {
  background-color: var(--hover-red);
}

.btn-primary:active {
  background-color: var(--active-red);
  box-shadow: rgba(0, 0, 0, 0.2) inset 0px 2px 4px;
}

.search-bar {
  height: 44px;
  border: 1px solid var(--border-gray);
  border-radius: 0px;
  padding: 6px 15px 6px 40px;
  font-size: 12px;
  font-family: var(--font-system);
  width: 100%;
  color: var(--lighter-gray);
}

.search-bar:hover {
  border-color: #BEBEBE;
}

.search-bar:focus {
  outline: none;
  border-color: var(--electric-blue);
  box-shadow: 0 0 0 3px rgba(56, 88, 233, 0.1);
}

.form-input-rounded {
  height: 50px;
  border: 1px solid var(--border-gray);
  border-radius: 10px;
  padding: 0 16px;
  font-size: 15px;
  font-family: var(--font-system);
  width: 100%;
  background-color: var(--white-primary);
}

.form-input-rounded:focus {
  outline: none;
  border-color: var(--primary-red);
  box-shadow: 0 0 0 3px rgba(229, 39, 39, 0.1);
}

.btn-cart-trigger {
  height: 44px;
  padding: 0 16px;
  background: var(--white-primary);
  border: 1px solid var(--border-gray);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--dark-gray);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-cart-trigger:hover {
  border-color: var(--primary-red);
  color: var(--primary-red);
}

/* ==========================================================================
   КОМПОНЕНТЫ: ЖИВОЙ ПОИСК (Depth Level 3)
   ========================================================================== */
.search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  background-color: var(--white-primary);
  border: 1px solid var(--border-gray);
  box-shadow: rgba(0, 0, 0, 0.15) 0px 2px 5px 0px;
  z-index: 500;
  max-height: 280px;
  overflow-y: auto;
}

.search-result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--reduced-border);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.search-result-item:hover {
  background-color: var(--light-surface);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.search-result-title {
  font-size: 14px;
  color: var(--charcoal-black);
  font-weight: 500;
}

.search-result-sku {
  font-family: var(--font-mono-list);
  font-size: 11px;
  color: var(--body-gray);
}

.search-result-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-red);
  white-space: nowrap;
}

/* ==========================================================================
   КОМПОНЕНТЫ: КАРТОЧКА ТОВАРА (B2B)
   ========================================================================== */
.product-card {
  background-color: var(--white-primary);
  border: 1px solid var(--reduced-border);
  border-radius: 10px;
  padding: 16px;
  box-shadow: rgba(0, 0, 0, 0.05) 0px 1px 10px 0px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  position: relative;
}

.product-card:hover {
  box-shadow: rgba(0, 0, 0, 0.1) 0px 2px 12px 0px;
}

.product-sku {
  font-family: var(--font-mono-list);
  font-size: 11px;
  color: var(--body-gray);
  background-color: var(--light-surface);
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 12px;
  width: fit-content;
}

.product-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--charcoal-black);
  line-height: 22px;
  margin-bottom: 8px;
  min-height: 44px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.status-badge {
  font-size: 12px;
  font-weight: 500;
  color: #518F11;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
}

.status-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  background-color: #518F11;
  border-radius: 50%;
}

.status-badge.order-only {
  color: var(--electric-blue);
}

.status-badge.order-only::before {
  background-color: var(--electric-blue);
}

.product-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 16px;
  margin-top: auto;
}

.price-current {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-red);
}

.price-old {
  font-size: 14px;
  color: var(--body-gray);
  text-decoration: line-through;
}

.btn-card-action {
  width: 100%;
  height: 44px;
  background-color: var(--white-primary);
  border: 2px solid var(--primary-red);
  color: var(--primary-red);
  font-size: 14px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-card-action:hover {
  background-color: var(--primary-red);
  color: var(--white-primary);
}

/* ==========================================================================
   КОМПОНЕНТЫ: МАКЕТ СТРАНИЦЫ КОНТАКТОВ (Contacts Board)
   ========================================================================== */
.contacts-layout {
  display: grid;
  grid-template-columns: 1fr 520px;
  gap: 48px;
  align-items: start;
}

.contact-card-item {
  margin-bottom: 24px;
}

.contact-item-lbl {
  font-size: 12.8px;
  font-weight: 500;
  color: var(--body-gray);
  display: block;
  margin-bottom: 6px;
}

.contacts-map-stub {
  background-color: var(--light-surface);
  border: 1px solid var(--reduced-border);
  border-radius: 10px;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--body-gray);
  margin-top: 32px;
  box-shadow: rgba(0, 0, 0, 0.05) 0px 1px 10px 0px;
}

.contacts-requisites-panel {
  background-color: var(--white-primary);
  border: 1px solid var(--reduced-border);
  border-radius: 10px;
  padding: 24px;
  box-shadow: rgba(0, 0, 0, 0.05) 0px 1px 10px 0px;
}

/* ==========================================================================
   КОМПОНЕНТЫ: СТРАНИЦА КАТАЛОГА (Catalog & Filters)
   ========================================================================== */
.catalog-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  align-items: start;
}

.filter-widget-sidebar {
  background-color: var(--white-primary);
  border: 1px solid var(--reduced-border);
  border-radius: 10px;
  padding: 24px 20px;
  box-shadow: rgba(0, 0, 0, 0.05) 0px 1px 10px 0px;
}

.filter-group-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--charcoal-black);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 14px;
}

.filter-checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.b2b-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--medium-gray);
  cursor: pointer;
}

.b2b-checkbox-label input {
  width: 18px;
  height: 18px;
  border: 1px solid var(--border-gray);
  border-radius: 4px;
  accent-color: var(--primary-red);
}

/* ==========================================================================
   КОМПОНЕНТЫ: СТРАНИЦА ТОВАРА (Product Detail Rules)
   ========================================================================= */
.breadcrumbs-wrapper {
  border-bottom: 1px solid var(--reduced-border);
}

.breadcrumbs {
  padding: 14px 0;
  font-size: 12px;
  color: var(--body-gray);
}

.breadcrumbs a {
  color: var(--body-gray);
}

.breadcrumbs a:hover {
  color: var(--primary-red);
  text-decoration: underline;
}

.breadcrumbs span {
  margin: 0 8px;
  color: var(--border-gray);
}

.product-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin-top: 24px;
}

.product-gallery-stub {
  background-color: var(--light-surface);
  border: 1px solid var(--reduced-border);
  border-radius: 10px;
  height: 440px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--body-gray);
  box-shadow: rgba(0, 0, 0, 0.05) 0px 1px 10px 0px;
}

.product-meta-panel {
  display: flex;
  flex-direction: column;
}

.product-buy-box {
  background-color: var(--light-surface);
  border: 1px solid var(--reduced-border);
  border-radius: 10px;
  padding: 24px;
  margin-top: auto;
  box-shadow: rgba(0, 0, 0, 0.05) 0px 1px 10px 0px;
}

.b2b-specs-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono-list);
  font-size: 12px;
  color: var(--dark-gray);
  margin-top: 12px;
  background-color: var(--white-primary);
  border: 1px solid var(--reduced-border);
}

.b2b-specs-table tr {
  border-bottom: 1px solid var(--reduced-border);
}

.b2b-specs-table tr:nth-child(even) {
  background-color: var(--light-surface);
}

.b2b-specs-table td {
  padding: 12px 16px;
  line-height: 1.6;
}

.b2b-specs-table td:first-child {
  font-weight: 600;
  color: var(--medium-gray);
  width: 35%;
  border-right: 1px solid var(--reduced-border);
}

/* ==========================================================================
   ДРУГИЕ БЛОКИ (Workflow, Бренды, Модалки, Корзина)
   ========================================================================== */
.workflow-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.workflow-card {
  background-color: var(--white-primary);
  border-left: 3px solid var(--primary-red);
  padding: 16px 20px;
}

.workflow-num {
  font-family: var(--font-mono-list);
  font-size: 28px;
  font-weight: 700;
  color: var(--reduced-border);
  line-height: 1;
  margin-bottom: 8px;
}

.brands-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}

.brand-card {
  background-color: var(--white-primary);
  border: 1px solid var(--reduced-border);
  border-radius: 10px;
  padding: 20px 16px;
  text-align: center;
  font-weight: 600;
  font-size: 15px;
  color: var(--dark-gray);
  box-shadow: rgba(0, 0, 0, 0.05) 0px 1px 10px 0px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.brand-card:hover {
  box-shadow: rgba(0, 0, 0, 0.1) 0px 2px 12px 0px;
  color: var(--primary-red);
  transform: translateY(-2px);
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background-color: var(--white-primary);
  padding: 32px 40px;
  border-radius: 12px;
  max-width: 440px;
  width: calc(100% - 32px);
  position: relative;
  box-shadow: rgba(0, 0, 0, 0.6) 0px 0px 0px 1px inset, rgba(255, 255, 255, 0.2) 0px 0px 0px 2px inset;
  transform: translateY(-20px);
  transition: transform 0.25s ease;
}

.modal-overlay.is-open .modal-content {
  transform: translateY(0);
}

.modal-content h4 {
  font-size: 20px;
  font-weight: 500;
  color: var(--charcoal-black);
  margin-bottom: 6px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: transparent;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: var(--body-gray);
  cursor: pointer;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: var(--primary-red);
}

.cart-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.cart-drawer-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.cart-drawer-content {
  position: absolute;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 100%;
  height: 100%;
  background-color: var(--white-primary);
  box-shadow: rgba(0, 0, 0, 0.18) 0px 2px 8px 0px;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.cart-drawer-overlay.is-open .cart-drawer-content {
  transform: translateX(0);
}

.cart-drawer-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: transparent;
  border: none;
  font-size: 28px;
  color: var(--body-gray);
  cursor: pointer;
}

.cart-drawer-close:hover {
  color: var(--primary-red);
}

.cart-drawer-header {
  border-bottom: 1px solid var(--reduced-border);
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.cart-drawer-header h4 {
  font-size: 20px;
  color: var(--charcoal-black);
}

.cart-drawer-items {
  flex-grow: 1;
  overflow-y: auto;
  margin-bottom: 16px;
  padding-right: 4px;
}

.cart-item-row {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--light-surface);
}

.cart-item-info h5 {
  font-size: 14px;
  font-weight: 500;
  color: var(--charcoal-black);
  line-height: 1.3;
}

.cart-item-meta {
  font-family: var(--font-mono-list);
  font-size: 11px;
  color: var(--body-gray);
  margin-top: 4px;
}

.cart-item-control {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.cart-count-btn {
  width: 24px;
  height: 24px;
  background-color: var(--light-surface);
  border: 1px solid var(--border-gray);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-item-price-delete {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  height: 55px;
}

.cart-item-del {
  background: transparent;
  border: none;
  color: var(--body-gray);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
}

.cart-item-del:hover {
  color: var(--primary-red);
}

.cart-drawer-footer {
  border-top: 1px solid var(--reduced-border);
  padding-top: 16px;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 600;
  color: var(--charcoal-black);
}

.cart-total-sum {
  color: var(--primary-red);
  font-size: 20px;
}

.header-main {
  padding: 20px 0;
  border-bottom: 1px solid var(--reduced-border);
}

.header-main .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-logo {
  font-size: 22px;
  font-weight: 500;
  color: var(--charcoal-black);
  white-space: nowrap;
}

.brand-logo span {
  color: var(--primary-red);
  font-weight: 700;
}

.header-search-box {
  flex-grow: 1;
  max-width: 420px;
  position: relative;
}

.header-contacts-block {
  display: flex;
  align-items: center;
  gap: 16px;
}

.phone-link {
  font-size: 20px;
  font-weight: 700;
  color: var(--charcoal-black);
}

.hero-wrapper {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 48px;
  align-items: start;
}

.hero-info {
  padding-top: 20px;
}

.hero-badge {
  color: var(--primary-red);
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 12px;
}

.hero-p {
  font-size: 16px;
  line-height: 24px;
  margin-top: 20px;
  color: var(--medium-gray);
}

.filter-widget {
  background-color: var(--white-primary);
  border: 1px solid var(--reduced-border);
  border-radius: 10px;
  padding: 24px;
  box-shadow: rgba(0, 0, 0, 0.05) 0px 1px 10px 0px;
}

.filter-widget h4 {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 16px;
  color: var(--charcoal-black);
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12.8px;
  color: var(--lighter-gray);
  margin-bottom: 8px;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.about-box {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 48px;
  align-items: center;
}

.about-avatar {
  background-color: var(--border-gray);
  height: 350px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white-primary);
}

.footer-platform {
  background-color: var(--light-surface);
  border-top: 1px solid var(--reduced-border);
  padding: 48px 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
}

.footer-col h5 {
  margin-bottom: 20px;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 12px;
  font-size: 14px;
}

/* ==========================================================================
   АДАПТИВНОСТЬ: ПЛАНШЕТЫ (600px – 1024px)
   ========================================================================== */
@media (max-width: 1024px) {
  .container { padding: 0 24px; }
  .section-gap { padding: 32px 0; }
  h1 { font-size: 36px; line-height: 42px; }
  h2 { font-size: 24px; line-height: 28.8px; }

  .hero-wrapper,
  .contacts-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  
  .hero-info { text-align: center; }
  .hero-p { margin: 16px auto 0 auto; max-width: 600px; }
  .filter-widget { max-width: 550px; margin: 0 auto; }
  .catalog-layout { grid-template-columns: 1fr; gap: 24px; }
  
  .catalog-grid,
  .workflow-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
  
  .brands-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .product-detail-grid { grid-template-columns: 1fr; gap: 32px; }
  .product-gallery-stub { height: 360px; }
  
  .about-box {
    grid-template-columns: 1fr;
    gap: 32px;
    text-align: center;
  }
  
  .about-avatar { max-width: 300px; height: 300px; margin: 0 auto; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 32px; }
}

/* ==========================================================================
   АДАПТИВНОСТЬ: МОБИЛЬНЫЕ УСТРОЙСТВА (320px – 599px)
   ========================================================================== */
@media (max-width: 599px) {
  .container { padding: 0 16px; }
  .section-gap { padding: 24px 0; }
  h1 { font-size: 32px; line-height: 38px; }
  h2 { font-size: 20px; line-height: 24px; margin-bottom: 16px; }
  
  .top-nav-strip nav { display: none; }
  .top-nav-strip .container { justify-content: center; text-align: center; }
  
  .header-main .container {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  
  .brand-logo { text-align: center; }
  .header-search-box { max-width: 100%; margin: 0; }
  
  .header-contacts-block {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .header-phone-box { text-align: center !important; }
  
  .btn-primary, 
  .header-contacts-block .btn-primary,
  .btn-cart-trigger {
    width: 100%;
    height: 50px;
  }
  
  .hero-wrapper,
  .catalog-layout { grid-template-columns: 1fr; }
  .filter-widget { padding: 16px; width: 100%; }
  
  .catalog-grid,
  .workflow-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .brands-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .b2b-specs-table td:first-child { width: 45%; padding: 10px 8px; }
  .b2b-specs-table td { padding: 10px 8px; font-size: 11px; }
  .footer-links li a { display: block; padding: 12px 0; min-height: 44px; }
  
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    text-align: center;
  }
  
  .cart-drawer-content { width: 100%; }
  .contacts-map-stub { height: 220px; }
}