/* ============================================================
   WHIEDA Marketplace — CSS корзины и checkout
   ============================================================ */

/* ---------- Layout ---------- */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 40px;
}
@media (min-width: 900px) {
  .cart-layout { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
}

/* ---------- Item card ---------- */
.cart-items {
  display: flex; flex-direction: column;
  gap: 12px;
}
.cart-item {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 16px;
  padding: 16px;
  border-radius: var(--r-md);
  background: var(--white);
  border: 1px solid var(--line);
  align-items: center;
}
@media (max-width: 640px) {
  .cart-item {
    grid-template-columns: 70px 1fr;
    grid-template-areas: 'ph info' 'ctrl ctrl';
    gap: 12px; padding: 12px;
  }
  .cart-item-ph { grid-area: ph; }
  .cart-item-info { grid-area: info; }
  .cart-item-ctrl { grid-area: ctrl; justify-self: stretch; }
}
.cart-item-ph {
  width: 90px; height: 90px;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--acc-soft);
}
@media (max-width: 640px) { .cart-item-ph { width: 70px; height: 70px; } }
.cart-item-ph img { width: 100%; height: 100%; object-fit: cover; }

.cart-item-sku {
  font-size: 11px; color: var(--mut);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.cart-item-name {
  font-size: 15px; font-weight: 700;
  line-height: 1.35;
  margin: 4px 0 6px;
  color: var(--ink);
  text-decoration: none;
}
.cart-item-name:hover { color: var(--acc-2); }
.cart-item-price {
  font-size: 15px; font-weight: 800;
  color: var(--acc-2);
}
.cart-item-price small {
  display: block; font-size: 11px; font-weight: 500;
  color: var(--mut); margin-top: 2px;
}
.cart-item-ctrl {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.qty-ctrl {
  display: inline-flex; align-items: center;
  gap: 0;
  border: 1.5px solid var(--bd);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.qty-ctrl button {
  width: 34px; height: 34px;
  background: var(--white); border: none;
  cursor: pointer;
  font-size: 18px; font-weight: 700;
  color: var(--ink);
  transition: background 0.15s;
}
.qty-ctrl button:hover { background: var(--acc-soft); color: var(--acc-2); }
.qty-ctrl button:disabled { opacity: 0.4; cursor: not-allowed; }
.qty-ctrl input {
  width: 42px; height: 34px;
  text-align: center;
  border: none; border-left: 1px solid var(--bd); border-right: 1px solid var(--bd);
  font-size: 14px; font-weight: 700;
  color: var(--ink);
  background: var(--white);
  -moz-appearance: textfield;
}
.qty-ctrl input::-webkit-outer-spin-button,
.qty-ctrl input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.cart-item-remove {
  background: transparent; border: none;
  color: var(--mut);
  padding: 8px; cursor: pointer;
  transition: color 0.15s;
  line-height: 0;
}
.cart-item-remove:hover { color: var(--acc-2); }
.cart-item-remove svg { width: 18px; height: 18px; }

/* ---------- Summary sidebar ---------- */
.cart-summary {
  padding: 24px;
  border-radius: var(--r-md);
  position: sticky;
  top: 90px;
}
.cart-summary h2 {
  margin: 0 0 16px;
  font-size: 20px;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 14.5px;
  color: var(--ink);
  border-bottom: 1px dashed var(--line);
}
.summary-row:last-of-type { border-bottom: none; }
.summary-row-total {
  padding: 16px 0 8px;
  font-size: 20px; font-weight: 800;
  color: var(--ink);
  border-bottom: none;
  border-top: 2px solid var(--line);
  margin-top: 8px;
}
.summary-row-total b { color: var(--acc-2); }

.cart-cta {
  width: 100%;
  padding: 15px;
  border-radius: var(--r);
  background: var(--acc);
  color: var(--white);
  font-size: 15px; font-weight: 800;
  transition: background 0.15s, transform 0.1s;
  margin-top: 16px;
  box-shadow: var(--sh-acc);
  cursor: pointer;
  border: none;
  display: block;
  text-align: center;
  text-decoration: none;
}
.cart-cta:hover { background: var(--acc-2); transform: translateY(-1px); }
.cart-cta:disabled { background: var(--mut); cursor: not-allowed; transform: none; }

.cart-safe {
  display: flex; gap: 8px;
  align-items: center;
  padding: 12px;
  background: var(--acc-soft);
  border-radius: var(--r-sm);
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--ink);
}
.cart-safe svg { color: var(--acc-2); flex: 0 0 auto; }

/* ---------- Empty state ---------- */
.cart-empty {
  text-align: center;
  padding: 60px 24px;
  border-radius: var(--r-md);
}
.cart-empty-icon {
  display: inline-flex;
  width: 88px; height: 88px;
  border-radius: 50%;
  background: var(--acc-soft);
  color: var(--acc-2);
  align-items: center; justify-content: center;
  margin-bottom: 20px;
}
.cart-empty-icon svg { width: 44px; height: 44px; }
.cart-empty h2 {
  font-size: 22px; margin: 0 0 8px;
}
.cart-empty p {
  color: var(--mut); font-size: 15px;
  margin: 0 0 24px;
}

/* ---------- Checkout form ---------- */
.checkout-block {
  padding: 24px;
  border-radius: var(--r-md);
  background: var(--white);
  border: 1px solid var(--line);
  margin-bottom: 20px;
}
.checkout-block h3 {
  margin: 0 0 4px;
  font-size: 17px; font-weight: 800;
}
.checkout-block-sub {
  font-size: 13px; color: var(--mut);
  margin: 0 0 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 640px) {
  .form-grid-2 { grid-template-columns: 1fr 1fr; }
}

.delivery-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.delivery-opt {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  border: 1.5px solid var(--bd);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.delivery-opt:hover { border-color: var(--acc); }
.delivery-opt input[type="radio"] { margin-top: 3px; accent-color: var(--acc); }
.delivery-opt-body { flex: 1; }
.delivery-opt-title {
  font-size: 15px; font-weight: 700;
  color: var(--ink);
}
.delivery-opt-desc {
  font-size: 12.5px; color: var(--mut);
  margin-top: 2px;
}
.delivery-opt-price {
  font-size: 14px; font-weight: 700;
  color: var(--acc-2);
  white-space: nowrap;
}
.delivery-opt.is-active {
  border-color: var(--acc);
  background: var(--acc-soft);
}

.checkout-agreements {
  display: flex; gap: 10px;
  align-items: flex-start;
  padding: 12px 0;
  font-size: 13px; color: var(--ink);
  line-height: 1.5;
}
.checkout-agreements input {
  margin-top: 3px; accent-color: var(--acc);
  flex: 0 0 auto;
}
.checkout-agreements a {
  color: var(--acc-2);
  text-decoration: underline;
}

.thankyou {
  text-align: center;
  padding: 60px 24px;
  border-radius: var(--r-md);
}
.thankyou-icon {
  display: inline-flex;
  width: 88px; height: 88px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--acc), var(--acc-2));
  color: var(--white);
  align-items: center; justify-content: center;
  margin-bottom: 20px;
  box-shadow: var(--sh-acc);
}
.thankyou-icon svg { width: 44px; height: 44px; }
.thankyou h2 { font-size: 26px; margin: 0 0 8px; }
.thankyou p { color: var(--mut); font-size: 15px; margin: 0 0 20px; }
.thankyou-order {
  display: inline-block;
  padding: 8px 16px;
  border-radius: var(--r-full);
  background: var(--acc-soft);
  color: var(--acc-2);
  font-weight: 800;
  margin-bottom: 24px;
}
