/* =====================================================
   СТРАНИЦА КОРЗИНЫ
===================================================== */

.orderpage {
  margin-top: 15px;
  padding-top: 30px;
  padding-bottom: 60px;
}

/* Хлебные крошки */
.bread {
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.4;
  font-weight: 300;
}

.bread a,
.woocommerce-breadcrumb a {
  font-family: var(--font-family);
  font-weight: 300;
  font-size: 13px;
  line-height: 140%;
  letter-spacing: 0.01em;
  color: var(--dark);
}

nav.bread .woocommerce-breadcrumb {
  font-size: 13px;
  font-weight: 300;
}

/* Шапка корзины */
.order_top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.order_top_info {
  display: flex;
  gap: 12px;
  align-items: center;
}

.order_top-title {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.4;
}

.order_top-p {
  font-size: 14px;
  line-height: 1.4;
  color: var(--grey, #888);
}

/* Кнопка оформления (мобайл) */
.add_order_btn {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--bright-yellow, #FFC74E);
  color: var(--dark, #121212);
  font-weight: 600;
  text-decoration: none;
}

.add_order_btn-top {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.add_order_btn-bottom {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 400;
}

/* =====================================================
   ПУСТАЯ КОРЗИНА
===================================================== */
.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 20px;
  gap: 24px;
}

.cart-empty__icon svg {
  width: 64px;
  height: 64px;
}

.cart-empty__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.cart-empty__title {
  font-size: 22px;
  font-weight: 600;
}

.cart-empty__text {
  font-size: 14px;
  color: var(--grey, #888);
}

.cart-empty__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 10px;
  background: var(--bright-yellow, #FFC74E);
  color: var(--dark, #121212);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: opacity .2s;
}

.cart-empty__btn:hover {
  opacity: .85;
}

/* =====================================================
   ФИЛЬТРЫ / СОРТИРОВКА
===================================================== */
.cart {
  margin-bottom: 30px;
}

.order_top-filters {
  display: flex;
  justify-content: space-between;
  margin-bottom: 24px;
}

.order_top-filters-inner,
.order_bottom-filters-inner {
  display: flex;
  gap: 6px;
  cursor: pointer;
  align-items: center;
}

.order_top-filters-inner svg,
.order_bottom-filters-inner svg {
  fill: var(--dark, #121212);
}

.order_top-filters-inner:hover svg,
.order_bottom-filters-inner:hover svg {
  fill: var(--bright-yellow, #FFC74E);
}

.order_top-filters-text,
.order_bottom-filters-text {
  font-size: 14px;
  line-height: 1.4;
}

.order_top-filters-inner:hover .order_top-filters-text,
.order_bottom-filters-inner:hover .order_bottom-filters-text {
  color: var(--bright-yellow, #FFC74E);
}

.order_top-filters-right {
  display: flex;
  gap: 24px;
}

/* Дропдаун сортировки */
.order-filter {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.order-filter__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  padding: 8px 0;
  min-width: 220px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,.15);
  display: none;
  z-index: 50;
}

.order-filter.is-open .order-filter__menu {
  display: block;
}

.order-filter__option {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 8px 14px;
  font: 14px/1.4 inherit;
  cursor: pointer;
}

.order-filter__option:hover {
  background: #f5f5f5;
}

.order-filter__option.is-active {
  font-weight: 600;
}

/* Строка массовых действий */
.order_bottom-filters {
  display: flex;
  gap: 32px;
  align-items: center;
  margin-bottom: 12px;
  position: sticky;
  top: 60px;
  z-index: 10;
  background: rgba(255,255,255,.95);
  padding: 10px;
  backdrop-filter: blur(4px);
}

.order_bottom-filters-choose {
  font-size: 14px;
  font-weight: 600;
}

.order_bottom-filters_right {
  display: flex;
  gap: 32px;
  margin-left: auto;
}

/* Чекбоксы */
.custom-checkbox {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 14px;
  gap: 8px;
  user-select: none;
}

.custom-checkbox input[type="checkbox"] {
  display: none;
}

.checkmark {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border: 1px solid var(--bright-yellow, #FFC74E);
  border-radius: 4px;
  background: #fff;
  transition: background .2s;
}

.custom-checkbox input[type="checkbox"]:checked + .checkmark {
  background: var(--bright-yellow, #FFC74E) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='11' viewBox='0 0 14 11'%3E%3Cpath d='M1 5.5L5 9.5L13 1.5' stroke='%23634607' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat;
}

.cart_checkbox {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.cart_checkbox input[type="checkbox"] {
  display: none;
}

.cart_checkmark {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border: 1px solid var(--bright-yellow, #FFC74E);
  border-radius: 4px;
  background: #fff;
  transition: background .2s;
}

.cart_checkbox input[type="checkbox"]:checked + .cart_checkmark {
  background: var(--bright-yellow, #FFC74E) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='8' viewBox='0 0 10 8'%3E%3Cpath d='M1 4L3.5 6.5L9 1' stroke='%23634607' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/10px no-repeat;
}

/* =====================================================
   БЛОК ТОВАРЫ + ИТОГ
===================================================== */
.block_order {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.woocommerce-cart-form {
  flex: 1;
  min-width: 0;
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* =====================================================
   СТРОКА ТОВАРА
===================================================== */
.cart-item {
  border-bottom: 1px solid var(--transparent-grey, #f0f0f0);
  font-size: 14px;
  line-height: 1.4;
  padding: 16px 0;
}

.cart-item__body {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.cart-item_left {
  display: flex;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.card-item__body_inner {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  flex-shrink: 0;
}

/* Чекбокс */
.cart-item__select {
  padding-top: 36px;
  flex-shrink: 0;
}

/* Колонки */
.cart-item__col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cart-item__col-left {
  flex-shrink: 0;
  width: 126px;
}

.cart-item__col--info {
  flex: 1;
  min-width: 0;
}

.cart-item__col--price {
  align-items: flex-end;
  min-width: 80px;
}

.cart-item__col--qty {
  align-items: center;
  min-width: 100px;
}

.cart-item__col--sum {
  align-items: flex-end;
  min-width: 90px;
}

.cart-item__col--actions {
  align-items: center;
  justify-content: flex-end;
  min-width: 32px;
}

/* Изображение */
.cart-item__img-wrap {
  display: block;
  width: 126px;
  height: 126px;
  overflow: hidden;
  background: #f5f5f5;
  border-radius: 8px;
}

.cart-item__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Артикул */
.cart-item__art {
  font-size: 10px;
  color: var(--grey, #888);
  line-height: 1.4;
}

/* Название */
.cart-item__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--dark, #121212);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

a.cart-item__title:hover {
  color: var(--bright-yellow, #FFC74E);
}

/* Мета / вариации */
.cart-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 12px;
  color: var(--grey, #888);
}

/* Скрытая цена (показывается на мобайле) */
.cart-item__price_block {
  display: none;
  font-size: 13px;
  color: var(--grey, #888);
}

/* Цена */
.cart-item__price,
.cart-item__sum {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}

.cart-item__price .woocommerce-Price-amount,
.cart-item__sum .woocommerce-Price-amount {
  font-size: inherit;
  font-weight: inherit;
}

.cart-item__sum-hint {
  font-size: 10px;
  color: var(--grey, #888);
}

/* Счётчик количества */
.cart-qty {
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  border: 1px solid #f5c977;
  padding: 4px 8px;
  gap: 4px;
  font-weight: 600;
}

.cart-qty__btn {
  border: none;
  background: transparent;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  color: var(--dark, #121212);
  transition: color .15s;
}

.cart-qty__btn:hover {
  color: var(--bright-yellow, #FFC74E);
}

.cart-qty__value {
  width: 36px;
  text-align: center;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  -moz-appearance: textfield;
}

.cart-qty__value::-webkit-outer-spin-button,
.cart-qty__value::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

.cart-qty__hint {
  font-size: 11px;
  color: var(--grey, #888);
  text-align: center;
}

/* Кнопка удаления */
.cart-icon-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background .15s;
  text-decoration: none;
}

.cart-icon-btn:hover {
  background: #fdeaea;
}

.cart-icon-btn:hover svg path {
  fill: #e53935;
}

/* =====================================================
   БОКОВОЙ БЛОК: ИТОГ
===================================================== */
.checkout-card__box {
  width: 320px;
  flex-shrink: 0;
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Сводка */
.checkout-summary {
  background: #f6f6f6;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkout-summary__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--dark, #121212);
}

.checkout-summary__row_total {
  font-weight: 600;
  border-top: 1px solid #e5e5e5;
  padding-top: 12px;
}

.checkout-summary__label {
  font-size: 15px;
  font-weight: 600;
}

.checkout-summary__meta {
  font-weight: 400;
  font-size: 11px;
  color: var(--grey, #888);
  margin-left: 4px;
}

.checkout-summary__total {
  font-size: 16px;
  font-weight: 700;
}

.checkout-summary__discount {
  color: #e53935;
  font-weight: 600;
}

.checkout-summary__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border-radius: 10px;
  background: var(--bright-yellow, #F0C568);
  color: var(--dark, #121212);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: opacity .2s;
  margin-top: 4px;
}

.checkout-summary__btn:hover {
  opacity: .85;
}

.checkout-summary__btn svg {
  fill: currentColor;
}

/* Выгодное предложение */
.checkout-offer {
  background: #f6f6f6;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkout-offer__title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--grey, #888);
}

.checkout-offer__card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.checkout-offer__img-wrap {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  display: block;
}

.checkout-offer__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.checkout-offer__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.checkout-offer__name {
  font-size: 12px;
  font-weight: 400;
  color: var(--dark, #121212);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.checkout-offer__name:hover {
  color: var(--bright-yellow, #FFC74E);
}

.checkout-offer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.checkout-offer__price {
  font-size: 13px;
  font-weight: 700;
}

.checkout-offer__btn {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--bright-yellow, #FFC74E);
  color: var(--dark, #121212);
  background: transparent;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, color .15s;
  cursor: pointer;
}

.checkout-offer__btn:hover,
.checkout-offer__btn.checkout-offer__btn--in-cart {
  background: var(--bright-yellow, #FFC74E);
  color: var(--dark, #121212);
}

/* =====================================================
   МОДАЛЬНОЕ ОКНО: ДОБАВИТЬ ПО АРТИКУЛУ
===================================================== */
.art-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn .2s ease;
}

.art-modal[hidden] {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.art-modal__card {
  background: #fff;
  border-radius: 16px;
  padding: 28px 24px;
  width: 100%;
  max-width: 480px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 16px 48px rgba(0,0,0,.18);
  animation: slideUp .22s ease;
}

@keyframes slideUp {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.art-modal__close {
  position: absolute;
  top: 14px;
  right: 16px;
  border: none;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  color: var(--grey, #888);
  line-height: 1;
  transition: color .15s;
}

.art-modal__close:hover {
  color: var(--dark, #121212);
}

.art-modal__text {
  font-size: 13px;
  line-height: 1.6;
  color: var(--dark, #121212);
  padding-right: 20px;
}

.art-modal__field {
  display: block;
}

.art-modal__textarea {
  width: 100%;
  min-height: 100px;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  outline: none;
  transition: border-color .15s;
}

.art-modal__textarea:focus {
  border-color: var(--bright-yellow, #FFC74E);
}

.art-modal__hint {
  font-size: 12px;
  color: var(--grey, #888);
}

.art-modal__hint span {
  font-family: monospace;
  background: #f5f5f5;
  padding: 1px 4px;
  border-radius: 3px;
}

.art-modal__divider {
  height: 1px;
  background: #f0f0f0;
}

.art-modal__submit {
  align-self: flex-start;
  padding: 11px 28px;
  border: none;
  border-radius: 8px;
  background: var(--bright-yellow, #F0C568);
  color: var(--dark, #121212);
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: opacity .15s;
}

.art-modal__submit:hover {
  opacity: .85;
}

.art-modal__result {
  font-size: 13px;
  min-height: 20px;
}

.art-modal__result--success {
  color: #2e7d32;
}

.art-modal__result--error {
  color: #c62828;
}

/* =====================================================
   АДАПТИВ
===================================================== */
@media (max-width: 1100px) {
  .block_order {
    flex-direction: column;
  }

  .checkout-card__box {
    width: 100%;
    position: static;
  }

  .order_top-filters {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .order_top{
    flex-wrap: wrap;
  }
  #basket_page .add_order_btn {
    display: flex;
    width: 100%;
  }
  .add_order_btn-top{
    font-size: 14px;
    justify-content: center;
  }
  .add_order_btn-bottom{
    justify-content: center;
  }

  .order_top-filters {
    flex-direction: column;
    gap: 12px;
  }

  /* Тело товара: строка 1 = картинка+название, строка 2 = qty+сумма */
  .cart-item__body {
    flex-wrap: wrap;
    gap: 8px;
  }

  .cart-item__select {
    padding-top: 4px;
  }

  /* Левая часть (картинка + название): занимает строку рядом с чекбоксом */
  .cart-item_left {
    flex: 1;
    min-width: 0;
    gap: 10px;
    align-items: flex-start;
  }

  /* Картинка — компактная */
  .cart-item__col-left {
    width: 70px;
    flex-shrink: 0;
  }

  .cart-item__img-wrap {
    width: 70px;
    height: 70px;
  }

  /* Название и мета занимают оставшееся место в строке */
  .cart-item__col--info {
    flex: 1;
    min-width: 0;
  }

  /* Скрытая мобильная цена в info — не нужна */
  .cart-item__price_block {
    display: none;
  }

  /* Нижняя строка: qty + сумма */
  .card-item__body_inner {
    width: 100%;
    flex-wrap: nowrap;
    gap: 16px;
    align-items: center;
    /* отступ = чекбокс(16) + gap(8) = визуально под картинкой */
    padding-left: 24px;
  }

  /* Скрываем цену за штуку — она будет видна через cart-item__sum-hint */
  .cart-item__col--price {
    display: none;
  }

  /* Количество — показываем */
  .cart-item__col--qty {
    min-width: unset;
    align-items: flex-start;
  }

  /* Сумма — показываем */
  .cart-item__col--sum {
    min-width: unset;
    align-items: flex-start;
  }

  /* Кнопка удаления — скрываем (слишком тесно) */
  .cart-item__col--actions {
    display: none;
  }
}
