/* ============================================================
   CART & CHECKOUT
   ============================================================ */
.cart-page,
.checkout-page,
.wishlist-page,
.care-page {
  padding: calc(80px + 48px) 0 80px;
  background: var(--cream);
}



.cart-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  align-items: start;
}

.cart-empty,
.wishlist-empty {
  text-align: center;
  padding: 60px 0;
  color: var(--muted);
}

.cart-empty p,
.wishlist-empty p { font-size: 16px; margin-bottom: 20px; }

.cart-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.cart-item__img {
  width: 125px;
  height: 125px;
  object-fit: cover;
  border-radius: var(--r-md);
  flex-shrink: 0;
}

.cart-item__info { flex: 1; min-width: 0; }
.cart-item__type { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 2px; }
.cart-item__name { font-weight: 500; }
.cart-item__details { font-size: 13px; color: var(--muted); }
.cart-item__img-link { display: contents; }
.cart-item__cert-thumb { width: 125px; height: 125px; flex-shrink: 0; border-radius: var(--r-md); overflow: hidden; }

.cart-item__dims {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cart-item__dims li {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 11px;
  line-height: 1.5;
}

.cart-item__dims-label {
  color: var(--muted-2);
  white-space: nowrap;
  flex-shrink: 0;
}

.cart-item__dims-val {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.cart-item__dims-label::after {
  content: ' —';
}

.cart-item__bottom {
  display: contents; /* на десктопе участвует в flex-потоке как обычные элементы */
}

.cart-item__controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-item__controls .qty-btn {
  background: var(--line);
  border: none;
  border-radius: 6px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-item__controls .qty-btn:hover { background: var(--line-2, #ddd); }

.qty-val { font-weight: 500; min-width: 20px; text-align: center; }
.cart-item__price { font-weight: 600; white-space: nowrap; }

.cart-item__remove {
  background: none;
  border: none;
  color: var(--muted-2);
  cursor: pointer;
  font-size: 20px;
  padding: 4px;
}

.cart-summary {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px;
  position: sticky;
  top: 100px;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  margin-bottom: 16px;
}

.cart-total strong { font-size: 20px; }
.cart-summary .btn { width: 100%; margin-bottom: 8px; }

.checkout-layout {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 48px;
  align-items: start;
}

.checkout-form-col { min-width: 0; }

.checkout-section-title {
  font-family: 'Cormorant', serif;
  font-size: 20px;
  font-weight: 400;
  margin: 32px 0 16px;
}

.checkout-section-title:first-child { margin-top: 0; }

/* Two-column row inside form */
.checkout-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Radio group */
.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  cursor: pointer;
  font-size: 14px;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}

.radio-option input[type=radio] {
  width: 16px;
  height: 16px;
  accent-color: var(--ink);
  flex-shrink: 0;
}

.radio-option--checked {
  border-color: var(--ink);
  background: var(--paper);
}

/* CDEK sub-options: На дом / В пункт выдачи */
.cdek-subtype {
  margin-top: 10px;
  padding: 12px 14px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}

.cdek-subtype__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.cdek-subtype .radio-group { margin-bottom: 0; gap: 8px; }

.radio-option--sub {
  padding: 7px 12px;
  font-size: 13px;
  border-color: var(--line);
  background: var(--paper);
}

.radio-option--sub.radio-option--checked {
  border-color: var(--ink);
  background: #fff;
}

/* Form fields */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  margin-bottom: 6px;
  color: var(--muted);
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  font-size: 14px;
  font-family: inherit;
  background: var(--paper);
  color: var(--ink);
  transition: border-color 0.15s;
}

.form-input:focus {
  outline: none;
  border-color: var(--ink);
}

.form-textarea { resize: vertical; }

/* Consent */
.checkout-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 20px;
  cursor: pointer;
  line-height: 1.5;
}

.checkout-consent input[type=checkbox] {
  margin-top: 2px;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--ink);
}

/* Submit */
.checkout-submit-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checkout-submit {
  width: 100%;
  padding: 14px 20px;
  font-size: 13px;
  letter-spacing: .08em;
  border-radius: var(--r-md);
}

.checkout-submit--disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: auto;
}

.checkout-consent-tip {
  display: none;
  font-size: 12px;
  color: var(--danger);
}

/* Summary (right column) */
.checkout-summary {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px;
  position: sticky;
  top: 100px;
}

.checkout-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.checkout-item__img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--r-sm);
  flex-shrink: 0;
}

.checkout-item__img--placeholder {
  background: var(--cream-2, #eee);
}

.checkout-item__cert-thumb { width: 60px; height: 60px; flex-shrink: 0; border-radius: 3px; overflow: hidden; }
.checkout-item__cert-thumb svg { display: block; }
.checkout-item__info { flex: 1; min-width: 0; }
.checkout-item__type { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 2px; }
.checkout-item__name { font-size: 14px; font-weight: 500; }
.checkout-item__meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.checkout-item__price { font-size: 14px; font-weight: 600; white-space: nowrap; }

.checkout-summary-totals { margin-top: 16px; }

.checkout-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 8px 0;
  color: var(--ink);
}

.checkout-summary-total {
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding-top: 16px;
  font-size: 18px;
  font-weight: 700;
}

.checkout-note {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin-top: 12px;
}

/* ============================================================
   RESPONSIVE — cart / checkout
   ============================================================ */
@media (max-width: 900px) {
  .checkout-layout { grid-template-columns: 1fr; }
  .checkout-summary { position: static; order: -1; }
}

@media (max-width: 768px) {
  .cart-page,
  .checkout-page,
  .wishlist-page,
  .care-page { padding-top: 100px; }

  .cart-layout { grid-template-columns: 1fr; }
  .checkout-row { grid-template-columns: 1fr; }

  /* ── cart item mobile ── */
  .cart-item {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    grid-template-areas:
      "thumb info   remove"
      "thumb bottom bottom";
    gap: 6px 12px;
    align-items: start;
    padding: 16px 0;
  }

  .cart-item__img-link { grid-area: thumb; display: block; }
  .cart-item__cert-thumb { grid-area: thumb; }
  .cart-item__img { width: 80px; height: 80px; }
  .cart-item__info { grid-area: info; }
  .cart-item__remove { grid-area: remove; padding: 0; line-height: 1; }

  .cart-item__bottom {
    grid-area: bottom;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 4px;
  }

  .cart-item__price { font-size: 15px; }
}
