/* Мобильная вёрстка магазина: корзина, оформление заказа, статус заказа, кабинет (21.10.2026).
   Подключается на всех страницах после header.css (includes/header.php, с ?v=<mtime>). */

/* ===== Общее: ничего не шире экрана ===== */
/* Длинные слова и номера переносятся, а не распирают блок */
.dm-page { overflow-wrap: break-word; }
.order-title { overflow-wrap: anywhere; }
/* Элемент сетки по умолчанию не уже своего содержимого (min-width: auto) — широкая таблица растягивала колонку 1fr */
.dm-cart-layout > *,
.dm-page [style*="grid-template-columns"] > * { min-width: 0; }

/* ===== Корзина (includes/cart_page.php): десктоп — прежний вид ===== */
.cart-t { width: 100%; font-size: 14px; border-collapse: collapse; min-width: 600px; }
.cart-t thead tr { border-bottom: 1px solid rgba(0,212,255,.1); }
.cart-t__th { padding: 12px 16px; text-align: left; color: #79a8c2; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
.cart-t__th--c { text-align: center; }
.cart-t__row { border-bottom: 1px solid rgba(0,212,255,.1); }
.cart-t__row > td { padding: 16px; text-align: center; }
.cart-t__row > td.cart-t__product { text-align: left; }
.cart-t__product-inner { display: flex; align-items: center; gap: 16px; }
.cart-t__product-inner > picture { flex-shrink: 0; line-height: 0; }
.cart-t__img { width: 60px; height: 60px; object-fit: contain; background: #fff; border-radius: 8px; flex-shrink: 0; }
.cart-t__name { color: #fff; text-decoration: none; font-weight: 600; }
.cart-t__article { font-size: 12px; color: #79a8c2; margin-top: 4px; }
.cart-t__badge { display: inline-block; margin-top: 4px; font-size: 12px; padding: 2px 8px; border-radius: 999px; }
.cart-t__badge--few { background: rgba(250,204,21,.2); color: #facc15; }
.cart-t__badge--out { background: rgba(107,114,128,.2); color: #d1d5db; }
.cart-t__old { font-size: 13px; color: #79a8c2; text-decoration: line-through; display: block; }
.cart-t__unit-price { font-weight: 600; color: #fff; }
.cart-t__unit { font-size: 12px; color: #79a8c2; }
.cart-t__qty-input { width: 80px; padding: 8px; background: #0a1a2e; border: 1px solid rgba(0,212,255,.3); color: #d4ecf5; border-radius: 8px; text-align: center; }
.cart-t__step { display: none; }
.cart-t__row > td.cart-t__sum { font-weight: 600; color: #38bdf8; }
.cart-t__remove-btn { background: none; border: none; color: #79a8c2; cursor: pointer; transition: color .2s; padding: 0; display: inline-flex; align-items: center; gap: 6px; font: inherit; }
.cart-t__remove-btn .material-symbols-outlined { font-size: 20px; }
.cart-t__remove-text { display: none; }
.cart-actions { display: flex; justify-content: space-between; margin-top: 16px; }
.cart-actions__clear { background: none; border: none; color: #79a8c2; cursor: pointer; display: flex; align-items: center; gap: 6px; font-size: 13px; transition: color .2s; }
.cart-actions__update { padding: 10px 20px; font-size: 12px; }

/* Сумма в составе заказа (оформление, статус заказа) не разрывается */
.order-sum td:last-child { white-space: nowrap; padding-left: 12px; vertical-align: top; }

/* ===== Телефоны ===== */
@media (max-width: 700px) {
  /* Поля ввода ≥ 16 px — iPhone не увеличивает страницу при фокусе */
  .dm-page input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  .dm-page select,
  .dm-page textarea { font-size: 16px; max-width: 100%; }
  .dm-search__input { font-size: 16px !important; }
  .dm-page .dm-btn { white-space: normal; text-align: center; min-height: 44px; }

  /* Корзина: строки таблицы → карточки */
  .cart-t { min-width: 0; }
  .cart-t, .cart-t tbody, .cart-t__row, .cart-t__row > td { display: block; }
  .cart-t thead { display: none; }
  .cart-t__row { padding: 14px 14px 8px; }
  .cart-t__row > td { padding: 0; text-align: left; }
  .cart-t__row > td.cart-t__product { margin-bottom: 8px; }
  .cart-t__product-inner { align-items: flex-start; gap: 12px; }
  .cart-t__img { width: 64px; height: 64px; }
  .cart-t__name { font-size: 15px; line-height: 1.35; }
  .cart-t__row > td.cart-t__price,
  .cart-t__row > td.cart-t__qty,
  .cart-t__row > td.cart-t__sum { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; }
  .cart-t__price::before,
  .cart-t__qty::before,
  .cart-t__sum::before { content: attr(data-label); font-size: 13px; font-weight: 400; color: #79a8c2; }
  .cart-t__value { text-align: right; }
  .cart-t__old { display: inline; margin-right: 6px; }
  .cart-t__sum .cart-t__value { font-size: 16px; }
  .cart-t__stepper { display: inline-flex; align-items: center; gap: 4px; }
  .cart-t__step {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; padding: 0; border-radius: 10px;
    border: 1px solid rgba(0,212,255,.3); background: #0a1a2e; color: #d4ecf5;
    font: 600 22px/1 Montserrat, sans-serif; cursor: pointer; touch-action: manipulation;
  }
  .cart-t__qty-input { width: 52px; height: 44px; padding: 4px; font-size: 16px; -moz-appearance: textfield; appearance: textfield; }
  .cart-t__qty-input::-webkit-inner-spin-button,
  .cart-t__qty-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
  .cart-t__row > td.cart-t__remove { text-align: right; }
  .cart-t__remove-btn { min-height: 44px; padding: 0 2px; font-size: 14px; }
  .cart-t__remove-text { display: inline; }
  .cart-actions { flex-direction: column-reverse; gap: 8px; }
  .cart-actions__update { width: 100%; min-height: 48px; justify-content: center; font-size: 13px; }
  .cart-actions__clear { width: 100%; min-height: 44px; justify-content: center; font-size: 14px; }
  .cart-summary { position: static !important; padding: 20px !important; }
  .cart-summary .dm-btn { min-height: 52px; }

  /* Оформление заказа */
  #checkoutForm .dm-partners-list { padding: 18px !important; }
  #checkoutForm input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  #checkoutForm select,
  #checkoutForm textarea { min-height: 44px; padding: 10px 12px !important; }
  #checkoutForm input[type="radio"],
  #checkoutForm input[type="checkbox"] { width: 20px; height: 20px; flex-shrink: 0; margin: 0; }
  #checkoutForm label:has(> input[type="radio"]) { min-height: 44px; font-size: 15px !important; }
  .co-consent { font-size: 14px !important; line-height: 1.45; gap: 10px !important; }
  .co-consent input[type="checkbox"] { margin-top: 1px !important; }
  .co-submit { min-height: 52px; font-size: 15px !important; }
  .order-sum td { font-size: 14px; }
}

@media (max-width: 700px) {
  /* Таблицы кабинета (список заказов, состав заказа) → карточки «подпись — значение» */
  .stack-t { min-width: 0 !important; }
  .stack-t thead { display: none; }
  .stack-t, .stack-t tbody, .stack-t tfoot, .stack-t tr, .stack-t td { display: block; width: auto; }
  .stack-t tbody tr { padding: 10px 0; border-bottom: 1px solid rgba(0,212,255,.1); }
  .stack-t tbody td { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 3px 0 !important; text-align: right !important; }
  .stack-t tbody td::before { content: attr(data-label); color: #79a8c2; text-align: left; flex-shrink: 0; }
  .stack-t tbody td.stack-t__head { display: block; text-align: left !important; font-weight: 600; padding-bottom: 6px !important; }
  .stack-t tbody td.stack-t__head::before { content: none; }
  .stack-t tfoot tr { display: flex; justify-content: space-between; gap: 12px; }
  .stack-t tfoot td { padding: 6px 0; text-align: left; }
  .stack-t tfoot td:last-child { white-space: nowrap; }
  .order-facts { grid-template-columns: minmax(0, 1fr) !important; gap: 12px !important; }
}

@media (max-width: 480px) {
  .order-title { font-size: 26px !important; line-height: 1.2; }
}

@media (max-width: 360px) {
  .dm-section__inner { padding-left: 16px; padding-right: 16px; }
}
