/* ==========================================================================
   Checkout & Cart Upgrade — checkout-upgrade.md
   ALL rules are scoped to body.thbig-checkout-upgrade.
   To revert: set THBIG_CHECKOUT_UPGRADE = false in
   inc/functions-checkout-upgrade.php — zero other files touched.
   ========================================================================== */

/* --------------------------------------------------------------------------
   10 · TYPOGRAPHY + BASE SPACING (applied first so everything inherits)
   -------------------------------------------------------------------------- */

body.thbig-checkout-upgrade .woocommerce-page,
body.thbig-checkout-upgrade .woocommerce-cart,
body.thbig-checkout-upgrade .woocommerce-checkout {
	font-family: 'Lato', sans-serif;
}

/* Tighten default WC form-row padding */
body.thbig-checkout-upgrade .woocommerce-checkout .form-row {
	padding-top: 0 !important;
	padding-bottom: 14px !important;
	margin-bottom: 0 !important;
}

/* --------------------------------------------------------------------------
   1 · CART — PRODUCT ROWS AS CARDS
   -------------------------------------------------------------------------- */

/* Convert table to block so flex-row layout works */
body.thbig-checkout-upgrade .woocommerce-cart-form table.cart,
body.thbig-checkout-upgrade .woocommerce-cart-form table.cart tbody {
	display: block;
	border: none;
	background: transparent;
	width: 100%;
}

body.thbig-checkout-upgrade .woocommerce-cart-form table.cart thead {
	display: none !important;
}

/* Each cart item row → flex card */
body.thbig-checkout-upgrade .woocommerce-cart-form table.cart tbody tr.cart_item {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px 14px;
	position: relative;
	padding: 14px 16px 14px 14px;
	margin-bottom: 12px;
	background: #fff;
	border: 1px solid #e2e8ef;
	border-radius: 10px;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

body.thbig-checkout-upgrade .woocommerce-cart-form table.cart td {
	border: 0 !important;
	padding: 0 !important;
}

/* Remove × — top-right corner */
body.thbig-checkout-upgrade .woocommerce-cart-form table.cart td.product-remove {
	position: absolute;
	top: 10px;
	right: 10px;
	flex: none;
	width: auto;
}

body.thbig-checkout-upgrade .woocommerce-cart-form table.cart td.product-remove a.remove {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: #f5f7fa;
	color: #9ca3af !important;
	font-size: 20px;
	line-height: 1;
	text-decoration: none;
	transition: background 0.2s, color 0.2s;
}

body.thbig-checkout-upgrade .woocommerce-cart-form table.cart td.product-remove a.remove:hover {
	background: #fee2e2;
	color: #dc2626 !important;
}

/* Thumbnail */
body.thbig-checkout-upgrade .woocommerce-cart-form table.cart td.product-thumbnail {
	flex: 0 0 72px;
}

body.thbig-checkout-upgrade .woocommerce-cart-form table.cart td.product-thumbnail img {
	width: 72px;
	height: 72px;
	object-fit: contain;
	border-radius: 6px;
	border: 1px solid #f0f2f5;
	display: block;
}

/* Product name */
body.thbig-checkout-upgrade .woocommerce-cart-form table.cart td.product-name {
	flex: 1 1 140px;
	font-size: 0.93rem;
	line-height: 1.4;
	padding-right: 44px !important;
	/* clear the remove × button (Issue 4) */
}

body.thbig-checkout-upgrade .woocommerce-cart-form table.cart td.product-name a {
	font-weight: 600;
	color: #0d1b2a;
	text-decoration: none;
}

body.thbig-checkout-upgrade .woocommerce-cart-form table.cart td.product-name a:hover {
	color: var(--lc-primary);
}

body.thbig-checkout-upgrade .woocommerce-cart-form table.cart td.product-name .variation {
	font-size: 0.82rem;
	color: #6b7280;
	margin-top: 3px;
}

/* Unit price — omit (visible in subtotal) */
body.thbig-checkout-upgrade .woocommerce-cart-form table.cart td.product-price {
	display: none !important;
}

/* Quantity stepper */
body.thbig-checkout-upgrade .woocommerce-cart-form table.cart td.product-quantity {
	flex: 0 0 auto;
}

body.thbig-checkout-upgrade .woocommerce-cart-form table.cart td.product-quantity .qty {
	width: 60px;
	border: 1px solid #dde3ea;
	border-radius: 6px;
	padding: 6px 8px;
	font-size: 0.9rem;
	text-align: center;
}

/* Subtotal */
body.thbig-checkout-upgrade .woocommerce-cart-form table.cart td.product-subtotal {
	flex: 0 0 auto;
	font-weight: 700;
	font-size: 0.97rem;
	color: #0d1b2a;
	min-width: 58px;
	text-align: right;
}

/* Footer (tfoot) — hidden; shown in cart totals widget */
body.thbig-checkout-upgrade .woocommerce-cart-form table.cart tfoot {
	display: none !important;
}

/* Actions row (coupon + update cart) — Issue #22: row layout so Update Cart
   aligns horizontally with the coupon input. flex-wrap ensures they stack on
   very narrow screens without overflow. */
body.thbig-checkout-upgrade .woocommerce-cart-form table.cart td.actions {
	display: flex !important;
	flex-direction: row !important;
	align-items: flex-start !important;
	flex-wrap: wrap !important;
	gap: 8px !important;
	padding: 10px 0 4px !important;
	border: none !important;
	background: none !important;
	width: 100%;
}

/* --------------------------------------------------------------------------
   2 · CART — COUPON + TOTALS
   -------------------------------------------------------------------------- */

/* Coupon inline row */
body.thbig-checkout-upgrade .woocommerce-cart-form .coupon {
	display: flex;
	gap: 8px;
	align-items: center;
	flex-wrap: wrap;
	flex: 1 1 0;
	min-width: 0;
	margin-bottom: 0;
}

body.thbig-checkout-upgrade .woocommerce-cart-form .coupon label {
	display: none;
	/* redundant with placeholder */
}

body.thbig-checkout-upgrade .woocommerce-cart-form .coupon input#coupon_code {
	flex: 1 1 140px;
	border: 1px solid #dde3ea !important;
	border-radius: 6px !important;
	padding: 9px 12px !important;
	font-size: 0.9rem;
	outline: none;
	transition: border-color 0.2s;
}

body.thbig-checkout-upgrade .woocommerce-cart-form .coupon input#coupon_code:focus {
	border-color: var(--lc-primary) !important;
}

body.thbig-checkout-upgrade .woocommerce-cart-form .coupon .button {
	flex: none;
	background: #f5f7fa !important;
	color: #0d1b2a !important;
	border: 1px solid #dde3ea !important;
	border-radius: 6px !important;
	padding: 9px 16px !important;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s;
}

body.thbig-checkout-upgrade .woocommerce-cart-form .coupon .button:hover {
	background: #e8ecf2 !important;
}

/* Hide the coupon code field + Apply coupon button on the cart page. */
body.thbig-checkout-upgrade .woocommerce-cart-form table.cart td.actions .coupon {
	display: none !important;
}

/* Update cart: sits in the same flex row as the coupon section (Issue #22) */
body.thbig-checkout-upgrade .woocommerce-cart-form button[name="update_cart"],
body.thbig-checkout-upgrade .woocommerce-cart-form input[name="update_cart"] {
	display: block !important;
	background: #f5f7fa !important;
	color: #0d1b2a !important;
	border: 1px solid #dde3ea !important;
	border-radius: 6px !important;
	padding: 9px 16px !important;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s;
	margin-top: 0;
	flex-shrink: 0;
	width: auto;
}

body.thbig-checkout-upgrade .woocommerce-cart-form button[name="update_cart"]:hover,
body.thbig-checkout-upgrade .woocommerce-cart-form input[name="update_cart"]:hover {
	background: #e8ecf2 !important;
}

/* On very narrow screens revert to stacked column so nothing clips */
@media (max-width: 480px) {
	body.thbig-checkout-upgrade .woocommerce-cart-form table.cart td.actions {
		flex-direction: column !important;
		align-items: stretch !important;
	}

	body.thbig-checkout-upgrade .woocommerce-cart-form .coupon {
		flex: none;
		width: 100%;
	}

	body.thbig-checkout-upgrade .woocommerce-cart-form button[name="update_cart"],
	body.thbig-checkout-upgrade .woocommerce-cart-form input[name="update_cart"] {
		width: 100% !important;
	}
}

/* Cart totals card */
body.thbig-checkout-upgrade .cart-collaterals .cart_totals {
	background: #fff;
	border: 1px solid #e2e8ef;
	border-radius: 10px;
	padding: 20px;
	box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
}

body.thbig-checkout-upgrade .cart-collaterals .cart_totals h2 {
	font-size: 1rem;
	font-weight: 700;
	color: #0d1b2a;
	margin: 0 0 16px;
	padding-bottom: 12px;
	border-bottom: 1px solid #f0f2f5;
}

body.thbig-checkout-upgrade .cart-collaterals .cart_totals table {
	border: none;
	background: transparent;
	width: 100%;
}

body.thbig-checkout-upgrade .cart-collaterals .cart_totals table tr {
	border-bottom: 1px solid #f4f6f8;
}

body.thbig-checkout-upgrade .cart-collaterals .cart_totals table tr:last-child {
	border-bottom: none;
}

body.thbig-checkout-upgrade .cart-collaterals .cart_totals table th,
body.thbig-checkout-upgrade .cart-collaterals .cart_totals table td {
	padding: 10px 0 !important;
	font-size: 0.93rem;
	border: none !important;
	background: transparent;
}

body.thbig-checkout-upgrade .cart-collaterals .cart_totals table .order-total th,
body.thbig-checkout-upgrade .cart-collaterals .cart_totals table .order-total td {
	font-weight: 700;
	font-size: 1.05rem;
	padding-top: 14px !important;
}

body.thbig-checkout-upgrade .cart-collaterals .cart_totals .wc-proceed-to-checkout {
	padding: 0;
	margin-top: 4px;
}

body.thbig-checkout-upgrade .cart-collaterals .cart_totals .wc-proceed-to-checkout .checkout-button {
	display: block !important;
	width: 100%;
	padding: 14px 20px !important;
	background: var(--lc-primary) !important;
	color: #fff !important;
	font-weight: 700;
	font-size: 1rem;
	border-radius: 8px !important;
	text-align: center;
	border: none !important;
	transition: background 0.2s;
	letter-spacing: 0.01em;
}

body.thbig-checkout-upgrade .cart-collaterals .cart_totals .wc-proceed-to-checkout .checkout-button:hover {
	background: var(--lc-primary-hover) !important;
}

/* --------------------------------------------------------------------------
   3 · EMPTY CART
   -------------------------------------------------------------------------- */

body.thbig-checkout-upgrade .thbig-empty-cart {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 60px 20px 80px;
	text-align: center;
	color: #6b7280;
}

body.thbig-checkout-upgrade .thbig-empty-cart svg {
	color: #c7d0da;
	margin-bottom: 20px;
}

body.thbig-checkout-upgrade .thbig-empty-cart h3 {
	font-size: 1.3rem;
	font-weight: 700;
	color: #0d1b2a;
	margin: 0 0 8px;
}

body.thbig-checkout-upgrade .thbig-empty-cart p {
	font-size: 0.95rem;
	margin: 0 0 28px;
}

body.thbig-checkout-upgrade .thbig-empty-cart .thbig-continue-shopping {
	display: inline-block;
	padding: 12px 32px !important;
	background: var(--lc-primary) !important;
	color: #fff !important;
	border-radius: 8px !important;
	font-weight: 700;
	font-size: 0.97rem;
	text-decoration: none;
	transition: background 0.2s;
}

body.thbig-checkout-upgrade .thbig-empty-cart .thbig-continue-shopping:hover {
	background: var(--lc-primary-hover) !important;
}

/* --------------------------------------------------------------------------
   4 · MOBILE CHECKOUT — billing form stays first (natural order preserved).
       Scroll reduction comes from compact cards + sticky Place Order (#8).
   -------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------
   5 · CHECKOUT SECTION HEADINGS — slim rule-through dividers
   -------------------------------------------------------------------------- */

body.thbig-checkout-upgrade .woocommerce-checkout #customer_details .col-1>h3,
body.thbig-checkout-upgrade .woocommerce-checkout #customer_details .col-2>h3,
body.thbig-checkout-upgrade .woocommerce-checkout #order_review_heading,
body.thbig-checkout-upgrade .woocommerce-checkout #payment h3 {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #9ca3af;
	margin: 0 0 18px;
}

body.thbig-checkout-upgrade .woocommerce-checkout #customer_details .col-1>h3::after,
body.thbig-checkout-upgrade .woocommerce-checkout #customer_details .col-2>h3::after,
body.thbig-checkout-upgrade .woocommerce-checkout #order_review_heading::after,
body.thbig-checkout-upgrade .woocommerce-checkout #payment h3::after {
	content: '';
	flex: 1;
	height: 1px;
	background: var(--lc-border-header);
}

/* --------------------------------------------------------------------------
   6 · CHECKOUT FORM FIELDS — clean bottom-border style
   -------------------------------------------------------------------------- */

body.thbig-checkout-upgrade .woocommerce-checkout .form-row input.input-text,
body.thbig-checkout-upgrade .woocommerce-checkout .form-row select,
body.thbig-checkout-upgrade .woocommerce-checkout .form-row textarea {
	border: none !important;
	border-bottom: 1.5px solid #d4dae2 !important;
	border-radius: 0 !important;
	padding: 10px 0 8px !important;
	background: transparent !important;
	font-size: 0.95rem;
	color: #0d1b2a;
	box-shadow: none !important;
	outline: none;
	transition: border-color 0.2s, box-shadow 0.2s;
	width: 100%;
}

body.thbig-checkout-upgrade .woocommerce-checkout .form-row input.input-text:focus,
body.thbig-checkout-upgrade .woocommerce-checkout .form-row select:focus,
body.thbig-checkout-upgrade .woocommerce-checkout .form-row textarea:focus {
	border-bottom-color: var(--lc-primary) !important;
	box-shadow: 0 1px 0 0 var(--lc-primary) !important;
}

body.thbig-checkout-upgrade .woocommerce-checkout .form-row.woocommerce-invalid input.input-text,
body.thbig-checkout-upgrade .woocommerce-checkout .form-row.woocommerce-invalid select {
	border-bottom-color: #dc2626 !important;
	box-shadow: 0 1px 0 0 #dc2626 !important;
}

body.thbig-checkout-upgrade .woocommerce-checkout .form-row label {
	font-size: 0.8rem;
	font-weight: 600;
	color: #6b7280;
	margin-bottom: 2px;
	display: block;
	line-height: 1.3;
}

body.thbig-checkout-upgrade .woocommerce-checkout .form-row label .required {
	color: #dc2626;
	margin-left: 1px;
}

body.thbig-checkout-upgrade .woocommerce-checkout .woocommerce-invalid-required-field label,
body.thbig-checkout-upgrade .woocommerce-checkout .woocommerce-invalid label {
	color: #dc2626;
}

/* --------------------------------------------------------------------------
   7 · PAYMENT SECTION — selectable tile radio buttons
   -------------------------------------------------------------------------- */

body.thbig-checkout-upgrade #payment {
	background: #fff;
	border: 1px solid #e2e8ef;
	border-radius: 10px;
	padding: 20px;
	box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
}

body.thbig-checkout-upgrade #payment ul.payment_methods {
	border: none !important;
	padding: 0 !important;
	margin: 0px !important;
}

body.thbig-checkout-upgrade #payment ul.payment_methods li.payment_method {
	border: 1.5px solid #e2e8ef;
	border-radius: 8px;
	margin-bottom: 8px;
	overflow: hidden;
	transition: border-color 0.2s;
	background: #fff;
	padding: 0 !important;
}

body.thbig-checkout-upgrade #payment ul.payment_methods li.payment_method:has(> label input:checked) {
	border-color: var(--lc-primary);
	background: #f0f7ff;
}

body.thbig-checkout-upgrade #payment ul.payment_methods li.payment_method>label {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 13px 16px;
	cursor: pointer;
	font-weight: 600;
	font-size: 0.93rem;
	color: #0d1b2a;
	width: 100%;
	margin: 0;
}

body.thbig-checkout-upgrade #payment ul.payment_methods li.payment_method>label img {
	height: 22px;
	width: auto;
	object-fit: contain;
}

body.thbig-checkout-upgrade #payment ul.payment_methods li.payment_method>label input[type="radio"] {
	accent-color: var(--lc-primary);
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	margin: 0;
}

body.thbig-checkout-upgrade #payment .payment_box {
	background: var(--lc-cream);
	padding: 12px 16px;
	margin: 0 0 8px;
	border-radius: 0 0 6px 6px;
	font-size: 0.88rem;
	color: #4b5563;
	line-height: 1.5;
}

body.thbig-checkout-upgrade #payment .place-order {
	padding: 0 !important;
	background: none;
}

body.thbig-checkout-upgrade #payment #place_order {
	display: block;
	width: 100%;
	padding: 14px 20px !important;
	background: var(--lc-primary) !important;
	color: #fff !important;
	font-weight: 700;
	font-size: 1rem;
	border: none !important;
	border-radius: 8px !important;
	cursor: pointer;
	letter-spacing: 0.01em;
	transition: background 0.2s, transform 0.1s;
}

body.thbig-checkout-upgrade #payment #place_order:hover {
	background: var(--lc-primary-hover) !important;
}

body.thbig-checkout-upgrade #payment #place_order:active {
	transform: scale(0.99);
}

/* --------------------------------------------------------------------------
   8 · STICKY PLACE ORDER — mobile only
   -------------------------------------------------------------------------- */

.thbig-sticky-place-order {
	display: none;
}

@media (max-width: 767px) {
	.thbig-sticky-place-order {
		display: block;
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		z-index: 9999;
		padding: 12px 16px;
		padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
		background: #fff;
		border-top: 1px solid #e2e8ef;
		box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.1);
		transform: translateY(110%);
		transition: transform 0.3s ease;
	}

	.thbig-sticky-place-order.is-visible {
		transform: translateY(0);
	}

	.thbig-sticky-po-btn {
		display: block;
		width: 100%;
		padding: 14px !important;
		background: var(--lc-primary) !important;
		color: #fff !important;
		font-weight: 700;
		font-size: 1rem;
		border: none !important;
		border-radius: 8px !important;
		cursor: pointer;
		text-align: center;
		transition: background 0.2s;
	}

	.thbig-sticky-po-btn:hover {
		background: var(--lc-primary-hover) !important;
	}

	/* Prevent content from hiding behind sticky bar */
	body.thbig-checkout-upgrade.woocommerce-checkout {
		padding-bottom: 80px;
	}
}

/* --------------------------------------------------------------------------
   9 · NOTICES + ERRORS — slim left-accented style
   WooCommerce adds ::before icon via its icon font (position:absolute,
   left:1.5em, top:1em). We override padding-left to 2.5em to give the
   icon space, then reposition it to top:50%/transform:translateY(-50%)
   so it stays vertically centered regardless of text length.
   -------------------------------------------------------------------------- */

body.thbig-checkout-upgrade .woocommerce-notices-wrapper ul.woocommerce-error,
body.thbig-checkout-upgrade .woocommerce-notices-wrapper .woocommerce-error,
body.thbig-checkout-upgrade .woocommerce-notices-wrapper .woocommerce-message,
body.thbig-checkout-upgrade .woocommerce-notices-wrapper .woocommerce-info {
	border-radius: 8px;
	padding: 12px 16px 12px 2.5em !important;
	font-size: 0.9rem;
	margin-bottom: 12px;
	border: none;
	border-left: 3px solid transparent;
	list-style: none;
	position: relative !important;
}

/* Re-anchor the WooCommerce icon so it sits left-center inside our box */
body.thbig-checkout-upgrade .woocommerce-notices-wrapper ul.woocommerce-error::before,
body.thbig-checkout-upgrade .woocommerce-notices-wrapper .woocommerce-error::before,
body.thbig-checkout-upgrade .woocommerce-notices-wrapper .woocommerce-message::before,
body.thbig-checkout-upgrade .woocommerce-notices-wrapper .woocommerce-info::before {
	position: absolute !important;
	top: 50% !important;
	left: 0.75em !important;
	transform: translateY(-50%) !important;
	line-height: 1 !important;
}

body.thbig-checkout-upgrade .woocommerce-notices-wrapper ul.woocommerce-error,
body.thbig-checkout-upgrade .woocommerce-notices-wrapper .woocommerce-error {
	background: #fef2f2;
	color: #b91c1c;
	border-left-color: #dc2626;
}

body.thbig-checkout-upgrade .woocommerce-notices-wrapper .woocommerce-message {
	background: #f0fdf4;
	color: #166534;
	border-left-color: #16a34a;
}

body.thbig-checkout-upgrade .woocommerce-notices-wrapper .woocommerce-info {
	background: #eff6ff;
	color: #1e40af;
	border-left-color: var(--lc-primary-subtle);
}

/* Checkout page inline validation errors */
body.thbig-checkout-upgrade .woocommerce-checkout .woocommerce-error {
	background: #fef2f2;
	color: #b91c1c;
	border-left-color: #dc2626;
	border-radius: 8px;
	padding: 12px 16px 12px 2.5em;
	list-style: none;
	margin-bottom: 16px;
	position: relative;
}

body.thbig-checkout-upgrade .woocommerce-checkout .woocommerce-error::before {
	position: absolute !important;
	top: 50% !important;
	left: 0.75em !important;
	transform: translateY(-50%) !important;
	line-height: 1 !important;
}

body.thbig-checkout-upgrade .woocommerce-checkout .woocommerce-error li {
	margin: 0;
	padding: 2px 0;
	font-size: 0.88rem;
}

/* ── Unified notice bar: WC NoticeGroup wrapper neutralised inside bar ── */
/* WC wraps payment errors in .woocommerce-NoticeGroup-checkout before our   */
/* MutationObserver moves the element into .woocommerce-notices-wrapper.      */
/* Strip its box so the inner .woocommerce-error receives our bar styles.     */
body.thbig-checkout-upgrade .woocommerce-notices-wrapper .woocommerce-NoticeGroup,
body.thbig-checkout-upgrade .woocommerce-notices-wrapper .woocommerce-NoticeGroup-checkout {
	margin: 0;
	padding: 0;
	background: transparent;
	border: none;
	width: 92%;
	margin-left: 4%;
}

/* Hide the second .woocommerce-notices-wrapper — only the first bar is used */
body.thbig-checkout-upgrade .woocommerce-notices-wrapper+.woocommerce-notices-wrapper {
	display: none !important;
}


/* Coupon message notices — fix icon overlap (same ::before issue) */
.thbig-coupon-msg .woocommerce-error,
.thbig-coupon-msg .woocommerce-message {
	padding-left: 2.5em !important;
	position: relative !important;
}

.thbig-coupon-msg .woocommerce-error::before,
.thbig-coupon-msg .woocommerce-message::before {
	position: absolute !important;
	top: 50% !important;
	left: 0.75em !important;
	transform: translateY(-50%) !important;
	line-height: 1 !important;
}

/* Cart page inline coupon error — WooCommerce cart.js appends
   <p class="coupon-error-notice"> inside .coupon when invalid */
body.thbig-checkout-upgrade .woocommerce-cart-form .coupon .coupon-error-notice {
	flex: 0 0 100%;
	margin: 6px 0 0;
	padding: 10px 14px;
	background: #fef2f2;
	color: #b91c1c;
	border: 1px solid #fecaca;
	border-left: 3px solid #dc2626;
	border-radius: 6px;
	font-size: 0.875rem;
	font-weight: 500;
	line-height: 1.5;
}

/* Red border on the coupon input when the code is invalid */
body.thbig-checkout-upgrade .woocommerce-cart-form .coupon input#coupon_code.has-error {
	border-color: #dc2626 !important;
}

/* --------------------------------------------------------------------------
   RESPONSIVE — cart on mobile
   -------------------------------------------------------------------------- */

@media (max-width: 600px) {
	body.thbig-checkout-upgrade .woocommerce-cart-form table.cart tbody tr.cart_item {
		padding: 12px 12px 12px 12px;
		gap: 10px 10px;
	}

	body.thbig-checkout-upgrade .woocommerce-cart-form table.cart td.product-thumbnail {
		flex: 0 0 60px;
	}

	body.thbig-checkout-upgrade .woocommerce-cart-form table.cart td.product-thumbnail img {
		width: 60px;
		height: 60px;
	}

	body.thbig-checkout-upgrade .woocommerce-cart-form table.cart td.product-name {
		flex: 1 1 120px;
		font-size: 0.88rem;
	}

	body.thbig-checkout-upgrade .woocommerce-cart-form table.cart td.product-quantity .qty {
		width: 52px;
		padding: 5px 6px;
	}

	body.thbig-checkout-upgrade .woocommerce-cart-form table.cart td.product-subtotal {
		font-size: 0.9rem;
	}

	/* Quantity + subtotal line up together below image+name */
	body.thbig-checkout-upgrade .woocommerce-cart-form table.cart td.product-quantity {
		margin-left: 70px;
		/* indent past thumbnail */
	}

	/* Checkout payment tiles compact */
	body.thbig-checkout-upgrade #payment ul.payment_methods li.payment_method>label {
		padding: 11px 14px;
		font-size: 0.88rem;
	}
}

@media (max-width: 400px) {
	body.thbig-checkout-upgrade .woocommerce-cart-form table.cart tbody tr.cart_item {
		padding: 10px;
	}

	body.thbig-checkout-upgrade .woocommerce-cart-form table.cart td.product-quantity {
		margin-left: 0;
		flex-basis: 100%;
	}

	body.thbig-checkout-upgrade .woocommerce-cart-form table.cart td.product-subtotal {
		flex-basis: 100%;
		text-align: left;
	}
}

/* --------------------------------------------------------------------------
   PROMO BANNER + COUPON ROW — Order Summary section
   -------------------------------------------------------------------------- */

/* Hide the default WooCommerce coupon toggle + form (removed via PHP hook,
   CSS hides it as a safety net in case another plugin re-adds it) */
body.thbig-checkout-upgrade .woocommerce-form-coupon-toggle,
body.thbig-checkout-upgrade .woocommerce-form-coupon {
	display: none !important;
}

.thbig-order-summary-header {
	margin-bottom: 4px;
}

/* Promo banner — site blue/navy gradient */
.thbig-promo-banner {
	background: linear-gradient(135deg, #071525 0%, #003a8c 55%, #0059c1 100%);
	border-radius: 10px;
	padding: 16px 16px 14px;
	margin-bottom: 12px;
	text-align: center;
	position: relative;
	overflow: hidden;
}

/* Decorative circles */
.thbig-promo-banner::before,
.thbig-promo-banner::after {
	content: '';
	position: absolute;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.05);
	pointer-events: none;
}

.thbig-promo-banner::before {
	width: 90px;
	height: 90px;
	top: -28px;
	right: -20px;
}

.thbig-promo-banner::after {
	width: 60px;
	height: 60px;
	bottom: -20px;
	left: -10px;
}

.thbig-promo-label {
	display: block;
	font-size: 0.66rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.65);
	margin-bottom: 3px;
	font-family: 'Lato', sans-serif;
}

.thbig-promo-heading {
	display: block;
	font-size: 0.97rem;
	font-weight: 700;
	color: #fff;
	margin-bottom: 6px;
	font-family: 'Lato', sans-serif;
}

.thbig-promo-sub {
	display: block;
	font-size: 0.74rem;
	color: rgba(255, 255, 255, 0.6);
	margin-bottom: 12px;
	font-family: 'Lato', sans-serif;
}

/* Dashed code row */
.thbig-promo-code-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: rgba(255, 255, 255, 0.1);
	border: 1.5px dashed rgba(255, 255, 255, 0.35);
	border-radius: 6px;
	padding: 8px 8px 8px 14px;
	margin-bottom: 15px;
}

.thbig-promo-code {
	font-size: 1.05rem;
	font-weight: 800;
	color: #fff;
	letter-spacing: 0.12em;
	font-family: 'Lato', sans-serif;
}

/* COPY button */
.thbig-promo-copy {
	background: #fff !important;
	color: var(--lc-primary-hover) !important;
	border: none !important;
	border-radius: 4px !important;
	padding: 5px 13px !important;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	cursor: pointer;
	flex-shrink: 0;
	transition: background 0.2s, color 0.2s;
	line-height: 1.4;
	font-family: 'Lato', sans-serif;
}

.thbig-promo-copy:hover {
	background: #deeeff !important;
}

.thbig-promo-copy.thbig-copied {
	background: #16a34a !important;
	color: #fff !important;
}

/* Coupon input row */
.thbig-checkout-coupon {
	margin-bottom: 16px;
}

.thbig-coupon-row {
	display: flex;
	gap: 8px;
	align-items: stretch;
}

.thbig-coupon-input {
	flex: 1 1 auto;
	border: 1.5px solid #dde3ea !important;
	border-radius: 6px !important;
	padding: 10px 12px !important;
	font-size: 0.9rem;
	background: #fff !important;
	color: #0d1b2a;
	font-family: 'Lato', sans-serif;
	transition: border-color 0.2s;
	box-shadow: none !important;
}

.thbig-coupon-input:focus {
	border-color: var(--lc-primary) !important;
	outline: none;
	box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.08) !important;
}

.thbig-coupon-apply {
	flex: none;
	background: #0d1b2a !important;
	color: #fff !important;
	border: none !important;
	border-radius: 6px !important;
	padding: 10px 20px !important;
	font-size: 0.9rem;
	font-weight: 700;
	cursor: pointer;
	white-space: nowrap;
	font-family: 'Lato', sans-serif;
	transition: background 0.2s;
}

.thbig-coupon-apply:hover {
	background: var(--lc-primary) !important;
}

.thbig-coupon-apply:disabled {
	opacity: 0.6;
	cursor: wait;
}

/* Response message */
.thbig-coupon-msg {
	margin-top: 8px;
	font-size: 0.83rem;
	line-height: 1.4;
}

.thbig-coupon-msg .woocommerce-message {
	background: #f0fdf4;
	color: #166534;
	border-left-color: #16a34a;
	padding: 8px 12px;
	margin: 0;
	font-size: 0.83rem;
}

.thbig-coupon-msg .woocommerce-error {
	background: #fef2f2;
	color: #b91c1c;
	border-left-color: #dc2626;
	padding: 8px 12px;
	margin: 0;
	font-size: 0.83rem;
}

/* --------------------------------------------------------------------------
   PLACEHOLDER STYLES — subtle on billing / shipping form fields
   -------------------------------------------------------------------------- */

body.thbig-checkout-upgrade .woocommerce-checkout .form-row input.input-text::placeholder,
body.thbig-checkout-upgrade .woocommerce-checkout .form-row textarea::placeholder {
	color: #c2ccd6 !important;
	opacity: 1;
	font-weight: 400;
	font-style: normal;
}

body.thbig-checkout-upgrade .woocommerce-checkout .form-row input.input-text::-webkit-input-placeholder,
body.thbig-checkout-upgrade .woocommerce-checkout .form-row textarea::-webkit-input-placeholder {
	color: #c2ccd6 !important;
}

body.thbig-checkout-upgrade .woocommerce-checkout .form-row input.input-text::-moz-placeholder,
body.thbig-checkout-upgrade .woocommerce-checkout .form-row textarea::-moz-placeholder {
	color: #c2ccd6 !important;
	opacity: 1;
}

/* --------------------------------------------------------------------------
   CREDIT CARD SECTION — modern, minimal
   -------------------------------------------------------------------------- */

/* Undo plugin's float-based two-column layout inside the card section */
body.thbig-checkout-upgrade .payment_method_offline_cc .form-row-first,
body.thbig-checkout-upgrade .payment_method_offline_cc .form-row-last {
	float: none !important;
	width: 100% !important;
	clear: both;
	overflow: visible;
}

/* Override WooCommerce's hardcoded #dcd7e2 payment_box background */
body.thbig-checkout-upgrade .woocommerce-checkout #payment div.payment_box {
	background: #fff !important;
	box-shadow: none !important;
	border-top: 1px solid var(--lc-border-header);
	border-radius: 0 0 6px 6px;
	padding: 10px;
	margin: 0;
}

/* Kill the lavender triangle arrow above the box */
body.thbig-checkout-upgrade .woocommerce-checkout #payment div.payment_box::before {
	border-color: transparent !important;
	display: none;
}

/* Fix WC's purple-gray input borders inside the payment box */
body.thbig-checkout-upgrade .woocommerce-checkout #payment div.payment_box input.input-text,
body.thbig-checkout-upgrade .woocommerce-checkout #payment div.payment_box textarea {
	border-color: #d4dae2 !important;
	border-top-color: #d4dae2 !important;
}

/* Fix WC's placeholder color override inside payment box */
body.thbig-checkout-upgrade .woocommerce-checkout #payment div.payment_box ::-webkit-input-placeholder {
	color: #c2ccd6 !important;
}

body.thbig-checkout-upgrade .woocommerce-checkout #payment div.payment_box :-moz-placeholder {
	color: #c2ccd6 !important;
	opacity: 1;
}

body.thbig-checkout-upgrade .woocommerce-checkout #payment div.payment_box ::placeholder {
	color: #c2ccd6 !important;
}

/* Card fieldset — transparent so it inherits the white payment_box */
body.thbig-checkout-upgrade .payment_method_offline_cc fieldset {
	background: transparent;
	border: none !important;
	padding: 0;
	margin: 0;
}


/* Field labels inside card section */
body.thbig-checkout-upgrade .payment_method_offline_cc fieldset .form-row label,
body.thbig-checkout-upgrade .woocommerce-page form .payment_method_offline_cc .form-row label {
	font-size: 0.78rem !important;
	font-weight: 600;
	color: #6b7280;
	display: block;
	margin-bottom: 4px;
}

/* All text inputs inside card section */
body.thbig-checkout-upgrade .payment_method_offline_cc fieldset input.input-text {
	border: none !important;
	border-bottom: 1.5px solid #d4dae2 !important;
	border-radius: 0 !important;
	background: transparent !important;
	padding: 8px 0 9px !important;
	font-size: 1rem;
	letter-spacing: 0.06em;
	width: 100% !important;
	/* overrides plugin's inline width:4em on CVV */
	box-shadow: none !important;
	transition: border-color 0.2s, box-shadow 0.2s;
}

body.thbig-checkout-upgrade .payment_method_offline_cc fieldset input.input-text:focus {
	border-bottom-color: var(--lc-primary) !important;
	box-shadow: 0 1px 0 0 var(--lc-primary) !important;
	outline: none;
}

/* Expiry row — month + year side by side */
body.thbig-checkout-upgrade .payment_method_offline_cc fieldset p.form-row-first {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 0 12px;
}

body.thbig-checkout-upgrade .payment_method_offline_cc fieldset p.form-row-first>label {
	flex: 0 0 100%;
	/* label spans full width */
}

body.thbig-checkout-upgrade .payment_method_offline_cc fieldset select#cc-expire-month,
body.thbig-checkout-upgrade .payment_method_offline_cc fieldset select#cc-expire-year {
	display: inline-block !important;
	flex: 1 1 0;
	min-width: 80px;
	border: none !important;
	border-bottom: 1.5px solid #d4dae2 !important;
	border-radius: 0 !important;
	background: transparent !important;
	padding: 8px 0 9px !important;
	font-size: 0.95rem;
	appearance: none;
	-webkit-appearance: none;
	cursor: pointer;
	box-shadow: none !important;
	transition: border-color 0.2s;
}

body.thbig-checkout-upgrade .payment_method_offline_cc fieldset select#cc-expire-month:focus,
body.thbig-checkout-upgrade .payment_method_offline_cc fieldset select#cc-expire-year:focus {
	border-bottom-color: var(--lc-primary) !important;
	box-shadow: 0 1px 0 0 var(--lc-primary) !important;
	outline: none;
}

/* Separator between selects */
body.thbig-checkout-upgrade .payment_method_offline_cc fieldset select#cc-expire-month::after {
	content: ' / ';
}

/* CVV hint icon area */
body.thbig-checkout-upgrade .payment_method_offline_cc fieldset .offline_cc_card_csc_description {
	display: block;
	font-size: 0.78rem;
	color: #9ca3af;
	margin-top: 4px;
}

/* Mobile — card section stacks cleanly already since we removed floats */
@media (max-width: 480px) {
	body.thbig-checkout-upgrade .payment_method_offline_cc fieldset {
		padding: 14px 12px 8px;
	}
}

/* ==========================================================================
   ISSUES.DOCX FIX PACK — issues 1, 3, 7, 11
   ========================================================================== */

/* --------------------------------------------------------------------------
   Issue 1: Shipment text overlapping on mobile in cart totals
   The <th> "Shipment" collapses to zero-width and bleeds into the <td> text.
   Fix: Give the th a reliable min-width on narrow viewports.
   -------------------------------------------------------------------------- */

/* On narrow viewports the two-column cart-totals table collapses and the
   <th> butts against the <td> content. Stack them vertically instead. */
@media (max-width: 640px) {

	body.thbig-checkout-upgrade .cart-collaterals .cart_totals table,
	body.thbig-checkout-upgrade .cart-collaterals .cart_totals table tbody,
	body.thbig-checkout-upgrade .cart-collaterals .cart_totals table tr,
	body.thbig-checkout-upgrade .cart-collaterals .cart_totals table th,
	body.thbig-checkout-upgrade .cart-collaterals .cart_totals table td {
		display: block !important;
		width: 100% !important;
	}

	body.thbig-checkout-upgrade .cart-collaterals .cart_totals table tr {
		padding: 8px 0 !important;
		border-bottom: 1px solid #f4f6f8 !important;
	}

	body.thbig-checkout-upgrade .cart-collaterals .cart_totals table th {
		font-weight: 700 !important;
		padding: 0 0 2px 0 !important;
		font-size: 0.82rem;
		color: #64748b;
		text-transform: uppercase;
		letter-spacing: 0.04em;
		border: none !important;
	}

	body.thbig-checkout-upgrade .cart-collaterals .cart_totals table td {
		padding: 0 !important;
		border: none !important;
		font-weight: 500;
	}

	/* WooCommerce's shop_table_responsive adds data-title as ::before on every
	   td. Since we already have the <th> showing the label, suppress it. */
	body.thbig-checkout-upgrade .cart-collaterals .cart_totals table td::before {
		display: none !important;
		content: none !important;
		float: none !important;
	}

	/* Total row: keep amount prominent */
	body.thbig-checkout-upgrade .cart-collaterals .cart_totals table .order-total th,
	body.thbig-checkout-upgrade .cart-collaterals .cart_totals table .order-total td {
		font-size: 1rem !important;
		font-weight: 700 !important;
	}
}

/* --------------------------------------------------------------------------
   Issue 3: Loader (blockUI overlay) alignment on cart page
   WooCommerce's $.fn.block() applies to table.cart. Since we set
   table.cart to display:block the overlay's dimensions may be
   miscalculated. Give the form a stacking context and round the overlay.
   -------------------------------------------------------------------------- */

body.thbig-checkout-upgrade .woocommerce-cart-form {
	position: relative;
}

body.thbig-checkout-upgrade .woocommerce-cart-form .blockUI.blockOverlay {
	border-radius: 10px !important;
	top: 0 !important;
	left: 0 !important;
	width: 100% !important;
	height: 100% !important;
	position: absolute !important;
}

body.thbig-checkout-upgrade .woocommerce-cart-form .blockUI.blockMsg {
	position: fixed !important;
	top: 50% !important;
	left: 50% !important;
	transform: translate(-50%, -50%) !important;
	margin: 0 !important;
	width: auto !important;
}

/* --------------------------------------------------------------------------
   Issue 7: Remove "Return to shop" button from cart page
   -------------------------------------------------------------------------- */

body.thbig-checkout-upgrade .return-to-shop {
	display: none !important;
}

/* --------------------------------------------------------------------------
   Issue 11: Spacing below "Country" & "State" labels before the dropdown
   -------------------------------------------------------------------------- */

body.thbig-checkout-upgrade .woocommerce-checkout #billing_country_field label,
body.thbig-checkout-upgrade .woocommerce-checkout #billing_state_field label,
body.thbig-checkout-upgrade .woocommerce-checkout #shipping_country_field label,
body.thbig-checkout-upgrade .woocommerce-checkout #shipping_state_field label {
	margin-bottom: 10px !important;
	padding-bottom: 4px;
}

/* --------------------------------------------------------------------------
   Issue 5: Checkout UI — fix text-align:justify in order review table
   The parent theme sets text-align:justify globally, which stretches
   multi-word shipping method names like "Local pickup: Free" across the
   full cell width. Override to left-align throughout checkout tables.
   -------------------------------------------------------------------------- */

body.thbig-checkout-upgrade .woocommerce-checkout-review-order-table td,
body.thbig-checkout-upgrade .woocommerce-checkout-review-order-table th,
body.thbig-checkout-upgrade .cart-collaterals td,
body.thbig-checkout-upgrade .cart-collaterals th,
body.thbig-checkout-upgrade .woocommerce-cart-form td,
body.thbig-checkout-upgrade .woocommerce-cart-form th {
	text-align: left !important;
}

/* ==========================================================================
   CART PAGE — RESPONSIVE & DESIGN FIXES
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Suppress WooCommerce shop_table_responsive ::before labels on cart rows.
   The theme uses a custom card layout — "Product:", "Quantity:", "Subtotal:"
   pseudo-labels are redundant and break the mobile card design.
   -------------------------------------------------------------------------- */

body.thbig-checkout-upgrade .woocommerce-cart-form table.cart td::before {
	display: none !important;
	content: none !important;
	float: none !important;
}

/* --------------------------------------------------------------------------
   2. .wc-proceed-to-checkout — WooCommerce injects one BEFORE the cart form
   (direct child of .woocommerce) AND one inside Cart Totals.
   Hide the top one at all sizes — Cart Totals already has the right one.
   -------------------------------------------------------------------------- */

/* Hide ONLY the top button (direct child of .woocommerce, before the form) */
body.thbig-checkout-upgrade .woocommerce>.wc-proceed-to-checkout {
	display: none !important;
}

/* Cart Totals proceed button — blue, full width */
body.thbig-checkout-upgrade .cart_totals .wc-proceed-to-checkout a.checkout-button {
	display: block !important;
	width: 100% !important;
	text-align: center !important;
	background-color: var(--lc-primary) !important;
	border-color: var(--lc-primary) !important;
	color: #fff !important;
	border-radius: 8px !important;
	font-weight: 700 !important;
	padding: 14px 24px !important;
	transition: background 0.2s;
}

body.thbig-checkout-upgrade .cart_totals .wc-proceed-to-checkout a.checkout-button:hover {
	background-color: var(--lc-primary-hover) !important;
	border-color: var(--lc-primary-hover) !important;
}

/* --------------------------------------------------------------------------
   3. Apply coupon button — prevent text wrapping on narrow screens
   -------------------------------------------------------------------------- */

body.thbig-checkout-upgrade .woocommerce-cart-form .coupon .button {
	white-space: nowrap !important;
}

/* --------------------------------------------------------------------------
   4. Remove (×) button — ensure it stays top-right of the card on all sizes
   -------------------------------------------------------------------------- */

body.thbig-checkout-upgrade .woocommerce-cart-form table.cart td.product-remove {
	position: absolute !important;
	top: 10px !important;
	right: 10px !important;
	flex: none !important;
	width: auto !important;
	/* prevent the ::before label from shifting it */
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
}

body.thbig-checkout-upgrade .woocommerce-cart-form table.cart td.product-remove a.remove {
	width: 28px !important;
	height: 28px !important;
	font-size: 18px !important;
	line-height: 1 !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	border-radius: 50% !important;
	background: #f1f5f9 !important;
	color: #64748b !important;
	text-decoration: none !important;
	border: 1px solid #e2e8f0 !important;
	transition: background 0.18s, color 0.18s;
}

body.thbig-checkout-upgrade .woocommerce-cart-form table.cart td.product-remove a.remove:hover {
	background: #fee2e2 !important;
	color: #dc2626 !important;
	border-color: #fca5a5 !important;
}

/* --------------------------------------------------------------------------
   5. Cart item — ensure padding-top leaves room for the absolute × button
   -------------------------------------------------------------------------- */

body.thbig-checkout-upgrade .woocommerce-cart-form table.cart tbody tr.cart_item {
	padding-top: 16px !important;
	padding-right: 50px !important;
	/* keep content clear of × button */
}

/* --------------------------------------------------------------------------
   6. Cart totals — improve mobile legibility
   -------------------------------------------------------------------------- */

@media (max-width: 640px) {
	body.thbig-checkout-upgrade .cart_totals {
		width: 100% !important;
		float: none !important;
	}
}

/* --------------------------------------------------------------------------
   Issue #19 — Cart: hide "Shipping to" when destination not yet chosen.
   The paragraph is suppressed in PHP (cart-shipping.php override).
   This rule collapses any residual gap left by an empty shipping-destination
   paragraph and tightens the shipping methods list spacing on cart.
   -------------------------------------------------------------------------- */

body.thbig-checkout-upgrade .cart_totals .woocommerce-shipping-destination:empty {
	display: none;
	margin: 0;
	padding: 0;
}

/* Thank you page — styles live in assets/css/thankyou.css */

/* --------------------------------------------------------------------------
   Issue #26: Checkout error box shows only the ⚠ icon when all list items
   are "required field" notices that the JS strips. Hide the now-empty <ul>
   so no phantom pink box is left behind.
   -------------------------------------------------------------------------- */

body.thbig-checkout-upgrade .woocommerce-notices-wrapper ul.woocommerce-error:not(:has(li)),
body.thbig-checkout-upgrade .woocommerce-checkout ul.woocommerce-error:not(:has(li)) {
	display: none !important;
}

/* ── CART: shipping radio alignment fix ──────────────────────────────────────
   WC sets text-indent:-22px on #shipping_method li (hanging-indent for the
   native radio). Flex layout + indent reset fixes the overlap at all viewports.
────────────────────────────────────────────────────────────────────────────── */
body.thbig-checkout-upgrade.woocommerce-cart ul#shipping_method {
	list-style: none !important;
	padding: 0 !important;
	margin: 0 !important;
	clear: left !important;
}

body.thbig-checkout-upgrade.woocommerce-cart ul#shipping_method li {
	display: flex !important;
	align-items: center !important;
	gap: 8px !important;
	margin-bottom: 4px !important;
	font-size: 13px !important;
	padding: 0 !important;
	text-indent: 0 !important;
}

body.thbig-checkout-upgrade.woocommerce-cart ul#shipping_method li label {
	text-indent: 0 !important;
	text-align: left !important;
	margin: 0 !important;
}

body.thbig-checkout-upgrade.woocommerce-cart ul#shipping_method li input[type="radio"] {
	appearance: none !important;
	-webkit-appearance: none !important;
	width: 16px !important;
	height: 16px !important;
	min-width: 16px !important;
	border-radius: 50% !important;
	border: 2px solid #c0c4cc !important;
	background: #fff !important;
	flex-shrink: 0 !important;
	cursor: pointer !important;
	margin: 0 !important;
	transition: border-color 0.15s, background 0.15s !important;
}

body.thbig-checkout-upgrade.woocommerce-cart ul#shipping_method li input[type="radio"]:checked {
	border-color: #185FA5 !important;
	background: #185FA5 !important;
	box-shadow: inset 0 0 0 3px #fff !important;
}