/**
 * Woo Category Layout — Cart & Checkout styling.
 *
 * Matches the shop-grid design: white cards, light borders, rounded corners,
 * accent-coloured primary buttons and focus states.
 *
 * Scoped under body.wcl-checkout and written to cover BOTH:
 *   - Classic (shortcode) markup: .woocommerce-checkout, #order_review, #payment …
 *   - Block markup:               .wc-block-checkout, .wc-block-components-* …
 *
 * Accent variables (--wcl-accent / --wcl-accent-dark) are injected inline
 * from the plugin settings; the rest of the palette is defined here.
 */

body.wcl-checkout {
	--wcl-accent: #2271b1;
	--wcl-accent-dark: #135e96;
	--wcl-border: #e4e7ec;
	--wcl-border-strong: #d0d5dd;
	--wcl-text: #1d2327;
	--wcl-muted: #667085;
	--wcl-bg-soft: #f9fafb;
	--wcl-card-bg: #ffffff;
	--wcl-radius: 10px;
	--wcl-radius-sm: 8px;
	color: var(--wcl-text);
}

/* =========================================================================
 * Shared form controls (classic + block)
 * ====================================================================== */

body.wcl-checkout input[type="text"],
body.wcl-checkout input[type="email"],
body.wcl-checkout input[type="tel"],
body.wcl-checkout input[type="password"],
body.wcl-checkout input[type="number"],
body.wcl-checkout textarea,
body.wcl-checkout select,
body.wcl-checkout .select2-selection,
body.wcl-checkout .wc-block-components-text-input input,
body.wcl-checkout .wc-block-components-textarea {
	width: 100%;
	border: 1px solid var(--wcl-border) !important;
	border-radius: var(--wcl-radius-sm) !important;
	padding: 11px 14px !important;
	font-size: 15px !important;
	line-height: 1.4 !important;
	color: var(--wcl-text) !important;
	background-color: #fff !important;
	box-shadow: none !important;
	transition: border-color .15s ease, box-shadow .15s ease;
	box-sizing: border-box;
}

body.wcl-checkout input:focus,
body.wcl-checkout textarea:focus,
body.wcl-checkout select:focus,
body.wcl-checkout .wc-block-components-text-input input:focus,
body.wcl-checkout .select2-container--focus .select2-selection {
	border-color: var(--wcl-accent) !important;
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--wcl-accent) 18%, transparent) !important;
	outline: none !important;
}

/* Select2 (classic country/state dropdowns) height alignment */
body.wcl-checkout .select2-container .select2-selection--single {
	height: auto !important;
	min-height: 44px;
	display: flex;
	align-items: center;
}
body.wcl-checkout .select2-container--default .select2-selection--single .select2-selection__arrow {
	height: 100%;
}

/* Labels */
body.wcl-checkout .woocommerce-billing-fields label,
body.wcl-checkout .woocommerce-shipping-fields label,
body.wcl-checkout .woocommerce-additional-fields label,
body.wcl-checkout form.checkout .form-row label,
body.wcl-checkout .wc-block-components-text-input label {
	font-size: 13px;
	font-weight: 600;
	color: var(--wcl-text);
}

/* Floating block labels keep the muted look */
body.wcl-checkout .wc-block-components-text-input label {
	color: var(--wcl-muted);
}

body.wcl-checkout .required,
body.wcl-checkout .wc-block-components-label-required {
	color: #e0405e;
	border: 0;
}

/* =========================================================================
 * Buttons (classic + block)
 * ====================================================================== */

/* Primary CTAs: filled accent */
body.wcl-checkout #place_order,
body.wcl-checkout .wc-proceed-to-checkout .checkout-button,
body.wcl-checkout .wc-block-components-checkout-place-order-button,
body.wcl-checkout .wp-block-woocommerce-cart .wc-block-cart__submit-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 14px 20px !important;
	font-size: 15px !important;
	font-weight: 700 !important;
	letter-spacing: .01em;
	color: #fff !important;
	background: var(--wcl-accent) !important;
	border: 1px solid var(--wcl-accent) !important;
	border-radius: var(--wcl-radius-sm) !important;
	box-shadow: none !important;
	text-shadow: none !important;
	cursor: pointer;
	transition: background .15s ease, border-color .15s ease;
}

body.wcl-checkout #place_order:hover,
body.wcl-checkout .wc-proceed-to-checkout .checkout-button:hover,
body.wcl-checkout .wc-block-components-checkout-place-order-button:hover,
body.wcl-checkout .wp-block-woocommerce-cart .wc-block-cart__submit-button:hover {
	background: var(--wcl-accent-dark) !important;
	border-color: var(--wcl-accent-dark) !important;
}

/* Secondary buttons: outlined (apply coupon, update cart, etc.) */
body.wcl-checkout .woocommerce button.button:not(#place_order),
body.wcl-checkout .woocommerce a.button:not(.checkout-button),
body.wcl-checkout .wc-block-components-button.outlined,
body.wcl-checkout .wc-block-components-button:not(.contained) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 11px 18px !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	color: var(--wcl-text) !important;
	background: #fff !important;
	border: 1px solid var(--wcl-border) !important;
	border-radius: var(--wcl-radius-sm) !important;
	box-shadow: none !important;
	transition: border-color .15s ease, color .15s ease, background .15s ease;
}

body.wcl-checkout .woocommerce button.button:not(#place_order):hover,
body.wcl-checkout .woocommerce a.button:not(.checkout-button):hover,
body.wcl-checkout .wc-block-components-button:not(.contained):hover {
	border-color: var(--wcl-accent) !important;
	color: var(--wcl-accent) !important;
	background: var(--wcl-bg-soft) !important;
}

/* Block "contained" buttons should read as primary */
body.wcl-checkout .wc-block-components-button.contained {
	background: var(--wcl-accent) !important;
	border-radius: var(--wcl-radius-sm) !important;
	color: #fff !important;
}

/* =========================================================================
 * Panels / cards — order review, cart totals, payment
 * ====================================================================== */

/* Classic order review + cart totals */
body.wcl-checkout #order_review,
body.wcl-checkout .cart_totals,
body.wcl-checkout .woocommerce-checkout-review-order,
body.wcl-checkout .wc-block-components-sidebar,
body.wcl-checkout .wc-block-checkout__sidebar {
	background: var(--wcl-card-bg);
	border: 1px solid var(--wcl-border);
	border-radius: var(--wcl-radius);
	padding: 22px;
}

/* Billing / shipping column — card it so the left/top matches the order summary.
 * Works whether the theme places it beside the order review (2-col) or stacked
 * full-width (e.g. Divi). */
body.wcl-checkout #customer_details {
	background: var(--wcl-card-bg);
	border: 1px solid var(--wcl-border);
	border-radius: var(--wcl-radius);
	padding: 24px;
	margin-bottom: 24px;
	box-sizing: border-box;
}

/* Stack billing + shipping full-width inside the card (WooCommerce floats
 * .col-1 to ~48% by default, which squishes the fields). */
body.wcl-checkout #customer_details .col-1,
body.wcl-checkout #customer_details .col-2 {
	width: 100%;
	float: none;
	max-width: 100%;
}

/* Classic payment box sits inside #order_review — flatten its default styling */
body.wcl-checkout #payment,
body.wcl-checkout #payment .payment_box {
	background: transparent !important;
	border-radius: var(--wcl-radius-sm);
}
body.wcl-checkout #payment {
	border-top: 1px solid var(--wcl-border);
	margin-top: 6px;
	padding-top: 16px;
}
body.wcl-checkout #payment ul.payment_methods {
	border: 0 !important;
	padding: 0 !important;
	margin: 0 0 12px !important;
}
body.wcl-checkout #payment ul.payment_methods li {
	list-style: none;
	padding: 12px 14px;
	border: 1px solid var(--wcl-border);
	border-radius: var(--wcl-radius-sm);
	margin-bottom: 8px;
}
body.wcl-checkout #payment .payment_box {
	background: var(--wcl-bg-soft) !important;
	padding: 12px 14px;
	margin-top: 8px;
	font-size: 13px;
	color: var(--wcl-muted);
}
body.wcl-checkout #payment .payment_box::before {
	display: none !important; /* remove the default speech-bubble arrow */
}

/* =========================================================================
 * Tables — cart contents & order review (classic)
 * ====================================================================== */

body.wcl-checkout .shop_table,
body.wcl-checkout .woocommerce-checkout-review-order-table,
body.wcl-checkout .woocommerce-cart-form__contents {
	border: 1px solid var(--wcl-border) !important;
	border-radius: var(--wcl-radius) !important;
	border-collapse: separate !important;
	border-spacing: 0 !important;
	overflow: hidden;
	width: 100%;
}

body.wcl-checkout .shop_table thead th {
	background: var(--wcl-bg-soft);
	color: var(--wcl-muted);
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .03em;
	padding: 14px 16px;
	border: 0;
}

body.wcl-checkout .shop_table td,
body.wcl-checkout .shop_table th {
	padding: 14px 16px;
	border-top: 1px solid var(--wcl-border) !important;
	border-left: 0 !important;
	border-right: 0 !important;
	vertical-align: middle;
}

body.wcl-checkout .shop_table tbody tr:first-child td {
	border-top: 0 !important;
}

body.wcl-checkout .shop_table tfoot th,
body.wcl-checkout .shop_table tfoot td {
	background: var(--wcl-bg-soft);
	font-size: 14px;
}

body.wcl-checkout .order-total .amount,
body.wcl-checkout .cart_totals .order-total td {
	color: var(--wcl-accent);
	font-weight: 700;
	font-size: 17px;
}

/* Product thumbs in the cart */
body.wcl-checkout .cart_item .product-thumbnail img {
	width: 64px;
	height: 64px;
	object-fit: cover;
	border-radius: var(--wcl-radius-sm);
	border: 1px solid var(--wcl-border);
}

/* Quantity input */
body.wcl-checkout .quantity input.qty {
	width: 72px;
	text-align: center;
	padding: 8px !important;
}

/* Coupon row */
body.wcl-checkout .coupon .input-text {
	max-width: 220px;
}

/* =========================================================================
 * Headings & login/coupon notices
 * ====================================================================== */

body.wcl-checkout h3#order_review_heading,
body.wcl-checkout .woocommerce-billing-fields h3,
body.wcl-checkout .woocommerce-shipping-fields h3,
body.wcl-checkout .cart_totals h2,
body.wcl-checkout .wc-block-components-title {
	font-size: 18px;
	font-weight: 700;
	color: var(--wcl-text);
	margin-bottom: 14px;
}

/* Info / coupon toggle bars at the top of checkout */
body.wcl-checkout .woocommerce-info,
body.wcl-checkout .woocommerce-form-login-toggle .woocommerce-info,
body.wcl-checkout .woocommerce-form-coupon-toggle .woocommerce-info {
	background: var(--wcl-bg-soft);
	border: 1px solid var(--wcl-border);
	border-top: 3px solid var(--wcl-accent);
	border-radius: var(--wcl-radius-sm);
	color: var(--wcl-text);
	padding: 14px 16px;
}
body.wcl-checkout .woocommerce-info a,
body.wcl-checkout .woocommerce-message a {
	color: var(--wcl-accent);
}

body.wcl-checkout .woocommerce-message {
	border-top-color: #2e9e5b;
}

body.wcl-checkout .woocommerce-error {
	border: 1px solid #f5c2cb;
	border-top: 3px solid #e0405e;
	border-radius: var(--wcl-radius-sm);
	background: #fff5f6;
}

/* =========================================================================
 * Block checkout layout polish
 * ====================================================================== */

body.wcl-checkout .wc-block-checkout__main,
body.wcl-checkout .wc-block-cart__main {
	background: var(--wcl-card-bg);
	border: 1px solid var(--wcl-border);
	border-radius: var(--wcl-radius);
	padding: 24px;
}

body.wcl-checkout .wc-block-components-totals-item__value {
	font-weight: 600;
}

body.wcl-checkout .wc-block-components-totals-footer-item .wc-block-components-totals-item__value {
	color: var(--wcl-accent);
}

/* Block step separators */
body.wcl-checkout .wc-block-checkout__form .wc-block-components-checkout-step {
	border-bottom: 1px solid var(--wcl-border);
}

/* Radio / payment option accents (block) */
body.wcl-checkout .wc-block-components-radio-control__option::before,
body.wcl-checkout input[type="radio"]:checked,
body.wcl-checkout input[type="checkbox"]:checked {
	accent-color: var(--wcl-accent);
}

/* =========================================================================
 * My Account pages (dashboard, orders, addresses, account details, login…)
 * ====================================================================== */

/* Account navigation menu → card with an accent active item. */
body.wcl-checkout .woocommerce-MyAccount-navigation ul {
	list-style: none !important;
	margin: 0 0 24px !important;
	padding: 0 !important;
	background: var(--wcl-card-bg);
	border: 1px solid var(--wcl-border);
	border-radius: var(--wcl-radius);
	overflow: hidden;
}
body.wcl-checkout .woocommerce-MyAccount-navigation li {
	margin: 0 !important;
	padding: 0 !important;
	border-bottom: 1px solid var(--wcl-border);
	list-style: none !important;
}
body.wcl-checkout .woocommerce-MyAccount-navigation li::before {
	content: none !important;
}
body.wcl-checkout .woocommerce-MyAccount-navigation li:last-child {
	border-bottom: 0;
}
body.wcl-checkout .woocommerce-MyAccount-navigation li a {
	display: block;
	padding: 12px 16px !important;
	color: var(--wcl-text) !important;
	font-weight: 500;
	text-decoration: none !important;
	transition: background .15s ease, color .15s ease;
}
body.wcl-checkout .woocommerce-MyAccount-navigation li a:hover {
	background: var(--wcl-bg-soft);
	color: var(--wcl-accent) !important;
}
body.wcl-checkout .woocommerce-MyAccount-navigation li.is-active a {
	background: var(--wcl-accent);
	color: #fff !important;
}

/* Account content headings + intro copy spacing. */
body.wcl-checkout .woocommerce-MyAccount-content > p:first-of-type {
	margin-top: 0;
}

/* Saved address blocks → cards. */
body.wcl-checkout .woocommerce-Addresses .woocommerce-Address {
	background: var(--wcl-card-bg);
	border: 1px solid var(--wcl-border);
	border-radius: var(--wcl-radius);
	padding: 20px;
}
body.wcl-checkout .woocommerce-Address address {
	font-style: normal;
	line-height: 1.6;
	color: var(--wcl-muted);
}

/* Account form labels match the rest of the design. */
body.wcl-checkout .woocommerce-account .form-row label,
body.wcl-checkout .woocommerce-EditAccountForm label,
body.wcl-checkout .woocommerce-form-login label,
body.wcl-checkout .woocommerce-form-register label {
	font-size: 13px;
	font-weight: 600;
	color: var(--wcl-text);
}

/* =========================================================================
 * Responsive
 * ====================================================================== */

@media (max-width: 768px) {
	body.wcl-checkout #order_review,
	body.wcl-checkout .cart_totals,
	body.wcl-checkout .wc-block-checkout__main,
	body.wcl-checkout .wc-block-cart__main {
		padding: 16px;
	}
	body.wcl-checkout .coupon .input-text {
		max-width: 100%;
	}
}
