/* DZ COD — checkout page, product page, WhatsApp button */
:root {
	--dzcod-accent: var(--dz-primary, #006233);
	--dzcod-accent-soft: color-mix(in srgb, var(--dzcod-accent) 10%, transparent);
	--dzcod-border: #e3e6ea;
	--dzcod-muted: #6b7480;
	--dzcod-text: #1f2933;
	--dzcod-ico-truck: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='1' y='3' width='15' height='13'/%3E%3Cpath d='M16 8h4l3 3v5h-7z'/%3E%3Ccircle cx='5.5' cy='18.5' r='2.5'/%3E%3Ccircle cx='18.5' cy='18.5' r='2.5'/%3E%3C/svg%3E");
	--dzcod-ico-building: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='2' width='14' height='20' rx='1'/%3E%3Cpath d='M9 6h2M13 6h2M9 10h2M13 10h2M9 14h2M13 14h2M10 22v-4h4v4'/%3E%3C/svg%3E");
	--dzcod-ico-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 11.08V12a10 10 0 1 1-5.93-9.14'/%3E%3Cpolyline points='22 4 12 14.01 9 11.01'/%3E%3C/svg%3E");
}

.dzcod-hide {
	display: none !important;
}

/* =====================================================================
 * Checkout page
 * ================================================================== */

body.dzcod-checkout .woocommerce,
body.dzcod-checkout .woocommerce *,
body.dzcod-checkout .woocommerce *::before,
body.dzcod-checkout .woocommerce *::after {
	box-sizing: border-box;
}

/* Page chrome: no page title, one centred column */
body.dzcod-checkout .entry-header,
body.dzcod-checkout .page-title,
body.dzcod-checkout .storefront-breadcrumb {
	display: none;
}

body.dzcod-checkout form.checkout {
	max-width: 640px;
	margin: 0 auto;
}

body.dzcod-checkout .woocommerce-notices-wrapper,
body.dzcod-checkout .woocommerce-NoticeGroup {
	max-width: 640px;
	margin-left: auto;
	margin-right: auto;
}

/* Notice, back button, title */
.dzcod-notice {
	max-width: 640px;
	margin: 0 auto 18px;
	font-weight: 700;
	line-height: 1.5;
	color: var(--dzcod-accent);
}

.dzcod-head {
	max-width: 640px;
	margin: 0 auto 18px;
	display: flex;
	align-items: center;
	gap: 12px;
}

.dzcod-back-btn {
	flex: none;
	width: 40px;
	height: 40px;
	display: grid;
	place-items: center;
	border-radius: 12px;
	background: #f1f3f5;
	color: var(--dzcod-text) !important;
	text-decoration: none !important;
}

[dir="rtl"] .dzcod-back-btn svg {
	transform: scaleX(-1);
}

.dzcod-title {
	margin: 0;
	font-size: 1.35rem;
	font-weight: 800;
	line-height: 1.2;
	color: var(--dzcod-text);
}

.dzcod-sub {
	margin: 2px 0 0;
	font-size: 0.78rem;
	color: var(--dzcod-muted);
}

/* One card: fields on top ... */
body.dzcod-checkout .col2-set,
body.dzcod-checkout #customer_details,
body.dzcod-checkout .col2-set .col-1,
body.dzcod-checkout .col2-set .col-2 {
	float: none !important;
	width: 100% !important;
	margin: 0;
	padding: 0;
}

body.dzcod-checkout #customer_details {
	padding: 20px !important;
	background: #fff;
	border: 1px solid var(--dzcod-border);
	border-bottom: 0;
	border-radius: 18px 18px 0 0;
}

body.dzcod-checkout .woocommerce-billing-fields > h3,
body.dzcod-checkout .woocommerce-shipping-fields,
body.dzcod-checkout .woocommerce-additional-fields,
body.dzcod-checkout #order_review_heading {
	display: none;
}

body.dzcod-checkout .woocommerce-billing-fields__field-wrapper {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
}

body.dzcod-checkout .woocommerce-billing-fields__field-wrapper .form-row {
	float: none;
	width: auto;
	margin: 0;
	padding: 0;
	grid-column: span 1;
}

body.dzcod-checkout .woocommerce-billing-fields__field-wrapper .form-row-wide {
	grid-column: 1 / -1;
}

body.dzcod-checkout .woocommerce-billing-fields__field-wrapper .clear {
	display: none;
}

@media (max-width: 359px) {
	body.dzcod-checkout .woocommerce-billing-fields__field-wrapper .form-row {
		grid-column: 1 / -1;
	}
}

/* Placeholders carry the meaning: labels stay for screen readers only */
body.dzcod-checkout .woocommerce-billing-fields label:not(.radio) {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* Inputs */
body.dzcod-checkout .woocommerce-billing-fields input.input-text,
body.dzcod-checkout .woocommerce-billing-fields select,
body.dzcod-checkout .woocommerce-billing-fields .select2-container .select2-selection--single {
	width: 100%;
	height: 52px;
	min-height: 0;
	padding: 0 16px;
	border: 1.5px solid var(--dzcod-border);
	border-radius: 12px;
	background: #f8f9fa;
	box-shadow: none;
	font-size: 1rem;
	color: var(--dzcod-text);
}

body.dzcod-checkout .woocommerce-billing-fields .validate-required input.input-text,
body.dzcod-checkout .woocommerce-billing-fields .validate-required select,
body.dzcod-checkout .woocommerce-billing-fields .validate-required .select2-container .select2-selection--single {
	border-color: var(--dzcod-accent);
	background: #fff;
}

body.dzcod-checkout .woocommerce-billing-fields input.input-text:focus,
body.dzcod-checkout .woocommerce-billing-fields select:focus,
body.dzcod-checkout .select2-container--open .select2-selection--single {
	outline: none;
	box-shadow: 0 0 0 3px var(--dzcod-accent-soft);
}

body.dzcod-checkout .woocommerce-billing-fields .select2-selection__rendered {
	line-height: 49px;
	padding: 0;
	color: var(--dzcod-text);
}

body.dzcod-checkout .woocommerce-billing-fields .select2-selection__placeholder {
	color: #8a93a0;
}

body.dzcod-checkout .woocommerce-billing-fields .select2-selection__arrow {
	height: 50px;
	inset-inline-end: 10px;
}

body.dzcod-checkout #billing_phone {
	direction: ltr;
	text-align: start;
}

/* No red required stars anywhere in the form (placeholders and colours show what is required) */
body.dzcod-checkout .woocommerce-billing-fields .required,
body.dzcod-checkout .woocommerce-billing-fields abbr.required,
body.dzcod-checkout .woocommerce-billing-fields .optional {
	display: none !important;
}

/* Commune / Bureau dropdown waiting for a wilaya */
body.dzcod-checkout .woocommerce-billing-fields .select2-container--disabled .select2-selection--single {
	background: #f1f3f5;
	border-color: var(--dzcod-border);
}

/* Delivery type: two buttons */
.dzcod-delivery .woocommerce-input-wrapper {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
}

.dzcod-delivery input[type="radio"] {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.dzcod-delivery label.radio {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 50px;
	margin: 0;
	padding: 0 10px;
	border: 0;
	border-radius: 12px;
	background: #f1f3f5;
	color: #4b5563;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
}

.dzcod-delivery label.radio::before {
	content: "";
	flex: none;
	width: 18px;
	height: 18px;
	background: currentColor;
	-webkit-mask: center / contain no-repeat;
	mask: center / contain no-repeat;
}

.dzcod-delivery label[for$="_home"]::before {
	-webkit-mask-image: var(--dzcod-ico-truck);
	mask-image: var(--dzcod-ico-truck);
}

.dzcod-delivery label[for$="_desk"]::before {
	-webkit-mask-image: var(--dzcod-ico-building);
	mask-image: var(--dzcod-ico-building);
}

.dzcod-delivery input[type="radio"]:checked + label.radio {
	background: var(--dzcod-accent);
	color: #fff;
}

.dzcod-delivery input[type="radio"]:disabled + label.radio,
.dzcod-delivery label.radio.dzcod-disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

body.dzcod-checkout .dzcod-delivery label.radio::after {
	content: none !important;
}

/* no red stars on the two delivery buttons */
.dzcod-delivery abbr.required,
.dzcod-delivery .required {
	display: none !important;
}

/* commune / bureau dropdown: native fallback look + disabled state */
body.dzcod-checkout .woocommerce-billing-fields select {
	-webkit-appearance: none;
	appearance: none;
	padding-inline-end: 40px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7480' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-size: 18px;
	background-position: right 14px center;
}

[dir="rtl"] body.dzcod-checkout .woocommerce-billing-fields select {
	background-position: left 14px center;
}

body.dzcod-checkout .woocommerce-billing-fields select:disabled,
body.dzcod-checkout .woocommerce-billing-fields .select2-container--disabled .select2-selection--single {
	background-color: #f1f3f5;
	opacity: 0.75;
	cursor: not-allowed;
}

/* ... summary band ... */
.dzcod-summary-head {
	max-width: 640px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 14px 20px;
	background: #f6f7f9;
	border: 1px solid var(--dzcod-border);
	font-weight: 700;
	font-size: 0.95rem;
	color: var(--dzcod-text);
}

body.dzcod-checkout #order_review {
	float: none !important;
	width: 100% !important;
	max-width: 640px;
	margin: 0 auto;
	padding: 0;
}

/* ... and the order table as the bottom of the same card */
body.dzcod-checkout table.shop_table {
	display: block;
	width: 100%;
	margin: 0 0 18px;
	padding: 0;
	border: 1px solid var(--dzcod-border);
	border-top: 0;
	border-radius: 0 0 18px 18px;
	background: #fff;
}

body.dzcod-checkout table.shop_table thead {
	display: none;
}

body.dzcod-checkout table.shop_table tbody,
body.dzcod-checkout table.shop_table tfoot {
	display: block;
}

body.dzcod-checkout table.shop_table tr {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	padding: 0 20px;
	background: none;
}

body.dzcod-checkout table.shop_table th,
body.dzcod-checkout table.shop_table td {
	display: block;
	padding: 7px 0;
	border: 0;
	background: transparent !important;
	font-size: 0.9rem;
}

body.dzcod-checkout table.shop_table tr.cart_item {
	padding: 16px 20px;
	border-bottom: 1px solid var(--dzcod-border);
}

body.dzcod-checkout table.shop_table td.product-total {
	font-weight: 700;
	white-space: nowrap;
}

.dzcod-item {
	display: flex;
	align-items: center;
	gap: 12px;
}

.dzcod-thumb {
	flex: none;
	width: 40px;
	height: 40px;
	object-fit: cover;
	border: 1px solid var(--dzcod-border);
	border-radius: 8px;
}

.dzcod-item-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.dzcod-item-name {
	font-weight: 600;
	font-size: 0.85rem;
}

.dzcod-qty {
	font-size: 0.75rem;
	color: var(--dzcod-muted);
}

body.dzcod-checkout table.shop_table dl.variation {
	display: flex;
	flex-wrap: wrap;
	gap: 2px 10px;
	margin: 4px 0 0;
	font-size: 0.75rem;
	color: var(--dzcod-muted);
}

body.dzcod-checkout table.shop_table dl.variation dt,
body.dzcod-checkout table.shop_table dl.variation dd,
body.dzcod-checkout table.shop_table dl.variation p {
	display: inline;
	margin: 0;
	padding: 0;
}

body.dzcod-checkout table.shop_table tr.cart-subtotal th,
body.dzcod-checkout table.shop_table tr.cart-subtotal td,
body.dzcod-checkout table.shop_table tr.shipping th,
body.dzcod-checkout table.shop_table tr.shipping td {
	color: var(--dzcod-muted);
	font-weight: 400;
}

body.dzcod-checkout table.shop_table tr.cart-subtotal {
	padding-top: 10px;
}

body.dzcod-checkout table.shop_table ul#shipping_method {
	margin: 0;
	padding: 0;
	list-style: none;
	text-align: end;
}

body.dzcod-checkout table.shop_table ul#shipping_method li {
	margin: 0;
	padding: 0;
}

body.dzcod-checkout table.shop_table ul#shipping_method input {
	display: none;
}

body.dzcod-checkout table.shop_table tr.order-total {
	margin-top: 6px;
	padding-top: 6px;
	padding-bottom: 8px;
	border-top: 1px solid var(--dzcod-border);
}

body.dzcod-checkout table.shop_table tr.order-total th {
	font-weight: 700;
	font-size: 1rem;
	color: var(--dzcod-text);
}

body.dzcod-checkout table.shop_table tr.order-total td {
	font-size: 1.4rem;
	font-weight: 800;
	color: var(--dzcod-accent);
}

/* Payment: COD is the only method, the list stays in the page (submitted) but hidden */
body.dzcod-checkout #payment {
	margin: 0;
	padding: 0;
	background: none;
	border-radius: 0;
}

body.dzcod-checkout #payment ul.wc_payment_methods:has(.wc_payment_method) {
	display: none;
}

body.dzcod-checkout #payment .form-row.place-order {
	margin: 0;
	padding: 0;
}

body.dzcod-checkout .woocommerce-privacy-policy-text,
body.dzcod-checkout .woocommerce-terms-and-conditions-wrapper {
	display: none;
}

body.dzcod-checkout #place_order {
	float: none;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	height: 56px;
	padding: 0 20px;
	border: 0;
	border-radius: 999px;
	background: var(--dzcod-accent);
	color: #fff;
	font-size: 1rem;
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	box-shadow: 0 8px 18px color-mix(in srgb, var(--dzcod-accent) 30%, transparent);
}

body.dzcod-checkout #place_order::after {
	content: "";
	flex: none;
	width: 22px;
	height: 22px;
	background: currentColor;
	-webkit-mask: var(--dzcod-ico-check) center / contain no-repeat;
	mask: var(--dzcod-ico-check) center / contain no-repeat;
}

.dzcod-back {
	display: block;
	margin-top: 16px;
	text-align: center;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: var(--dzcod-muted) !important;
	text-decoration: none !important;
}

/* =====================================================================
 * Product page
 * ================================================================== */
form.cart .dzcod-buy-now {
	display: block;
	width: 100%;
	margin-top: 0.7em;
	padding: 1em;
	font-size: 1.05rem;
	border-radius: 12px;
}

.dzcod-trust {
	list-style: none;
	margin: 1.2em 0;
	padding: 0;
}

.dzcod-trust li {
	position: relative;
	padding-inline-start: 1.6em;
	margin: 0.35em 0;
}

.dzcod-trust li::before {
	content: "\2713";
	position: absolute;
	inset-inline-start: 0;
	color: var(--dzcod-accent);
	font-weight: 700;
}

/* =====================================================================
 * WhatsApp button (round, bottom corner)
 * ================================================================== */
.dzcod-wa {
	position: fixed;
	inset-inline-end: 16px;
	bottom: 16px;
	z-index: 999;
	width: 52px;
	height: 52px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: #25c05f;
	color: #fff !important;
	text-decoration: none !important;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.dzcod-wa span {
	display: none;
}
