/**
 * Modern classic checkout — scoped to body.wcigr-modern-checkout.woocommerce-checkout
 * Keeps your theme layout but improves spacing, typography, and focus states.
 */

body.wcigr-modern-checkout.woocommerce-checkout {
	--wcigr-co-bg: #f8fafc;
	--wcigr-co-card: #ffffff;
	--wcigr-co-border: #e2e8f0;
	--wcigr-co-text: #0f172a;
	--wcigr-co-muted: #64748b;
	--wcigr-co-accent: #2563eb;
	--wcigr-co-accent-hover: #1d4ed8;
	--wcigr-co-radius: 12px;
	--wcigr-co-pad: 10px;
	--wcigr-co-shadow: 0 8px 28px rgba(15, 23, 42, 0.07);
	background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

body.wcigr-modern-checkout.woocommerce-checkout .woocommerce {
	max-width: 1080px;
	margin-left: auto;
	margin-right: auto;
	padding-top: clamp(10px, 2.2vw, 18px);
	padding-left: clamp(var(--wcigr-co-pad, 12px), 3vw, 22px);
	padding-right: clamp(var(--wcigr-co-pad, 12px), 3vw, 22px);
	padding-bottom: clamp(12px, 2.4vw, 24px);
}

body.wcigr-modern-checkout.woocommerce-checkout form.checkout {
	background: transparent;
}

body.wcigr-modern-checkout.woocommerce-checkout #customer_details,
body.wcigr-modern-checkout.woocommerce-checkout #order_review,
body.wcigr-modern-checkout.woocommerce-checkout #order_review_heading {
	background: var(--wcigr-co-card);
	border: 1px solid var(--wcigr-co-border);
	border-radius: var(--wcigr-co-radius);
	box-shadow: var(--wcigr-co-shadow);
	padding: clamp(0.55rem, 1.8vw, 0.85rem);
	margin-bottom: 0.55rem;
}

body.wcigr-modern-checkout.woocommerce-checkout #order_review_heading {
	margin-bottom: 0;
	border-bottom-left-radius: 0;
	border-bottom-right-radius: 0;
	border-bottom: none;
	padding-bottom: 0.75rem;
	font-size: 1.15rem;
	font-weight: 700;
	color: var(--wcigr-co-text);
	letter-spacing: -0.02em;
}

body.wcigr-modern-checkout.woocommerce-checkout #order_review {
	border-top-left-radius: 0;
	border-top-right-radius: 0;
	margin-top: 0;
	padding-top: 0.72rem;
}

body.wcigr-modern-checkout.woocommerce-checkout .woocommerce-billing-fields > h3,
body.wcigr-modern-checkout.woocommerce-checkout .woocommerce-shipping-fields > h3,
body.wcigr-modern-checkout.woocommerce-checkout .woocommerce-additional-fields > h3 {
	font-size: 0.92rem;
	font-weight: 700;
	color: var(--wcigr-co-text);
	margin: 0 0 0.65rem;
	letter-spacing: -0.02em;
}

body.wcigr-modern-checkout.woocommerce-checkout .woocommerce form .form-row {
	margin-bottom: 0.48rem;
}

body.wcigr-modern-checkout.woocommerce-checkout .woocommerce form .form-row label {
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--wcigr-co-muted);
	margin-bottom: 0.28rem;
	text-transform: none;
	letter-spacing: 0.01em;
}

body.wcigr-modern-checkout.woocommerce-checkout .woocommerce form .form-row input.input-text,
body.wcigr-modern-checkout.woocommerce-checkout .woocommerce form .form-row textarea,
body.wcigr-modern-checkout.woocommerce-checkout .woocommerce form .form-row select {
	border: 1px solid var(--wcigr-co-border);
	border-radius: 10px;
	padding: 0.5rem 0.65rem;
	font-size: 1rem;
	line-height: 1.35;
	min-height: 38px;
	background: #ffffff;
	color: var(--wcigr-co-text);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	width: 100%;
	box-sizing: border-box;
}

body.wcigr-modern-checkout.woocommerce-checkout .woocommerce form .form-row input.input-text:focus,
body.wcigr-modern-checkout.woocommerce-checkout .woocommerce form .form-row textarea:focus,
body.wcigr-modern-checkout.woocommerce-checkout .woocommerce form .form-row select:focus {
	outline: none;
	border-color: var(--wcigr-co-accent);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

body.wcigr-modern-checkout.woocommerce-checkout #place_order {
	background: linear-gradient(135deg, var(--wcigr-co-accent), #4f46e5) !important;
	color: #fff !important;
	border: none !important;
	border-radius: 12px !important;
	padding: 0.72rem 1.1rem !important;
	font-size: 0.98rem !important;
	letter-spacing: 0.01em;
	font-weight: 700 !important;
	width: 100%;
	box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
	transition: transform 0.12s ease, filter 0.12s ease !important;
	cursor: pointer;
}

body.wcigr-modern-checkout.woocommerce-checkout #place_order:hover {
	filter: brightness(1.05);
	transform: translateY(-1px);
}

/* On mobile the button is fixed; hover movement can feel janky */
body.wcigr-modern-checkout.woocommerce-checkout #place_order:active {
	transform: none;
}

body.wcigr-modern-checkout.woocommerce-checkout .woocommerce-checkout-review-order-table {
	border: none;
	border-radius: 10px;
	overflow: hidden;
}

body.wcigr-modern-checkout.woocommerce-checkout .woocommerce-checkout-review-order-table th,
body.wcigr-modern-checkout.woocommerce-checkout .woocommerce-checkout-review-order-table td {
	border-color: var(--wcigr-co-border);
	padding: 0.45rem 0.35rem;
	font-size: 0.8rem;
	vertical-align: middle;
}

/* Dense line items: small type, tight thumbnails, compact qty widgets */
body.wcigr-modern-checkout.woocommerce-checkout .woocommerce-checkout-review-order-table .product-name {
	font-size: 0.8rem;
	font-weight: 600;
	line-height: 1.28;
}

body.wcigr-modern-checkout.woocommerce-checkout .woocommerce-checkout-review-order-table .product-name .product-quantity,
body.wcigr-modern-checkout.woocommerce-checkout .woocommerce-checkout-review-order-table .product-name small {
	font-size: 0.72rem;
	font-weight: 500;
	color: var(--wcigr-co-muted);
}

body.wcigr-modern-checkout.woocommerce-checkout .woocommerce-checkout-review-order-table .product-name img,
body.wcigr-modern-checkout.woocommerce-checkout .woocommerce-checkout-review-order-table .product-thumbnail img {
	width: 36px !important;
	max-width: 36px !important;
	height: auto !important;
	max-height: 36px !important;
	object-fit: contain;
	margin: 0 0.45rem 0 0 !important;
	vertical-align: middle;
	border-radius: 6px;
	border: 1px solid var(--wcigr-co-border);
	background: #f8fafc;
}

body.wcigr-modern-checkout.woocommerce-checkout .woocommerce-checkout-review-order-table .product-total,
body.wcigr-modern-checkout.woocommerce-checkout .woocommerce-checkout-review-order-table .product-subtotal {
	font-size: 0.78rem;
	font-weight: 700;
	white-space: nowrap;
}

body.wcigr-modern-checkout.woocommerce-checkout .woocommerce-checkout-review-order-table .product-total del,
body.wcigr-modern-checkout.woocommerce-checkout .woocommerce-checkout-review-order-table .product-name del {
	font-size: 0.72rem;
	opacity: 0.75;
}

body.wcigr-modern-checkout.woocommerce-checkout .woocommerce-checkout-review-order-table .product-total ins,
body.wcigr-modern-checkout.woocommerce-checkout .woocommerce-checkout-review-order-table .product-name ins {
	font-size: inherit;
	text-decoration: none;
}

body.wcigr-modern-checkout.woocommerce-checkout .woocommerce-checkout-review-order-table .quantity {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	margin: 0.2rem 0 0;
	vertical-align: middle;
}

body.wcigr-modern-checkout.woocommerce-checkout .woocommerce-checkout-review-order-table .quantity .qty {
	width: 2.15em;
	min-width: 2.15em;
	min-height: 26px;
	height: 26px;
	padding: 1px 4px;
	font-size: 0.8rem;
	font-weight: 700;
	border-radius: 6px;
	text-align: center;
	line-height: 1.2;
}

body.wcigr-modern-checkout.woocommerce-checkout .woocommerce-checkout-review-order-table .quantity .minus,
body.wcigr-modern-checkout.woocommerce-checkout .woocommerce-checkout-review-order-table .quantity .plus,
body.wcigr-modern-checkout.woocommerce-checkout .woocommerce-checkout-review-order-table .quantity button {
	min-width: 26px !important;
	width: 26px !important;
	min-height: 26px !important;
	height: 26px !important;
	padding: 0 !important;
	font-size: 15px !important;
	line-height: 1 !important;
	border-radius: 6px !important;
	font-weight: 800 !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
}

body.wcigr-modern-checkout.woocommerce-checkout .woocommerce-checkout-review-order-table .variation,
body.wcigr-modern-checkout.woocommerce-checkout .woocommerce-checkout-review-order-table .wc-item-meta,
body.wcigr-modern-checkout.woocommerce-checkout .woocommerce-checkout-review-order-table dl.variation {
	font-size: 0.68rem !important;
	line-height: 1.25 !important;
	margin: 0.15rem 0 0 !important;
	color: var(--wcigr-co-muted) !important;
	font-weight: 500 !important;
}

body.wcigr-modern-checkout.woocommerce-checkout .shop_table thead th {
	background: #f1f5f9;
	font-weight: 700;
	color: var(--wcigr-co-text);
}

body.wcigr-modern-checkout.woocommerce-checkout .woocommerce-NoticeGroup-checkout,
body.wcigr-modern-checkout.woocommerce-checkout .woocommerce-error,
body.wcigr-modern-checkout.woocommerce-checkout .woocommerce-message {
	border-radius: 10px;
	border-left-width: 4px;
}

body.wcigr-modern-checkout.woocommerce-checkout #payment {
	background: #f8fbff;
	border: 1px solid #dbeafe;
	border-radius: 10px;
	padding: 0.5rem 0.6rem;
}

body.wcigr-modern-checkout.woocommerce-checkout #payment div.payment_box {
	border-radius: 10px;
	background: #eef6ff;
}

body.wcigr-modern-checkout.woocommerce-checkout .woocommerce-checkout-payment ul.payment_methods {
	margin-bottom: 0.85rem;
}

body.wcigr-modern-checkout.woocommerce-checkout .woocommerce-shipping-methods li,
body.wcigr-modern-checkout.woocommerce-checkout .payment_methods li {
	padding: 0.25rem 0;
}

/* App / WebView: reduce horizontal jank */
body.wcigr-app-webview.wcigr-modern-checkout.woocommerce-checkout .woocommerce {
	padding-left: max(var(--wcigr-co-pad, 12px), env(safe-area-inset-left));
	padding-right: max(var(--wcigr-co-pad, 12px), env(safe-area-inset-right));
	padding-bottom: max(12px, env(safe-area-inset-bottom));
}

@media (max-width: 768px) {
	body.wcigr-modern-checkout.woocommerce-checkout #customer_details,
	body.wcigr-modern-checkout.woocommerce-checkout #order_review,
	body.wcigr-modern-checkout.woocommerce-checkout #order_review_heading {
		padding: 0.65rem 0.7rem;
		border-radius: 12px;
	}

	body.wcigr-modern-checkout.woocommerce-checkout form.checkout {
		/* Keep content readable when we pin “Place order” at the bottom */
		padding-bottom: 120px;
	}

	body.wcigr-modern-checkout.woocommerce-checkout .woocommerce form .form-row {
		margin-bottom: 0.55rem;
	}

	body.wcigr-modern-checkout.woocommerce-checkout .woocommerce form .form-row label {
		font-size: 0.72rem;
		margin-bottom: 0.22rem;
	}

	body.wcigr-modern-checkout.woocommerce-checkout .woocommerce form .form-row input.input-text,
	body.wcigr-modern-checkout.woocommerce-checkout .woocommerce form .form-row textarea,
	body.wcigr-modern-checkout.woocommerce-checkout .woocommerce form .form-row select {
		padding: 0.5rem 0.65rem;
		min-height: 40px;
		font-size: 16px; /* avoids iOS zoom on focus */
		border-radius: 9px;
	}

	body.wcigr-modern-checkout.woocommerce-checkout #order_review_heading {
		font-size: 0.88rem;
		padding-bottom: 0.35rem;
	}

	body.wcigr-modern-checkout.woocommerce-checkout #order_review {
		padding-top: 0.45rem;
	}

	body.wcigr-modern-checkout.woocommerce-checkout .woocommerce-checkout-review-order-table th,
	body.wcigr-modern-checkout.woocommerce-checkout .woocommerce-checkout-review-order-table td {
		padding: 0.35rem 0.25rem;
		font-size: 0.74rem;
	}

	body.wcigr-modern-checkout.woocommerce-checkout .woocommerce-checkout-review-order-table .product-name {
		font-size: 0.74rem;
	}

	body.wcigr-modern-checkout.woocommerce-checkout .woocommerce-checkout-review-order-table .product-name img,
	body.wcigr-modern-checkout.woocommerce-checkout .woocommerce-checkout-review-order-table .product-thumbnail img {
		width: 32px !important;
		max-width: 32px !important;
		max-height: 32px !important;
		margin-right: 0.35rem !important;
	}

	body.wcigr-modern-checkout.woocommerce-checkout #place_order {
		min-height: 46px;
		position: fixed;
		left: max(12px, env(safe-area-inset-left));
		right: max(12px, env(safe-area-inset-right));
		bottom: max(14px, env(safe-area-inset-bottom));
		z-index: 9999;
		border-radius: 12px !important;
		padding: 0.65rem 1rem !important;
		font-size: 0.92rem !important;
	}
}

/* Small phones: keep dense layout; sticky summary for long pages */
@media (max-width: 640px) {
	body.wcigr-modern-checkout.woocommerce-checkout {
		font-size: 15px;
	}

	body.wcigr-modern-checkout.woocommerce-checkout .woocommerce form .form-row label {
		font-size: 0.7rem;
		margin-bottom: 0.2rem;
	}

	body.wcigr-modern-checkout.woocommerce-checkout .woocommerce form .form-row input.input-text,
	body.wcigr-modern-checkout.woocommerce-checkout .woocommerce form .form-row textarea,
	body.wcigr-modern-checkout.woocommerce-checkout .woocommerce form .form-row select {
		border-radius: 9px;
		padding: 0.48rem 0.6rem;
		font-size: 16px;
		min-height: 40px;
	}

	body.wcigr-modern-checkout.woocommerce-checkout #order_review {
		position: sticky;
		bottom: 84px;
		z-index: 9;
		background: #ffffff;
	}

	body.wcigr-modern-checkout.woocommerce-checkout #order_review_heading {
		position: sticky;
		top: 0;
		z-index: 10;
		background: #ffffff;
	}

	body.wcigr-modern-checkout.woocommerce-checkout #place_order {
		border-radius: 12px !important;
		font-size: 0.9rem !important;
		min-height: 46px;
	}

	body.wcigr-modern-checkout.woocommerce-checkout #payment .payment_methods li,
	body.wcigr-modern-checkout.woocommerce-checkout .woocommerce-shipping-methods li {
		padding: 0.28rem 0;
	}

	body.wcigr-modern-checkout.woocommerce-checkout #payment {
		padding: 0.55rem 0.6rem;
	}
}

/*
 * Fixed bottom menu (.wcigr-bm) uses z-index 999999 — without this, #place_order (9999) sits UNDER the bar
 * and disappears in Chrome and WebViews. Pin the button just above the menu.
 */
@media (max-width: 768px) {
	body.wcigr-bm-on.wcigr-modern-checkout.woocommerce-checkout #place_order {
		z-index: 1000000;
		bottom: calc(var(--wcigr-bm-h, 74px) + 10px);
	}
	body.wcigr-bm-on.wcigr-modern-checkout.woocommerce-checkout form.checkout {
		padding-bottom: calc(170px + var(--wcigr-bm-h, 74px) + env(safe-area-inset-bottom, 0px));
	}
}
@media (max-width: 768px) {
	body.wcigr-bm-on.wcigr-modern-checkout.woocommerce-checkout .wc-block-components-checkout-place-order-button {
		position: fixed;
		left: max(12px, env(safe-area-inset-left));
		right: max(12px, env(safe-area-inset-right));
		bottom: calc(var(--wcigr-bm-h, 74px) + 10px + env(safe-area-inset-bottom, 0px));
		width: auto;
		min-height: 52px;
		z-index: 1000000;
	}
}
