/* ============================================================
   checkout-page.css
   Rosbotanic P2 — двухколоночный cart (form + sticky summary)
   checkout.twig (accordion) — оставляем как есть, там свой поток
   Создано: 2026-07-28. STAMP: p2_2026-07-28_1446
   ============================================================ */

/* ------- CART: полноширинная 1140, sticky-итоги на desktop ------- */
@media (min-width: 992px) {

  /* Расширяем контентную колонку — убираем bootstrap-offset */
  #checkout-cart #content.col-sm-8,
  #checkout-cart #content.col-sm-offset-2,
  #checkout-cart > .row > #content {
    width: 100% !important;
    max-width: 1140px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    float: none !important;
  }

  /* Cart-wrapper — сетка 720 (form + accordion) + 380 (totals+CTA) */
  #checkout-cart .cart-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 720px) 380px;
    gap: 40px;
    align-items: start;
  }

  /* Левая колонка: form + panel-group */
  #checkout-cart .cart-wrapper > form,
  #checkout-cart .cart-wrapper > .panel-group {
    grid-column: 1;
    min-width: 0;
  }

  /* Правая колонка: totals + buttons */
  #checkout-cart .cart-wrapper > .row,
  #checkout-cart .cart-wrapper > .buttons {
    grid-column: 2;
    position: sticky;
    top: 88px;
    align-self: start;
    background: #FAFAF7;
    border: 1px solid rgba(46,42,36,0.08);
    border-radius: 8px;
    padding: 20px;
    margin: 0;
  }

  /* .row тоталов — базовое sticky уже применено выше */

  /* Убираем внутренний bootstrap-offset у ячейки с итогами */
  #checkout-cart .cart-wrapper .col-md-6.col-md-offset-6,
  #checkout-cart .cart-wrapper .col-sm-8.col-sm-offset-4 {
    width: 100% !important;
    margin-left: 0 !important;
  }

  /* Итоги — таблица без bootstrap-обёрток */
  #checkout-cart .cart-wrapper .table {
    margin-bottom: 16px;
  }

  /* Buttons row — центруется в правой колонке */
  #checkout-cart .cart-wrapper > .buttons {
    top: calc(88px + 200px);  /* смещение под totals */
    display: flex !important;
    flex-direction: column;
    gap: 12px;
  }

  #checkout-cart .cart-wrapper > .buttons > .pull-left,
  #checkout-cart .cart-wrapper > .buttons > .pull-right {
    float: none !important;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  #checkout-cart .cart-wrapper > .buttons .btn {
    width: 100%;
    margin: 0 !important;
  }

  /* Панели модулей внутри accordion — только левая колонка */
  #checkout-cart .cart-wrapper .panel-group#accordion {
    grid-column: 1;
    margin-top: 16px;
  }
}

/* ------- Tablet (768-991): full-width обычная колонка + sticky снизу ------- */
@media (min-width: 768px) and (max-width: 991px) {
  #checkout-cart #content.col-sm-8 {
    width: 100% !important;
    margin-left: 0 !important;
    max-width: 720px;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

/* ------- Общие мелочи cart ------- */
#checkout-cart h1.text-center {
  font-family: 'Lora', 'Georgia', serif;
  font-weight: 500;
  color: var(--rb-ink, #2E2A24);
}

/* Итоги — крупный total */
#checkout-cart .table tr:last-child td {
  font-size: 18px;
  font-weight: 600;
  padding-top: 14px;
  border-top: 1px solid rgba(46,42,36,0.15);
}

/* Primary кнопка checkout */
#checkout-cart .btn-primary {
  background: var(--rb-olive, #5C7F5A) !important;
  border-color: var(--rb-olive, #5C7F5A) !important;
  color: #fff !important;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 6px;
}
#checkout-cart .btn-primary:hover {
  background: #4d6a4b !important;
  border-color: #4d6a4b !important;
}

/* ------- CHECKOUT (accordion) — легкие правки, не ломающие поток ------- */
@media (min-width: 992px) {
  #checkout-checkout #content.col-sm-8,
  #checkout-checkout > .row > #content {
    width: 100% !important;
    max-width: 720px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    float: none !important;
  }

  /* Поля ввода — не тянуть на всю ширину */
  #checkout-checkout input[type='text'],
  #checkout-checkout input[type='email'],
  #checkout-checkout input[type='tel'],
  #checkout-checkout input[type='password'],
  #checkout-checkout select,
  #checkout-checkout textarea {
    max-width: 480px;
  }
}
