/*
 * Cart and checkout (design/Cart.dc.html, design/Checkout.dc.html).
 * Styles the WooCommerce Cart/Checkout blocks + the free-shipping bar and the
 * focused checkout header.
 */

.tt-cart-page__inner,
.tt-checkout-page__inner {
	max-width: var(--tt-container, 1200px);
	margin-inline: auto;
	padding: 32px 0 64px; /* L/R gutter from the theme root padding; avoid double padding. */
	box-sizing: border-box;
}
.tt-checkout-page__inner {
	max-width: 1100px;
}
.tt-cart-page__title,
.tt-checkout-page__title {
	font-size: var(--wp--preset--font-size--xx-large);
	font-weight: 900;
	color: var(--wp--preset--color--brand-purple);
	margin: 0 0 20px;
}

/* ---------- Free-shipping bar ---------- */
.tt-shipbar {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 18px 20px;
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 16px;
	margin-bottom: 16px;
}
.tt-shipbar__msg {
	font-weight: 800;
}
.tt-shipbar__track {
	height: 14px;
	border-radius: 999px;
	background: var(--wp--preset--color--line);
	overflow: hidden;
}
.tt-shipbar__fill {
	height: 100%;
	background: var(--wp--preset--color--success-bar);
	border-radius: 999px;
	transition: width 0.3s ease;
}

/* ---------- Checkout steps / header ---------- */
.tt-checkout-steps {
	gap: 10px;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 800;
	margin-bottom: 8px;
}
.tt-checkout-steps .tt-step {
	margin: 0;
	color: var(--wp--preset--color--muted);
}
.tt-checkout-steps .tt-step--current {
	color: var(--wp--preset--color--primary);
}

/* ---------- WooCommerce blocks: shared ---------- */
.tt-cart-page .wc-block-cart,
.tt-checkout-page .wc-block-checkout {
	font-size: var(--wp--preset--font-size--medium);
}
.tt-cart-page .wc-block-cart-items,
.tt-cart-page .wc-block-components-sidebar,
.tt-checkout-page .wc-block-components-sidebar,
.tt-checkout-page .wc-block-checkout__main {
	border-radius: 18px;
}
.tt-cart-page .wc-block-components-sidebar,
.tt-checkout-page .wc-block-components-sidebar {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 20px;
	padding: 24px;
}
.tt-cart-page .wc-block-cart-item__product-name,
.tt-cart-page .wc-block-components-product-name {
	font-weight: 800;
	color: var(--wp--preset--color--ink);
}
/* "Order summary" heading: title case + weight to match the design (not caps). */
.tt-cart-page .wp-block-woocommerce-cart-order-summary-heading-block {
	text-transform: none;
	font-size: var(--wp--preset--font-size--large);
	font-weight: 900;
	color: var(--wp--preset--color--brand-purple);
	letter-spacing: 0;
	margin-bottom: 8px;
}
.tt-cart-page .wc-block-components-totals-item__value,
.tt-cart-page .wc-block-components-order-summary__button-text {
	font-weight: 800;
}

/* Primary action buttons in the blocks */
.tt-cart-page .wc-block-cart__submit-button,
.tt-checkout-page .wc-block-components-checkout-place-order-button {
	min-height: 60px;
	border-radius: 14px;
	background: var(--wp--preset--color--primary);
	font-weight: 900;
	font-size: 20px;
}
.tt-cart-page .wc-block-cart__submit-button:hover,
.tt-checkout-page .wc-block-components-checkout-place-order-button:hover {
	background: var(--wp--preset--color--primary-dark);
}

/* Group each checkout step into a white rounded card (matches the design panels). */
.tt-checkout-page .wc-block-components-checkout-step {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 20px;
	padding: 24px;
	margin-bottom: 24px;
}
.tt-checkout-page .wc-block-components-checkout-step__title {
	font-size: var(--wp--preset--font-size--large);
	font-weight: 900;
	color: var(--wp--preset--color--brand-purple);
}

/* Form fields in the checkout block */
.tt-checkout-page .wc-block-components-text-input input,
.tt-checkout-page .wc-block-components-select select,
.tt-checkout-page .wc-block-components-text-input textarea {
	min-height: 54px;
	border-radius: 12px;
	border: 2px solid var(--wp--preset--color--field-border);
	font-size: var(--wp--preset--font-size--medium);
}

/* Coupon / discount field in the cart */
.tt-cart-page .wc-block-components-totals-coupon__input input {
	min-height: 50px;
	border-radius: 12px;
}
.tt-cart-page .wc-block-components-totals-discount {
	color: var(--wp--preset--color--success);
}

/* Remove / links */
.tt-cart-page .wc-block-cart-item__remove-link {
	color: var(--wp--preset--color--danger);
	text-decoration: underline;
}

/* ---------- Cart line item: match the design ---------- */
/* Title: bold, dark, no underline (underline on hover only). */
.tt-cart-page .wc-block-components-product-name {
	text-decoration: none;
	font-size: var(--wp--preset--font-size--medium);
}
.tt-cart-page .wc-block-components-product-name:hover {
	text-decoration: underline;
}
/* Hide the per-unit price under the title — the line total on the right is enough. */
.tt-cart-page .wc-block-cart-item__prices {
	display: none !important;
}
/* Variation "Navy · L": drop the "Color:/Size:" labels and the default " / " sep. */
.tt-cart-page .wc-block-components-product-details__name,
.tt-cart-page .wc-block-components-product-metadata span[aria-hidden="true"] {
	display: none;
}
.tt-cart-page .wc-block-components-product-details > span:not(:last-child)::after {
	content: " · ";
	color: var(--wp--preset--color--muted);
}
/* Show the variation line above the "Made to order" note (design order). */
.tt-cart-page .wc-block-components-product-metadata {
	display: flex;
	flex-direction: column;
}
.tt-cart-page .wc-block-components-product-details:has(.wc-block-components-product-details__name) {
	order: -1;
}
/* Remove: a "Remove" text link instead of the default trash icon. */
.tt-cart-page .wc-block-cart-item__remove-link svg {
	display: none;
}
.tt-cart-page .wc-block-cart-item__remove-link {
	width: auto;
	height: auto;
	min-width: 0;
	padding: 0;
}
.tt-cart-page .wc-block-cart-item__remove-link::after {
	content: "Remove";
	font-weight: 700;
	font-size: var(--wp--preset--font-size--small);
}

/* The design uses plain item rows, no "Product / Total" column header. */
.tt-cart-page .wc-block-cart-items__header {
	display: none;
}
/* Soft rounded frame on each item image (design). */
.tt-cart-page .wc-block-cart-item__image img {
	border-radius: 12px;
	background: var(--wp--preset--color--surface);
}

/* Each line item is its own white rounded card. Convert the WooCommerce table
   row to a flex container so the whole item — image, details and price — sits
   inside ONE clean card, independent of the block's table layout (otherwise the
   price cell can spill outside the card). */
.tt-cart-page .wc-block-cart-items,
.tt-cart-page .wc-block-cart-items > tbody {
	display: block;
	background: transparent;
	border: 0;
}
.tt-cart-page .wc-block-cart-items__row {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	background: #fff;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 14px;
	padding: 10px;
	margin-bottom: 12px;
}
.tt-cart-page .wc-block-cart-items__row td {
	display: block;
	background: transparent;
	border: 0;
	padding: 0;
}
.tt-cart-page .wc-block-cart-item__image {
	flex: 0 0 auto;
}
.tt-cart-page .wc-block-cart-item__image img {
	max-width: 110px;
}
.tt-cart-page .wc-block-cart-item__product {
	flex: 1 1 auto;
}
.tt-cart-page .wc-block-cart-item__total {
	flex: 0 0 auto;
	margin-left: auto;
	white-space: nowrap;
	font-weight: 800;
	color: var(--wp--preset--color--brand-purple);
}

/* Product name: bolder. */
.tt-cart-page .wc-block-components-product-name {
	font-weight: 800 !important;
}

/* Quantity stepper: clearer outer box, borderless inner number field. */
.tt-cart-page .wc-block-components-quantity-selector {
	border: 2px solid var(--wp--preset--color--field-border);
	border-radius: 12px;
}
.tt-cart-page .wc-block-components-quantity-selector__input,
.tt-cart-page .wc-block-components-quantity-selector__input:focus {
	border: 0 !important;
	box-shadow: none !important;
	outline: 0 !important;
	background: transparent;
}

/* "Continue shopping" link below the items column (design/Cart) */
.tt-cart-continue {
	margin: 20px 0 0;
	font-weight: 800;
}
.tt-cart-continue a {
	color: var(--wp--preset--color--primary);
	text-decoration: none;
}
.tt-cart-continue a:hover {
	text-decoration: underline;
}

/* Order summary: emphasise the Total row with a divider above it (design). */
.tt-cart-page .wc-block-components-totals-item.wc-block-components-totals-footer-item {
	border-top: 1px solid var(--wp--preset--color--line);
	margin-top: 6px;
	padding-top: 14px;
	font-size: var(--wp--preset--font-size--large);
}
.tt-cart-page .wc-block-components-totals-footer-item .wc-block-components-totals-item__value {
	font-weight: 900;
	color: var(--wp--preset--color--brand-purple);
}

/* Replace the default card-icon strip with the design's reassurance note. */
.tt-cart-page .wp-block-woocommerce-cart-accepted-payment-methods-block {
	display: none;
}
.tt-cart-page .wp-block-woocommerce-proceed-to-checkout-block::after {
	content: "Secure checkout with PayPal. Printables download right after payment.";
	display: block;
	margin-top: 14px;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--muted);
	text-align: center;
	line-height: 1.5;
}

/* ---------- Empty cart: "New in store" + buttons match the theme ----------
 * WooCommerce's default product-collection links/buttons render in its blue;
 * recolour them to the shop's ink + primary so the empty cart stays on-brand. */
.tt-cart-page .wc-block-product-template .wp-block-post-title,
.tt-cart-page .wc-block-product-template .wp-block-post-title a,
.tt-cart-page .wc-block-grid__product-title,
.tt-cart-page .wc-block-components-product-name {
	color: var(--wp--preset--color--ink) !important;
	text-decoration: none;
	font-weight: 800;
}
.tt-cart-page .wc-block-product-template .wp-block-post-title a:hover,
.tt-cart-page .wc-block-components-product-name:hover {
	color: var(--wp--preset--color--primary) !important;
}
/* Buttons: Return to shop, Select options / Add to cart, and any core button. */
.tt-cart-page .wc-block-product-template .wp-block-button__link,
.tt-cart-page .wp-block-woocommerce-product-button .wc-block-components-product-button__button,
.tt-cart-page .wp-block-woocommerce-product-button a,
.tt-cart-page .wc-block-cart__empty-cart__button,
.tt-cart-page .wc-block-cart__empty-cart__button .wp-block-button__link,
.tt-cart-page .wp-block-button__link {
	background-color: var(--wp--preset--color--primary) !important;
	color: #fff !important;
	border-color: var(--wp--preset--color--primary) !important;
	border-radius: 14px !important;
}
.tt-cart-page .wc-block-product-template .wp-block-button__link:hover,
.tt-cart-page .wp-block-button__link:hover {
	background-color: var(--wp--preset--color--primary-dark) !important;
}
/* Plain text links on the empty cart (e.g. "Continue shopping"). */
.tt-cart-page .wp-block-woocommerce-empty-cart-block a:not(.wp-block-button__link):not(.wc-block-cart__empty-cart__button) {
	color: var(--wp--preset--color--primary) !important;
}
