/*
 * Dream Lashes — checkout.css (зона E)
 * Глюе-слой: маппинг маркапа корзины/чекаута WooCommerce на классы макета.
 * Базовые классы (.cart-item, .summary, .co-block, .radio-card, .quantity …)
 * и Woo-глобалка (.button, .form-row, нотисы) заданы в theme.css — здесь только
 * то, что связывает конкретную Woo-разметку с макетом.
 */

/* ==== Корзина: список позиций ==== */
.cart-items { display: block; }
.cart-items .woocommerce-cart-form__contents { display: flex; flex-direction: column; gap: 14px; }
.cart-item .ci-body { min-width: 0; }
.cart-item .ci-name a { color: var(--ink); }
.cart-item .ci-name a:hover { color: var(--wine); }
.cart-item .ci-attr { margin-top: 2px; }
.cart-item .ci-attr dl.variation { margin: 0; display: flex; flex-wrap: wrap; gap: 2px 8px; }
.cart-item .ci-attr dl.variation dt,
.cart-item .ci-attr dl.variation dd { margin: 0; font-size: 12.5px; color: var(--ink-faint); }
.cart-item .ci-attr dl.variation dd p { margin: 0; }
.cart-item .ci-price .amount { font-family: var(--serif); }
.cart-item .product-quantity .quantity { margin: 0; }
/* .product-remove — стоковая обёртка ссылки удаления (нужна wc-cart.js). display:contents,
   чтобы .rm остался прямым flex-элементом .ci-tools и вид макета не менялся. */
.cart-item .product-remove { display: contents; }
.cart-item .rm svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.7; fill: none; }
/* скрытая ветка степпера (min == max) не должна показывать пустую «пилюлю» */
.quantity.hidden { display: none; }

/* строка действий: промокод (слева) + обновить корзину (справа) */
.cart-actions { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; }
.cart-actions .btn-ghost { min-height: 42px; padding: 11px 20px; }
.cart-coupon { display: flex; gap: 8px; flex: 1 1 260px; min-width: 200px; max-width: 380px; }
.cart-coupon input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; font: 500 14px var(--sans); background: var(--base); }
.cart-coupon button.btn-ghost { flex: none; }
/* Купоны выключены → остаётся одна кнопка «Обновить корзину»: space-between иначе
   прижмёт её влево, margin-left:auto держит её справа как в макете. */
.cart-actions .button[name="update_cart"] { margin-left: auto; }

/* коллатералы = сводка справа */
.cart-collaterals { align-self: start; }
@media (min-width: 861px) { .cart-collaterals { position: sticky; top: 88px; } }

/* ==== Сводка корзины (.summary → таблица итогов) ==== */
.cart_totals.summary h3 { font-size: 20px; margin-bottom: 16px; }
.dl-cart-totals { width: 100%; border-collapse: collapse; margin: 0; border: none; }
.dl-cart-totals tr { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; font-size: 14.5px; color: var(--ink-soft); border: none; }
.dl-cart-totals th { font-weight: 500; text-align: left; padding: 0; border: none; background: none; color: var(--ink-soft); }
.dl-cart-totals td { text-align: right; padding: 0; border: none; color: var(--ink); }
.dl-cart-totals tr.order-total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 16px; font-size: 18px; color: var(--ink); font-weight: 700; }
.dl-cart-totals tr.order-total th { color: var(--ink); font-weight: 700; }
.dl-cart-totals tr.order-total b,
.dl-cart-totals tr.order-total .amount { font-family: var(--serif); font-size: 24px; font-weight: 600; }
.dl-cart-totals .woocommerce-shipping-totals th { align-self: flex-start; }
.dl-cart-totals ul#shipping_method { list-style: none; margin: 0; padding: 0; text-align: right; }
.dl-cart-totals ul#shipping_method li { margin: 0 0 4px; display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.dl-cart-totals ul#shipping_method label { font-weight: 500; }
.dl-cart-totals .shipping-calculator-button { color: var(--wine); font-weight: 600; }
.dl-cart-totals .wc-shipping-calculator .button { min-height: 40px; }

/* кнопка «Оформить заказ» */
.wc-proceed-to-checkout { margin-top: 16px; }
.wc-proceed-to-checkout .checkout-button,
.wc-proceed-to-checkout .button { display: flex; width: 100%; justify-content: center; text-align: center; }

/* доверие */
.summary .note a { color: var(--wine); font-weight: 600; }
.summary-service { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0 0; }
.summary-service span { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 10px 12px; }
.summary-service b { font-size: 13px; line-height: 1.2; color: var(--ink); }
.summary-service small { font-size: 11.5px; line-height: 1.25; color: var(--ink-faint); }

/* ==== Пустая корзина ==== */
.cart-empty-state { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 48px 28px; box-shadow: var(--shadow-sm); text-align: center; max-width: 560px; margin: 20px auto 60px; }
.cart-empty-state .ce-icon { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 50%; background: var(--panel); display: grid; place-items: center; }
.cart-empty-state .ce-icon svg { width: 28px; height: 28px; stroke: var(--wine); stroke-width: 1.6; fill: none; }
.cart-empty-state h2 { font-size: 26px; margin-bottom: 10px; background: none; border: none; padding: 0; }
.cart-empty-state p { color: var(--ink-soft); max-width: 42ch; margin: 0 auto 22px; }
.cart-empty-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: -8px auto 22px; }
.cart-empty-links a { border: 1px solid var(--line); border-radius: 999px; background: var(--panel); padding: 8px 12px; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); transition: border-color .18s, color .18s, transform .18s; }
.cart-empty-links a:hover { border-color: var(--wine); color: var(--wine); transform: translateY(-1px); }
.cart-empty-state .return-to-shop { margin: 0; }
.cart-empty-state .btn .arrow { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.8; fill: none; }

/* ==== Чекаут: раскладка ==== */
.checkout-layout { counter-reset: dl-step; }
.checkout-layout .co-main { min-width: 0; }
.checkout-layout .col2-set { display: flex; flex-direction: column; gap: 0; }
/* Сток Woo даёт .col-1/.col-2 float+width:48% (ядро сбрасывает только ≤768px) —
   на 900–1440px карточки реквизитов ужимались вдвое. */
.checkout-layout .col2-set .col-1,
.checkout-layout .col2-set .col-2 { width: auto; float: none; }
.checkout-layout .co-block { counter-increment: dl-step; }
.checkout-layout .co-block .woocommerce-billing-fields > :is(h2, h3),
.checkout-layout .co-block .woocommerce-shipping-fields > :is(h2, h3) { display: flex; align-items: center; gap: 10px; font-size: 19px; margin-bottom: 16px; }
.checkout-layout .co-block .woocommerce-billing-fields > :is(h2, h3)::before,
.checkout-layout .co-block .woocommerce-shipping-fields > :is(h2, h3)::before { content: counter(dl-step); width: 26px; height: 26px; border-radius: 50%; background: var(--wine); color: #fff; font: 700 13px var(--sans); display: grid; place-items: center; flex: none; }
.checkout-layout .co-block .woocommerce-additional-fields > :is(h2, h3) { font-size: 17px; margin: 20px 0 14px; }
.checkout-layout .co-block--shipping:empty { display: none; }
.checkout-layout .woocommerce-billing-fields__field-wrapper,
.checkout-layout .woocommerce-shipping-fields__field-wrapper,
.checkout-layout .woocommerce-additional-fields__field-wrapper { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.checkout-layout .woocommerce-billing-fields__field-wrapper > .form-row,
.checkout-layout .woocommerce-shipping-fields__field-wrapper > .form-row { width: auto; float: none; margin-left: 0; margin-right: 0; }
.checkout-layout .form-row-wide,
.checkout-layout .form-row.notes,
.checkout-layout .woocommerce-additional-fields,
.checkout-layout #ship-to-different-address { grid-column: 1 / -1; }
.checkout-layout .woocommerce-shipping-fields :is(h2, h3) label { font-size: 16px; font-weight: 600; }
.checkout-layout .create-account { grid-column: 1 / -1; }

/* ==== Обзор заказа (review-order.php) ==== */
.co-summary .summary > :is(h2, h3) { font-size: 20px; margin-bottom: 16px; }
.co-reassurance { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 11px 13px; margin: -4px 0 14px; }
.co-reassurance span { display: block; font-size: 13px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.co-reassurance small { display: block; margin-top: 3px; font-size: 12px; color: var(--ink-faint); line-height: 1.35; }
.dl-review { width: 100%; border-collapse: collapse; margin: 0 0 4px; border: none; }
.dl-review thead { display: none; }
.dl-review tbody { display: block; }
.dl-review tbody tr { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.dl-review tbody td.co-line { display: flex; gap: 12px; align-items: center; flex: 1; min-width: 0; padding: 10px 0; border: none; }
.dl-review .cl-ph { width: 52px; height: 52px; border-radius: 9px; background: var(--panel); overflow: hidden; flex: none; }
.dl-review .cl-ph img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; }
.dl-review .cl-body { min-width: 0; flex: 1; }
.dl-review .cl-n { display: block; font-size: 13px; font-weight: 600; line-height: 1.3; }
.dl-review .cl-q { display: block; font-size: 12px; color: var(--ink-faint); }
.dl-review .cl-q dl.variation { margin: 0; display: inline; }
.dl-review .cl-q dl.variation dt,
.dl-review .cl-q dl.variation dd { display: inline; margin: 0; font-size: 12px; }
.dl-review .cl-q .qty-x { font-weight: 600; color: var(--ink-soft); }
.dl-review tbody td.cl-p { flex: none; text-align: right; font-weight: 600; padding: 10px 0; border: none; white-space: nowrap; }
.dl-review tfoot { display: block; margin-top: 8px; }
.dl-review tfoot tr { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; font-size: 14.5px; color: var(--ink-soft); border: none; }
.dl-review tfoot th { font-weight: 500; text-align: left; padding: 0; border: none; color: var(--ink-soft); }
.dl-review tfoot td { text-align: right; padding: 0; border: none; color: var(--ink); }
.dl-review tfoot tr.order-total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 16px; font-size: 18px; color: var(--ink); font-weight: 700; }
.dl-review tfoot tr.order-total th { color: var(--ink); font-weight: 700; }
.dl-review tfoot tr.order-total b,
.dl-review tfoot tr.order-total .amount { font-family: var(--serif); font-size: 24px; font-weight: 600; }
/* Шаг «Доставка» макета: методы доставки в сводке как radio-card. Только CSS,
   без переноса DOM из фрагмента — переживает AJAX update_order_review. */
.dl-review tfoot tr.woocommerce-shipping-totals { flex-direction: column; align-items: stretch; gap: 8px; }
.dl-review tfoot tr.woocommerce-shipping-totals > th { color: var(--ink); font-weight: 600; }
.dl-review tfoot ul#shipping_method { list-style: none; margin: 0; padding: 0; text-align: left; display: flex; flex-direction: column; gap: 8px; }
.dl-review tfoot ul#shipping_method li { display: flex; align-items: center; gap: 10px; margin: 0; border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; transition: border-color .18s, background .18s; }
.dl-review tfoot ul#shipping_method li:hover { border-color: var(--wine); }
.dl-review tfoot ul#shipping_method li input[type="radio"] { accent-color: var(--wine); width: 18px; height: 18px; flex: none; margin: 0; }
.dl-review tfoot ul#shipping_method li label { flex: 1; margin: 0; font-weight: 600; font-size: 13.5px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.dl-review tfoot ul#shipping_method li label .amount { font-weight: 600; white-space: nowrap; }
.dl-review tfoot .woocommerce-shipping-destination { font-size: 12px; color: var(--ink-faint); margin: 2px 0 0; }
.dl-review tfoot .shipping-calculator-button { color: var(--wine); font-weight: 600; }

/* ==== Оплата (checkout/payment.php, стоковый) ==== */
#payment { background: none; margin-top: 18px; }
#payment .payment_methods { list-style: none; margin: 0 0 14px; padding: 0; border: none; }
#payment .payment_methods li { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; transition: border-color .18s, background .18s; }
#payment .payment_methods li:hover { border-color: var(--wine); }
#payment .payment_methods li > label { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; cursor: pointer; margin: 0; }
#payment .payment_methods li input[type="radio"] { accent-color: var(--wine); width: 18px; height: 18px; }
#payment .payment_methods li img { max-height: 24px; margin-left: 6px; }
#payment .payment_box { background: var(--panel); border-radius: 10px; padding: 12px 14px; margin-top: 10px; font-size: 13px; color: var(--ink-soft); }
#payment .payment_box p { margin: 0; }
#payment .place-order { margin-top: 6px; }
#payment #place_order { display: flex; width: 100%; justify-content: center; }
#payment .woocommerce-terms-and-conditions-wrapper { margin-bottom: 14px; font-size: 13px; }
#payment .woocommerce-privacy-policy-text { font-size: 12.5px; color: var(--ink-faint); }

/* ==== Thank you ==== */
.thankyou-panel { max-width: 620px; margin: 12px auto 60px; }
.thankyou-head { text-align: center; margin-bottom: 26px; }
.thankyou-head .ty-icon { width: 66px; height: 66px; margin: 0 auto 16px; border-radius: 50%; background: #E7F1EA; display: grid; place-items: center; }
.thankyou-head .ty-icon svg { width: 30px; height: 30px; stroke: var(--ok); stroke-width: 2; fill: none; }
.thankyou-head.is-failed .ty-icon { background: #FBEAEE; }
.thankyou-head.is-failed .ty-icon svg { stroke: var(--wine); }
.thankyou-head .woocommerce-thankyou-order-received { font-family: var(--serif); font-size: 26px; color: var(--ink); background: none; border: none; padding: 0; margin: 0; }
.thankyou-panel .order_details.summary { list-style: none; margin: 0 0 24px; padding: 24px; }
.thankyou-panel .order_details.summary li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; font-size: 14.5px; color: var(--ink-soft); border: none; }
.thankyou-panel .order_details.summary li strong { color: var(--ink); font-weight: 600; }
.thankyou-panel .order_details.summary li.total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 16px; font-size: 18px; font-weight: 700; }
.thankyou-panel .order_details.summary li.total strong { font-family: var(--serif); font-size: 22px; }
.thankyou-panel .woocommerce-thankyou-order-failed-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.thankyou-panel .woocommerce-order-details,
.thankyou-panel .woocommerce-customer-details { margin-top: 26px; }
.thankyou-panel .woocommerce-order-details h2,
.thankyou-panel .woocommerce-customer-details h2 { font-size: 20px; margin-bottom: 14px; }
.thankyou-panel .woocommerce-table.shop_table { width: 100%; border: 1px solid var(--line); border-radius: var(--r); border-collapse: collapse; overflow: hidden; background: #fff; }
.thankyou-panel .woocommerce-table.shop_table th,
.thankyou-panel .woocommerce-table.shop_table td { padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 14px; text-align: left; }

/* ==== Адаптив ==== */
@media (max-width: 860px) {
	.checkout-layout .woocommerce-billing-fields__field-wrapper,
	.checkout-layout .woocommerce-shipping-fields__field-wrapper,
	.checkout-layout .woocommerce-additional-fields__field-wrapper { grid-template-columns: 1fr; }
	.dl-review tbody tr td.cl-p { margin: 0; }
	.dl-review tbody td.co-line { padding-bottom: 4px; }
	.summary-service { grid-template-columns: 1fr; }
}

/* Mockup-fidelity: выбранная карточка доставки/оплаты — винная рамка + тон +
   внутренняя обводка (макет подсвечивает активный radio-card). */
.dl-review tfoot ul#shipping_method li:has(input:checked),
#payment .payment_methods li:has(input:checked) { border-color: var(--wine); background: #FBF1F1; box-shadow: 0 0 0 1px var(--wine) inset; }
