/* Верхняя информационная панель */
.header-top {
  background-color: var(--blueBg);
  color: var(--whiteColor);
  font-size: 0.875rem;
  line-height: var(--lineHeight_130);
  position: relative;
  z-index: 150;
}
.header-top__container {
  max-width: 89.375rem;
  margin: 0 auto;
  padding: 0.75rem 0.9375rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
}
.header-top__phones {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}
.header-top__phone {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--whiteColor);
  font-weight: var(--fontWeight_600);
  white-space: nowrap;
}
.header-top__phone img {
  width: 1rem;
  height: 1rem;
  filter: brightness(0) invert(1);
}
.header-top__schedule {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 2rem;
}
.header-top__item strong {
  font-weight: var(--fontWeight_600);
}

/* Шапка — в потоке документа, не перекрывает верхнюю панель */
.header.header_with-top {
  position: relative;
  top: auto;
  left: auto;
  width: 100%;
  z-index: 145;
}

.header.header_with-top .header__row {
  padding: 1.5rem 0;
}

.header.header_with-top .header__row:not(:last-child) {
  margin-bottom: 1.875rem;
}

/* Контент страницы — шапка уже в потоке, лишний отступ не нужен */
.page {
  padding-top: 0 !important;
}

.page__cart {
  padding-top: 2.5rem;
  padding-bottom: 3rem;
}
.header__box {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.header__box > .contacts-block,
.header__box > .header__contacts-block {
  gap: 3rem;
}

.contacts-block__item + .contacts-block__item {
  margin-left: 0;
}

/* Кнопка корзины в шапке */
.header__cart {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  margin-left: 0.5rem;
  border: none;
  cursor: pointer;
  border-radius: 0.625rem;
  background-color: var(--redBg);
  transition: opacity var(--s) var(--e), transform var(--s) var(--e);
  flex-shrink: 0;
}
.header__cart:hover {
  opacity: 0.88;
  transform: scale(1.04);
}
.header__cart svg {
  width: 1.625rem;
  height: 1.625rem;
  fill: var(--whiteColor);
}
.cart-btn__count {
  position: absolute;
  top: -0.375rem;
  right: -0.375rem;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.3125rem;
  border-radius: 50%;
  background-color: var(--blueBg);
  color: var(--whiteColor);
  font-size: 0.75rem;
  font-weight: var(--fontWeight_600);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border: 2px solid var(--whiteColor);
}
.cart-btn__count:empty,
.cart-btn__count[data-count="0"] {
  display: none;
}

/* Цена товара в каталоге */
.cards__price {
  text-align: center;
  font-size: 1.375rem;
  font-weight: var(--fontWeight_600);
  color: var(--redColor);
  margin-bottom: 0.875rem;
}
.cards__price-monthly {
  display: block;
  font-size: 0.875rem;
  font-weight: var(--fontWeight_400);
  color: var(--mainColor);
  margin-top: 0.25rem;
}

/* Кнопки в карточке товара */
.cards__block-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}
.cards__block-buttons .block-buttons__button {
  width: 100%;
}
.cards__block-buttons .block-buttons__button_cart {
  background-color: var(--blueBg);
}
.cards__block-buttons .block-buttons__button_cart:hover {
  opacity: 0.88;
}

/* Боковая панель корзины */
.cart-panel {
  position: fixed;
  inset: 0;
  z-index: 300;
  pointer-events: none;
  visibility: hidden;
}
.cart-panel._open {
  pointer-events: auto;
  visibility: visible;
}
.cart-panel__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.cart-panel._open .cart-panel__overlay {
  opacity: 1;
}
.cart-panel__drawer {
  position: absolute;
  top: 0;
  right: 0;
  width: min(26rem, 100vw);
  height: 100%;
  background: var(--whiteBg);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  box-shadow: -0.5rem 0 2rem rgba(0, 0, 0, 0.12);
}
.cart-panel._open .cart-panel__drawer {
  transform: translateX(0);
}
.cart-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #eee;
  background: var(--blueBg);
  color: var(--whiteColor);
}
.cart-panel__title {
  font-size: 1.25rem;
  font-weight: var(--fontWeight_600);
}
.cart-panel__close {
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: var(--whiteColor);
  border-radius: 0.375rem;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.cart-panel__close:hover {
  background: rgba(255, 255, 255, 0.25);
}
.cart-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem;
}
.cart-panel__empty {
  text-align: center;
  padding: 2rem 0;
  color: #888;
}
.cart-panel__items {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}
.cart-panel__item {
  display: flex;
  gap: 0.875rem;
  align-items: center;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid #f0f0f0;
}
.cart-panel__item-image {
  width: 3.5rem;
  height: 3.5rem;
  object-fit: contain;
  background: var(--mainBg);
  border-radius: 0.375rem;
  flex-shrink: 0;
}
.cart-panel__item-info {
  flex: 1;
  min-width: 0;
}
.cart-panel__item-name {
  font-size: 0.875rem;
  font-weight: var(--fontWeight_600);
  line-height: 1.3;
  margin-bottom: 0.25rem;
}
.cart-panel__item-price {
  color: var(--redColor);
  font-weight: var(--fontWeight_600);
  font-size: 0.9375rem;
}
.cart-panel__item-remove {
  background: none;
  border: none;
  color: #bbb;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}
.cart-panel__item-remove:hover {
  color: var(--redColor);
}
.cart-panel__footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid #eee;
  background: #fafafa;
}
.cart-panel__total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-weight: var(--fontWeight_600);
  font-size: 1.125rem;
}
.cart-panel__total-value {
  color: var(--redColor);
  font-size: 1.25rem;
}
.cart-panel__checkout {
  display: block;
  width: 100%;
  text-align: center;
  padding: 0.875rem;
  background: var(--redBg);
  color: var(--whiteColor);
  border-radius: 0.75rem;
  font-weight: var(--fontWeight_500);
  text-decoration: none;
}
.cart-panel__checkout:hover {
  opacity: 0.9;
}

/* Страница корзины */
.cart-page__title {
  margin-bottom: 2rem;
}
.cart-page__empty {
  text-align: center;
  padding: 3rem 1rem;
  background: var(--whiteBg);
  border-radius: 0.75rem;
}
.cart-page__empty p {
  margin-bottom: 1.5rem;
  font-size: 1.125rem;
}
.cart-page__items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}
.cart-item {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem;
  background: var(--whiteBg);
  border-radius: 0.75rem;
  box-shadow: 0 0.25rem 0.75rem rgba(238, 238, 238, 0.4);
}
.cart-item__image {
  flex: 0 0 5rem;
  width: 5rem;
  height: 5rem;
  object-fit: contain;
  border-radius: 0.5rem;
  background: var(--mainBg);
}
.cart-item__body {
  flex: 1;
  min-width: 0;
}
.cart-item__name {
  font-weight: var(--fontWeight_600);
  margin-bottom: 0.375rem;
  line-height: var(--lineHeight_130);
}
.cart-item__price {
  color: var(--redColor);
  font-weight: var(--fontWeight_600);
}
.cart-item__qty {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.cart-item__qty-btn {
  width: 2rem;
  height: 2rem;
  border: 1px solid #ddd;
  border-radius: 0.375rem;
  background: var(--whiteBg);
  cursor: pointer;
  font-size: 1.125rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cart-item__qty-btn:hover {
  border-color: var(--redBg);
}
.cart-item__qty-value {
  min-width: 1.5rem;
  text-align: center;
  font-weight: var(--fontWeight_600);
}
.cart-item__remove {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.25rem;
}
.cart-item__remove:hover {
  color: var(--redColor);
}
.cart-page__summary {
  background: var(--whiteBg);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
}
.cart-page__total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.25rem;
  font-weight: var(--fontWeight_600);
}
.cart-page__total-value {
  color: var(--redColor);
  font-size: 1.5rem;
}
.cart-page__form {
  background: var(--whiteBg);
  border-radius: 0.75rem;
  padding: 2rem;
}
.cart-page__form-title {
  margin-bottom: 1.5rem;
}

/* Белые инпуты в форме корзины */
.cart-page .input,
.cart-page textarea.input {
  background-color: var(--whiteBg) !important;
  color: var(--mainColor) !important;
  border: 1px solid #ddd !important;
}
.cart-page .input._form-focus {
  background-color: var(--whiteBg) !important;
  border-color: var(--redBg) !important;
}
.cart-page .input._form-error {
  border-color: red !important;
  background-color: #fff5f5 !important;
}
.cart-page .input[placeholder]::placeholder {
  color: #999 !important;
  opacity: 1 !important;
}

@media (max-width: 61.99875em) {
  /* Компактная верхняя панель на мобильном */
  .header-top__container {
    padding: 0.5rem 0.9375rem;
    gap: 0.375rem 1rem;
  }

  .header-top {
    font-size: 0.75rem;
  }

  .header-top__schedule {
    gap: 0.25rem 0.75rem;
  }

  .header-top__schedule .header-top__item + .header-top__item::before {
    margin-right: 0.75rem;
  }

  /* Мобильная шапка: только логотип + корзина + меню */
  .header.header_with-top .header__row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    grid-template-areas: "logo cart menu";
    align-items: center;
    column-gap: 0.75rem;
    padding: 0.75rem 0;
  }

  .header.header_with-top .header__row:not(:last-child) {
    margin-bottom: 0;
  }

  .header.header_with-top .header__logo {
    grid-area: logo;
  }

  .header.header_with-top .header__box {
    display: contents;
  }

  /* Контакты в шапке скрыты — они есть в верхней панели и в меню */
  .header.header_with-top .header__box > .contacts-block,
  .header.header_with-top .header__box > .header__contacts-block {
    display: none !important;
  }

  .header.header_with-top .header__cart {
    grid-area: cart;
    margin-left: 0;
    width: 2.75rem;
    height: 2.75rem;
  }

  .header.header_with-top .header__cart svg {
    width: 1.375rem;
    height: 1.375rem;
  }

  .header.header_with-top .icon-menu {
    grid-area: menu;
  }

  /* Открытое меню — поверх всего, без перекрытия шапкой */
  .menu-open .header-top {
    display: none;
  }

  .menu-open .header.header_with-top {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 300;
    background: transparent;
  }

  .menu-open .header.header_with-top .header__row::before {
    display: none;
  }

  .menu-open .header.header_with-top .header__row {
    position: relative;
    z-index: 310;
    padding: 0.875rem 0.9375rem;
    background: var(--blueBg);
  }

  .menu-open .header.header_with-top .header__image._mobile {
    filter: brightness(0) invert(1);
  }

  .menu-open .menu__body {
    z-index: 290;
    padding-top: 4.5rem;
  }

  .menu-open .menu__body::before {
    display: none;
  }

  /* Кнопка закрытия (крестик) — поверх меню */
  .menu-open .icon-menu {
    position: relative;
    z-index: 311;
    width: 2.75rem;
    height: 2.75rem;
    flex-shrink: 0;
    cursor: pointer;
  }

  .menu-open .icon-menu::before,
  .menu-open .icon-menu::after {
    background-color: var(--whiteColor) !important;
    width: 1.375rem;
    right: 0.6875rem;
  }

  /* Контакты только внутри меню */
  .contacts-block_mobile {
    display: flex !important;
    flex-direction: column;
    row-gap: 1rem;
    align-items: flex-start;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  .contacts-block_mobile .contacts-block__link {
    font-size: 1rem;
    color: var(--whiteColor);
  }
}

@media (max-width: 47.99875em) {
  .header-top__container {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    padding: 0.375rem 0.9375rem;
  }

  .header-top__schedule {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.125rem;
  }

  .header-top {
    font-size: 0.6875rem;
  }

  .header-top__phone img {
    width: 0.875rem;
    height: 0.875rem;
  }

  .page__cart {
    padding-top: 2rem;
  }

  .cart-item {
    flex-wrap: wrap;
  }

  .cart-item__qty {
    order: 3;
    width: 100%;
    justify-content: center;
    margin-top: 0.5rem;
  }

  .cart-panel__drawer {
    width: 100vw;
  }
}

@media (min-width: 48em) {
  .header-top__schedule .header-top__item + .header-top__item::before {
    content: "|";
    margin-right: 2rem;
    opacity: 0.4;
  }
}

/* Рейтинг в карточке каталога */
.cards__card_clickable {
  cursor: default;
}
.cards__name-link {
  color: inherit;
  text-decoration: none;
  transition: color var(--s) var(--e);
}
.cards__name-link:hover {
  color: var(--redColor);
}
.cards__picture-link {
  display: block;
}
.cards__rating {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.cards__rating-stars {
  display: flex;
  gap: 0.125rem;
}
.cards__rating-star {
  color: #ddd;
  font-size: 0.875rem;
  line-height: 1;
}
.cards__rating-star_full {
  color: #f5a623;
}
.cards__rating-value {
  font-size: 0.875rem;
  font-weight: var(--fontWeight_600);
}
.cards__rating-reviews {
  font-size: 0.8125rem;
  color: #888;
}
.block-buttons__button_details {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--mainBg);
  color: var(--mainColor);
  text-decoration: none;
}
.block-buttons__button_details:hover {
  opacity: 0.88;
}

/* Страница товара */
.page__product {
  padding-top: 2rem;
  padding-bottom: 3rem;
}
.product-page__container {
  max-width: 89.375rem;
  margin: 0 auto;
  padding: 0 0.9375rem;
}
.product-page__not-found {
  text-align: center;
  padding: 3rem 1rem;
  background: var(--whiteBg);
  border-radius: 0.75rem;
}
.product-page__not-found p {
  margin: 1rem 0 1.5rem;
  font-size: 1.125rem;
}
.product-page__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
  background: var(--whiteBg);
  border-radius: 0.75rem;
  padding: 2rem;
  box-shadow: 0 0.25rem 0.75rem rgba(238, 238, 238, 0.4);
}
.product-page__image-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--mainBg);
  border-radius: 0.75rem;
  padding: 2rem;
  min-height: 20rem;
}
.product-page__image {
  max-width: 100%;
  max-height: 22rem;
  object-fit: contain;
}
.product-page__title {
  margin-bottom: 1rem;
  font-size: 1.75rem;
  line-height: var(--lineHeight_130);
}
.product-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.product-rating__stars {
  display: flex;
  gap: 0.125rem;
}
.product-rating__star {
  color: #ddd;
  font-size: 1.125rem;
  line-height: 1;
}
.product-rating__star_full,
.product-rating__star_half {
  color: #f5a623;
}
.product-rating__value {
  font-weight: var(--fontWeight_600);
  font-size: 1rem;
}
.product-rating__reviews {
  color: #888;
  font-size: 0.9375rem;
}
.product-page__price {
  font-size: 2rem;
  font-weight: var(--fontWeight_600);
  color: var(--redColor);
  margin-bottom: 1.25rem;
}
.product-page__price-monthly {
  display: block;
  font-size: 1rem;
  font-weight: var(--fontWeight_400);
  color: var(--mainColor);
  margin-top: 0.375rem;
}
.product-page__benefits {
  list-style: none;
  margin-bottom: 1.5rem;
  padding: 0;
}
.product-page__benefits li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
  line-height: var(--lineHeight_150);
}
.product-page__benefits li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--redColor);
  font-weight: var(--fontWeight_600);
}
.product-page__actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.product-page__actions .block-buttons__button {
  width: 100%;
}
.product-page__details {
  background: var(--whiteBg);
  border-radius: 0.75rem;
  padding: 2rem;
  box-shadow: 0 0.25rem 0.75rem rgba(238, 238, 238, 0.4);
}
.product-page__section + .product-page__section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #eee;
}
.product-page__section-title {
  font-size: 1.375rem;
  font-weight: var(--fontWeight_600);
  margin-bottom: 1rem;
}
.product-page__description-block {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.product-page__description {
  line-height: var(--lineHeight_150);
  color: var(--mainColor);
  margin: 0;
}
.product-specs {
  width: 100%;
  border-collapse: collapse;
}
.product-specs tr:nth-child(even) {
  background: var(--mainBg);
}
.product-specs td {
  padding: 0.875rem 1rem;
  vertical-align: top;
}
.product-specs__label {
  font-weight: var(--fontWeight_600);
  width: 40%;
  color: #555;
}
.product-specs__value {
  color: var(--mainColor);
}

@media (max-width: 61.99875em) {
  .product-page__grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.25rem;
  }

  .product-page__image-wrap {
    min-height: 14rem;
    padding: 1.25rem;
  }

  .product-page__title {
    font-size: 1.375rem;
  }

  .product-page__price {
    font-size: 1.625rem;
  }

  .product-page__details {
    padding: 1.25rem;
  }

  .product-specs__label {
    width: 45%;
  }
}
