/*
 * Cart and checkout (templates/page-cart.html, templates/page-checkout.html): CartMobile.dc.html and
 * CheckoutMobile.dc.html on phones, WooCommerce's two-column layout (form + summary) on wide screens.
 * Styles WooCommerce's Cart / Checkout blocks and the notes inc/checkout.php places among them.
 * Logical properties only, so /ar/ mirrors.
 */

.dolphin-cart,
.dolphin-checkout {
	--dolphin-c-line: var(--wp--preset--color--line);
	--dolphin-c-muted: var(--wp--preset--color--muted);
	--dolphin-c-forest: var(--wp--preset--color--forest);
	--dolphin-c-control: #cfc3ae;
	--dolphin-c-shadow: 0 1px 2px rgba(15, 61, 50, 0.06);
	padding-block: 16px 48px;
}

.dolphin-cart > *,
.dolphin-checkout > * {
	margin-block: 0;
}

@media (min-width: 960px) {
	.dolphin-cart,
	.dolphin-checkout {
		padding-block-start: 32px;
	}
}

/* Shared: WooCommerce block notices, totals rows, form controls */
.dolphin-cart .wc-block-components-notice-banner,
.dolphin-checkout .wc-block-components-notice-banner {
	border-radius: 12px;
	font-size: 14px;
}

.dolphin-cart .wc-block-components-totals-item,
.dolphin-checkout .wc-block-components-totals-item {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 4px 12px;
	padding-block: 6px;
	padding-inline: 0;
	font-size: 15px;
	color: var(--dolphin-c-forest);
}

.dolphin-cart .wc-block-components-totals-item__label,
.dolphin-checkout .wc-block-components-totals-item__label {
	flex: 1 1 auto;
	font-weight: 400;
}

.dolphin-cart .wc-block-components-totals-item__value,
.dolphin-checkout .wc-block-components-totals-item__value {
	font-weight: 600;
	white-space: nowrap;
}

.dolphin-cart .wc-block-components-totals-item__description,
.dolphin-checkout .wc-block-components-totals-item__description {
	flex: 1 1 100%;
	font-size: 12px;
	line-height: 1.5;
	color: var(--dolphin-c-muted);
}

.dolphin-cart .wc-block-components-totals-footer-item,
.dolphin-checkout .wc-block-components-totals-footer-item {
	padding-block: 12px 4px;
}

.dolphin-cart .wc-block-components-totals-footer-item .wc-block-components-totals-item__label,
.dolphin-checkout .wc-block-components-totals-footer-item .wc-block-components-totals-item__label {
	font-size: 16px;
	font-weight: 600;
}

.dolphin-cart .wc-block-components-totals-footer-item .wc-block-components-totals-item__value,
.dolphin-checkout .wc-block-components-totals-footer-item .wc-block-components-totals-item__value {
	font-size: 18px;
	font-weight: 700;
}

.dolphin-cart .wc-block-components-totals-wrapper,
.dolphin-checkout .wc-block-components-totals-wrapper {
	padding-block: 8px;
	padding-inline: 0;
	border-top-color: var(--dolphin-c-line);
}

.dolphin-cart .wc-block-components-totals-wrapper:empty,
.dolphin-checkout .wc-block-components-totals-wrapper:empty {
	display: none;
}

/* Quantity stepper (cart line items) */
.dolphin-cart .wc-block-components-quantity-selector {
	display: inline-flex;
	align-items: center;
	width: auto;
	min-width: 0;
	height: 44px;
	margin: 0;
	padding: 0 1px;
	box-sizing: border-box;
	border: 1.5px solid var(--dolphin-c-control);
	border-radius: 999px;
	background: var(--wp--preset--color--white);
	overflow: hidden;
}

.dolphin-cart .wc-block-components-quantity-selector::after {
	display: none;
}

.dolphin-cart .wc-block-components-quantity-selector input.wc-block-components-quantity-selector__input {
	order: 2;
	width: 32px;
	min-width: 32px;
	height: 40px;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--dolphin-c-forest);
	font-family: inherit;
	font-size: 16px;
	font-weight: 600;
	text-align: center;
	box-shadow: none;
}

.dolphin-cart .wc-block-components-quantity-selector .wc-block-components-quantity-selector__button {
	flex: none;
	width: 40px;
	min-width: 40px;
	height: 42px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--dolphin-c-forest);
	font-family: inherit;
	font-size: 20px;
	line-height: 1;
	opacity: 1;
	cursor: pointer;
}

.dolphin-cart .wc-block-components-quantity-selector__button--minus {
	order: 1;
}

.dolphin-cart .wc-block-components-quantity-selector__button--plus {
	order: 3;
}

.dolphin-cart .wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:disabled {
	color: #6c7772;
	opacity: 0.55;
	cursor: not-allowed;
}

.dolphin-cart .wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:hover:not(:disabled) {
	background: var(--wp--preset--color--sage-50);
}

.dolphin-cart .wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:focus-visible,
.dolphin-cart .wc-block-components-quantity-selector input:focus-visible {
	outline: 3px solid var(--wp--preset--color--orange-600);
	outline-offset: -3px;
}

/* ===================== Cart ===================== */

.dolphin-cart__title {
	margin: 0;
	font-size: 26px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.01em;
}

@media (min-width: 960px) {
	.dolphin-cart__title {
		font-size: 34px;
	}
}

.dolphin-cart__content {
	margin-block-start: 16px !important;
}

.dolphin-cart .wp-block-woocommerce-cart {
	margin: 0;
}

.dolphin-cart .wc-block-cart {
	margin: 0;
	padding: 0;
}

/* Line items as cards: image | name, size, unit price, stepper | remove; line total at the bottom end. */
.dolphin-cart table.wc-block-cart-items {
	display: block;
	width: 100%;
	margin: 0;
	border: 0;
	border-collapse: separate;
}

.dolphin-cart table.wc-block-cart-items thead,
.dolphin-cart table.wc-block-cart-items .wc-block-cart-items__header {
	display: none;
}

.dolphin-cart table.wc-block-cart-items tbody {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.dolphin-cart table.wc-block-cart-items .wc-block-cart-items__row {
	position: relative;
	display: grid;
	grid-template-columns: 84px minmax(0, 1fr);
	align-items: start;
	column-gap: 12px;
	margin: 0;
	padding: 12px;
	background: var(--wp--preset--color--white);
	border: 1px solid var(--dolphin-c-line);
	border-radius: 16px;
	box-shadow: var(--dolphin-c-shadow);
}

.dolphin-cart table.wc-block-cart-items .wc-block-cart-items__row td {
	display: block;
	margin: 0;
	padding: 0;
	border: 0;
}

.dolphin-cart table.wc-block-cart-items .wc-block-cart-item__image {
	grid-column: 1;
	grid-row: 1;
	width: 84px;
	padding: 0;
}

.dolphin-cart .wc-block-cart-item__image a,
.dolphin-cart .wc-block-cart-item__image img {
	display: block;
	width: 84px;
	height: 84px;
	max-width: none;
	border-radius: 12px;
	object-fit: contain;
	background: var(--wp--preset--color--white);
}

.dolphin-cart table.wc-block-cart-items .wc-block-cart-item__product {
	grid-column: 2;
	grid-row: 1;
	min-width: 0;
	padding-inline-end: 36px;
}

.dolphin-cart .wc-block-cart-item__wrap {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.dolphin-cart .wc-block-cart-item__wrap > * {
	margin: 0;
}

.dolphin-cart .wc-block-components-product-name {
	font-size: 15px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--dolphin-c-forest);
	text-decoration: none;
	overflow-wrap: anywhere;
}

.dolphin-cart a.wc-block-components-product-name:hover {
	text-decoration: underline;
}

.dolphin-cart .wc-block-cart-item__prices,
.dolphin-cart .wc-block-components-product-metadata {
	font-size: 13px;
	line-height: 1.45;
	color: var(--dolphin-c-muted);
}

.dolphin-cart .wc-block-components-product-metadata__description:empty,
.dolphin-cart .wc-block-components-product-metadata__description p:empty {
	display: none;
}

.dolphin-cart .wc-block-components-product-details {
	margin: 0;
	padding: 0;
	list-style: none;
}

.dolphin-cart .wc-block-cart-item__prices del {
	opacity: 1;
}

.dolphin-cart .wc-block-cart-item__prices ins {
	text-decoration: none;
	color: var(--wp--preset--color--orange-600);
}

.dolphin-cart .wc-block-components-sale-badge,
.dolphin-cart .wc-block-components-product-badge {
	align-self: flex-start;
	margin-block-start: 4px;
	padding: 2px 8px;
	border: 0;
	border-radius: 999px;
	background: var(--wp--preset--color--orange-50);
	color: var(--wp--preset--color--orange-700);
	font-size: 11px;
	font-weight: 700;
	text-transform: none;
}

.dolphin-cart .wc-block-cart-item__quantity {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-block-start: 10px !important;
	min-height: 44px;
}

/*
 * Remove: a trash icon in the top corner (its accessible name stays "Remove … from cart"). WooCommerce sizes this
 * button 24×24 with a long selector and puts its own trash SVG inside, so the size rule repeats that selector under
 * .dolphin-cart and the WooCommerce SVG is hidden (the theme's icon is drawn by ::before).
 */
.dolphin-cart .wc-block-cart-item__remove-link,
.dolphin-cart .wc-block-cart table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity .wc-block-cart-item__remove-link {
	position: absolute;
	top: 4px;
	inset-inline-end: 4px;
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--dolphin-c-muted) !important;
	font-size: 0 !important;
	line-height: 0;
	text-decoration: none !important;
	cursor: pointer;
}

.dolphin-cart .wc-block-cart-item__remove-link::before {
	content: "";
	width: 20px;
	height: 20px;
	background: currentColor;
	-webkit-mask: 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='M4 7h16M10 11v6M14 11v6M5 7l1 13h12l1-13M9 7V4h6v3'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: 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='M4 7h16M10 11v6M14 11v6M5 7l1 13h12l1-13M9 7V4h6v3'/%3E%3C/svg%3E") center / contain no-repeat;
}

.dolphin-cart .wc-block-cart-item__remove-link svg {
	display: none;
}

.dolphin-cart .wc-block-cart-item__remove-link:hover {
	background: var(--wp--preset--color--orange-50);
	color: var(--wp--preset--color--orange-700) !important;
}

.dolphin-cart .wc-block-cart-item__remove-link:focus-visible {
	outline: 3px solid var(--wp--preset--color--orange-600);
	outline-offset: 0;
}

/* Line total, bottom end of the card, level with the stepper. */
.dolphin-cart table.wc-block-cart-items .wc-block-cart-item__total {
	position: absolute;
	inset-block-end: 22px;
	inset-inline-end: 14px;
	padding: 0;
	text-align: end;
}

.dolphin-cart .wc-block-cart-item__total .wc-block-components-product-price,
.dolphin-cart .wc-block-cart-item__total .wc-block-components-formatted-money-amount {
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--dolphin-c-forest);
	white-space: nowrap;
}

.dolphin-cart .wc-block-cart-item__total .wc-block-components-sale-badge {
	display: none;
}

/* Summary card */
.dolphin-cart .wc-block-cart__totals-title {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.dolphin-cart .wc-block-cart__sidebar {
	margin-block-start: 16px;
}

/*
 * Summary card (CartMobile.dc.html): Subtotal, Delivery with "One price anywhere…" under it, a line, the total.
 * The Cart block draws the note (inc/checkout.php adds it after the delivery row) next to the heading, so the card
 * is a flex column with the totals group "unwrapped" and the rows put back in order: rows that come before the
 * delivery row, the delivery row, the note, then everything after it (taxes and the total).
 */
.dolphin-cart .wp-block-woocommerce-cart-order-summary-block {
	display: flex;
	flex-direction: column;
	padding: 8px 16px;
	background: var(--wp--preset--color--white);
	border: 1px solid var(--dolphin-c-line);
	border-radius: 16px;
	box-shadow: var(--dolphin-c-shadow);
}

.dolphin-cart .wp-block-woocommerce-cart-order-summary-totals-block {
	display: contents;
}

.dolphin-cart .wp-block-woocommerce-cart-order-summary-shipping-block {
	order: 1;
}

.dolphin-cart .wp-block-woocommerce-cart-order-summary-block .dolphin-cart-note {
	order: 2;
}

.dolphin-cart .wp-block-woocommerce-cart-order-summary-taxes-block,
.dolphin-cart .wp-block-woocommerce-cart-order-summary-block > .wc-block-components-totals-wrapper {
	order: 3;
}

/* No line above the first row, and none between Subtotal and Delivery (one group in the prototype). */
.dolphin-cart .wp-block-woocommerce-cart-order-summary-subtotal-block,
.dolphin-cart .wp-block-woocommerce-cart-order-summary-shipping-block,
.dolphin-cart .wp-block-woocommerce-cart-order-summary-block > .wc-block-components-totals-wrapper:first-child {
	border-top: 0;
}

.dolphin-cart .wc-block-components-totals-shipping .wc-block-components-totals-item__description {
	display: none; /* Address summary / "Change address": the delivery area is chosen at checkout. */
}

.dolphin-cart .wc-block-components-totals-shipping__fieldset,
.dolphin-cart .wc-block-components-totals-shipping__options .wc-block-components-radio-control__description {
	display: none;
}

.dolphin-cart-note {
	margin: -4px 0 8px;
	font-size: 12px;
	line-height: 1.45;
	color: var(--dolphin-c-muted);
}

.dolphin-cart .wc-block-cart__payment-options:empty,
.dolphin-cart .wp-block-woocommerce-cart-accepted-payment-methods-block:empty {
	display: none;
}

/* We accept */
.dolphin-cart-accept {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-block: 20px 4px;
}

.dolphin-cart-accept__label {
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	color: var(--dolphin-c-muted);
}

.dolphin-cart-accept__list {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.dolphin-cart-accept__list li {
	display: inline-flex;
	align-items: center;
	height: 34px;
	margin: 0;
	padding: 0 10px;
	box-sizing: border-box;
	border: 1px solid var(--dolphin-c-line);
	border-radius: 999px;
	background: var(--wp--preset--color--white);
	font-size: 12px;
	font-weight: 500;
	white-space: nowrap;
}

/* Checkout button: forest pill (BRAND.md: "Checkout" is the forest button). */
.dolphin-cart .wc-block-cart__submit {
	margin: 20px 0 0;
}

.dolphin-cart .wc-block-cart__submit-container {
	padding: 0;
}

.dolphin-cart .wc-block-cart__submit-button,
.dolphin-cart .wc-block-cart__submit-container .wc-block-components-button {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	min-height: 48px;
	padding: 0 24px;
	box-sizing: border-box;
	border: 0;
	border-radius: 999px;
	background: var(--dolphin-c-forest);
	color: var(--wp--preset--color--cream);
	font-family: inherit;
	font-size: 16px;
	font-weight: 600;
	text-decoration: none;
}

.dolphin-cart .wc-block-cart__submit-button:hover,
.dolphin-cart .wc-block-cart__submit-container .wc-block-components-button:hover {
	background: var(--wp--preset--color--forest-900);
	color: var(--wp--preset--color--cream);
}

.dolphin-cart .wc-block-cart__submit-button:focus-visible {
	outline: 3px solid var(--wp--preset--color--orange-600);
	outline-offset: 2px;
}

.dolphin-cart .wc-block-cart__submit-container--sticky {
	padding: 12px 16px;
	background: var(--wp--preset--color--white);
	border-top: 1px solid var(--dolphin-c-line);
	box-shadow: 0 -4px 16px rgba(15, 61, 50, 0.08);
}

.dolphin-cart-continue {
	display: flex;
	justify-content: center;
	margin: 4px 0 0;
}

.dolphin-cart-continue a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 12px;
	color: var(--dolphin-c-forest);
	font-size: 15px;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.dolphin-cart-continue a:hover {
	color: var(--wp--preset--color--orange-700);
}

/* Cross-sells under the items (only when the owner sets them). */
.dolphin-cart .wp-block-woocommerce-cart-items-block .wp-block-woocommerce-product-collection {
	margin-block-start: 32px;
}

/* Empty cart (patterns/cart-empty.php) */
.dolphin-cart-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	margin: 0;
	padding: 40px 24px;
	text-align: center;
	background: var(--wp--preset--color--white);
	border: 1px solid var(--dolphin-c-line);
	border-radius: 16px;
}

.dolphin-cart-empty__icon {
	position: relative;
	width: 96px;
	height: 96px;
	border-radius: 999px;
	background: var(--wp--preset--color--orange-50);
	color: var(--dolphin-c-forest);
	display: flex;
	align-items: center;
	justify-content: center;
}

.dolphin-cart-empty__dot {
	position: absolute;
	top: 6px;
	inset-inline-end: 6px;
	width: 14px;
	height: 14px;
	border-radius: 999px;
	background: var(--wp--preset--color--sage);
}

.dolphin-cart-empty__title {
	margin: 20px 0 0;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.2;
}

.dolphin-cart-empty__text {
	margin: 8px 0 0;
	max-width: 280px;
	font-size: 15px;
	color: var(--dolphin-c-muted);
}

.dolphin-cart-empty__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 48px;
	margin-block-start: 24px;
	padding: 0 28px;
	border-radius: 999px;
	background: var(--wp--preset--color--orange-600);
	color: var(--wp--preset--color--white) !important;
	font-size: 16px;
	font-weight: 600;
	text-decoration: none;
}

.dolphin-cart-empty__button:hover {
	background: var(--wp--preset--color--orange-700);
}

.dolphin-cart-empty__button:focus-visible {
	outline: 3px solid var(--dolphin-c-forest);
	outline-offset: 2px;
}

/* The page heading says "Your cart"; the empty state has its own heading. */
.dolphin-cart:has(.dolphin-cart-empty) .dolphin-cart__title {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Wide screens: items and summary side by side (WooCommerce's sidebar layout). */
@media (min-width: 960px) {
	.dolphin-cart .wc-block-components-sidebar-layout {
		display: grid;
		grid-template-columns: minmax(0, 1fr) 380px;
		gap: 32px;
		align-items: start;
		margin: 0;
	}

	.dolphin-cart .wc-block-components-sidebar-layout > .wc-block-components-main,
	.dolphin-cart .wc-block-components-sidebar-layout > .wc-block-components-sidebar {
		width: auto;
		margin: 0;
		padding: 0;
	}

	.dolphin-cart .wc-block-cart__sidebar {
		position: sticky;
		top: 24px;
		margin-block-start: 0;
	}
}

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

.dolphin-checkout-intro {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.dolphin-checkout-intro > * {
	margin: 0;
}

.dolphin-checkout-intro__title {
	font-size: 26px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.01em;
}

@media (min-width: 960px) {
	.dolphin-checkout-intro__title {
		font-size: 34px;
	}
}

.dolphin-checkout-intro__lead {
	font-size: 15px;
	color: var(--dolphin-c-muted);
}

.dolphin-checkout-intro__box {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin-block-start: 14px;
	padding: 12px 16px;
	border-radius: 16px;
	background: var(--wp--preset--color--sage-50);
	color: var(--dolphin-c-forest);
}

.dolphin-checkout-intro__box p {
	margin: 0;
	font-size: 14px;
	line-height: 1.55;
	align-self: center;
}

.dolphin-checkout-intro__icon {
	flex: none;
	width: 40px;
	height: 40px;
	border-radius: 999px;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--sage-700);
	display: flex;
	align-items: center;
	justify-content: center;
}

@media (min-width: 960px) {
	.dolphin-checkout-intro__box {
		max-width: 760px;
	}
}

.dolphin-checkout__content {
	margin-block-start: 24px !important;
}

/* Empty cart at checkout: WooCommerce's own message only. */
.dolphin-checkout:has(.wc-block-checkout-empty) .dolphin-checkout-intro__lead,
.dolphin-checkout:has(.wc-block-checkout-empty) .dolphin-checkout-intro__box {
	display: none;
}

.dolphin-checkout .wc-block-checkout-empty {
	padding: 40px 24px;
	text-align: center;
	background: var(--wp--preset--color--white);
	border: 1px solid var(--dolphin-c-line);
	border-radius: 16px;
}

.dolphin-checkout .wc-block-checkout-empty .wp-block-button__link,
.dolphin-checkout .wc-block-checkout-empty .wc-block-components-button {
	min-height: 48px;
	padding: 0 28px;
	border-radius: 999px;
	background: var(--wp--preset--color--orange-600);
	color: var(--wp--preset--color--white);
}

.dolphin-checkout .wp-block-woocommerce-checkout {
	margin: 0;
	padding: 0;
}

.dolphin-checkout .wc-block-checkout {
	margin: 0;
}

/* Steps: numbered forest circles, 18px headings (CheckoutMobile.dc.html). */
.dolphin-checkout .wc-block-components-checkout-step {
	margin-block-end: 32px;
	padding: 0;
}

.dolphin-checkout .wc-block-components-checkout-step__heading {
	margin: 0 0 12px;
	min-height: 28px;
}

.dolphin-checkout .wc-block-components-checkout-step__title,
.dolphin-checkout .wc-block-components-title.wc-block-components-checkout-step__title {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--dolphin-c-forest);
}

.dolphin-checkout .wc-block-components-checkout-step__description {
	margin: 0 0 12px;
	font-size: 13px;
	line-height: 1.5;
	color: var(--dolphin-c-muted);
}

.dolphin-checkout .wc-block-checkout__form--with-step-numbers .wc-block-components-checkout-step--with-step-number .wc-block-components-checkout-step__title::before,
.dolphin-checkout .wc-block-checkout__form--with-step-numbers .wc-block-components-checkout-step--with-step-number .wc-block-components-checkout-step__heading::before {
	background: var(--dolphin-c-forest);
	color: var(--wp--preset--color--cream);
	border-radius: 999px;
}

/* Text inputs and selects (the [type] / form selectors outrank WooCommerce's 4px-corner input rule). */
.dolphin-checkout .wc-block-components-text-input input,
.dolphin-checkout .wc-block-components-form .wc-block-components-text-input input[type],
.dolphin-checkout .wc-block-components-textarea,
.dolphin-checkout .wc-blocks-components-select .wc-blocks-components-select__select,
.dolphin-checkout .wc-block-components-combobox .wc-block-components-combobox-control input {
	min-height: 52px;
	border: 1.5px solid var(--dolphin-c-control);
	border-radius: 12px;
	background-color: var(--wp--preset--color--white);
	color: var(--dolphin-c-forest);
	font-family: inherit;
	font-size: 16px;
	box-shadow: none;
}

.dolphin-checkout .wc-block-components-textarea {
	min-height: 96px;
	padding: 12px 14px;
}

.dolphin-checkout .wc-block-components-text-input input:focus,
.dolphin-checkout .wc-block-components-form .wc-block-components-text-input input[type]:focus,
.dolphin-checkout .wc-block-components-textarea:focus,
.dolphin-checkout .wc-blocks-components-select .wc-blocks-components-select__select:focus,
.dolphin-checkout .wc-block-components-combobox .wc-block-components-combobox-control input:focus {
	border-color: var(--dolphin-c-forest);
	outline: 2px solid var(--dolphin-c-forest);
	outline-offset: 0;
	box-shadow: none;
}

.dolphin-checkout .wc-block-components-text-input label,
.dolphin-checkout .wc-blocks-components-select__label {
	color: var(--dolphin-c-muted);
}

.dolphin-checkout .wc-block-components-text-input.has-error input,
.dolphin-checkout .wc-block-components-form .wc-block-components-text-input.has-error input[type],
.dolphin-checkout .wc-blocks-components-select.has-error .wc-blocks-components-select__select {
	border-color: #b3261e;
}

.dolphin-checkout .wc-block-components-validation-error {
	font-size: 13px;
}

.dolphin-checkout .wc-block-components-validation-error > p {
	color: #b3261e;
}

.dolphin-checkout .wc-block-components-address-card {
	border-radius: 16px;
	border-color: var(--dolphin-c-line);
	background: var(--wp--preset--color--white);
}

/*
 * Address form as in CheckoutMobile.dc.html:
 * - no Country/Region select while Egypt is the only country the shop sells to (the select then holds only Egypt
 *   and its "Select a country/region" placeholder; it shows again if the owner adds a country);
 * - no "Use same address for billing" while it is ticked (the default): the delivery address is the billing address;
 * - the Google Maps link on its own full-width row, last, so the hint under the form sits right under it.
 */
.dolphin-checkout .wc-block-components-address-form__country:has(select option:only-child),
.dolphin-checkout .wc-block-components-address-form__country:has(select option[value=""]:first-child:nth-last-child(2)) {
	display: none;
}

.dolphin-checkout .wc-block-checkout__use-address-for-billing:has(input:checked) {
	display: none;
}

.dolphin-checkout .wc-block-components-address-form .wc-block-components-address-form__dolphin-store-maps-link {
	flex: 0 0 100%;
	order: 99;
}

/* Google Maps hint under the address (patterns/checkout-maps-hint.php) */
.dolphin-checkout-maps-hint {
	margin: -24px 0 32px;
	font-size: 13px;
	line-height: 1.5;
	color: var(--dolphin-c-muted);
}

/* Checkboxes (same address for billing, order note) */
.dolphin-checkout .wc-block-components-checkbox {
	margin-block: 12px;
}

.dolphin-checkout .wc-block-components-checkbox .wc-block-components-checkbox__input[type="checkbox"] {
	width: 20px;
	height: 20px;
	min-width: 20px;
	border: 1.5px solid var(--dolphin-c-control);
	border-radius: 6px;
	background: var(--wp--preset--color--white);
}

.dolphin-checkout .wc-block-components-checkbox .wc-block-components-checkbox__input[type="checkbox"]:checked {
	background: var(--dolphin-c-forest);
	border-color: var(--dolphin-c-forest);
}

.dolphin-checkout .wc-block-components-checkbox .wc-block-components-checkbox__mark {
	fill: var(--wp--preset--color--cream);
}

.dolphin-checkout .wc-block-components-checkbox label {
	min-height: 44px;
	align-items: center;
}

/* Delivery rate: one sage card ("Delivery, same day · EGP 60") */
.dolphin-checkout .wc-block-components-shipping-rates-control .wc-block-components-radio-control,
.dolphin-checkout .wc-block-checkout__shipping-option .wc-block-components-radio-control {
	border: 0;
	border-radius: 16px;
	overflow: hidden;
}

.dolphin-checkout .wc-block-checkout__shipping-option .wc-block-components-radio-control__option {
	margin: 0;
	padding-block: 14px;
	padding-inline: 52px 16px;
	border: 0;
	border-radius: 16px;
	background: var(--wp--preset--color--sage-50);
	box-shadow: none;
}

.dolphin-checkout .wc-block-checkout__shipping-option .wc-block-components-radio-control__label,
.dolphin-checkout .wc-block-checkout__shipping-option .wc-block-components-radio-control__secondary-label {
	font-size: 15px;
	font-weight: 600;
	color: var(--dolphin-c-forest);
}

/*
 * Radio inputs: forest when chosen. WooCommerce places the radio with a physical left: 16px, and /ar/ pages get its
 * left-to-right stylesheet, so the radio is put at the start side here (right on Arabic pages, where the option's
 * 52px start padding leaves room for it).
 */
.dolphin-checkout .wc-block-components-radio-control .wc-block-components-radio-control__input {
	right: auto;
	left: auto;
	inset-inline-start: 16px;
}

.dolphin-checkout .wc-block-components-radio-control__input {
	border: 1.5px solid var(--dolphin-c-control);
	background: var(--wp--preset--color--white);
	width: 20px;
	height: 20px;
	min-height: 20px;
	min-width: 20px;
}

.dolphin-checkout .wc-block-components-radio-control__input:checked {
	border-color: var(--dolphin-c-forest);
}

.dolphin-checkout .wc-block-components-radio-control__input:checked::before {
	background: var(--dolphin-c-forest);
}

.dolphin-checkout .wc-block-components-radio-control__input:focus-visible {
	outline: 3px solid var(--wp--preset--color--orange-600);
	outline-offset: 2px;
}

/* Payment methods: white cards, the chosen one with a 2px forest border. */
.dolphin-checkout .wc-block-checkout__payment-method .wc-block-components-radio-control {
	display: flex;
	flex-direction: column;
	gap: 12px;
	border: 0;
}

.dolphin-checkout .wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option {
	margin: 0;
	background: var(--wp--preset--color--white);
	border: 1px solid var(--dolphin-c-line);
	border-radius: 16px;
	box-shadow: none;
	overflow: hidden;
}

.dolphin-checkout .wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option::after {
	display: none;
}

.dolphin-checkout .wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option:has(.wc-block-components-radio-control__option-checked),
.dolphin-checkout .wc-block-checkout__payment-method .wc-block-components-radio-control__option-checked {
	border-color: var(--dolphin-c-forest);
}

.dolphin-checkout .wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option:has(.wc-block-components-radio-control__option-checked) {
	box-shadow: inset 0 0 0 1px var(--dolphin-c-forest);
}

/* border-box: the 56px minimum includes the padding, so the radio (centred by WooCommerce) lines up with the title. */
.dolphin-checkout .wc-block-checkout__payment-method .wc-block-components-radio-control__option {
	box-sizing: border-box;
	margin: 0;
	padding-block: 16px;
	padding-inline: 52px 16px;
	border: 0;
	box-shadow: none;
	min-height: 56px;
}

.dolphin-checkout .wc-block-checkout__payment-method .wc-block-components-radio-control__label {
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
	color: var(--dolphin-c-forest);
}

.dolphin-checkout .wc-block-components-radio-control-accordion-content {
	margin: 0 16px;
	padding: 12px 0 16px;
	border-top: 1px solid var(--dolphin-c-line);
	font-size: 14px;
	line-height: 1.5;
	color: var(--dolphin-c-forest);
}

.dolphin-checkout .wc-block-components-radio-control-accordion-content:empty {
	display: none;
}

.dolphin-checkout .wc-block-components-radio-control-accordion-content p {
	margin: 0;
}

/* Order note */
.dolphin-checkout .wc-block-checkout__add-note .wc-block-components-textarea {
	width: 100%;
	box-sizing: border-box;
}

/* Terms and Place order */
.dolphin-checkout .wc-block-checkout__terms {
	margin: 0 0 16px;
	padding: 0;
	border: 0;
	font-size: 12px;
	line-height: 1.5;
	color: var(--dolphin-c-muted);
}

.dolphin-checkout .wc-block-checkout__terms a {
	color: var(--dolphin-c-forest);
	font-weight: 600;
}

.dolphin-checkout .wc-block-checkout__actions {
	padding: 0;
	margin: 0;
}

.dolphin-checkout .wc-block-checkout__actions_row {
	display: flex;
	flex-direction: column-reverse;
	align-items: stretch;
	gap: 8px;
}

.dolphin-checkout .wc-block-components-checkout-place-order-button {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	min-height: 52px;
	padding: 0 24px;
	box-sizing: border-box;
	border: 0;
	border-radius: 999px;
	background: var(--wp--preset--color--orange-600);
	color: var(--wp--preset--color--white);
	font-family: inherit;
	font-size: 16px;
	font-weight: 600;
}

.dolphin-checkout .wc-block-components-checkout-place-order-button:hover:not(:disabled) {
	background: var(--wp--preset--color--orange-700);
	color: var(--wp--preset--color--white);
}

.dolphin-checkout .wc-block-components-checkout-place-order-button:focus-visible {
	outline: 3px solid var(--dolphin-c-forest);
	outline-offset: 2px;
}

.dolphin-checkout .wc-block-components-checkout-place-order-button:disabled {
	opacity: 0.7;
}

.dolphin-checkout .wc-block-components-checkout-return-to-cart-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 44px;
	color: var(--dolphin-c-forest);
	font-size: 15px;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* WhatsApp confirmation line under Place order (patterns/checkout-confirm-note.php) */
.dolphin-checkout-confirm {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin-block: 16px 0;
}

.dolphin-checkout-confirm p {
	margin: 0;
	font-size: 14px;
	line-height: 1.55;
	color: var(--dolphin-c-forest);
}

.dolphin-checkout-confirm__icon {
	display: flex;
	flex: none;
	padding-block-start: 1px;
	color: var(--wp--preset--color--sage-700);
}

/* Order summary (collapsible on phones, sidebar on wide screens) */
.dolphin-checkout .wc-block-checkout__sidebar .wp-block-woocommerce-checkout-order-summary-block,
.dolphin-checkout .wc-block-components-checkout-order-summary {
	background: var(--wp--preset--color--white);
	border: 1px solid var(--dolphin-c-line);
	border-radius: 16px;
	box-shadow: var(--dolphin-c-shadow);
}

.dolphin-checkout .wc-block-components-checkout-order-summary__title {
	min-height: 64px;
	padding-inline: 16px;
	font-size: 15px;
	font-weight: 600;
}

/*
 * Phones: the collapsible summary at the top is one card. WooCommerce gives its title a 16px top margin and a line
 * above and below (an empty band, and a bottom line that runs past the card's round corners); the card draws the
 * edges instead, and one line separates the title from the opened list.
 */
.dolphin-checkout .wp-block-woocommerce-checkout-order-summary-block .wc-block-components-checkout-order-summary__title {
	box-sizing: border-box;
	margin: 0;
	padding-block: 12px;
	border-top: 0;
	border-bottom: 0;
}

.dolphin-checkout .wp-block-woocommerce-checkout-order-summary-block .wc-block-components-checkout-order-summary__content.is-open {
	border-top: 1px solid var(--dolphin-c-line);
	border-bottom: 0;
}

.dolphin-checkout .wc-block-components-checkout-order-summary__title-price {
	font-size: 16px;
	font-weight: 700;
}

.dolphin-checkout .wc-block-components-checkout-order-summary__content,
.dolphin-checkout .wc-block-components-order-summary {
	padding-inline: 16px;
}

.dolphin-checkout .wc-block-components-order-summary-item__image img {
	border-radius: 12px;
	background: var(--wp--preset--color--white);
	object-fit: contain;
}

.dolphin-checkout .wc-block-components-order-summary-item__quantity {
	background: var(--dolphin-c-forest);
	color: var(--wp--preset--color--cream);
	border: 2px solid var(--wp--preset--color--white);
	box-shadow: none;
}

.dolphin-checkout .wc-block-components-order-summary-item__description .wc-block-components-product-name {
	font-size: 14px;
	font-weight: 600;
	color: var(--dolphin-c-forest);
}

.dolphin-checkout .wc-block-components-order-summary-item__total-price {
	font-size: 14px;
	font-weight: 700;
}

.dolphin-checkout .wc-block-components-totals-shipping .wc-block-components-totals-shipping__via,
.dolphin-checkout .wc-block-components-totals-shipping .wc-block-components-totals-item__description {
	font-size: 12px;
	color: var(--dolphin-c-muted);
}

@media (min-width: 960px) {
	.dolphin-checkout .wc-block-components-sidebar-layout {
		display: grid;
		grid-template-columns: minmax(0, 1fr) 400px;
		gap: 48px;
		align-items: start;
		margin: 0;
	}

	.dolphin-checkout .wc-block-components-sidebar-layout > .wc-block-components-main,
	.dolphin-checkout .wc-block-components-sidebar-layout > .wc-block-components-sidebar {
		width: auto;
		margin: 0;
		padding: 0;
	}

	.dolphin-checkout .wc-block-checkout__sidebar {
		position: sticky;
		top: 24px;
	}
}

/*
 * Arabic pages: text written in Latin letters keeps its own order inside the right-to-left page. Without this,
 * "12 Mostafa Fahmy St" shows as "Mostafa Fahmy St 12" and "Royal Canin … – 400 جم" puts "جم" in front of the name.
 * Each value takes its direction from its first letter; the alignment stays on the right like the rest of the page.
 */
html[dir="rtl"] .dolphin-checkout .wc-block-components-text-input input,
html[dir="rtl"] .dolphin-checkout .wc-block-components-textarea,
html[dir="rtl"] .dolphin-checkout .wc-block-components-address-card address,
html[dir="rtl"] .dolphin-cart .wc-block-components-product-name,
html[dir="rtl"] .dolphin-checkout .wc-block-components-product-name,
html[dir="rtl"] .dolphin-cart .wc-block-components-product-details__value,
html[dir="rtl"] .dolphin-checkout .wc-block-components-product-details__value {
	unicode-bidi: plaintext;
	text-align: right;
}

@media (prefers-reduced-motion: reduce) {
	.dolphin-cart *,
	.dolphin-checkout * {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		scroll-behavior: auto !important;
	}
}
