/* ТЕМА INGRIAFARM — страница корзины и чекаута (cart/index.blade.php).
   Тон темы: оранжевый #F39B2B — рамки и акценты (не заливки), Montserrat,
   светлая тема по умолчанию + .theme-dark. Степперы наследуют .if-qty из
   theme-extra.css; здесь — только раскладка страницы и её блоки. */

/* Тонкая лента шапки и волна «оранжевый → бумага» здесь больше не живут:
   рецепт стал дефолтом ВСЕЙ темы (theme-extra.css, «Единая шапка витрины»,
   волна .if-topwave в layouts/shop) — своя копия .if-cart-topwave удалена. */

.if-cart {
  max-width: 1120px;
  margin: 0 auto;
  padding: 8px 0 56px;
  font-family: 'Montserrat', sans-serif;
  color: #181411;
}
.theme-dark .if-cart { color: #f4f0ea; }

.if-cart__title {
  margin: 18px 0 22px;
  font: 800 clamp(26px, 4vw, 38px)/1.15 'Montserrat', sans-serif;
}

/* --- Сетка: позиции слева, оформление справа --------------------------- */
/* display:grid/flex перебил бы UA-стиль атрибута hidden (JS прячет сетку и
   шаги, когда корзина опустела без перезагрузки) — возвращаем явно. */
.if-cart__grid[hidden],
.if-cart__steps[hidden] { display: none !important; }
.if-cart__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
  gap: 26px;
  align-items: start;
}
@media (max-width: 900px) {
  .if-cart__grid { grid-template-columns: minmax(0, 1fr); }
}

/* --- Шаги покупки: Корзина → Оплата → Мгновенная выдача ------------------ */
.if-cart__steps {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: -6px 0 20px;
  padding: 0;
  list-style: none;
  font: 700 12.5px/1 'Montserrat', sans-serif;
}
.if-cart__step {
  display: flex;
  align-items: center;
  gap: 7px;
  opacity: 0.45;
}
.if-cart__step.is-current { opacity: 1; }
.if-cart__step-dot {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1.5px solid currentColor;
  border-radius: 8px;
  font-size: 11px;
}
.if-cart__step.is-current .if-cart__step-dot {
  border-color: #F39B2B;
  color: #b25e00;
}
.theme-dark .if-cart__step.is-current .if-cart__step-dot { color: #f6b96b; }
/* Молния выдачи — фирменный оранжевый даже в «будущем» шаге */
.if-cart__step--zap .if-cart__step-dot { color: #F39B2B; border-style: dashed; }
/* Пунктирная связка между шагами */
.if-cart__step + .if-cart__step::before {
  content: '';
  width: 26px;
  border-top: 2px dashed rgba(4, 0, 0, 0.2);
  margin-right: 7px;
}
.theme-dark .if-cart__step + .if-cart__step::before { border-top-color: rgba(255, 255, 255, 0.22); }

/* --- Плашка pending-заказа --------------------------------------------- */
.if-cart__pending {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: 0 0 18px;
  padding: 14px 18px;
  border: 2px solid #F39B2B;
  border-radius: 14px;
  background: transparent;
}
.if-cart__pending-body { flex: 1; min-width: 220px; }
.if-cart__pending-t { font-weight: 700; font-size: 15px; }
.if-cart__pending-s { margin-top: 4px; font-size: 13px; opacity: .75; }
.if-cart__pending-btn { padding: 10px 18px; font-size: 14px; }
.if-cart__pending-cancel {
  padding: 10px 14px;
  font: 600 13px/1 'Montserrat', sans-serif;
  color: inherit;
  opacity: .65;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.if-cart__pending-cancel:hover { opacity: 1; }

/* --- Панель «завершите оплату» (по этой корзине уже идёт оплата) --------- */
.if-cart__resume { border: 2px solid #F39B2B; text-align: center; }
.if-cart__resume-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(243, 155, 43, .14);
  color: #b25e00;
  font: 700 12px/1 'Montserrat', sans-serif;
}
.theme-dark .if-cart__resume-badge { color: #f6b96b; }
.if-cart__resume-amount { margin-top: 12px; font: 800 30px/1 'Montserrat', sans-serif; }
.if-cart__resume-timer { margin-top: 6px; font-size: 13.5px; opacity: .75; }
.if-cart__resume-timer b { font-weight: 800; opacity: 1; }
.if-cart__resume-btn { width: 100%; margin-top: 16px; }
.if-cart__resume-cancelform { margin-top: 10px; }
.if-cart__resume-cancel {
  font: 600 13px/1 'Montserrat', sans-serif;
  color: inherit;
  opacity: .6;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.if-cart__resume-cancel:hover { opacity: 1; }
.if-cart__resume-hint { margin-top: 12px; font-size: 12px; opacity: .55; line-height: 1.4; }

/* --- Уведомления (остаток изменился / ошибка чекаута) ------------------- */
.if-cart__notice {
  margin: 0 0 18px;
  padding: 12px 16px;
  border: 1px solid rgba(4, 0, 0, .18);
  border-left: 4px solid #F39B2B;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.45;
}
.if-cart__notice--error { border-left-color: #d64545; }
.theme-dark .if-cart__notice { border-color: rgba(255, 255, 255, .2); border-left-color: #F39B2B; }
.theme-dark .if-cart__notice--error { border-left-color: #e06666; }

/* --- Пустая корзина ----------------------------------------------------- */
.if-cart__empty {
  padding: 46px 20px 54px;
  border: 1px dashed rgba(4, 0, 0, .25);
  border-radius: 16px;
  text-align: center;
}
.theme-dark .if-cart__empty { border-color: rgba(255, 255, 255, .25); }
.if-cart__empty-cat { width: 96px; height: auto; margin-bottom: 10px; }
.if-cart__empty-t { font: 800 22px/1.2 'Montserrat', sans-serif; margin: 0 0 6px; }
.if-cart__empty-s { font-size: 14px; opacity: .7; margin: 0 0 20px; }
.if-cart__empty-btn { display: inline-flex; padding: 12px 26px; }

/* --- Позиции ------------------------------------------------------------ */
.if-cart__row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(4, 0, 0, .14);
  border-radius: 14px;
  background: #fff;
  transition: border-color .18s ease;
}
.if-cart__row + .if-cart__row { margin-top: 12px; }
.if-cart__row:hover { border-color: #F39B2B; }
.theme-dark .if-cart__row { background: #221f1c; border-color: rgba(255, 255, 255, .16); }
.theme-dark .if-cart__row:hover { border-color: #F39B2B; }

.if-cart__row-img {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(243, 155, 43, .10);
  display: grid;
  place-items: center;
}
.if-cart__row-img img { width: 100%; height: 100%; object-fit: contain; }

.if-cart__row-body { flex: 1; min-width: 140px; }
.if-cart__row-name {
  display: block;
  font: 700 15px/1.3 'Montserrat', sans-serif;
  color: inherit;
  text-decoration: none;
}
.if-cart__row-name:hover { color: #F39B2B; }
.if-cart__row-unit { display: block; margin-top: 3px; font-size: 13px; opacity: .65; }
.if-cart__row-stock {
  display: inline-block;
  margin-top: 5px;
  font: 600 12px/1 'Montserrat', sans-serif;
  color: #b25e00;
}
.theme-dark .if-cart__row-stock { color: #f6b96b; }

.if-cart__row-side { display: flex; align-items: center; gap: 14px; }
.if-cart__row-total {
  min-width: 74px;
  text-align: right;
  font: 800 15px/1 'Montserrat', sans-serif;
  white-space: nowrap;
}
.if-cart__row-removeform { display: contents; }
.if-cart__row-remove {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: inherit;
  opacity: .45;
  cursor: pointer;
  transition: opacity .15s ease, color .15s ease;
}
.if-cart__row-remove:hover { opacity: 1; color: #d64545; }

/* Строка «уезжает» при удалении (JS ставит класс) */
.if-cart__row.is-removing {
  opacity: 0;
  transform: translateX(14px);
  transition: opacity .22s ease, transform .22s ease;
  pointer-events: none;
}

/* Порог 700 (был 560): в одноколоночной сетке 561–700px строке уже тесно —
   имя сжималось в столбик рядом со степпером, суммой и крестиком */
@media (max-width: 700px) {
  .if-cart__row { flex-wrap: wrap; }
  .if-cart__row-side { width: 100%; justify-content: space-between; }
}
/* Пальцевые тап-таргеты корзины */
@media (pointer: coarse) {
  .if-cart__row-remove { width: 44px; height: 44px; }
  .if-cart__coupon-remove { min-width: 40px; min-height: 40px; }
}

/* --- Панели оформления --------------------------------------------------- */
.if-cart__panel {
  padding: 18px;
  border: 1px solid rgba(4, 0, 0, .14);
  border-radius: 14px;
  background: #fff;
}
.theme-dark .if-cart__panel { background: #221f1c; border-color: rgba(255, 255, 255, .16); }
.if-cart__panel + .if-cart__panel { margin-top: 16px; }

.if-cart__label {
  display: block;
  margin: 0 0 8px;
  font: 700 13px/1.2 'Montserrat', sans-serif;
  text-transform: uppercase;
  letter-spacing: .04em;
  opacity: .75;
}

.if-cart__input {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border: 1px solid rgba(4, 0, 0, .2);
  border-radius: 10px;
  background: transparent;
  font: 600 14px/1 'Montserrat', sans-serif;
  color: inherit;
}
.if-cart__input:focus { outline: none; border-color: #F39B2B; }
.theme-dark .if-cart__input { border-color: rgba(255, 255, 255, .22); }
.theme-dark .if-cart__input:focus { border-color: #F39B2B; }

.if-cart__err { margin: 8px 0 0; font: 600 13px/1.4 'Montserrat', sans-serif; color: #d64545; }
.theme-dark .if-cart__err { color: #e06666; }
.if-cart__hint { margin: 8px 0 0; font-size: 12.5px; line-height: 1.45; opacity: .65; }
.if-cart__link { color: #b25e00; font-weight: 700; }
.theme-dark .if-cart__link { color: #f6b96b; }

/* --- Промокод ------------------------------------------------------------ */
.if-cart__coupon-form { display: flex; gap: 8px; }
.if-cart__coupon-form .if-cart__input { flex: 1; min-width: 0; }
.if-cart__coupon-btn { flex: 0 0 auto; padding: 0 18px; height: 42px; font-size: 14px; }
.if-cart__coupon-applied {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border: 1px dashed #F39B2B;
  border-radius: 10px;
}
.if-cart__coupon-code { font: 800 14px/1 'Montserrat', sans-serif; letter-spacing: .05em; }
.if-cart__coupon-value { font: 700 14px/1 'Montserrat', sans-serif; color: #2e9e5b; }
.if-cart__coupon-removeform { margin-left: auto; display: contents; }
.if-cart__coupon-remove {
  margin-left: auto;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: inherit;
  opacity: .5;
  cursor: pointer;
}
.if-cart__coupon-remove:hover { opacity: 1; }

/* --- Баланс как способ оплаты (карточка-переключатель) ------------------- */
.if-balcard { display: block; cursor: pointer; margin: 0 0 12px; }
.if-balcard input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.if-balcard__card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid rgba(4, 0, 0, .18);
  border-radius: 12px;
  background: rgba(243, 155, 43, .05);
  transition: border-color .15s ease, background .15s ease;
}
.theme-dark .if-balcard__card { border-color: rgba(255, 255, 255, .2); }
.if-balcard:hover .if-balcard__card { border-color: rgba(243, 155, 43, .6); }
.if-balcard input:checked + .if-balcard__card {
  border: 2px solid #F39B2B;
  padding: 10px 12px;
  background: rgba(243, 155, 43, .1);
}
.if-balcard input:focus-visible + .if-balcard__card { outline: 2px solid #F39B2B; outline-offset: 2px; }
.if-balcard__ic {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(243, 155, 43, .16);
  color: #b25e00;
}
.theme-dark .if-balcard__ic { color: #f6b96b; }
.if-balcard__ic svg { width: 20px; height: 20px; }
.if-balcard__body { flex: 1; min-width: 0; }
.if-balcard__name { display: block; font: 700 14px/1.2 'Montserrat', sans-serif; }
.if-balcard__sub { display: block; margin-top: 2px; font-size: 12px; opacity: .6; }
/* Индикатор-галочка (квадрат с «птичкой» — не радио-точка, это тумблер) */
.if-balcard__check {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(4, 0, 0, .25);
  border-radius: 6px;
  position: relative;
}
.theme-dark .if-balcard__check { border-color: rgba(255, 255, 255, .3); }
.if-balcard input:checked + .if-balcard__card .if-balcard__check {
  border-color: #F39B2B;
  background: #F39B2B;
}
.if-balcard input:checked + .if-balcard__card .if-balcard__check::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
/* Сводка списания «X с баланса · доплата Y» */
.if-cart__balsplit {
  margin: 0 0 12px;
  font: 600 13px/1.35 'Montserrat', sans-serif;
  color: #b25e00;
}
.theme-dark .if-cart__balsplit { color: #f6b96b; }
.if-cart__balsplit[hidden] { display: none; }
.if-cart__guest { margin: 0 0 14px; }

/* --- Способ оплаты (карточки-радио) -------------------------------------- */
.if-cart__methods { border: 0; padding: 0; margin: 0 0 16px; }
.if-cart__methods legend { padding: 0; }
.if-payopt { display: block; cursor: pointer; }
.if-payopt + .if-payopt { margin-top: 8px; }
.if-payopt input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.if-payopt__card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid rgba(4, 0, 0, .18);
  border-radius: 12px;
  transition: border-color .15s ease;
}
.theme-dark .if-payopt__card { border-color: rgba(255, 255, 255, .2); }
.if-payopt:hover .if-payopt__card { border-color: rgba(243, 155, 43, .6); }
.if-payopt input:checked + .if-payopt__card { border: 2px solid #F39B2B; padding: 10px 12px; }
.if-payopt input:focus-visible + .if-payopt__card { outline: 2px solid #F39B2B; outline-offset: 2px; }

.if-payopt__ic {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(243, 155, 43, .12);
  color: #b25e00;
}
.theme-dark .if-payopt__ic { color: #f6b96b; }
.if-payopt__ic svg { width: 20px; height: 20px; }
.if-payopt__body { flex: 1; min-width: 0; }
.if-payopt__name { display: block; font: 700 14px/1.2 'Montserrat', sans-serif; }
.if-payopt__sub { display: block; margin-top: 2px; font-size: 12px; opacity: .6; }
.if-payopt__dot {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(4, 0, 0, .25);
  border-radius: 50%;
  position: relative;
}
.theme-dark .if-payopt__dot { border-color: rgba(255, 255, 255, .3); }
.if-payopt input:checked + .if-payopt__card .if-payopt__dot { border-color: #F39B2B; }
.if-payopt input:checked + .if-payopt__card .if-payopt__dot::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: #F39B2B;
}

/* --- Итоги и кнопка ------------------------------------------------------ */
.if-cart__totals { margin: 0 0 14px; padding-top: 14px; border-top: 1px dashed rgba(4, 0, 0, .18); }
/* display:flex у строк ниже перебил бы UA-стиль атрибута hidden — возвращаем */
.if-cart__totals [hidden] { display: none !important; }
.theme-dark .if-cart__totals { border-top-color: rgba(255, 255, 255, .2); }
.if-cart__subtotal { font-size: 14px; opacity: .55; text-decoration: line-through; text-align: right; }
.if-cart__discount {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font: 600 13.5px/1.3 'Montserrat', sans-serif;
  color: #2e9e5b;
}
.if-cart__total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 6px;
  font: 700 15px/1.2 'Montserrat', sans-serif;
}
.if-cart__total b { font: 800 26px/1 'Montserrat', sans-serif; }
.if-cart__uah { margin-top: 5px; text-align: right; font-size: 12.5px; opacity: .6; }

.if-cart__pay { width: 100%; padding: 15px 20px; font-size: 16px; }
.if-cart__pay:disabled { opacity: .55; cursor: default; }
.if-cart__note { margin: 10px 0 0; text-align: center; font-size: 12.5px; opacity: .6; }
.if-cart__consent { margin: 6px 0 0; text-align: center; font-size: 11.5px; line-height: 1.45; opacity: .45; }
