/*
 * Order-placed page (templates/order-confirmation.html), following ThankYouMobile.dc.html: heading with the order
 * number and status pill, payment card (InstaPay rows with Copy / Open in InstaPay, added by
 * assets/js/48-order-received.js), "What happens next", order details, delivery address and the last actions.
 */

.dolphin-order-received {
	--dolphin-o-line: var(--wp--preset--color--line);
	--dolphin-o-muted: var(--wp--preset--color--muted);
	--dolphin-o-forest: var(--wp--preset--color--forest);
	--dolphin-o-shadow: 0 1px 2px rgba(15, 61, 50, 0.06);
	display: flex;
	flex-direction: column;
	gap: 32px;
	padding-block: 32px 48px;
}

/*
 * Every section is as wide as the 720px column (the prototype's full-width cards). The column centres its children
 * with auto side margins, which in this flex column would otherwise shrink each card to its own content.
 */
.dolphin-order-received > * {
	width: 100%;
	box-sizing: border-box;
	margin-block: 0 !important;
}

.dolphin-order-received > :empty {
	display: none;
}

.dolphin-ty-section-title,
.dolphin-order-received .dolphin-ty-section-title {
	margin: 0 0 12px;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--dolphin-o-forest);
}

.dolphin-ty-card {
	padding: 16px;
	background: var(--wp--preset--color--white);
	border: 1px solid var(--dolphin-o-line);
	border-radius: 16px;
	box-shadow: var(--dolphin-o-shadow);
}

/* Heading, order number, status pill */
.dolphin-ty-hero {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.dolphin-ty-hero::before {
	content: "";
	width: 72px;
	height: 72px;
	margin-block-end: 16px;
	border-radius: 999px;
	background-color: var(--wp--preset--color--sage-50);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232E7D52' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
	background-position: center;
	background-repeat: no-repeat;
	background-size: 36px 36px;
}

.dolphin-ty-hero .wc-block-order-confirmation-status {
	margin: 0;
	padding: 0;
}

.dolphin-ty-hero .wc-block-order-confirmation-status h1 {
	margin: 0;
	font-size: 26px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.01em;
	text-wrap: balance;
	max-width: 16em;
	margin-inline: auto;
}

.dolphin-ty-hero .wc-block-order-confirmation-status p {
	margin: 8px 0 0;
	font-size: 15px;
	font-weight: 600;
}

@media (min-width: 960px) {
	.dolphin-ty-hero .wc-block-order-confirmation-status h1 {
		font-size: 34px;
	}
}

.dolphin-ty-pill {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 32px;
	margin: 12px 0 0;
	padding: 0 14px;
	border-radius: 999px;
	background: var(--wp--preset--color--orange-50);
	color: var(--wp--preset--color--orange-700);
	font-size: 13px;
	font-weight: 600;
}

.dolphin-ty-pill__dot {
	width: 8px;
	height: 8px;
	border-radius: 999px;
	background: currentColor;
}

.dolphin-ty-pill.is-processing,
.dolphin-ty-pill.is-out-for-delivery,
.dolphin-ty-pill.is-completed {
	background: var(--wp--preset--color--sage-50);
	color: var(--wp--preset--color--sage-700);
}

.dolphin-ty-pill.is-cancelled,
.dolphin-ty-pill.is-refunded,
.dolphin-ty-pill.is-failed {
	background: #efe9df;
	color: var(--dolphin-o-muted);
}

/* No-permission and fallback texts from WooCommerce (email check form). */
.dolphin-order-received .wc-block-order-confirmation-status-description {
	text-align: center;
	font-size: 15px;
}

.dolphin-order-received .woocommerce-verify-email {
	max-width: 420px;
	margin: 16px auto 0;
	text-align: start;
}

.dolphin-order-received .woocommerce-verify-email input[type="email"] {
	width: 100%;
	min-height: 48px;
	box-sizing: border-box;
	padding: 0 14px;
	border: 1.5px solid #cfc3ae;
	border-radius: 12px;
	font-family: inherit;
	font-size: 16px;
}

.dolphin-order-received .wc-block-order-confirmation-status-description .button,
.dolphin-order-received .woocommerce-verify-email .button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0 20px;
	border-radius: 999px;
	border: 0;
	background: var(--dolphin-o-forest);
	color: var(--wp--preset--color--cream);
	font-weight: 600;
	text-decoration: none;
}

/* Payment card */
.dolphin-order-received .dolphin-ty-instructions,
.dolphin-order-received .wc-block-order-confirmation-additional-information {
	margin: 0;
}

.dolphin-ty-pay {
	background: var(--wp--preset--color--white);
	border: 1px solid var(--dolphin-o-line);
	border-radius: 16px;
	overflow: hidden;
	box-shadow: var(--dolphin-o-shadow);
}

.dolphin-ty-pay + .dolphin-ty-next {
	margin-block-start: 32px;
}

.dolphin-ty-pay__head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 16px;
	background: var(--wp--preset--color--orange-50);
}

.dolphin-ty-pay.is-on-delivery .dolphin-ty-pay__head {
	background: var(--wp--preset--color--sage-50);
}

.dolphin-ty-pay__icon {
	flex: none;
	width: 32px;
	height: 32px;
	border-radius: 999px;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--orange-600);
	display: flex;
	align-items: center;
	justify-content: center;
}

.dolphin-ty-pay.is-on-delivery .dolphin-ty-pay__icon {
	color: var(--wp--preset--color--sage-700);
}

.dolphin-ty-pay__title {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
}

.dolphin-ty-pay__body {
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: 16px;
}

.dolphin-ty-pay__facts {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 12px 24px;
	padding-block-end: 16px;
	border-bottom: 1px solid var(--dolphin-o-line);
}

.dolphin-ty-pay__fact {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.dolphin-ty-pay__fact-label {
	font-size: 13px;
	color: var(--dolphin-o-muted);
}

.dolphin-ty-pay__amount {
	font-size: 28px;
	font-weight: 800;
	line-height: 1.15;
	letter-spacing: -0.01em;
}

.dolphin-ty-pay__ref {
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
	unicode-bidi: isolate;
}

.dolphin-ty-pay .wc-block-order-confirmation-additional-information {
	font-size: 15px;
	line-height: 1.55;
}

.dolphin-ty-pay .wc-block-order-confirmation-additional-information > :first-child {
	margin-block-start: 0;
}

.dolphin-ty-pay .wc-block-order-confirmation-additional-information > :last-child {
	margin-block-end: 0;
}

.dolphin-ty-pay .wc-block-order-confirmation-additional-information p {
	margin: 0 0 12px;
}

.dolphin-ty-pay .wc-block-order-confirmation-additional-information a {
	color: var(--dolphin-o-forest);
	font-weight: 600;
	overflow-wrap: anywhere;
}

/* Bank-details table WooCommerce prints for transfers (empty for InstaPay). */
.dolphin-ty-pay .wc-bacs-bank-details-heading:last-child,
.dolphin-ty-pay .wc-bacs-bank-details:empty {
	display: none;
}

/* InstaPay rows (assets/js/48-order-received.js) */
.dolphin-ip-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 0 0 16px;
	padding: 0;
	list-style: none;
}

.dolphin-ip-row {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin: 0;
	padding-block: 4px 6px;
	padding-inline: 14px 4px;
	background: #f3e9d8;
	border-radius: 12px;
}

/* Vodafone Cash wallet: the number and Copy only (no payment link to open). */
.dolphin-ip-row--wallet {
	padding-block: 4px;
}

.dolphin-ip-row__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.dolphin-ip-row__address {
	min-width: 0;
	overflow-wrap: anywhere;
	font-family: ui-monospace, Menlo, Consolas, monospace;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	unicode-bidi: isolate;
}

.dolphin-ip-row__copy {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-width: 96px;
	min-height: 44px;
	padding: 0 14px;
	border: 1px solid #cfc3ae;
	border-radius: 999px;
	background: var(--wp--preset--color--white);
	color: var(--dolphin-o-forest);
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

.dolphin-ip-row__copy:hover {
	border-color: var(--dolphin-o-forest);
}

.dolphin-ip-row__copy.is-copied {
	border-color: var(--wp--preset--color--sage-700);
	color: var(--wp--preset--color--sage-700);
}

.dolphin-ip-row__copy:focus-visible,
.dolphin-ip-row__open:focus-visible,
.dolphin-ty-wa:focus-visible {
	outline: 3px solid var(--wp--preset--color--orange-600);
	outline-offset: 2px;
}

.dolphin-ip-row__open {
	align-self: flex-start;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 44px;
	color: var(--dolphin-o-forest) !important;
	font-size: 14px;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}

[dir="rtl"] .dolphin-ip-row__open svg {
	transform: scaleX(-1);
}

/* WhatsApp screenshot button inside the instructions */
.dolphin-ty-pay a.dolphin-ty-wa {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	min-height: 48px;
	margin-block-start: 10px;
	padding: 0 16px;
	box-sizing: border-box;
	border: 2px solid var(--dolphin-o-forest);
	border-radius: 999px;
	background: var(--wp--preset--color--white);
	color: var(--dolphin-o-forest);
	font-size: 16px;
	font-weight: 600;
	text-decoration: none;
}

.dolphin-ty-pay a.dolphin-ty-wa:hover {
	background: var(--wp--preset--color--sage-50);
}

.dolphin-ty-wa__icon {
	display: flex;
	color: var(--wp--preset--color--sage-700);
}

.dolphin-order-received .screen-reader-text {
	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;
}

/* What happens next */
.dolphin-ty-steps {
	margin: 0;
	padding: 0;
	list-style: none;
}

.dolphin-ty-steps__item {
	position: relative;
	display: grid;
	grid-template-columns: 20px minmax(0, 1fr);
	column-gap: 14px;
	margin: 0;
	padding-block-end: 20px;
}

.dolphin-ty-steps__item:last-child {
	padding-block-end: 0;
}

.dolphin-ty-steps__item:not(:last-child)::before {
	content: "";
	position: absolute;
	inset-inline-start: 9px;
	top: 26px;
	bottom: 2px;
	width: 2px;
	border-radius: 1px;
	background: var(--dolphin-o-line);
}

.dolphin-ty-steps__item.is-done:not(:last-child)::before {
	background: var(--wp--preset--color--sage);
}

.dolphin-ty-steps__mark {
	position: relative;
	margin-block-start: 2px;
	width: 20px;
	height: 20px;
	box-sizing: border-box;
	border-radius: 999px;
	border: 2px solid #cfc3ae;
	background: var(--wp--preset--color--white);
}

.dolphin-ty-steps__item.is-current .dolphin-ty-steps__mark {
	border: 0;
	background: var(--wp--preset--color--orange-50);
}

.dolphin-ty-steps__item.is-current .dolphin-ty-steps__mark::after {
	content: "";
	position: absolute;
	inset: 4px;
	border-radius: 999px;
	background: var(--wp--preset--color--orange-600);
}

.dolphin-ty-steps__item.is-done .dolphin-ty-steps__mark {
	border: 0;
	background-color: var(--wp--preset--color--sage-700);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E");
	background-position: center;
	background-repeat: no-repeat;
	background-size: 14px 14px;
}

.dolphin-ty-steps__text {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.dolphin-ty-steps__label {
	font-size: 15px;
	font-weight: 500;
	line-height: 1.5;
	color: var(--dolphin-o-muted);
}

.dolphin-ty-steps__item.is-current .dolphin-ty-steps__label,
.dolphin-ty-steps__item.is-done .dolphin-ty-steps__label {
	font-weight: 600;
	color: var(--dolphin-o-forest);
}

.dolphin-ty-steps__note {
	font-size: 13px;
	line-height: 1.5;
	color: var(--dolphin-o-muted);
}

/* Order details (WooCommerce totals table) */
.dolphin-order-received .wc-block-order-confirmation-totals-wrapper,
.dolphin-order-received .wc-block-order-confirmation-shipping-wrapper,
.dolphin-order-received .wc-block-order-confirmation-additional-fields-wrapper {
	margin: 0;
	width: 100%;
	max-width: 720px;
}

.dolphin-order-received .wc-block-order-confirmation-totals {
	margin: 0;
	padding: 4px 16px;
	background: var(--wp--preset--color--white);
	border: 1px solid var(--dolphin-o-line);
	border-radius: 16px;
	box-shadow: var(--dolphin-o-shadow);
}

.dolphin-order-received .wc-block-order-confirmation-totals table {
	width: 100%;
	margin: 0;
	border: 0;
	border-collapse: collapse;
	font-size: 14px;
}

.dolphin-order-received .wc-block-order-confirmation-totals thead {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

.dolphin-order-received .wc-block-order-confirmation-totals th,
.dolphin-order-received .wc-block-order-confirmation-totals td {
	padding: 10px 0;
	border: 0;
	border-bottom: 1px solid var(--dolphin-o-line);
	text-align: start;
	vertical-align: top;
	font-weight: 400;
}

.dolphin-order-received .wc-block-order-confirmation-totals tbody td {
	font-weight: 600;
}

.dolphin-order-received .wc-block-order-confirmation-totals tbody td a {
	color: var(--dolphin-o-forest);
	text-decoration: none;
}

.dolphin-order-received .wc-block-order-confirmation-totals tbody td a:hover {
	text-decoration: underline;
}

/* The size at the end of a variation's name ("400 g") never breaks between number and unit (inc/order-received.php). */
.dolphin-order-received .dolphin-ty-variant {
	white-space: nowrap;
}

.dolphin-order-received .wc-block-order-confirmation-totals td:last-child,
.dolphin-order-received .wc-block-order-confirmation-totals tfoot td {
	text-align: end;
	white-space: nowrap;
	padding-inline-start: 12px;
}

.dolphin-order-received .wc-block-order-confirmation-totals tfoot th {
	color: var(--dolphin-o-muted);
}

.dolphin-order-received .wc-block-order-confirmation-totals tfoot tr:last-child th,
.dolphin-order-received .wc-block-order-confirmation-totals tfoot tr:last-child td {
	border-bottom: 0;
}

.dolphin-order-received .wc-block-order-confirmation-totals tfoot tr:has(+ tr:last-child) th,
.dolphin-order-received .wc-block-order-confirmation-totals tfoot tr:has(+ tr:last-child) td {
	border-bottom: 1px solid var(--dolphin-o-line);
}

.dolphin-order-received .wc-block-order-confirmation-totals .wc-item-meta,
.dolphin-order-received .wc-block-order-confirmation-totals .product-quantity,
.dolphin-order-received .wc-block-order-confirmation-totals .shipped_via {
	font-size: 13px;
	font-weight: 400;
	color: var(--dolphin-o-muted);
}

.dolphin-order-received .wc-block-order-confirmation-totals .wc-item-meta {
	margin: 2px 0 0;
	padding: 0;
	list-style: none;
}

.dolphin-order-received .wc-block-order-confirmation-totals .wc-item-meta li,
.dolphin-order-received .wc-block-order-confirmation-totals .wc-item-meta p {
	display: inline;
	margin: 0;
}

.dolphin-order-received .wc-block-order-confirmation-totals .order-total th,
.dolphin-order-received .wc-block-order-confirmation-totals tfoot tr:last-child th {
	font-size: 16px;
	font-weight: 700;
	color: var(--dolphin-o-forest);
}

.dolphin-order-received .wc-block-order-confirmation-totals tfoot tr:last-child td {
	font-size: 18px;
	font-weight: 800;
}

/* Delivery address and extra fields */
.dolphin-order-received .wc-block-order-confirmation-address-wrapper,
.dolphin-order-received .wc-block-order-confirmation-shipping-address,
.dolphin-order-received .wc-block-order-confirmation-additional-fields {
	margin: 0;
	padding: 16px;
	background: var(--wp--preset--color--white);
	border: 1px solid var(--dolphin-o-line);
	border-radius: 16px;
	box-shadow: var(--dolphin-o-shadow);
	font-size: 14px;
	line-height: 1.6;
}

.dolphin-order-received .wc-block-order-confirmation-shipping-address address {
	font-style: normal;
}

.dolphin-order-received .wc-block-components-additional-fields-list {
	margin: 0;
}

.dolphin-order-received .wc-block-components-additional-fields-list dt {
	font-weight: 600;
}

.dolphin-order-received .wc-block-components-additional-fields-list dd {
	margin: 0 0 8px;
	overflow-wrap: anywhere;
}

/* Last actions (patterns/order-actions.php) */
.dolphin-ty-actions {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
}

.dolphin-ty-actions__shop {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	max-width: 420px;
	min-height: 48px;
	padding: 0 24px;
	box-sizing: border-box;
	border-radius: 999px;
	background: var(--dolphin-o-forest);
	color: var(--wp--preset--color--cream) !important;
	font-size: 16px;
	font-weight: 600;
	text-decoration: none;
}

.dolphin-ty-actions__shop:hover {
	background: var(--wp--preset--color--forest-900);
}

.dolphin-ty-actions__help {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 8px;
	color: var(--dolphin-o-forest);
	font-size: 14px;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.dolphin-ty-actions__wa {
	display: flex;
	color: var(--wp--preset--color--sage-700);
}

.dolphin-ty-actions__shop:focus-visible,
.dolphin-ty-actions__help:focus-visible {
	outline: 3px solid var(--wp--preset--color--orange-600);
	outline-offset: 2px;
}

/*
 * Arabic pages: product names and address lines written in Latin letters keep their own order ("… – 400 جم × 1",
 * "12 Mostafa Fahmy St"), aligned on the right like the rest of the page.
 */
html[dir="rtl"] .dolphin-order-received .wc-block-order-confirmation-totals tbody td a,
html[dir="rtl"] .dolphin-order-received .wc-block-order-confirmation-totals .wc-item-meta p,
html[dir="rtl"] .dolphin-order-received .wc-block-order-confirmation-shipping-address address,
html[dir="rtl"] .dolphin-order-received .wc-block-components-additional-fields-list dd {
	unicode-bidi: plaintext;
	text-align: right;
}

@media (prefers-reduced-motion: reduce) {
	.dolphin-order-received * {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
}
