/* ==========================================================================
   Cart — refined minimal, scoped under .cartx
   Шрифт намеренно наследуется от темы (font: inherit), чтобы корзина не
   выбивалась из типографики сайта. Цвет акцента и радиусы — через переменные,
   меняйте --cartx-accent на ваш бренд.
   ========================================================================== */

.cartx {
  --cartx-ink: #1a1a1a;
  --cartx-muted: #8a8378;
  --cartx-line: #e7e3dc;
  --cartx-bg: #ffffff;
  --cartx-surface: #faf8f4;
  --cartx-hover: #f1ede6;
  --cartx-accent: #1a1a1a;      /* основная кнопка / активное состояние */
  --cartx-accent-ink: #ffffff;
  --cartx-danger: #b23b3b;
  --cartx-radius: 12px;
  --cartx-radius-sm: 8px;

  color: var(--cartx-ink);
  font: inherit;
  -webkit-font-smoothing: antialiased;
}

.cartx *,
.cartx *::before,
.cartx *::after { box-sizing: border-box; }


.woocommerce-cart .entry-header {
  width: 100%;
}
.woocommerce-cart .entry-header h1 {
  font-size: 1.4rem;
  line-height: 1.4rem;
  font-weight: 300;
  margin: 0;
  padding: 5px 15px 10px 15px;
  text-transform: uppercase;
  border-bottom: solid 1px #666;
}
.woocommerce-cart .entry-content .woocommerce {
  max-width: 800px;
  margin: 20px auto;
}


/* --------------------------------------------------------------------------
   Таблица позиций
   -------------------------------------------------------------------------- */
.cartx__table {
  width: 100%;
  max-width: 800px;
  border-collapse: collapse;
  margin: 0 0 1.75rem;
}

.cartx__table thead { display: none; }

.cartx__table thead .product-remove,
.cartx__table thead .product-thumbnail { width: 1%; }

.cartx__row {
  border-bottom: 1px solid var(--cartx-line);
  transition: opacity 0.2s ease;
}
.cartx__row > td {
  padding: 1rem 0.4rem;
  vertical-align: middle;
}
.cartx__row > td:first-child { padding-left: 0; }
.cartx__row > td:last-child { padding-right: 0; }

/* Удаление */
.cartx td.product-remove { width: 28px; }
.cartx__remove {
  display: inline-grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  color: var(--cartx-muted);
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.cartx__remove:hover {
  color: var(--cartx-danger);
  background: var(--cartx-hover);
  transform: scale(1.05);
}

/* Миниатюра */
.cartx__thumb { width: 88px; }
.cartx__thumb img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--cartx-radius-sm);
  display: block;
}

/* Название и мета */
.cartx__name a {
  color: var(--cartx-ink);
  text-decoration: none;
  font-weight: 600;
}
.cartx__name a:hover { text-decoration: underline; }
.cartx__name .variation {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  color: var(--cartx-muted);
  display: flex;
  flex-wrap: wrap;
}
.cartx__name .variation dt,
.cartx__name .variation dd,
.cartx__name .variation p { 
  width: 48%;
  font-size: 0.82rem;
  line-height: 0.9rem;
  margin: 0;
  padding: 0;
  height: 1rem;
}

.cartx .backorder_notification {
  display: flex;
  justify-content: center;
  align-items: center;
  width: max-content;
  margin: 0.45rem 0 0;
  padding: 0.2rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--cartx-accent);
  background: var(--cartx-surface);
  border: 1px solid var(--cartx-line);
  border-radius: 5px;
}

.cartx__price { color: var(--cartx-muted); }
.cartx__subtotal { font-weight: 600; white-space: nowrap; }
.cartx__subtotal del { color: var(--cartx-muted); font-weight: 400; margin-right: 0.35rem; }

/* --------------------------------------------------------------------------
   Степпер количества
   -------------------------------------------------------------------------- */
.cartx-stepper {
  display: inline-flex;
  align-items: center;
  height: 42px;
  background: var(--cartx-bg);
  border: 1px solid var(--cartx-line);
  border-radius: 999px;
  overflow: hidden;
  transition: opacity 0.2s ease, border-color 0.15s ease;
}
.cartx-stepper.is-loading { opacity: 0.55; pointer-events: none; }

.cartx-stepper__btn {
  appearance: none;
  width: 40px;
  height: 100%;
  border: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  color: var(--cartx-ink);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.cartx-stepper__btn:hover:not(:disabled) { background: var(--cartx-hover); }
.cartx-stepper__btn:disabled { color: var(--cartx-line); cursor: not-allowed; }

.cartx-stepper__field {
  width: 46px;
  height: 100%;
  border: 0;
  background: transparent;
  text-align: center;
  font: inherit;
  font-weight: 600;
  color: var(--cartx-ink);
  -moz-appearance: textfield;
  appearance: textfield;
}
.cartx-stepper__field:focus { outline: none; }
.cartx-stepper__field::-webkit-outer-spin-button,
.cartx-stepper__field::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.cartx-stepper input {
  user-select: none;
  pointer-events: none;
}

.cartx-stepper--single {
  justify-content: center;
  width: 42px;
  cursor: default;
}
.cartx-stepper__single { font-weight: 600; }

/* --------------------------------------------------------------------------
   Действия / промокод
   -------------------------------------------------------------------------- */
.cartx__actions {
  display: none;
}

/* Фолбэк-кнопка «Обновить корзину»: при активном JS не нужна */
.cartx--js .cartx__update { display: none; }

.cartx .coupon {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
/* По умолчанию (JS активен) поле и кнопка скрыты — показываем по тоггл-клику */
.cartx--js .cartx-promo .cartx-promo__input,
.cartx--js .cartx-promo .cartx-promo__apply { display: none; }
.cartx--js .cartx-promo.is-open .cartx-promo__toggle { display: none; }
.cartx--js .cartx-promo.is-open .cartx-promo__input,
.cartx--js .cartx-promo.is-open .cartx-promo__apply { display: inline-flex; }

.cartx-promo__toggle {
  appearance: none;
  border: 1px dashed var(--cartx-line);
  background: var(--cartx-surface);
  color: var(--cartx-ink);
  font: inherit;
  font-weight: 600;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.cartx-promo__toggle:hover { border-color: var(--cartx-ink); }

.cartx-promo__input {
  height: 42px;
  padding: 0 0.9rem;
  border: 1px solid var(--cartx-line);
  border-radius: 999px;
  font: inherit;
  background: var(--cartx-bg);
  min-width: 180px;
}
.cartx-promo__input:focus { outline: none; border-color: var(--cartx-ink); }

/* --------------------------------------------------------------------------
   Кнопки общего вида
   -------------------------------------------------------------------------- */
.cartx .button,
.cartx-promo__apply {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 1.25rem;
  border: 0;
  border-radius: 999px;
  background: var(--cartx-accent);
  color: var(--cartx-accent-ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.15s ease;
}
.cartx .button:hover,
.cartx-promo__apply:hover { transform: translateY(-1px); opacity: 0.92; }
.cartx .button:active { transform: translateY(0); }

/* --------------------------------------------------------------------------
   Collaterals (итоги)
   -------------------------------------------------------------------------- */


.cartx .cart_totals { transition: opacity 0.2s ease; }
.cartx .cart_totals.cartx-busy { opacity: 0.5; pointer-events: none; }
.cartx .cart_totals table { width: 100%; border-collapse: collapse; }
.cartx .cart_totals th,
.cartx .cart_totals td {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--cartx-line);
  text-align: left;
}


/* mmm */
.site-main {
  margin: 0;
  padding: 0;
}
.site-main .woocommerce {
  padding: 0 15px;
}
.woocommerce-message {
  display: none !important;
}
.cartx__row bdi {
  white-space: nowrap;
}
.cart-collaterals {
  width: 100%;
  max-width: 800px;
}
.cartx .cart_totals h2,
.cartx .cart_totals .cart-subtotal th,
.cartx .cart_totals .shipping,
.cartx .cart_totals .order-total {
  display: none;
}
.cartx .cartx-collaterals__title,
.cartx .cart-subtotal td,
.cartx .cartx-collaterals__note {
  width: 100%;
  text-align: center;
}
.cartx .cart-subtotal td {
  padding: 5px 0 25px 0;
}
.cartx .cart_totals .wc-proceed-to-checkout .checkout-button {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background-color: #f9c89d !important;
  color: #000;
  margin: 15px 0;
  padding: 0 15px !important;
  height: 40px !important;
  font-size: 1rem !important;
  line-height: 1rem !important;
  border-radius: 3px;
}
.cartx .cartx-collaterals__note {
  margin: 0 0 50px 0;
}

@media (max-width: 991px) {
  .entry-header {
    margin: 0 !important;
  }
  .cartx .cartx__row {
    display: flex;
    align-items: flex-start;
    padding: 20px 0;
  }
  .cartx .cartx__row td {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin: 0;
    padding: 0;
    height: auto;
    min-height: 80px;
  }
  .cartx .cartx__row td .variation {
    width: 100%;
  }

  .cartx td.product-remove,
  .cartx td.product-remove a {
    width: 15px;
  }
  .cartx .cartx__thumb {
    display: block !important;
    width: 80px !important;
    padding: 10px !important;
  }
  .cartx .cartx__thumb a img {
    width: 40px;
    height: 50px;
  }
  .cartx .cartx__name {
    position: relative;
  }
  .cartx .cartx__name,
  .cartx .cartx__name a {
    display: block !important;
    font-size: 0.7rem;
    line-height: 0.9rem;
  }
  .cartx .cartx__name dl,
  .cartx .cartx__name dt,
  .cartx .cartx__name dd,
  .cartx .cartx__name p {
    font-size: 0.5rem;
    line-height: 0.7rem;
    height: 0.7rem;
  }
  .cartx__price bdi,
  .cartx__price span {
    display: none;
  }
  .cartx__qty .cartx-stepper {
    height: 36px;
  }
  .cartx__qty .cartx-stepper button,
  .cartx__qty .cartx-stepper input {
    width: 20px;
    font-size: 0.8rem;
    line-height: 0.8rem;
  }
  .cartx__row .cartx__subtotal {
    padding: 0 0 0 0.8rem !important;
  }
  .cartx__row .cartx__subtotal span,
  .cartx__row .cartx__subtotal bdi {
    font-size: 0.8rem;
    line-height: 0.8rem;
  }
  .cartx .backorder_notification {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 60px !important;
    height: 0.9rem !important;
    margin: 0 !important;
    padding: 0 !important;
    position: absolute;
    top: 72px;
    left: -70px;
    font-size: 0.5rem !important;
    font-weight: 400 !important;
    border-radius: 3px !important;
  }
}

/* потом убрать */
.cartx .cartx-crosssell {
  display: none;
}



.cartx .cart_totals .order-total td {
  font-size: 1.05rem;
  font-weight: 700;
  border-bottom: 0;
}
.cartx .cart_totals .checkout-button {
  display: flex;
  width: 100%;
  margin-top: 1rem;
  height: 48px;
  font-size: 1rem;
}

/* --------------------------------------------------------------------------
   Cross-sells: всплывающая панель снизу справа
   -------------------------------------------------------------------------- */
.cartx-crosssell {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 60;
  width: min(340px, calc(100vw - 2.5rem));
  max-height: 70vh;
  overflow-y: auto;
  padding: 1.25rem;
  background: var(--cartx-bg);
  border: 1px solid var(--cartx-line);
  border-radius: var(--cartx-radius);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.35);
  transform: translateY(120%);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
  pointer-events: none;
}
.cartx-crosssell.is-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.cartx-crosssell > h2 {
  margin: 0 2rem 0.9rem 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}
.cartx-crosssell__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: var(--cartx-surface);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.cartx-crosssell__close::before {
  content: "+";
  display: block;
  font-size: 20px;
  line-height: 28px;
  color: var(--cartx-ink);
  transform: rotate(45deg);
}
.cartx-crosssell__close:hover { background: var(--cartx-hover); transform: rotate(90deg); }

/* --------------------------------------------------------------------------
   Адаптив: на узких экранах раскладываем строки карточками (data-title)
   -------------------------------------------------------------------------- */

