/* ============================================================
   Переиспользуемые компоненты
   ============================================================ */

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  height: var(--h-btn);
  padding-inline: var(--s-6);
  border-radius: var(--r-md);
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  line-height: 1;
  letter-spacing: var(--ls-base);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
  white-space: nowrap;
  user-select: none;
  border: 1px solid transparent;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--c-primary);
  color: var(--c-text-on-dark);
}
.btn-primary:hover { background: var(--c-primary-hover); }
.btn-primary:active { background: var(--c-primary-active); }

.btn-white {
  background: #fff;
  color: var(--c-text);
}
.btn-white:hover { background: #f3f4f6; }

.btn-outline-white {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,0.45);
}
.btn-outline-white:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.75); }

.btn-outline {
  background: transparent;
  color: var(--c-text);
  border-color: var(--c-border-strong);
}
.btn-outline:hover { border-color: var(--c-primary); color: var(--c-primary); }

.btn-ghost {
  background: transparent;
  color: var(--c-text);
}
.btn-ghost:hover { background: var(--c-bg-soft); }

.btn-sm { height: var(--h-btn-sm); padding-inline: var(--s-4); font-size: var(--fs-sm); }
.btn-lg { height: var(--h-btn-lg); padding-inline: var(--s-8); font-size: var(--fs-lg); }
.btn-block { width: 100%; }

/* ---------- Бейджи ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--r-sm);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  line-height: 1;
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
}
.badge-hit { background: var(--c-badge-hit-bg); color: var(--c-badge-hit-fg); }
.badge-new { background: var(--c-badge-new-bg); color: var(--c-badge-new-fg); }
.badge-sale { background: var(--c-badge-sale-bg); color: var(--c-badge-sale-fg); }

/* ---------- Поля ввода ---------- */
.input {
  height: var(--h-input);
  padding-inline: var(--s-4);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-md);
  background: #fff;
  font-size: var(--fs-base);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
  width: 100%;
}
.input:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(27,63,160,0.15); }

/* Поисковое поле с иконкой и кнопкой "Найти" внутри */
.search-field {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: var(--h-input);
  background: var(--c-bg-soft);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  padding-inline: var(--s-4);
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.search-field:focus-within { background: #fff; border-color: var(--c-primary); }
.search-field svg { color: var(--c-text-subtle); flex-shrink: 0; }
.search-field input {
  flex: 1;
  height: 100%;
  border: 0;
  background: transparent;
  outline: none;
  padding-inline: var(--s-3);
  font-size: var(--fs-base);
  color: var(--c-text);
}
.search-field input::placeholder { color: var(--c-text-subtle); }
.search-field .btn { height: 32px; padding-inline: var(--s-4); border-radius: var(--r-sm); }

/* ---------- Чипы (активные фильтры) ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px 0 14px;
  background: var(--c-primary-soft);
  color: var(--c-primary);
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
}
.chip button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  color: var(--c-primary);
  opacity: 0.6;
  transition: opacity var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.chip button:hover { opacity: 1; background: rgba(27,63,160,0.12); }

/* ---------- Чекбокс ---------- */
.checkbox {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  cursor: pointer;
  user-select: none;
  font-size: var(--fs-sm);
  color: var(--c-text);
}
.checkbox input { position: absolute; opacity: 0; pointer-events: none; }
.checkbox .box {
  width: 18px; height: 18px;
  border-radius: var(--r-xs);
  border: 1.5px solid var(--c-border-strong);
  background: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
  flex-shrink: 0;
}
.checkbox .box::after {
  content: '';
  width: 10px; height: 10px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='2,7 6,11 12,3'/></svg>") center / contain no-repeat;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease);
}
.checkbox input:checked + .box { background: var(--c-primary); border-color: var(--c-primary); }
.checkbox input:checked + .box::after { opacity: 1; }
.checkbox:hover .box { border-color: var(--c-primary); }
.checkbox .count {
  margin-left: auto;
  color: var(--c-text-subtle);
  font-size: var(--fs-xs);
}

/* ---------- Карточка товара ---------- */
.product-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--r-lg);
  border: 1px solid var(--c-border-soft);
  overflow: hidden;
  transition: border-color var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease), transform var(--dur-base) var(--ease);
  position: relative;
  /* НЕ ставим height: 100% — это блокирует grid stretching. align-items: stretch
     на родителе .product-row + display: flex здесь сам растянет карточку до
     высоты ряда. min-height: 100% подстраховывает на случай если grid считает
     ячейку короче карточки. */
  min-height: 100%;
}
.product-card:hover {
  border-color: var(--c-border-strong);
  box-shadow: var(--sh-card-hover);
  transform: translateY(-2px);
}
.product-card__media {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  background: var(--c-bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-5);
  overflow: hidden;
}
.product-card__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}
.product-card__media .product-card__placeholder {
  width: 60%;
  max-width: 140px;
  height: auto;
  opacity: 0.85;
}
.product-card__top {
  position: absolute;
  top: var(--s-3);
  left: var(--s-3);
  right: var(--s-3);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
}
.product-card__top > * { pointer-events: auto; }
.product-card__actions {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
}
.product-card__icon-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(4px);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--c-text-muted);
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.product-card__icon-btn {
  border: 0;
  cursor: pointer;
  font-family: inherit;
}
.product-card__icon-btn:hover { color: var(--c-primary); background: #fff; }
.product-card__icon-btn.is-active { color: var(--c-danger); }
.product-card__icon-btn[data-fav-toggle].is-active svg {
  fill: var(--c-danger);
  stroke: var(--c-danger);
}
.product-card__icon-btn[data-fav-toggle].is-active:hover {
  color: var(--c-danger);
}
.product-card__icon-btn[data-compare-toggle].is-active {
  color: var(--c-primary);
  background: var(--c-primary-soft);
}

.product-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5) var(--s-5);
  /* Растягиваем body на всё доступное пространство — кнопка прижмётся к низу */
  flex: 1 1 auto;
}
.product-card__brand {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--c-text-subtle);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
}
.product-card__title {
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  color: var(--c-text);
  line-height: var(--lh-snug);
  display: block;
  word-break: break-word;
  overflow-wrap: break-word;
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}
.product-card__title:hover { color: var(--c-primary); }

/* Делаем всю карточку кликабельной: ::before-overlay на title-ссылке покрывает всю карточку.
   Кнопка "В корзину" и иконки сравнения/избранное имеют свой z-index выше. */
.product-card__title::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  cursor: pointer;
}
.product-card__cta,
.product-card__icon-btn,
.product-card__actions {
  position: relative;
  z-index: 2;
}
.product-card__specs {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  line-height: var(--lh-base);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.product-card__price {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: var(--c-text);
  /* Прижимаем цену к низу — вместе с ней и stock + cta будут на одном уровне
     в разных карточках, даже если у одной есть бренд/длинный заголовок, а у другой нет. */
  margin-top: auto;
}
.product-card__stock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  color: var(--c-success);
  font-weight: var(--fw-medium);
}
.product-card__stock::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--c-success);
}
.product-card__cta {
  margin-top: auto; /* прижимаем кнопку к низу карточки */
}

/* ---------- Хлебные крошки ---------- */
.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-block: var(--s-5);
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
}
.breadcrumbs a:hover { color: var(--c-primary); }
.breadcrumbs .sep { color: var(--c-text-subtle); }
.breadcrumbs .current { color: var(--c-text); }

/* ---------- Пагинация ---------- */
.pagination {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.pagination a, .pagination span {
  min-width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--c-text);
  padding-inline: var(--s-3);
}
.pagination a:hover { background: var(--c-bg-soft); }
.pagination .is-active { background: var(--c-primary); color: #fff; }
.pagination .dots { color: var(--c-text-subtle); }

/* ---------- Иконка-кнопка в шапке (Сравнить/Избранное/Кабинет) ---------- */
.icon-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--c-text);
  font-size: var(--fs-xs);
  position: relative;
  padding: var(--s-1) var(--s-2);
  transition: color var(--dur-fast) var(--ease);
}
.icon-btn:hover { color: var(--c-primary); }
.icon-btn .badge-count {
  position: absolute;
  top: -2px;
  right: 2px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  background: var(--c-primary);
  color: #fff;
  border-radius: var(--r-pill);
  font-size: 10px;
  font-weight: var(--fw-bold);
  line-height: 16px;
  text-align: center;
}

/* ---------- Плавающая корзина (прижата к правому краю) ---------- */
.floating-cart {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 10px 7px;
  min-width: 64px;
  background: #fff;
  color: var(--c-bg-dark);
  border: 1px solid var(--c-border-soft);
  border-right: 0;
  border-radius: var(--r-md) 0 0 var(--r-md);
  z-index: var(--z-sticky);
  text-decoration: none;
  transition: padding-right var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.floating-cart:hover {
  padding-right: 12px;
  border-color: var(--c-border-strong);
}
.floating-cart:active { padding-right: 10px; }

.floating-cart__top {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 28px;
}
.floating-cart__icon {
  color: var(--c-bg-dark);
  display: block;
  width: 26px;
  height: 26px;
  stroke-width: 2;
}

.floating-cart__count {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--c-bg-dark);
  color: #fff;
  border-radius: var(--r-pill);
  font-family: var(--ff-base);
  font-size: 10px;
  font-weight: var(--fw-bold);
  line-height: 18px;
  text-align: center;
  letter-spacing: -0.01em;
  transition: transform var(--dur-base) var(--ease);
}
.floating-cart__count[hidden] { display: none; }
.floating-cart__count.is-bump { animation: cart-bump 0.5s var(--ease); }
@keyframes cart-bump {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.45); }
  70%  { transform: scale(0.92); }
  100% { transform: scale(1); }
}

.floating-cart__label {
  font-size: 11px;
  font-weight: var(--fw-semibold);
  color: var(--c-bg-dark);
  letter-spacing: -0.01em;
  line-height: 1;
}

@media (max-width: 640px) {
  .floating-cart {
    min-width: 54px;
    padding: 6px 8px 6px;
    gap: 2px;
  }
  .floating-cart__top { width: 30px; height: 24px; }
  .floating-cart__icon { width: 22px; height: 22px; }
  .floating-cart__count {
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    font-size: 9px;
    top: -5px;
    right: -6px;
  }
  .floating-cart__label { font-size: 10px; }
}

/* ---------- Поповер «Поделиться» ---------- */
.aq-share-pop {
  position: fixed;
  z-index: var(--z-modal);
  min-width: 210px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--c-border-soft);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(20, 40, 80, .16);
  opacity: 0;
  transform: translateY(-6px) scale(.98);
  transform-origin: top left;
  transition: opacity .15s ease, transform .15s ease;
}
.aq-share-pop.is-open { opacity: 1; transform: none; }
.aq-share-pop__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  background: transparent;
  border-radius: 9px;
  font-family: inherit;
  font-size: var(--fs-sm);
  color: var(--c-text);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.aq-share-pop__item svg { flex: 0 0 auto; color: var(--c-text-muted); }
.aq-share-pop__item:hover { background: var(--c-bg-soft); color: var(--c-primary); }
.aq-share-pop__item:hover svg { color: var(--c-primary); }

/* ---------- Тосты ---------- */
.aq-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: calc(100vw - 48px);
}
.aq-toast__item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--c-border-soft);
  border-left: 4px solid var(--c-success);
  border-radius: var(--r-md);
  padding: 12px 16px 12px 14px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(15, 23, 42, 0.06);
  font-size: var(--fs-sm);
  color: var(--c-text);
  min-width: 260px;
  max-width: 360px;
  pointer-events: auto;
  opacity: 0;
  transform: translateX(24px);
  transition: opacity var(--dur-base) var(--ease), transform var(--dur-base) var(--ease);
}
.aq-toast__item.is-show { opacity: 1; transform: translateX(0); }
.aq-toast__item.is-error { border-left-color: var(--c-danger); }
.aq-toast__item .aq-toast__ico {
  flex-shrink: 0;
  width: 20px; height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--c-success);
}
.aq-toast__item.is-error .aq-toast__ico { color: var(--c-danger); }
.aq-toast__item .aq-toast__body { flex: 1; line-height: var(--lh-snug); }
.aq-toast__item .aq-toast__close {
  flex-shrink: 0;
  width: 18px; height: 18px;
  color: var(--c-text-subtle);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.aq-toast__item .aq-toast__close:hover { color: var(--c-text); background: var(--c-bg-soft); }

/* ---------- Состояние загрузки кнопки ---------- */
.btn.is-loading,
.product-card__cta.is-loading {
  position: relative;
  pointer-events: none;
  color: transparent !important;
}
.btn.is-loading svg,
.product-card__cta.is-loading svg { opacity: 0; }
.btn.is-loading::after,
.product-card__cta.is-loading::after {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  width: 18px; height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* ============================================================
   Страница поиска /search/
   ============================================================ */
.search-page {
  max-width: 820px;
  margin: 0 auto;
  padding-block: var(--s-7);
}
.search-page__head {
  margin-bottom: var(--s-7);
}
.search-page__title {
  font-size: var(--fs-5xl);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight);
  margin: 0 0 var(--s-5);
}
.search-page__form {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  background: #fff;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-lg);
  padding: 8px 8px 8px 16px;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.search-page__form:focus-within {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(44, 82, 129, 0.12);
}
.search-page__form svg { color: var(--c-text-subtle); flex-shrink: 0; }
.search-page__form input {
  flex: 1;
  height: 36px;
  border: 0;
  background: transparent;
  outline: none;
  font-size: var(--fs-base);
  color: var(--c-text);
  font-family: inherit;
}
.search-page__form input::placeholder { color: var(--c-text-subtle); }
.search-page__form .btn { height: 36px; padding: 0 18px; }

.search-page__meta {
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
  margin-bottom: var(--s-5);
}
.search-page__meta strong { color: var(--c-text); font-weight: var(--fw-semibold); }

.search-results {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.search-result {
  background: #fff;
  border: 1px solid var(--c-border-soft);
  border-radius: var(--r-lg);
  padding: var(--s-4) var(--s-5);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.search-result:hover {
  border-color: var(--c-border-strong);
  box-shadow: var(--sh-sm);
}
.search-result__title {
  display: block;
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  color: var(--c-text);
  text-decoration: none;
  line-height: var(--lh-snug);
  margin-bottom: 4px;
}
.search-result__title:hover { color: var(--c-primary); }
.search-result__title b {
  background: rgba(44, 82, 129, 0.12);
  color: var(--c-primary);
  padding: 0 2px;
  border-radius: 2px;
  font-weight: var(--fw-bold);
}
.search-result__body {
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
  margin: 0 0 var(--s-1);
  line-height: var(--lh-base);
}
.search-result__body b {
  background: rgba(44, 82, 129, 0.12);
  color: var(--c-primary);
  padding: 0 2px;
  border-radius: 2px;
  font-weight: var(--fw-bold);
}
.search-result__url {
  font-size: var(--fs-xs);
  color: var(--c-text-subtle);
  font-family: var(--ff-mono);
}

.search-page__empty,
.search-page__hint,
.search-page__error {
  padding: var(--s-9) var(--s-5);
  background: var(--c-bg-soft);
  border-radius: var(--r-lg);
  text-align: center;
  color: var(--c-text-muted);
}
.search-page__empty h3 {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: var(--c-text);
  margin-bottom: var(--s-3);
}
.search-page__error { color: var(--c-danger); }

.search-page__pagination {
  margin-top: var(--s-7);
  display: flex;
  justify-content: center;
}

/* ============================================================
   Личный кабинет /personal/
   ============================================================ */
.lk-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--s-6);
  margin-top: var(--s-6);
  margin-bottom: var(--s-10);
  align-items: flex-start;
}
.lk-sidebar {
  background: #fff;
  border: 1px solid var(--c-border-soft);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  position: sticky;
  top: calc(var(--h-header) + var(--s-4));
}
.lk-sidebar__user {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding-bottom: var(--s-4);
  margin-bottom: var(--s-4);
  border-bottom: 1px solid var(--c-border-soft);
}
.lk-sidebar__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--c-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  font-family: var(--ff-base);
  text-transform: uppercase;
  flex-shrink: 0;
}
.lk-sidebar__user-info {
  flex: 1;
  min-width: 0;
}
.lk-sidebar__user-name {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--c-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lk-sidebar__user-email {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}

.lk-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.lk-nav__item {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 10px var(--s-3);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--c-text);
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.lk-nav__item svg {
  color: var(--c-text-subtle);
  flex-shrink: 0;
  transition: color var(--dur-fast) var(--ease);
}
.lk-nav__item:hover {
  background: var(--c-bg-soft);
  color: var(--c-primary);
}
.lk-nav__item:hover svg { color: var(--c-primary); }
.lk-nav__item.is-active {
  background: var(--c-primary);
  color: #fff;
}
.lk-nav__item.is-active svg { color: #fff; }
.lk-nav__item--logout {
  margin-top: var(--s-4);
  padding-top: var(--s-4);
  border-top: 1px solid var(--c-border-soft);
  border-radius: 0;
  color: var(--c-text-muted);
}
.lk-nav__item--logout:hover {
  background: transparent;
  color: var(--c-danger);
}
.lk-nav__item--logout:hover svg { color: var(--c-danger); }

/* Главная зона ЛК */
.lk-main {
  min-width: 0;
}
.lk-main__head {
  margin-bottom: var(--s-5);
}
.lk-main__title {
  font-size: var(--fs-4xl);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight);
  margin: 0 0 var(--s-2);
  line-height: 1.1;
}
.lk-main__sub {
  font-size: var(--fs-base);
  color: var(--c-text-muted);
  margin: 0;
}

.lk-card {
  background: #fff;
  border: 1px solid var(--c-border-soft);
  border-radius: var(--r-lg);
  padding: var(--s-6);
}

@media (max-width: 991px) {
  .lk-grid { grid-template-columns: 1fr; }
  .lk-sidebar { position: static; }
}

/* ============================================================
   bitrix:sale.personal.order.list — кастомизация стандартного шаблона
   под стиль сайта (страницы /personal/ и /personal/orders/history/)
   ============================================================ */

/* Empty-state — большой блок с иконкой вместо просто <h3> */
.lk-main > h3 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-4);
  background: #fff;
  border: 1px solid var(--c-border-soft);
  border-radius: var(--r-xl);
  padding: var(--s-9) var(--s-6);
  font-size: var(--fs-lg);
  font-weight: var(--fw-medium);
  color: var(--c-text-muted);
  text-align: center;
  margin: var(--s-5) 0;
}

.lk-main > h3::before {
  content: '';
  width: 64px;
  height: 64px;
  background: var(--c-bg-soft);
  border-radius: 50%;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 24 24' fill='none' stroke='%2393A1B5' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4' width='18' height='16' rx='2'/><path d='M3 10h18'/><path d='M8 14h4'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
}

/* Ссылки-фильтры «Посмотреть текущие заказы» / «История» / «Отмененные» */
.lk-main .sale-order-history-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding-inline: var(--s-5);
  background: #fff;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-md);
  color: var(--c-text);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  text-decoration: none;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
  margin: 0 var(--s-2) var(--s-3) 0;
}

.lk-main .sale-order-history-link::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-primary);
  flex-shrink: 0;
}

.lk-main .sale-order-history-link:hover {
  border-color: var(--c-primary);
  background: #eef2fb;
  color: var(--c-primary);
}

/* Стандартный bootstrap-row у Bitrix компонента — обнуляем «Bootstrap-овщину» */
.lk-main .row {
  display: flex !important;
  flex-wrap: wrap;
  margin: 0 !important;
  padding: 0;
  width: 100% !important;
}

.lk-main [class*="col-"] {
  padding: 0 !important;
  margin: 0 !important;
  float: none !important;
  width: 100% !important;
  max-width: 100% !important;
}

/* Карточки заказов */
.lk-main .sale-order-title {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: var(--c-text);
  margin: var(--s-6) 0 var(--s-3);
  letter-spacing: var(--ls-tight);
}

.lk-main .sale-order-list-container {
  background: #fff;
  border: 1px solid var(--c-border-soft);
  border-radius: var(--r-lg);
  padding: var(--s-5) var(--s-6);
  margin-bottom: var(--s-4);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}

.lk-main .sale-order-list-container:hover {
  border-color: var(--c-border-strong);
  box-shadow: var(--sh-md);
}

.lk-main .sale-order-list-title-container {
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--c-border-soft);
  margin-bottom: var(--s-3);
}

.lk-main .sale-order-list-title {
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  color: var(--c-text);
  margin: 0;
  letter-spacing: -0.01em;
}

.lk-main .sale-order-list-inner-container {
  margin-bottom: var(--s-3);
}

.lk-main .sale-order-list-inner-title-line {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-2);
}

.lk-main .sale-order-list-inner-title-line-item {
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  font-weight: var(--fw-semibold);
  color: var(--c-text-muted);
  flex-shrink: 0;
}

.lk-main .sale-order-list-inner-title-line-border {
  flex: 1;
  height: 1px;
  background: var(--c-border-soft);
}

/* Кнопки-действия (оплатить, отменить, повторить) */
.lk-main button,
.lk-main input[type="submit"],
.lk-main .btn {
  font-family: var(--ff-base);
}

.lk-main .btn-default,
.lk-main .sale-order-list-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding-inline: var(--s-5);
  background: var(--c-primary);
  color: #fff;
  border: 0;
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease);
}

.lk-main .btn-default:hover,
.lk-main .sale-order-list-button:hover {
  background: var(--c-primary-hover);
  color: #fff;
}

/* Иконки в карточке заказа (картинки товаров) */
.lk-main img {
  max-width: 100%;
  height: auto;
}

/* Адаптив */
@media (max-width: 767px) {
  .lk-main > h3 {
    padding: var(--s-6) var(--s-4);
    font-size: var(--fs-base);
  }
  .lk-main .sale-order-history-link {
    width: 100%;
    justify-content: center;
    margin-right: 0;
  }
  .lk-main .sale-order-list-container { padding: var(--s-4); }
  .lk-main .sale-order-list-title { font-size: var(--fs-base); }
}

/* ============================================================
   Страница сравнения /personal/compare/
   ============================================================ */
.compare-page {
  padding-bottom: var(--s-9);
}
.compare-page__head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--s-3) var(--s-5);
  margin-bottom: var(--s-6);
}
.compare-page__title {
  font-size: var(--fs-5xl);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight);
  margin: 0;
}
.compare-page__meta {
  color: var(--c-text-muted);
  font-size: var(--fs-base);
}
.compare-page__meta strong { color: var(--c-text); font-weight: var(--fw-semibold); }

.compare-table-wrap {
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--c-border-soft);
  border-radius: var(--r-lg);
}
.compare-table {
  min-width: 100%;
  width: max-content;
}
.compare-grid {
  display: grid;
  grid-template-columns: 180px repeat(var(--cmp-cols), 220px);
}
.compare-cell {
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--c-border-soft);
  border-right: 1px solid var(--c-border-soft);
  font-size: var(--fs-sm);
  line-height: var(--lh-snug);
  display: flex;
  align-items: center;
}
/* Последняя колонка в каждой строке — без правой границы */
.compare-cell.is-last-col { border-right: 0; }
.compare-cell.is-stripe { background: rgba(244, 246, 250, 0.5); }

/* Шапка-колонка (левая): серый фон, приглушённый текст */
.compare-cell--head {
  background: var(--c-bg-soft);
  color: var(--c-text-muted);
  font-weight: var(--fw-semibold);
}

.compare-cell--top {
  position: relative;
  padding: var(--s-3);
  background: #fff;
  min-height: 160px;
  align-items: stretch;
  justify-content: center;
}
.compare-cell--head.compare-cell--top { background: var(--c-bg-soft); }
.compare-img {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  text-decoration: none;
}
.compare-img img {
  max-width: 100%;
  max-height: 130px;
  object-fit: contain;
  mix-blend-mode: multiply;
}
.compare-img__ph {
  width: 100%;
  height: 130px;
  background: var(--c-bg-soft);
  border-radius: var(--r-md);
}
.compare-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--c-border-soft);
  border-radius: 50%;
  color: var(--c-text-muted);
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
  z-index: 2;
}
.compare-remove:hover { color: var(--c-danger); border-color: var(--c-danger); }

.compare-cell--name {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--c-text);
}
.compare-brand {
  font-size: var(--fs-xs);
  color: var(--c-text-subtle);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
}
.compare-name-link {
  color: var(--c-text);
  text-decoration: none;
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
}
.compare-name-link:hover { color: var(--c-primary); }

.compare-cell--price {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--c-text);
}
.compare-stock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
}
.compare-stock--ok { color: var(--c-success); }
.compare-stock--ok::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--c-success);
}
.compare-stock--no { color: var(--c-text-subtle); }

.compare-cell--actions {
  padding: var(--s-3) var(--s-4);
}
.compare-cell--actions .btn {
  width: 100%;
  height: 34px;
  font-size: var(--fs-xs);
  padding: 0 var(--s-3);
  gap: 6px;
}

.compare-cell--prop {
  color: var(--c-text);
  font-size: var(--fs-sm);
}
.compare-cell--prop-name {
  color: var(--c-text-muted);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
}


/* ============================================================
   Юридические страницы: Политика конфиденциальности, Оферта
   ============================================================ */
.legal-page {
  max-width: 840px;
  margin: 0 auto;
  padding-block: var(--s-6) var(--s-12);
}
.legal-page__head {
  margin-bottom: var(--s-7);
  padding-bottom: var(--s-5);
  border-bottom: 1px solid var(--c-border-soft);
}
.legal-page__title {
  font-size: var(--fs-5xl);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight);
  color: var(--c-text);
  line-height: 1.15;
  margin: 0 0 var(--s-3);
}
.legal-page__updated {
  font-size: var(--fs-sm);
  color: var(--c-text-subtle);
  margin: 0;
}
.legal-page__content {
  font-size: var(--fs-base);
  line-height: 1.65;
  color: var(--c-text);
}
.legal-page__content section {
  margin-bottom: var(--s-6);
}
.legal-page__content section:last-child {
  margin-bottom: 0;
}
.legal-page__content h2 {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: var(--c-text);
  margin: 0 0 var(--s-3);
  letter-spacing: var(--ls-tight);
}
.legal-page__content p {
  margin: 0 0 var(--s-3);
  color: var(--c-text);
}
.legal-page__content p:last-child {
  margin-bottom: 0;
}
.legal-page__content ul,
.legal-page__content ol {
  margin: 0 0 var(--s-3);
  padding-left: var(--s-5);
}
.legal-page__content li {
  margin-bottom: 6px;
  line-height: 1.6;
}
.legal-page__content li:last-child {
  margin-bottom: 0;
}
.legal-page__content a {
  color: var(--c-primary);
  text-decoration: underline;
  text-decoration-color: rgba(44, 82, 129, 0.3);
  text-underline-offset: 2px;
  transition: text-decoration-color var(--dur-fast) var(--ease);
}
.legal-page__content a:hover {
  text-decoration-color: var(--c-primary);
}
.legal-page__content strong {
  font-weight: var(--fw-semibold);
  color: var(--c-text);
}
.legal-page__lead {
  font-size: var(--fs-lg);
  line-height: 1.55;
  padding: var(--s-4) var(--s-5);
  background: var(--c-bg-soft);
  border-left: 3px solid var(--c-primary);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  margin-bottom: var(--s-4) !important;
}

@media (max-width: 767px) {
  .legal-page__title {
    font-size: var(--fs-4xl);
  }
  .legal-page__content h2 {
    font-size: var(--fs-lg);
  }
  .legal-page__lead {
    font-size: var(--fs-base);
    padding: var(--s-3) var(--s-4);
  }
}


/* ============================================================
   Плашка о сборе cookies — нижний правый угол, лаконично
   ============================================================ */
/* Скрываем когда стоит атрибут hidden — браузерный [hidden]{display:none}
   перебивается классом .cookie-consent{display:flex} (одинаковая специфичность),
   поэтому добавляем явное правило с !important. */
.cookie-consent[hidden] {
  display: none !important;
}
.cookie-consent {
  position: fixed;
  right: var(--s-5);
  bottom: var(--s-5);
  z-index: 1100;
  max-width: 420px;
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  background: #fff;
  border: 1px solid var(--c-border-soft);
  border-radius: var(--r-lg);
  box-shadow: 0 8px 32px rgba(10, 30, 91, 0.15);
  padding: var(--s-4) var(--s-5);
  animation: aqCookieSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.cookie-consent.is-hiding {
  animation: aqCookieSlideDown 0.3s ease-in forwards;
}
@keyframes aqCookieSlideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes aqCookieSlideDown {
  to { opacity: 0; transform: translateY(24px); }
}

.cookie-consent__icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--c-primary-soft);
  color: var(--c-primary);
  border-radius: 50%;
}
.cookie-consent__text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--c-text);
}
.cookie-consent__text strong {
  display: block;
  font-weight: var(--fw-semibold);
  margin-bottom: 2px;
}
.cookie-consent__text span {
  color: var(--c-text-muted);
}
.cookie-consent__text a {
  color: var(--c-primary);
  text-decoration: underline;
  text-decoration-color: rgba(44, 82, 129, 0.35);
  text-underline-offset: 2px;
}
.cookie-consent__text a:hover {
  text-decoration-color: var(--c-primary);
}
.cookie-consent__btn {
  flex-shrink: 0;
  background: var(--c-primary);
  color: #fff;
  border: 0;
  border-radius: var(--r-md);
  padding: 8px 18px;
  font-family: var(--ff-base);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease);
  white-space: nowrap;
  align-self: center;
}
.cookie-consent__btn:hover {
  background: var(--c-primary-hover);
}

@media (max-width: 575px) {
  .cookie-consent {
    left: var(--s-3);
    right: var(--s-3);
    bottom: var(--s-3);
    max-width: none;
    padding: var(--s-3) var(--s-4);
  }
  .cookie-consent__icon {
    width: 32px;
    height: 32px;
  }
  .cookie-consent__btn {
    padding: 7px 14px;
    font-size: var(--fs-xs);
  }
}

/* ============================================================
   МОДАЛЬНОЕ ОКНО «Оставить заявку» / «Получить консультацию»
   Глобальное (разметка в footer.php), открывается кнопками
   с атрибутом data-callback-open. Логика — main.js.
   ============================================================ */
.aq-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-4);
}
.aq-modal[hidden] { display: none !important; }
.aq-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.aq-modal__dialog {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: var(--r-lg);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  padding: var(--s-7) var(--s-7) var(--s-6);
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.aq-modal.is-open .aq-modal__overlay { opacity: 1; }
.aq-modal.is-open .aq-modal__dialog { opacity: 1; transform: translateY(0) scale(1); }

.aq-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--c-text-muted);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  border-radius: var(--r-md);
  transition: background 0.15s ease, color 0.15s ease;
}
.aq-modal__close:hover { background: var(--c-bg-soft); color: var(--c-text); }

.aq-modal__title {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  color: var(--c-text);
  letter-spacing: var(--ls-tight);
  margin: 0 0 var(--s-2);
  padding-right: 28px;
}
.aq-modal__lead {
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
  line-height: 1.5;
  margin: 0 0 var(--s-5);
}
.aq-modal__input {
  display: block;
  width: 100%;
  height: 48px;
  padding: 0 16px;
  margin-bottom: var(--s-3);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-md);
  background: #fff;
  font-family: var(--ff-base);
  font-size: var(--fs-base);
  color: var(--c-text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.aq-modal__input:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(27, 63, 160, 0.14);
}
/* honeypot — прячем от людей, но не display:none (некоторые боты это учитывают) */
.aq-modal__hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.aq-modal__submit {
  display: block;
  width: 100%;
  height: 50px;
  margin-top: var(--s-2);
  border: 0;
  border-radius: var(--r-md);
  background: var(--c-primary);
  color: #fff;
  font-family: var(--ff-base);
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  transition: background 0.15s ease;
}
.aq-modal__submit:hover { background: var(--c-primary-hover); }
.aq-modal__submit:disabled { opacity: 0.7; cursor: default; }

.aq-modal__status {
  margin-top: var(--s-3);
  font-size: var(--fs-sm);
  line-height: 1.4;
  text-align: center;
}
.aq-modal__status.is-error { color: var(--c-danger); }

.aq-modal__consent {
  margin: var(--s-3) 0 0;
  font-size: var(--fs-xs);
  color: var(--c-text-subtle);
  line-height: 1.5;
  text-align: center;
}
.aq-modal__consent a { color: var(--c-text-muted); text-decoration: underline; }
.aq-modal__consent a:hover { color: var(--c-primary); }

/* Экран «успех» */
.aq-modal__success { text-align: center; padding: var(--s-4) 0 var(--s-2); }
.aq-modal__success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--s-4);
  border-radius: 50%;
  background: #dcfce7;
  color: var(--c-success);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.aq-modal__success-title {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: var(--c-text);
  margin: 0 0 var(--s-2);
}
.aq-modal__success-text {
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
  line-height: 1.5;
  margin: 0 0 var(--s-5);
}
.aq-modal__success-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 140px;
  height: 46px;
  padding: 0 var(--s-6);
  border: 0;
  border-radius: var(--r-md);
  background: var(--c-primary);
  color: #fff;
  font-family: var(--ff-base);
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  transition: background 0.15s ease;
}
.aq-modal__success-btn:hover { background: var(--c-primary-hover); }

/* вертикальный скролл страницы НЕ блокируем (по требованию) */

@media (max-width: 480px) {
  .aq-modal { padding: 0; align-items: flex-end; }
  .aq-modal__dialog {
    max-width: none;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    padding: var(--s-6) var(--s-5) var(--s-5);
    transform: translateY(100%);
  }
  .aq-modal.is-open .aq-modal__dialog { transform: translateY(0); }
}
