/**
 * Diesel Injection - One Page Checkout styles.
 * Modern, clean, reassuring, mobile-first. Scoped under .di-opc.
 */

.di-opc {
	--di-accent: #d32f2f;
	--di-accent-dark: #b71c1c;
	--di-ink: #1f2733;
	--di-muted: #6b7686;
	--di-line: #e4e8ee;
	--di-bg-soft: #f6f8fa;
	--di-radius: 12px;
	--di-shadow: 0 1px 3px rgba(18, 30, 45, .08), 0 6px 20px rgba(18, 30, 45, .05);
	color: var(--di-ink);
	max-width: 1180px;
	margin: 0 auto;
	font-size: 15px;
	line-height: 1.5;
}

.di-opc *,
.di-opc *::before,
.di-opc *::after {
	box-sizing: border-box;
}

/* ---------- Layout grid ---------- */
.di-opc-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 22px;
}

@media (min-width: 981px) {
	.di-opc-grid {
		grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
		align-items: start;
		gap: 24px;
	}
	.di-opc-col-right {
		position: sticky;
		top: 20px;
	}
}

.di-opc-col {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 18px;
}

/* ---------- Cards ---------- */
.di-opc-card {
	background: #fff;
	border: 1px solid var(--di-line);
	border-radius: var(--di-radius);
	box-shadow: var(--di-shadow);
	padding: 20px;
}

.di-opc-section-title {
	margin: 0 0 14px;
	font-size: 18px;
	font-weight: 700;
	letter-spacing: -.01em;
}

.di-opc-injected-title {
	margin: 4px 0 12px;
	padding-top: 6px;
	font-size: 15px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: var(--di-muted);
}
.di-opc-injected-title + .form-row,
.di-opc-billing .woocommerce-billing-fields__field-wrapper > .di-opc-injected-title:first-child {
	margin-top: 0;
}

/* ---------- Form fields ---------- */
.di-opc .form-row {
	margin: 0 0 14px;
	padding: 0;
}
.di-opc .form-row label {
	display: block;
	font-weight: 600;
	font-size: 13px;
	margin-bottom: 5px;
	color: var(--di-ink);
}
.di-opc .form-row .required { color: var(--di-accent); border: 0; }

.di-opc input[type="text"],
.di-opc input[type="email"],
.di-opc input[type="tel"],
.di-opc input[type="number"],
.di-opc input[type="password"],
.di-opc textarea,
.di-opc select,
.di-opc .select2-container .select2-selection--single {
	width: 100%;
	min-height: 48px;
	padding: 10px 12px;
	font-size: 16px; /* >=16px prevents iOS zoom */
	border: 1px solid var(--di-line);
	border-radius: 10px;
	background: #fff;
	color: var(--di-ink);
	transition: border-color .15s ease, box-shadow .15s ease;
}
.di-opc textarea { min-height: 90px; }

.di-opc input:focus,
.di-opc textarea:focus,
.di-opc select:focus {
	outline: none;
	border-color: var(--di-accent);
	box-shadow: 0 0 0 3px rgba(211, 47, 47, .12);
}

.di-opc .select2-container .select2-selection--single {
	display: flex;
	align-items: center;
}
.di-opc .select2-container--default .select2-selection--single .select2-selection__arrow {
	height: 46px;
}

@media (min-width: 560px) {
	.di-opc .form-row-first { float: left; width: 48%; }
	.di-opc .form-row-last { float: right; width: 48%; }
	.di-opc .form-row-wide { clear: both; width: 100%; }
	.di-opc #customer_details .col-1,
	.di-opc #customer_details .col-2 { width: 100%; float: none; }
	.di-opc .woocommerce-billing-fields__field-wrapper::after,
	.di-opc .woocommerce-shipping-fields__field-wrapper::after { content: ""; display: table; clear: both; }
}

/* Returning-customer login */
.di-opc-login-wrap .woocommerce-form-login-toggle { margin: 0 0 6px; }
.di-opc .woocommerce-form-login {
	border: 1px solid var(--di-line);
	border-radius: var(--di-radius);
	padding: 16px;
	background: var(--di-bg-soft);
}

/* Ship to different address */
.di-opc #ship-to-different-address {
	font-size: 15px;
	margin: 4px 0 10px;
}
.di-opc #ship-to-different-address label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 700;
	cursor: pointer;
}

/* ---------- Cart panel ---------- */
.di-opc-cart-panel { position: relative; }
.di-opc-busy { opacity: .55; pointer-events: none; }

.di-opc-cart-items { list-style: none; margin: 0; padding: 0; }
.di-opc-cart-item {
	display: grid;
	grid-template-columns: 64px 1fr auto;
	gap: 12px;
	padding: 14px 0;
	border-bottom: 1px solid var(--di-line);
}
.di-opc-cart-item:first-child { padding-top: 0; }

.di-opc-item-thumb img {
	width: 64px;
	height: 64px;
	object-fit: cover;
	border-radius: 8px;
	border: 1px solid var(--di-line);
	display: block;
}
.di-opc-item-name { font-weight: 600; font-size: 14px; line-height: 1.35; }
.di-opc-item-name a { color: var(--di-ink); text-decoration: none; }
.di-opc-item-name a:hover { color: var(--di-accent); }
.di-opc-item-sku,
.di-opc-item-variation { font-size: 12px; color: var(--di-muted); margin-top: 2px; }
.di-opc-item-variation p { margin: 0; }
.di-opc-item-unit { font-size: 13px; color: var(--di-muted); margin-top: 4px; }
.di-opc-item-unit-label { font-size: 11px; }
.di-opc-item-total { font-weight: 700; white-space: nowrap; text-align: right; }

.di-opc-item-controls {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 8px;
	flex-wrap: wrap;
}

.di-opc-qty {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--di-line);
	border-radius: 10px;
	overflow: hidden;
}
.di-opc .di-opc-qty-btn {
	width: 40px;
	height: 40px;
	min-height: 40px;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: var(--di-bg-soft) !important;
	background-image: none !important;
	font-size: 20px !important;
	font-weight: 700;
	line-height: 1 !important;
	cursor: pointer;
	color: var(--di-ink) !important;
	box-shadow: none !important;
}
.di-opc .di-opc-qty-btn:hover { background: #eceff3 !important; }
.di-opc-qty-input {
	width: 52px !important;
	min-height: 40px !important;
	height: 40px;
	text-align: center;
	border: 0 !important;
	border-radius: 0 !important;
	padding: 0 !important;
	-moz-appearance: textfield;
}
.di-opc-qty-input::-webkit-outer-spin-button,
.di-opc-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.di-opc-qty-input:focus { box-shadow: none !important; }

.di-opc .di-opc-remove {
	border: 0 !important;
	background: none !important;
	background-image: none !important;
	box-shadow: none !important;
	color: var(--di-muted) !important;
	font-size: 13px !important;
	font-weight: 500 !important;
	min-height: 0 !important;
	text-transform: none !important;
	cursor: pointer;
	text-decoration: underline;
	padding: 4px !important;
	width: auto !important;
}
.di-opc .di-opc-remove:hover { color: var(--di-accent) !important; }
.di-opc-qty-fixed { font-size: 13px; color: var(--di-muted); }

/* Coupon */
.di-opc-coupon { margin-top: 16px; }
.di-opc-coupon-row { display: flex; gap: 8px; }
.di-opc-coupon-input { flex: 1; min-height: 44px !important; }
.di-opc .di-opc-coupon-apply {
	min-height: 44px;
	padding: 0 16px !important;
	border: 1px solid var(--di-ink) !important;
	background: #fff !important;
	background-image: none !important;
	color: var(--di-ink) !important;
	border-radius: 10px !important;
	font-weight: 600 !important;
	text-transform: none !important;
	cursor: pointer;
	white-space: nowrap;
	width: auto !important;
	box-shadow: none !important;
}
.di-opc .di-opc-coupon-apply:hover { background: var(--di-ink) !important; color: #fff !important; }
.di-opc-applied-coupons { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.di-opc-applied-coupon {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: #eef7ee;
	color: #1b5e20;
	border: 1px solid #cfe6cf;
	border-radius: 999px;
	padding: 4px 10px;
	font-size: 13px;
}
.di-opc-coupon-remove { border: 0; background: none; cursor: pointer; font-size: 16px; line-height: 1; color: #1b5e20; }

.di-opc-cart-subtotal {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-top: 16px;
	padding-top: 14px;
	border-top: 1px solid var(--di-line);
	font-weight: 600;
}
.di-opc-cart-subtotal-value { font-size: 17px; }

/* ---------- Order review (native totals) ---------- */
/* Hide the duplicated item list; keep the totals footer only. */
.di-opc .woocommerce-checkout-review-order-table thead,
.di-opc .woocommerce-checkout-review-order-table tbody { display: none; }

.di-opc #order_review { width: 100%; }
.di-opc .woocommerce-checkout-review-order-table {
	width: 100% !important;
	border-collapse: collapse;
	margin: 0 0 4px;
}
/* Flex rows: label left, amount right — robust in a narrow column. */
.di-opc .woocommerce-checkout-review-order-table tfoot { display: block; width: 100%; }
.di-opc .woocommerce-checkout-review-order-table tfoot tr {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	padding: 7px 0;
	border-top: 1px solid var(--di-line);
}
.di-opc .woocommerce-checkout-review-order-table tfoot th,
.di-opc .woocommerce-checkout-review-order-table tfoot td {
	border: 0;
	padding: 0;
	font-size: 14px;
	line-height: 1.35;
}
.di-opc .woocommerce-checkout-review-order-table tfoot th {
	font-weight: 600;
	white-space: normal;
	text-align: left;
	flex: 1 1 auto;
	min-width: 0;
}
/* Amounts never wrap; the label wraps instead if space is tight. */
.di-opc .woocommerce-checkout-review-order-table tfoot td {
	font-weight: 600;
	text-align: right;
	white-space: nowrap;
	flex: 0 0 auto;
}
/* Shipping cell holds descriptive text (method + price): allow it to wrap. */
.di-opc .woocommerce-checkout-review-order-table tfoot tr.shipping td,
.di-opc .woocommerce-checkout-review-order-table tfoot tr.woocommerce-shipping-totals td {
	white-space: normal;
	flex: 1 1 auto;
	min-width: 0;
}
.di-opc .woocommerce-checkout-review-order-table tfoot tr.shipping th,
.di-opc .woocommerce-checkout-review-order-table tfoot tr.woocommerce-shipping-totals th {
	flex: 0 0 auto;
	white-space: nowrap;
}
.di-opc .woocommerce-checkout-review-order-table tfoot tr.order-total {
	border-top: 2px solid var(--di-ink);
	margin-top: 2px;
}
.di-opc .woocommerce-checkout-review-order-table tfoot .order-total th,
.di-opc .woocommerce-checkout-review-order-table tfoot .order-total td {
	font-size: 18px;
	font-weight: 800;
}
.di-opc .woocommerce-checkout-review-order-table tfoot .order-total .amount { color: var(--di-accent-dark); }

/* Shipping methods inside the totals */
.di-opc ul#shipping_method,
.di-opc .woocommerce-shipping-methods {
	list-style: none;
	margin: 0;
	padding: 0;
}
.di-opc ul#shipping_method li {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 0;
}
.di-opc ul#shipping_method li input { width: auto; min-height: 0; }
.di-opc ul#shipping_method label { font-weight: 500; margin: 0; }

/* ---------- Payment method icons ("Nous acceptons") ---------- */
.di-opc-payment-icons {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 8px;
	margin: 0 0 10px;
	padding: 10px 0 0;
	border-top: 1px solid var(--di-line);
}
.di-opc-payment-icons-label {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: var(--di-muted);
	margin-right: 2px;
}
.di-opc-payment-icons-row {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
}
.di-opc-pay-icon { display: inline-flex; }
.di-opc-pay-icon svg {
	width: 36px;
	height: 24px;
	display: block;
	border-radius: 4px;
	box-shadow: 0 1px 2px rgba(18, 30, 45, .1);
}

/* ---------- Payment ---------- */
.di-opc #payment {
	background: transparent;
	margin-top: 8px;
}
.di-opc #payment ul.payment_methods {
	list-style: none;
	margin: 0 0 14px;
	padding: 14px 0 0;
	border-top: 1px solid var(--di-line);
}
.di-opc #payment ul.payment_methods li {
	padding: 8px 0;
}
.di-opc #payment ul.payment_methods li label {
	font-weight: 600;
	display: inline-flex;
	align-items: center;
	gap: 8px;
}
.di-opc #payment div.payment_box {
	background: var(--di-bg-soft);
	border-radius: 10px;
	padding: 9px 12px;
	margin-top: 6px;
	font-size: 12.5px;
	line-height: 1.4;
	color: var(--di-muted);
}
.di-opc #payment div.payment_box::before { display: none; }
.di-opc #payment div.payment_box p { margin: 0; }
.di-opc #payment ul.payment_methods { margin-bottom: 10px; padding-top: 10px; }
.di-opc #payment ul.payment_methods li { padding: 6px 0; }

/* Place order button (high specificity to beat theme .button styles) */
.di-opc #payment #place_order,
.di-opc button#place_order,
.di-opc input#place_order {
	display: block;
	width: 100% !important;
	min-height: 56px;
	padding: 14px 18px !important;
	font-size: 17px !important;
	font-weight: 800 !important;
	line-height: 1.1 !important;
	letter-spacing: .01em !important;
	text-transform: uppercase !important;
	white-space: nowrap !important;
	color: #fff !important;
	background: var(--di-accent) !important;
	background-image: none !important;
	border: 0 !important;
	border-radius: 12px !important;
	cursor: pointer;
	box-shadow: 0 6px 16px rgba(211, 47, 47, .28);
	transition: background .15s ease, transform .05s ease;
}
.di-opc #payment #place_order:hover,
.di-opc button#place_order:hover { background: var(--di-accent-dark) !important; }
.di-opc #place_order:active { transform: translateY(1px); }

.di-opc .woocommerce-terms-and-conditions-wrapper { margin: 6px 0 12px; font-size: 12.5px; }
.di-opc .woocommerce-privacy-policy-text {
	font-size: 11.5px;
	line-height: 1.4;
	color: var(--di-muted);
	margin: 6px 0 10px;
}
.di-opc .woocommerce-privacy-policy-text p { margin: 0; }
.di-opc-review-card { padding: 16px 18px; }
.di-opc-review-card .di-opc-section-title { margin-bottom: 10px; font-size: 16px; }
.di-opc-cart-card { padding: 16px 18px; }

/* ---------- Trust / misc ---------- */
.di-opc-trust {
	display: flex;
	gap: 16px;
	justify-content: center;
	flex-wrap: wrap;
	font-size: 13px;
	color: var(--di-muted);
	margin: 4px 0 0;
}
.di-opc-notices:not(:empty) { margin-bottom: 16px; }
.di-opc-notices .woocommerce-error,
.di-opc-notices .woocommerce-message,
.di-opc-notices .woocommerce-info {
	list-style: none;
	margin: 0 0 10px;
	padding: 12px 14px;
	border-radius: 10px;
	font-size: 14px;
}
.di-opc-notices .woocommerce-error { background: #fdecea; color: #a12622; }
.di-opc-notices .woocommerce-message { background: #eef7ee; color: #1b5e20; }
.di-opc-notices .woocommerce-info { background: #eaf2fb; color: #14508c; }

.di-opc-empty { text-align: center; padding: 48px 16px; }
.di-opc-empty .button { margin-top: 12px; }

.blockUI.blockOverlay { border-radius: var(--di-radius); }
