/* ============================================================
   CraftyWorth — Cart Page (premium)
   Scoped to .woocommerce-cart .cw-cart. Layout: items (left) +
   sticky Order Summary (right), cross-sells full-width below.
   Uses theme design tokens (cw-tokens.css).
   ============================================================ */

/* ── Page header ────────────────────────────────────────── */
.woocommerce-cart .cw-cart__head {
	display: flex; align-items: baseline; gap: var(--cw-space-4) var(--cw-space-5);
	flex-wrap: wrap;
	max-width: var(--max, 1240px);
	margin: var(--cw-space-8) auto 0;
	padding: 0 var(--cw-gutter);
}
.cw-cart__head-title {
	font-family: var(--head); font-weight: 600; line-height: 1.1;
	font-size: clamp(26px, 4vw, 38px); color: var(--ink); margin: 0;
}
.cw-cart__head-count {
	font-family: var(--body); font-size: 14px; font-weight: 600;
	color: var(--p); background: var(--cw-primary-light);
	padding: 4px 12px; border-radius: var(--cw-radius-full);
}
.cw-cart__head-cont {
	margin-left: auto; font-family: var(--body); font-size: 14px; font-weight: 600;
	color: var(--ink-3); text-decoration: none;
}
.cw-cart__head-cont:hover { color: var(--p); }

.woocommerce-cart .cw-cart {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 380px;
	grid-template-areas:
		"main  aside"
		"cross cross";
	gap: var(--cw-space-8) var(--cw-space-10);
	align-items: start;
	max-width: var(--max, 1240px);
	margin: var(--cw-space-6) auto var(--cw-space-12);
	padding: 0 var(--cw-gutter);
}

.cw-cart__main  { grid-area: main;  min-width: 0; }
.cw-cart__aside { grid-area: aside; min-width: 0; }
.cw-cart__cross { grid-area: cross; min-width: 0; }

/* ── Items card ─────────────────────────────────────────── */
.cw-cart__main .woocommerce-cart-form {
	background: var(--cw-bg, #fff);
	border: 1px solid var(--line);
	border-radius: var(--cw-radius-card);
	box-shadow: 0 1px 2px rgba(26,18,8,.04), 0 12px 28px -18px rgba(26,18,8,.18);
	overflow: hidden;
}

.cw-cart__main table.cart.woocommerce-cart-form__contents {
	display: block; width: 100%; margin: 0; border: 0; background: transparent;
	font-family: var(--body);
}
.cw-cart__main table.cart thead { display: none; }   /* rows are self-descriptive */
.cw-cart__main table.cart tbody { display: block; }
.cw-cart__main table.cart tr { display: block; }

/* Each item = CSS grid row (avoids table auto-width breaking column sizes) */
.cw-cart__main table.cart tr.woocommerce-cart-form__cart-item {
	display: grid;
	grid-template-columns: 30px 84px minmax(0, 1fr) auto auto auto;
	align-items: center;
	gap: var(--cw-space-2) var(--cw-space-5);
	padding: var(--cw-space-6) var(--cw-space-5);
	border-bottom: 1px solid var(--cw-line-soft);
	transition: background .15s ease;
}
.cw-cart__main table.cart tr.woocommerce-cart-form__cart-item:hover { background: var(--cw-surface); }
.cw-cart__main table.cart tr.woocommerce-cart-form__cart-item td {
	display: block; border: 0; padding: 0; margin: 0; background: transparent;
}

/* Remove × */
.cw-cart__main td.product-remove { text-align: center; }
.cw-cart__main td.product-remove a.remove {
	display: inline-flex; align-items: center; justify-content: center;
	width: 20px; height: 20px; border-radius: var(--cw-radius-full);
	font-size: 14px; line-height: 1; color: var(--ink-4) !important;
	background: transparent; text-decoration: none;
	transition: all .15s ease;
}
.cw-cart__main td.product-remove a.remove:hover { background: var(--cw-error-bg); color: var(--cw-error) !important; }

/* Thumbnail — larger, prominent */
.cw-cart__main td.product-thumbnail img {
	width: 84px; height: 84px; object-fit: cover; display: block;
	border-radius: var(--cw-radius-md);
	border: 1px solid var(--line);
	background: var(--cw-surface-2);
}

/* Name + meta — prominent product detail */
.cw-cart__main td.product-name { font-size: 15.5px; line-height: 1.45; }
.cw-cart__main td.product-name a {
	color: var(--ink); font-weight: 700; text-decoration: none;
	display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.cw-cart__main td.product-name a:hover { color: var(--p); }
.cw-cart__main td.product-name .variation,
.cw-cart__main td.product-name dl.variation { margin: 6px 0 0; font-size: 12px; color: var(--ink-3); }
.cw-cart__main td.product-name .backorder_notification { font-size: 12px; color: var(--cw-warning); margin-top: 4px; }

/* Price + subtotal */
.cw-cart__main td.product-price { color: var(--ink-2); font-weight: 500; white-space: nowrap; }
.cw-cart__main td.product-subtotal { color: var(--p); font-weight: 700; white-space: nowrap; }
.cw-cart__main td.product-subtotal .tax_label,
.cw-cart__main td.product-price .tax_label { display: block; font-size: 10px; font-weight: 500; color: var(--ink-4); }

/* Quantity stepper */
.cw-cart__main td.product-quantity .quantity {
	display: inline-flex; align-items: center;
	border: 1px solid var(--line); border-radius: var(--cw-radius-full);
	background: var(--cw-bg, #fff); overflow: hidden; padding: 2px;
}
.cw-cart__main td.product-quantity input.qty {
	width: 52px; height: 34px; border: 0; background: transparent;
	text-align: center; font-weight: 700; color: var(--ink);
	font-family: var(--body); font-size: 14px; -moz-appearance: textfield;
}
.cw-cart__main td.product-quantity input.qty:focus { outline: none; }

/* Coupon + update row */
.cw-cart__main td.actions {
	display: flex; flex-wrap: wrap; align-items: center; gap: var(--cw-space-4);
	padding: var(--cw-space-5) var(--cw-space-5);
	border-bottom: 0; background: var(--cw-surface);
}
.cw-cart__main td.actions .coupon { display: flex; gap: 8px; align-items: center; flex: 1 1 60%; min-width: 260px; }
.cw-cart__main td.actions .coupon input#coupon_code {
	flex: 1 1 auto; min-width: 140px; width: auto !important; max-width: none !important; height: 44px; padding: 0 16px;
	border: 1px solid var(--line); border-radius: var(--cw-radius-full);
	background: var(--cw-bg, #fff); font-family: var(--body); font-size: 14px; color: var(--ink);
}
.cw-cart__main td.actions .coupon input#coupon_code:focus {
	outline: none; border-color: var(--p); box-shadow: 0 0 0 3px var(--cw-primary-light);
}
.cw-cart__main td.actions button {
	flex: 0 0 auto; height: 44px; padding: 0 22px; border: 0; cursor: pointer;
	border-radius: var(--cw-radius-full); font-family: var(--body);
	font-weight: 700; font-size: 14px; transition: all .15s ease; white-space: nowrap;
}
.cw-cart__main td.actions button[name="update_cart"] { margin-left: auto; }
.cw-cart__main td.actions .coupon button[name="apply_coupon"] {
	background: var(--ink); color: #fff;
}
.cw-cart__main td.actions .coupon button[name="apply_coupon"]:hover { background: var(--ink-2); }
.cw-cart__main td.actions button[name="update_cart"] {
	background: var(--cw-surface-2); color: var(--ink-2); border: 1px solid var(--line);
}
.cw-cart__main td.actions button[name="update_cart"]:hover:not(:disabled) { background: #fff; border-color: var(--p); color: var(--p); }
.cw-cart__main td.actions button[name="update_cart"]:disabled { opacity: .5; cursor: not-allowed; }

/* Reassurance strip */
.cw-cart__assure {
	list-style: none; margin: var(--cw-space-5) 0 0; padding: 0;
	display: flex; flex-wrap: wrap; gap: var(--cw-space-3) var(--cw-space-6);
}
.cw-cart__assure li {
	display: inline-flex; align-items: center; gap: 7px;
	font-size: 12.5px; font-weight: 600; color: var(--ink-2);
}
.cw-cart__assure-ic { font-size: 15px; }

/* ── Order Summary (sticky) ─────────────────────────────── */
.cw-cart__aside .cw-cart__summary {
	position: sticky; top: 96px;
	background: var(--cw-bg, #fff);
	border: 1px solid var(--line);
	border-radius: var(--cw-radius-card);
	box-shadow: 0 1px 2px rgba(26,18,8,.04), 0 14px 34px -20px rgba(26,18,8,.22);
	padding: var(--cw-space-6) var(--cw-space-6) var(--cw-space-6);
	width: auto; float: none; margin: 0;
}
.cw-cart__summary-title {
	font-family: var(--head); font-size: 22px; font-weight: 600;
	color: var(--ink); margin: 0 0 var(--cw-space-5); line-height: 1.2;
}

/* Free-shipping bar already themed (.cwv2-ship-bar) — just spacing */
.cw-cart__summary .cwv2-ship-bar { margin: 0 0 var(--cw-space-5); }

.cw-cart__summary .cart_totals { width: 100% !important; float: none !important; margin: 0; }
.cw-cart__summary .cart_totals > h2 { display: none; }   /* we have our own title */
.cw-cart__summary table.shop_table {
	width: 100%; border: 0; margin: 0; border-collapse: collapse; background: transparent;
}
.cw-cart__summary table.shop_table th,
.cw-cart__summary table.shop_table td {
	border: 0; border-bottom: 1px dashed var(--cw-line-soft);
	padding: var(--cw-space-4) 0; font-family: var(--body);
	font-size: 14px; color: var(--ink-2); background: transparent; text-align: left;
}
.cw-cart__summary table.shop_table th { font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.cw-cart__summary table.shop_table td { text-align: right; font-weight: 600; color: var(--ink); }
.cw-cart__summary .cart_totals .order-total th { font-size: 15px; color: var(--ink); }
.cw-cart__summary .cart_totals .order-total td { font-size: 19px; color: var(--p); font-weight: 800; }
.cw-cart__summary .cart_totals .order-total th,
.cw-cart__summary .cart_totals .order-total td { border-bottom: 0; padding-top: var(--cw-space-5); }
.cw-cart__summary .cart_totals .order-total .tax_label { display: block; font-size: 10px; font-weight: 500; color: var(--ink-4); }
.cw-cart__summary .cart_totals .shipping th { vertical-align: top; }
.cw-cart__summary .cart_totals .shipping td { font-weight: 700; }
.cw-cart__summary .cart_totals .shipping ul#shipping_method { margin: 0; padding: 0; list-style: none; }
.cw-cart__summary .cart_totals .shipping ul#shipping_method li { margin: 0; }
/* Amazon-style price-detail rows */
.cw-cart__summary .cw-row-mrp td .cw-strike { text-decoration: line-through; color: var(--ink-3); font-weight: 600; }
.cw-cart__summary .cw-row-save th { color: var(--ink-2); }
.cw-cart__summary .cw-row-save .cw-save-amt { color: var(--cw-success); font-weight: 700; }
.cw-cart__summary .cw-row-gst th { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.cw-cart__summary .cw-row-gst .cw-gst-amt { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.cw-cart__summary .cw-save-banner {
	margin: var(--cw-space-4) 0 0; padding: 10px 14px;
	background: var(--cw-success-bg); color: var(--cw-success);
	border-radius: var(--cw-radius-md); font-size: 13px; font-weight: 600; text-align: center;
}
.cw-cart__summary .cw-save-banner strong { font-weight: 800; }

.cw-cart__summary .woocommerce-shipping-destination {
	display: block; font-size: 11.5px; line-height: 1.45; font-weight: 500;
	color: var(--ink-3); margin-top: 6px;
}
.cw-cart__summary .woocommerce-shipping-destination strong { font-weight: 600; color: var(--ink-2); }
.cw-cart__summary .shipping-calculator-button {
	display: inline-block; margin-top: 4px; font-size: 12px;
	color: var(--p) !important; text-decoration: underline; font-weight: 600;
}

/* Secure / payment trust row */
.cw-cart__pay {
	display: flex; flex-direction: column; gap: 4px; align-items: center; text-align: center;
	margin-top: var(--cw-space-5); padding-top: var(--cw-space-5);
	border-top: 1px solid var(--cw-line-soft);
}
.cw-cart__pay-lock { font-size: 12.5px; font-weight: 600; color: var(--cw-success); }
.cw-cart__pay-methods { font-size: 11.5px; font-weight: 500; color: var(--ink-3); letter-spacing: .3px; }

/* Proceed to checkout */
.cw-cart__summary .wc-proceed-to-checkout { padding: var(--cw-space-5) 0 0; }
.cw-cart__summary .wc-proceed-to-checkout a.checkout-button {
	display: flex; align-items: center; justify-content: center; gap: 8px;
	width: 100%; height: 54px; margin: 0;
	background: linear-gradient(135deg, var(--p) 0%, var(--p-d) 100%);
	color: #fff !important; border: 0; border-radius: var(--cw-radius-full);
	font-family: var(--body); font-weight: 800; font-size: 16px; letter-spacing: .2px;
	text-decoration: none; box-shadow: 0 10px 22px -10px rgba(160,41,62,.6);
	transition: transform .15s ease, box-shadow .15s ease;
}
.cw-cart__summary .wc-proceed-to-checkout a.checkout-button::after { content: "→"; font-weight: 700; }
.cw-cart__summary .wc-proceed-to-checkout a.checkout-button:hover {
	transform: translateY(-2px); box-shadow: 0 16px 30px -12px rgba(160,41,62,.7);
}

/* ── Cross-sells full width ─────────────────────────────── */
.cw-cart__cross .cross-sells { width: 100%; float: none; margin: 0; }
.cw-cart__cross .cross-sells > h2 {
	font-family: var(--head); font-size: clamp(20px, 3vw, 26px); font-weight: 600;
	color: var(--ink); margin: 0 0 var(--cw-space-6);
}

/* ── Empty cart ─────────────────────────────────────────── */
.woocommerce-cart .cart-empty.woocommerce-info,
.woocommerce-cart .wc-empty-cart-message {
	text-align: center; font-family: var(--head); font-size: 22px; color: var(--ink-2);
	background: transparent; border: 0; padding: var(--cw-space-12) 0 var(--cw-space-6);
}
.woocommerce-cart .return-to-shop { text-align: center; margin: 0 0 var(--cw-space-16); }
.woocommerce-cart .return-to-shop .button {
	display: inline-flex; align-items: center; gap: 8px; height: 50px; padding: 0 30px;
	background: linear-gradient(135deg, var(--p) 0%, var(--p-d) 100%);
	color: #fff !important; border-radius: var(--cw-radius-full);
	font-weight: 700; font-size: 15px; text-decoration: none;
	box-shadow: 0 10px 22px -10px rgba(160,41,62,.6);
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 980px) {
	.woocommerce-cart .cw-cart {
		grid-template-columns: 1fr;
		grid-template-areas: "main" "aside" "cross";
		gap: var(--cw-space-6);
	}
	.cw-cart__aside .cw-cart__summary { position: static; }
}

@media (max-width: 560px) {
	.cw-cart__main table.cart tr.woocommerce-cart-form__cart-item {
		grid-template-columns: 70px 1fr auto;
		grid-template-areas:
			"thumb name   remove"
			"thumb price  price"
			"thumb qty    sub";
		row-gap: 8px; column-gap: var(--cw-space-4);
		align-items: start;
	}
	.cw-cart__main td.product-thumbnail { grid-area: thumb; align-self: start; }
	.cw-cart__main td.product-thumbnail img { width: 70px; height: 70px; }
	.cw-cart__main td.product-name     { grid-area: name; }
	.cw-cart__main td.product-remove   { grid-area: remove; text-align: right; }
	.cw-cart__main td.product-price    { grid-area: price; color: var(--ink-3); }
	.cw-cart__main td.product-quantity { grid-area: qty; }
	.cw-cart__main td.product-subtotal { grid-area: sub; text-align: right; align-self: center; }

	.cw-cart__main td.actions { flex-direction: column; align-items: stretch; }
	.cw-cart__main td.actions .coupon { flex-wrap: wrap; }
	.cw-cart__main td.actions .coupon input#coupon_code { flex: 1 1 100%; }
	.cw-cart__main td.actions button[name="apply_coupon"],
	.cw-cart__main td.actions button[name="update_cart"] { width: 100%; margin-left: 0; }
}

/* ── Estimated delivery (cart summary) ── */
.cw-cart__summary .cwv2-deliv-by--cart{margin:var(--cw-space-4) 0 0;padding:10px 14px;
  background:var(--cw-success-bg);color:var(--cw-success);border-radius:var(--cw-radius-md);
  font-size:12.5px;font-weight:600;text-align:center;}
.cw-cart__summary .cwv2-deliv-by--cart strong{font-weight:800;}
