/**
 * Cart & Checkout blocks (WooCommerce).
 * Buttons already follow theme.json (orange, ink text); this file adds panels,
 * spacing, focus colours and a clear "Place order" action.
 */

.woocommerce-cart .az-page__title,
.woocommerce-checkout .az-page__title {
	font-size: clamp(1.375rem, 1.1rem + 1vw, 1.875rem);
}

/* Main panels -------------------------------------------------------------- */
.wp-block-woocommerce-cart .wc-block-cart__main,
.wp-block-woocommerce-checkout .wc-block-checkout__main {
	padding: clamp(14px, 2vw, 24px);
	border: 1px solid var(--az-line);
	border-radius: var(--az-radius-lg);
	background: var(--az-white);
}

.wc-block-components-sidebar-layout .wc-block-components-sidebar {
	padding: 0;
}

.wc-block-components-sidebar .wc-block-components-panel,
.wc-block-components-sidebar .wc-block-components-totals-wrapper,
.wc-block-components-sidebar .wp-block-woocommerce-cart-order-summary-block,
.wc-block-components-sidebar .wp-block-woocommerce-checkout-order-summary-block {
	border-color: var(--az-line);
}

.wp-block-woocommerce-cart-order-summary-block,
.wp-block-woocommerce-checkout-order-summary-block {
	padding: 4px 16px 8px;
	border: 1px solid var(--az-line) !important;
	border-radius: var(--az-radius-lg);
	background: var(--az-white);
}

@media (min-width: 782px) {
	.wc-block-components-sidebar {
		position: sticky;
		inset-block-start: 16px;
		align-self: flex-start;
	}
}

/* Cart items ----------------------------------------------------------------- */
.wc-block-cart-items__header {
	color: var(--az-muted);
	font-size: 0.8125rem;
}

.wc-block-cart-item__image img {
	border-radius: 10px;
	background: var(--az-surface-2);
	mix-blend-mode: multiply;
}

.wc-block-components-product-name {
	color: var(--az-ink) !important;
	font-weight: 600;
	text-decoration: none !important;
}

.wc-block-components-product-name:hover {
	color: var(--az-orange-text) !important;
}

.wc-block-components-product-badge {
	border-color: var(--az-orange) !important;
	border-radius: 6px !important;
	background: var(--az-orange) !important;
	color: var(--az-ink) !important;
	font-weight: 700;
}

.wc-block-components-quantity-selector {
	border-radius: 10px !important;
}

.wc-block-components-quantity-selector::after {
	border-color: #cfcfcf !important;
	border-radius: 10px !important;
}

.wc-block-cart-item__remove-link {
	color: var(--az-muted) !important;
}

/* Totals & primary actions ------------------------------------------------------ */
.wc-block-components-totals-footer-item .wc-block-components-totals-item__value,
.wc-block-components-totals-footer-item .wc-block-components-totals-item__label {
	font-size: 1.25rem;
	font-weight: 700;
}

.wc-block-cart__submit-button,
.wc-block-components-checkout-place-order-button {
	min-block-size: 54px;
	border-radius: 999px !important;
	font-size: 1.0625rem !important;
	font-weight: 700 !important;
}

.wc-block-components-checkout-place-order-button {
	inline-size: 100%;
}

/* Checkout steps --------------------------------------------------------------- */
.wc-block-components-checkout-step__title {
	font-weight: 700 !important;
}

.wc-block-components-checkout-step__heading-content a {
	color: var(--az-orange-text);
}

/* Form fields: brand focus colour, rounder corners, 16px text (no iOS zoom) */
.wc-block-components-text-input input,
.wc-block-components-text-input textarea,
.wc-blocks-components-select .wc-blocks-components-select__select,
.wc-block-components-combobox .wc-block-components-combobox-control input {
	border-radius: 10px !important;
	font-size: 1rem !important;
}

.wc-block-components-text-input input:focus,
.wc-blocks-components-select .wc-blocks-components-select__select:focus,
.wc-block-components-combobox .wc-block-components-combobox-control input:focus {
	border-color: var(--az-ink) !important;
	box-shadow: 0 0 0 2px var(--az-orange-soft) !important;
}

/* Shipping & payment options */
.wc-block-components-radio-control__option {
	border-radius: 10px;
}

.wc-block-components-radio-control__option-checked,
.wc-block-components-radio-control--highlight-checked .wc-block-components-radio-control__option-checked {
	box-shadow: inset 0 0 0 2px var(--az-orange) !important;
}

.wc-block-components-radio-control__input:checked {
	border-color: var(--az-ink) !important;
}

.wc-block-components-radio-control__input:checked::before {
	background: var(--az-orange) !important;
}

.wc-block-components-checkbox .wc-block-components-checkbox__input:checked {
	border-color: var(--az-ink);
	background: var(--az-orange);
}

/* Notices */
.wc-block-components-notice-banner {
	border-radius: 10px !important;
}

/* Links inside blocks */
.wp-block-woocommerce-cart a:not(.wc-block-components-button),
.wp-block-woocommerce-checkout a:not(.wc-block-components-button) {
	color: var(--az-orange-text);
}

/* Empty cart */
.wp-block-woocommerce-empty-cart-block .wc-block-cart__empty-cart__title {
	font-size: 1.375rem;
}

.wp-block-woocommerce-empty-cart-block .wc-block-cart__empty-cart__title::before {
	background: var(--az-orange-text) !important;
}

/* Payment methods (accordion): one clean highlighted frame. */
.wc-block-components-radio-control-accordion-option .wc-block-components-radio-control__option-checked {
	box-shadow: none !important;
}

.wc-block-components-radio-control-accordion-option {
	border-radius: 10px;
	overflow: hidden;
}

.wc-block-components-radio-control--highlight-checked .wc-block-components-radio-control-accordion-option--checked-option-highlighted,
.wc-block-components-radio-control-accordion-option--checked-option-highlighted {
	box-shadow: inset 0 0 0 2px var(--az-orange) !important;
	border-radius: 10px;
}

.wc-block-components-radio-control--highlight-checked::after {
	display: none !important;
}

/* Morocco: single "Full name" field — let it span the whole row. */
.wc-block-components-address-form__first_name {
	flex-basis: 100% !important;
	inline-size: 100% !important;
	margin-inline-end: 0 !important;
}

/* =========================================================================
   Classic checkout ([woocommerce_checkout]) — used so that email can be optional.
   Layout: details on one side, sticky order summary + payment on the other.
   ========================================================================= */
.woocommerce-checkout form.checkout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 20px;
	align-items: start;
}

.woocommerce-checkout form.checkout > .woocommerce-NoticeGroup {
	grid-column: 1 / -1;
}

.woocommerce-checkout #customer_details,
.woocommerce-checkout #order_review {
	padding: clamp(16px, 2.5vw, 26px);
	border: 1px solid var(--az-line);
	border-radius: var(--az-radius-lg);
	background: var(--az-white);
}

.woocommerce-checkout #customer_details .col-1,
.woocommerce-checkout #customer_details .col-2 {
	float: none;
	inline-size: 100%;
}

.woocommerce-checkout h3 {
	margin: 0 0 14px;
	font-size: 1.125rem;
	font-weight: 700;
}

.woocommerce-checkout #order_review_heading {
	margin: 0;
}

/* Fields */
.woocommerce-checkout .form-row {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0 0 14px;
	padding: 0;
}

.woocommerce-checkout .form-row label {
	font-size: 0.875rem;
	font-weight: 600;
}

.woocommerce-checkout .form-row .optional {
	color: var(--az-muted);
	font-weight: 400;
}

.woocommerce-checkout .form-row .required {
	color: #b42318;
	text-decoration: none;
}

.woocommerce-checkout .form-row input.input-text,
.woocommerce-checkout .form-row textarea,
.woocommerce-checkout .form-row select {
	inline-size: 100%;
	min-block-size: 48px;
	padding: 10px 14px;
	border: 1px solid #cfcfcf;
	border-radius: 10px;
	background: var(--az-white);
	font: inherit;
	font-size: 1rem;
}

.woocommerce-checkout .form-row textarea {
	min-block-size: 90px;
}

.woocommerce-checkout .form-row input.input-text:focus,
.woocommerce-checkout .form-row textarea:focus {
	border-color: var(--az-ink);
	outline: 2px solid var(--az-orange-soft);
}

.woocommerce-checkout .form-row.woocommerce-invalid input.input-text {
	border-color: #b42318;
}

/* Country is fixed (Morocco only): show it as a quiet line. */
.woocommerce-checkout #billing_country_field strong {
	font-weight: 600;
}

.woocommerce-checkout .woocommerce-shipping-fields,
.woocommerce-checkout #ship-to-different-address {
	display: none;
}

/* Order summary table */
.woocommerce-checkout-review-order-table {
	inline-size: 100%;
	margin-block-end: 16px;
	border-collapse: collapse;
	font-size: 0.9375rem;
}

.woocommerce-checkout-review-order-table th,
.woocommerce-checkout-review-order-table td {
	padding: 10px 0;
	border-block-end: 1px solid var(--az-line);
	text-align: start;
	vertical-align: top;
}

.woocommerce-checkout-review-order-table td:last-child,
.woocommerce-checkout-review-order-table th:last-child {
	text-align: end;
}

.woocommerce-checkout-review-order-table thead th {
	color: var(--az-muted);
	font-size: 0.8125rem;
	font-weight: 600;
}

.woocommerce-checkout-review-order-table .product-quantity {
	color: var(--az-muted);
	font-weight: 600;
}

.woocommerce-checkout-review-order-table .variation {
	margin: 4px 0 0;
	color: var(--az-muted);
	font-size: 0.8125rem;
}

.woocommerce-checkout-review-order-table .variation dt,
.woocommerce-checkout-review-order-table .variation dd {
	display: inline;
	margin: 0;
}

.woocommerce-checkout-review-order-table .variation dd p {
	display: inline;
	margin: 0;
}

.woocommerce-checkout-review-order-table ul#shipping_method {
	margin: 0;
	padding: 0;
	list-style: none;
}

.woocommerce-checkout-review-order-table .order-total th,
.woocommerce-checkout-review-order-table .order-total td {
	border-block-end: 0;
	font-size: 1.25rem;
	font-weight: 700;
}

/* Payment */
#payment .wc_payment_methods {
	margin: 0 0 14px;
	padding: 0;
	list-style: none;
}

#payment .wc_payment_method {
	padding: 14px;
	border: 2px solid var(--az-orange);
	border-radius: 10px;
}

#payment .wc_payment_method + .wc_payment_method {
	margin-block-start: 8px;
}

#payment .wc_payment_method > label {
	font-weight: 700;
}

#payment .wc_payment_method input[type="radio"] {
	accent-color: var(--az-orange-text);
	margin-inline-end: 8px;
}

#payment .payment_box {
	margin-block-start: 8px;
	color: var(--az-muted);
	font-size: 0.875rem;
}

#payment .payment_box p {
	margin: 0;
}

.woocommerce-terms-and-conditions-wrapper {
	margin-block-end: 12px;
	color: var(--az-muted);
	font-size: 0.8125rem;
}

.woocommerce-terms-and-conditions-wrapper a {
	color: var(--az-orange-text);
}

#place_order {
	inline-size: 100%;
	min-block-size: 54px;
	border: 0;
	border-radius: 999px;
	background: var(--az-orange);
	color: var(--az-ink);
	font: inherit;
	font-size: 1.0625rem;
	font-weight: 700;
	cursor: pointer;
}

#place_order:hover {
	background: var(--az-orange-hover);
}

.woocommerce-checkout .blockUI.blockOverlay {
	border-radius: var(--az-radius-lg);
}

.woocommerce-form-coupon-toggle .woocommerce-info,
.woocommerce-form-login-toggle .woocommerce-info {
	font-size: 0.875rem;
}

.checkout_coupon {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-block-end: 16px;
	padding: 14px;
	border: 1px solid var(--az-line);
	border-radius: var(--az-radius);
	background: var(--az-white);
}

.checkout_coupon .form-row {
	margin: 0;
}

@media (min-width: 1024px) {
	.woocommerce-checkout form.checkout {
		grid-template-columns: minmax(0, 1fr) 400px;
		gap: 28px;
	}

	.woocommerce-checkout #customer_details {
		grid-column: 1;
		grid-row: 1 / span 3;
	}

	.woocommerce-checkout #order_review_heading,
	.woocommerce-checkout #order_review {
		grid-column: 2;
	}

	.woocommerce-checkout #order_review {
		position: sticky;
		inset-block-start: 16px;
	}
}

/* Morocco is the only destination: the country selector carries no choice. */
.woocommerce-checkout #billing_country_field {
	display: none !important; /* WooCommerce JS calls .show() (inline style) */
}
