/* ───── Triada-1.5 / shop-стили (cart, checkout, order_done) ─────
   Только разделы коммерции — общая палитра/шрифт берутся из style.css.
   Подключается в base.html.
*/

/* Header cart icon */
.vh-cart {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
}
.vh-cart svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.vh-cart-count {
  position: absolute;
  top: -2px; right: -2px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0;
}
.vh-cart-count[data-empty="1"] { display: none; }

/* Add-to-cart на странице товара */
.cta.cta-add {
  background: var(--accent);
  color: #fff;
}
.cta.is-added {
  background: #0a8a1d;
}

/* Cart page */
.cart-page { padding: 24px 0; }
.cart-loading,
.cart-empty {
  padding: 32px;
  text-align: center;
  color: #888;
}
.cart-empty .cta { margin-top: 12px; display: inline-block; }
.cart-table {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}
.cart-item {
  display: grid;
  grid-template-columns: 90px 1fr auto auto auto;
  gap: 16px;
  align-items: center;
  padding: 12px;
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 12px;
}
.cart-item.static-item { grid-template-columns: 90px 1fr auto; }
.cart-item-pic {
  width: 90px; height: 90px;
  border-radius: 8px;
  overflow: hidden;
  background: #f5f5f5;
}
.cart-item-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cart-item-body { min-width: 0; }
.cart-item-title {
  display: block;
  font-weight: 600;
  color: #1a1a1a;
  text-decoration: none;
  font-size: 15px;
  margin-bottom: 4px;
}
.cart-item-title:hover { color: var(--accent); }
.cart-item-meta {
  font-size: 12px;
  color: #8a8a8a;
  display: flex; gap: 12px; flex-wrap: wrap;
}
.cart-item-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid #ececec;
  border-radius: 8px;
}
.cart-qty-btn {
  width: 32px; height: 32px;
  border: none; background: transparent;
  cursor: pointer; font-size: 18px; color: #1a1a1a;
  font-family: inherit;
}
.cart-qty-btn:hover { background: #f5f5f5; }
.cart-qty-input {
  width: 40px; height: 32px;
  border: none;
  text-align: center;
  font: inherit;
  -moz-appearance: textfield;
}
.cart-qty-input::-webkit-outer-spin-button,
.cart-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cart-item-line {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.cart-item-remove {
  width: 32px; height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #aaa;
  font-size: 14px;
  border-radius: 6px;
}
.cart-item-remove:hover { background: rgba(255,0,0,0.08); color: #c00; }

.cart-totals {
  margin-top: 24px;
  padding: 18px;
  background: #fafafa;
  border-radius: 12px;
}
.cart-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 4px 0;
}
.cart-total-row.total-grand {
  font-size: 20px;
  font-weight: 700;
  border-top: 1px solid #e0e0e0;
  margin-top: 8px;
  padding-top: 12px;
}
.cart-actions {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.cart-actions .cta { flex: 1 0 auto; min-width: 200px; text-align: center; }

/* Checkout */
.checkout-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
.checkout-fields { display: flex; flex-direction: column; gap: 14px; }
.cf-row { display: flex; flex-direction: column; gap: 4px; }
.cf-label {
  font-size: 12px;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 600;
}
.cf-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ececec;
  border-radius: 8px;
  font: inherit;
  background: #fff;
}
.cf-input:focus { outline: none; border-color: var(--accent); }
.cf-shipping { border: 1px solid #ececec; border-radius: 8px; padding: 12px; }
.cf-shipping legend { padding: 0 6px; font-size: 12px; color: #555; }
.cf-shipping label {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 0; font-size: 14px;
}
.checkout-summary {
  padding: 18px;
  background: #fafafa;
  border-radius: 12px;
}
.checkout-lines { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.checkout-line {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: baseline;
  font-size: 14px;
}
.cl-qty { color: #888; }
.cl-sum {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.checkout-foot {
  grid-column: 1 / 3;
  margin-top: 24px;
}
.checkout-note {
  font-size: 13px;
  color: #555;
  margin-bottom: 16px;
}
#checkoutSubmit { font-size: 16px; padding: 14px 28px; }

/* Order done */
.order-done .order-summary { margin-top: 24px; }
.order-done .order-foot {
  margin-top: 32px;
  padding: 20px;
  background: #fafafa;
  border-radius: 12px;
}
.order-done .order-foot p { margin: 0 0 12px; }

@media (max-width: 700px) {
  .cart-item {
    grid-template-columns: 70px 1fr;
    grid-template-areas:
      "pic body"
      "qty line"
      "rm rm";
    row-gap: 8px;
  }
  .cart-item-pic { grid-area: pic; width: 70px; height: 70px; }
  .cart-item-body { grid-area: body; }
  .cart-item-qty { grid-area: qty; }
  .cart-item-line { grid-area: line; text-align: right; }
  .cart-item-remove { grid-area: rm; justify-self: end; }
  .cart-item.static-item { grid-template-areas: "pic body" "pic line"; }
  .cart-item.static-item .cart-item-line { grid-area: line; text-align: right; }
  .checkout-form { grid-template-columns: 1fr; }
  .checkout-foot { grid-column: 1; }
}
