/**
 * Prostore UI overrides — кастомные правки поверх app.min.css
 * Подключать после app.min.css
 */

/* =============================================================================
   Header — Segmented-капсула: ЛК / Сравнение / Избранное / Корзина
   ============================================================================= */

.header__group--segmented {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  flex: 0 0 auto;
}

.header__group--segmented > * {
  margin: 0 !important;
}

.header__group--segmented .header__acc,
.header__group--segmented .header__action,
.header__group--segmented .header__cart {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  height: 4.6rem;
  border-radius: 8px;
  border: none !important;
  transition: background 0.2s, box-shadow 0.2s;
}

.header__group--segmented .header__acc-btn,
.header__group--segmented .header__action-btn,
.header__group--segmented .header__cart-btn {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 8px;
}

.header__group--segmented .header__acc-btn {
  width: 4.4rem;
  height: 4.6rem;
  flex-shrink: 0;
}

.header__group--segmented .header__action {
  padding: 0;
}

.header__group--segmented .header__action-line {
  height: 2.8rem;
  background: rgba(255, 255, 255, 0.12);
}

/* Бейдж количества — сравнение и избранное */
.header__group--segmented .header__action-counter.js-compare-total:not(:empty),
.header__group--segmented .header__action-counter.js-wishlist-total:not(:empty) {
  opacity: 1;
  top: 0.5rem;
  right: 0.5rem;
  min-width: 1.6rem;
  height: 1.6rem;
  padding: 0 0.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FFD540;
  color: #111;
  border-radius: 99px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
}

.header__group--segmented .header__acc:hover,
.header__group--segmented .header__action:hover {
  background: rgba(255, 255, 255, 0.1);
}

.header__group--segmented .header__acc-btn:hover,
.header__group--segmented .header__action-btn:hover,
.header__group--segmented .header__cart-btn:hover {
  background: transparent !important;
  border-color: transparent !important;
  color: inherit;
}

.header__group--segmented .header__cart {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.header__group--segmented .header__cart:hover {
  background: rgba(255, 255, 255, 0.16);
}

.header__group--segmented .header__cart-btn {
  height: 4.6rem;
  padding: 0.5rem 1.6rem 0.5rem 1.2rem;
}

.header__group--segmented .header__cart-btn:hover {
  border-color: transparent !important;
  color: #fff;
}

/* Светлая шапка v6 / v7 / v8 */
.is-header-v6 .header__group--segmented,
.is-header-v7 .header__group--segmented,
.is-header-v8 .header__group--segmented {
  background: #f7f7fb;
}

.is-header-v6 .header__group--segmented .header__action-line,
.is-header-v7 .header__group--segmented .header__action-line,
.is-header-v8 .header__group--segmented .header__action-line {
  background: rgba(52, 52, 52, 0.1);
}

.is-header-v6 .header__group--segmented .header__acc:hover,
.is-header-v6 .header__group--segmented .header__action:hover,
.is-header-v7 .header__group--segmented .header__acc:hover,
.is-header-v7 .header__group--segmented .header__action:hover,
.is-header-v8 .header__group--segmented .header__acc:hover,
.is-header-v8 .header__group--segmented .header__action:hover {
  background: rgba(52, 52, 52, 0.06);
}

.is-header-v6 .header__group--segmented .header__cart,
.is-header-v7 .header__group--segmented .header__cart,
.is-header-v8 .header__group--segmented .header__cart {
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.is-header-v6 .header__group--segmented .header__cart:hover,
.is-header-v7 .header__group--segmented .header__cart:hover,
.is-header-v8 .header__group--segmented .header__cart:hover {
  background: #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
}

.is-header-v6 .header__group--segmented .header__cart-btn:hover,
.is-header-v7 .header__group--segmented .header__cart-btn:hover,
.is-header-v8 .header__group--segmented .header__cart-btn:hover {
  color: #343434;
}

/* =============================================================================
   Mobile offcanvas — Segmented-капсула: ЛК / Сравнение / Избранное / Корзина
   ============================================================================= */

@media (max-width: 1199px) {
  .header__nav-offcanvas .header__nav-group--acc_action_cart {
    display: flex;
    align-items: stretch;
    gap: clamp(2px, 0.35vw, 3px);
    width: auto;
    max-width: none;
    margin: 0 clamp(1.5rem, 7.5vw, 3rem) clamp(1.25rem, 5vw, 2rem);
    padding: clamp(2px, 0.35vw, 3px);
    background: #f7f7fb;
    border-radius: 8px;
    border-bottom: none;
  }

  .header__nav-offcanvas .header__nav-group--acc_action_cart + .header__catalog-menu {
    border-top: 1px solid #e8eaf3;
    margin-top: 0;
  }

  .header__nav-offcanvas .header__nav-group--acc_action_cart > * {
    margin: 0 !important;
  }

  .header__nav-offcanvas .header__nav-acc,
  .header__nav-offcanvas .header__nav-action,
  .header__nav-offcanvas .header__nav-cart {
    display: flex;
    align-items: center;
    height: 5rem;
    border: none !important;
    border-radius: 6px;
    transition: background 0.2s;
    min-width: 0;
  }

  /* Пропорции сегментов: ЛК 1 : действия 2 : корзина 3 */
  .header__nav-offcanvas .header__nav-acc {
    flex: 1 1 0;
    min-width: 4.8rem;
    max-width: 6rem;
    justify-content: center;
    border-radius: 6px 0 0 6px;
  }

  .header__nav-offcanvas .header__nav-action {
    flex: 2 1 0;
    min-width: 9.5rem;
    padding: 0;
  }

  .header__nav-offcanvas .header__nav-acc-btn,
  .header__nav-offcanvas .header__nav-action-btn,
  .header__nav-offcanvas .header__nav-cart-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 6px;
    color: #343434;
    text-decoration: none;
  }

  .header__nav-offcanvas .header__nav-acc-btn {
    width: 100%;
    max-width: 5rem;
    height: 5rem;
    flex-shrink: 0;
  }

  .header__nav-offcanvas .header__nav-action-btn {
    flex: 1 1 50%;
    width: auto;
    min-width: 0;
    height: 5rem;
    position: relative;
  }

  .header__nav-offcanvas .header__nav-action-line {
    height: 2.8rem;
    background: rgba(52, 52, 52, 0.1);
    flex-shrink: 0;
  }

  .header__nav-offcanvas .header__nav-action-counter.js-compare-total:not(:empty),
  .header__nav-offcanvas .header__nav-action-counter.js-wishlist-total:not(:empty) {
    opacity: 1;
    top: 0.5rem;
    right: clamp(0.35rem, 2vw, 0.5rem);
    min-width: 1.6rem;
    height: 1.6rem;
    padding: 0 0.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffd540;
    color: #111;
    border-radius: 99px;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
  }

  .header__nav-offcanvas .header__nav-acc:hover,
  .header__nav-offcanvas .header__nav-action:hover {
    background: rgba(52, 52, 52, 0.06);
  }

  .header__nav-offcanvas .header__nav-acc-btn:hover,
  .header__nav-offcanvas .header__nav-action-btn:hover,
  .header__nav-offcanvas .header__nav-cart-btn:hover {
    background: transparent !important;
    border-color: transparent !important;
    color: #343434;
  }

  .header__nav-offcanvas .header__nav-cart {
    flex: 3 1 0;
    min-width: 0;
    background: #fff;
    box-shadow: none;
    border-radius: 6px;
  }

  .header__nav-offcanvas .header__nav-cart:hover {
    background: #fff;
  }

  .header__nav-offcanvas .header__nav-cart-btn {
    width: 100%;
    height: 5rem;
    justify-content: flex-start;
    align-items: center;
    padding: 0.5rem clamp(0.65rem, 3vw, 1rem) 0.5rem clamp(0.75rem, 2.5vw, 1rem);
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header__nav-offcanvas .header__nav-cart-btn svg {
    margin: 0 clamp(0.5rem, 2.5vw, 0.85rem) 0 0;
    flex-shrink: 0;
    align-self: center;
  }

  .header__nav-offcanvas .header__nav-cart-total {
    display: block;
    font-size: clamp(1.15rem, 3.2vw, 1.3rem);
    font-weight: 500;
    line-height: 1.15;
    min-width: 0;
  }

  .header__nav-offcanvas .header__nav-cart-total mark {
    display: block;
    padding: 0;
    background: none;
    color: inherit;
    font-size: clamp(1.05rem, 3vw, 1.2rem);
    opacity: 0.4;
    margin: 0 0 0.1rem;
  }
}

/* =============================================================================
   Карточка товара — избранное / сравнение (Font Awesome 6)
   ============================================================================= */

.sku__addto-btn {
  color: #343434;
}

.sku__addto-btn.is-active {
  color: #343434 !important;
}

.sku__addto-btn .sku__addto-btn-icon {
  width: 2rem;
  min-width: 2rem;
  justify-content: center;
}

.sku__addto-btn .sku__addto-btn-icon i,
.sku__addto-btn .sku__addto-btn-icon svg.svg-inline--fa {
  display: inline-block;
  font-size: 1.8rem;
  width: 2rem;
  height: 2rem;
  line-height: 2rem;
  flex-shrink: 0;
  text-align: center;
  color: #343434;
}

.sku__addto-btn.is-active .sku__addto-btn-icon i,
.sku__addto-btn.is-active .sku__addto-btn-icon svg.svg-inline--fa {
  font-size: 1.8rem;
  color: #ffcd00 !important;
}

/* Страховка: если на странице ещё SVG-спрайты */
.sku__addto-btn-icon svg.icon-compare,
.sku__addto-btn-icon svg.icon-compare-active,
.sku__addto-btn-icon svg.icon-favorites,
.sku__addto-btn-icon svg.icon-favorites-active {
  width: 2.1rem !important;
  height: 1.9rem !important;
}

.sku__addto-btn.is-active .sku__addto-btn-text small {
  color: #bdc2d3;
}

/* Единый radius 8px и высота 52px — каталог и поиск в строке шапки */
@media (min-width: 768px) {
  .header__row--02 .header__catalog-btn,
  .header__row--02 .header__search-input,
  .header__row--02 .header__search-compact-btn {
    height: 5.2rem;
    border-radius: 8px;
  }

  .header__row--02 .header__search-btn {
    height: calc(5.2rem - 0.8rem);
    margin: calc((0.8rem - 5.2rem) / 2) 0 0;
    border-radius: 8px;
  }

  .is-header-fixed .header-fixed .header__catalog-btn {
    height: 5.2rem;
    border-radius: 8px;
  }
}

/* =============================================================================
   Кнопки — единый border-radius 8px
   ============================================================================= */

.ui-btn,
.btn,
.comments__form-close,
.comments__form-btn,
.brands__search-btn,
.details__comments-form-close,
.details__comments-form-btn,
.reviews__item-details-close,
.reviews__form-close,
.reviews__form-btn,
.categories-aside__close,
.ui-code__btn,
.button-group button {
  border-radius: 8px;
}

/* =============================================================================
   Счётчик количества — единый border-radius 8px
   ============================================================================= */

.ui-number__input {
  border-radius: 8px;
}

.ui-number__decrease {
  border-radius: 8px 0 0 8px;
}

.ui-number__increase {
  border-radius: 0 8px 8px 0;
}

/* =============================================================================
   Мега-меню — блок «Товар дня»: как в каталоге, без обрезки (contain)
   ============================================================================= */

/* Скрыть избранное и сравнение */
.header__additional .products__item-buttons,
.header__additional-single .products__item-buttons {
  display: none !important;
}

/* Несколько товаров — сетка 2×2 */
.header__additional .products__item--small .products__item-in {
  padding: 0.75rem;
}

.header__additional .products__item--small .products__item-gallery,
.header__additional-single .products__item-gallery {
  display: grid;
  grid-template-rows: auto;
  position: relative;
  overflow: visible;
  margin: 0 0 0.75rem;
  padding: 0 0 calc(0.75rem + 2px);
}

.header__additional .products__item--small .products__item-gallery > .products__item-image,
.header__additional-single .products__item-gallery > .products__item-image {
  grid-row: 1;
  grid-column: 1;
  width: 100%;
  transform: none !important;
}

/* Невидимые зоны hover поверх фото + визуальные полоски снизу (::after) */
.header__additional .products__item--small .products__item-pagination,
.header__additional-single .products__item-pagination {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  aspect-ratio: 3 / 4;
  height: auto;
  z-index: 10;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: stretch;
  background: transparent;
  pointer-events: auto;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.header__additional .products__item--small .products__item-bullet,
.header__additional-single .products__item-bullet {
  flex: 1;
  height: 100%;
  margin: 0 0.15rem;
  border: none;
  background: transparent;
  border-radius: 0;
  position: relative;
  transition: none;
}

.header__additional .products__item--small .products__item-bullet.is-active,
.header__additional-single .products__item-bullet.is-active {
  background: transparent;
}

.header__additional .products__item--small .products__item-bullet::before,
.header__additional-single .products__item-bullet::before {
  content: "";
  display: block;
  position: absolute;
  top: 0;
  bottom: 0;
  left: -0.15rem;
  right: -0.15rem;
}

.header__additional .products__item--small .products__item-bullet::after,
.header__additional-single .products__item-bullet::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0.15rem;
  right: 0.15rem;
  margin-top: 0.75rem;
  height: 2px;
  background: #e9e8f1;
  border-radius: 1px;
  pointer-events: none;
  transition: background 0.25s;
}

.header__additional .products__item--small .products__item-bullet.is-active::after,
.header__additional-single .products__item-bullet.is-active::after {
  background: var(--theme-primary-color, #c8a96e);
}

.header__additional .products__item--small .products__item-bullet:first-child,
.header__additional-single .products__item-bullet:first-child {
  margin-left: 0;
}

.header__additional .products__item--small .products__item-bullet:last-child,
.header__additional-single .products__item-bullet:last-child {
  margin-right: 0;
}

.header__additional .products__item--small .products__item-image,
.header__additional-single .products__item-image {
  height: auto;
  aspect-ratio: 3 / 4;
  margin: 0;
  padding: 0;
  border-radius: 6px;
  overflow: hidden;
}

.header__additional .products__item--small .products__item-image img,
.header__additional-single .products__item-image img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
}

.header__additional .products__item--small .products__item-title,
.header__additional .products__item--small .products__item-price,
.header__additional .products__item--small .products__item-rating {
  padding: 0;
}

/* Один товар в блоке */
.header__additional-single .products__item-in {
  padding: 0.75rem;
}

.header__additional-single .products__item-title,
.header__additional-single .products__item-price,
.header__additional-single .products__item-status,
.header__additional-single .products__item-id,
.header__additional-single .products__item-rating,
.header__additional-single .products__item-action {
  padding-left: 0;
  padding-right: 0;
}
