/* Team Moon Options — gift order box. */

.tm-gift {
	--tm-gift-accent: #807af8;
	--tm-gift-bg: #ffffff;
	--tm-gift-border: #e6e8f0;
	--tm-gift-text: #1e2130;
	--tm-gift-radius: 12px;
	--tm-gift-soft: color-mix(in srgb, var(--tm-gift-accent) 8%, var(--tm-gift-bg));
	margin: 0 0 16px;
	color: var(--tm-gift-text);
	font-family: "Tajawal", inherit;
	text-align: start;
	background: var(--tm-gift-bg);
	border: 1.5px solid var(--tm-gift-border);
	border-radius: var(--tm-gift-radius);
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.tm-gift *,
.tm-gift *::before,
.tm-gift *::after {
	box-sizing: border-box;
}

.tm-gift.is-on {
	border-color: var(--tm-gift-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--tm-gift-accent) 12%, transparent);
}

/* Header row: icon · title · switch */
.tm-gift .tm-gift__head {
	position: relative;
	display: flex !important;
	align-items: center;
	gap: 12px;
	width: 100%;
	margin: 0 !important;
	padding: 14px 16px;
	cursor: pointer;
	font-weight: 400;
	line-height: 1.4;
}

.tm-gift__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 42px;
	height: 42px;
	color: var(--tm-gift-accent);
	background: var(--tm-gift-soft);
	border-radius: 50%;
}

.tm-gift.is-on .tm-gift__icon {
	color: #fff;
	background: var(--tm-gift-accent);
}

.tm-gift__copy {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.tm-gift__title {
	font-size: 15px;
	font-weight: 700;
}

.tm-gift__sub {
	font-size: 12.5px;
	color: color-mix(in srgb, var(--tm-gift-text) 60%, transparent);
}

/* Native checkbox hidden, custom switch shown. */
.tm-gift .tm-gift__toggle {
	position: absolute !important;
	opacity: 0 !important;
	width: 1px !important;
	height: 1px !important;
	margin: 0 !important;
	pointer-events: none;
}

.tm-gift__switch {
	position: relative;
	flex: 0 0 auto;
	width: 44px;
	height: 26px;
	background: color-mix(in srgb, var(--tm-gift-text) 18%, transparent);
	border-radius: 999px;
	transition: background-color 0.2s ease;
}

.tm-gift__switch::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
	transition: transform 0.2s ease;
}

.tm-gift__toggle:checked ~ .tm-gift__switch {
	background: var(--tm-gift-accent);
}

.tm-gift__toggle:checked ~ .tm-gift__switch::after {
	transform: translateX(18px);
}

[dir="rtl"] .tm-gift__switch::after,
.tm-gift[dir="rtl"] .tm-gift__switch::after {
	left: auto;
	right: 3px;
}

.tm-gift[dir="rtl"] .tm-gift__toggle:checked ~ .tm-gift__switch::after {
	transform: translateX(-18px);
}

.tm-gift__toggle:focus-visible ~ .tm-gift__switch {
	outline: 2px solid var(--tm-gift-accent);
	outline-offset: 2px;
}

/* Fields */
.tm-gift__body {
	padding: 0 16px 16px;
	border-top: 1px dashed var(--tm-gift-border);
	animation: tmGiftIn 0.2s ease;
}

.tm-gift__body[hidden] {
	display: none !important;
}

.tm-gift__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0 12px;
}

@media (min-width: 600px) {
	.tm-gift--checkout .tm-gift__grid {
		grid-template-columns: 1fr 1fr;
	}
}

.tm-gift .tm-gift__field {
	position: relative;
	margin: 12px 0 0 !important;
	padding: 0 !important;
}

.tm-gift .tm-gift__field label {
	display: block;
	margin: 0 0 6px;
	font-size: 13px;
	font-weight: 700;
}

.tm-gift .tm-gift__field .required {
	color: #ef4444;
	text-decoration: none;
	border: 0;
}

.tm-gift .tm-gift__input {
	display: block;
	width: 100% !important;
	min-height: 44px;
	margin: 0;
	padding: 10px 14px;
	font: inherit;
	font-size: 14px;
	color: var(--tm-gift-text);
	background: #fff;
	border: 1.5px solid var(--tm-gift-border);
	border-radius: var(--tm-gift-radius);
	box-shadow: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tm-gift textarea.tm-gift__input {
	min-height: 90px;
	padding-bottom: 26px;
	resize: vertical;
}

.tm-gift .tm-gift__input:focus {
	outline: none;
	border-color: var(--tm-gift-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--tm-gift-accent) 16%, transparent);
}

.tm-gift .tm-gift__input[dir="ltr"] {
	text-align: left;
}

.tm-gift[dir="rtl"] .tm-gift__input[dir="ltr"]::placeholder {
	text-align: right;
}

.tm-gift__count {
	position: absolute;
	direction: ltr;
	unicode-bidi: isolate;
	bottom: 8px;
	inset-inline-end: 12px;
	font-size: 11.5px;
	color: color-mix(in srgb, var(--tm-gift-text) 50%, transparent);
	pointer-events: none;
}

.tm-gift__status:empty {
	display: none;
}

@keyframes tmGiftIn {
	from { opacity: 0; transform: translateY(-4px); }
	to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.tm-gift__body,
	.tm-gift__switch,
	.tm-gift__switch::after {
		animation: none !important;
		transition: none !important;
	}
}

/* Counter sits at the end side of the box (left in Arabic, right in English). */
.tm-gift[dir="rtl"] .tm-gift__count {
	left: 12px;
	right: auto;
}

.tm-gift[dir="ltr"] .tm-gift__count {
	right: 12px;
	left: auto;
}

/* ---------- Card design + color pickers ---------- */
.tm-gift__pick {
	margin: 14px 0 0;
}

.tm-gift__pick-label {
	display: block;
	margin: 0 0 8px;
	font-size: 13px;
	font-weight: 700;
}

.tm-gift__designs {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
}

.tm-gift .tm-gift__design {
	position: relative;
	display: flex !important;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	margin: 0 !important;
	padding: 8px;
	cursor: pointer;
	background: #fff;
	border: 1.5px solid var(--tm-gift-border);
	border-radius: var(--tm-gift-radius);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tm-gift .tm-gift__design.is-selected {
	border-color: var(--tm-gift-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--tm-gift-accent) 14%, transparent);
}

.tm-gift__design-name {
	font-size: 12.5px;
	font-weight: 700;
}

.tm-gift .tm-gift__radio {
	position: absolute !important;
	opacity: 0 !important;
	width: 1px !important;
	height: 1px !important;
	margin: 0 !important;
	pointer-events: none;
}

.tm-gift__design:has(.tm-gift__radio:focus-visible),
.tm-gift__color:has(.tm-gift__radio:focus-visible) {
	outline: 2px solid var(--tm-gift-accent);
	outline-offset: 2px;
}

.tm-gift__colors {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.tm-gift .tm-gift__color {
	position: relative;
	display: inline-flex !important;
	margin: 0 !important;
	padding: 3px;
	cursor: pointer;
	border: 2px solid transparent;
	border-radius: 50%;
	transition: border-color 0.15s ease;
}

.tm-gift .tm-gift__color.is-selected {
	border-color: var(--c);
}

.tm-gift__dot {
	display: block;
	width: 28px;
	height: 28px;
	background: var(--c);
	border-radius: 50%;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.tm-gift .tm-gift__color.is-selected .tm-gift__dot::after {
	content: "";
	display: block;
	width: 7px;
	height: 12px;
	margin: 6px auto 0;
	border: solid #fff;
	border-width: 0 2.5px 2.5px 0;
	transform: rotate(45deg);
}

.tm-gift .tm-gift__preview {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	min-height: 44px;
	margin: 14px 0 0;
	padding: 10px 16px;
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	text-transform: none;
	letter-spacing: normal;
	color: var(--tm-gift-accent) !important;
	background: color-mix(in srgb, var(--tm-gift-accent) 7%, #fff) !important;
	border: 1.5px dashed color-mix(in srgb, var(--tm-gift-accent) 45%, transparent) !important;
	border-radius: var(--tm-gift-radius) !important;
	box-shadow: none !important;
	cursor: pointer;
}

.tm-gift .tm-gift__preview:hover,
.tm-gift .tm-gift__preview:focus-visible {
	background: color-mix(in srgb, var(--tm-gift-accent) 12%, #fff) !important;
	border-color: var(--tm-gift-accent) !important;
	outline: none;
}

/* ---------- Preview popup ---------- */
html.tm-gift-modal-open,
html.tm-gift-modal-open body {
	overflow: hidden;
}

.tm-gift-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(15, 17, 23, 0.55);
	font-family: "Tajawal", inherit;
	animation: tmGiftFade 0.15s ease;
}

.tm-gift-modal__panel {
	width: min(520px, 100%);
	max-height: 92vh;
	overflow: auto;
	padding: 16px 16px 20px;
	background: #f6f7f9;
	border-radius: 18px;
	box-shadow: 0 24px 60px rgba(16, 24, 40, 0.28);
	outline: none;
}

.tm-gift-modal__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 16px;
}

.tm-gift-modal__title {
	font-size: 16px;
	font-weight: 700;
	color: #111827;
}

.tm-gift-modal .tm-gift-modal__close {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 36px !important;
	height: 36px !important;
	min-width: 0 !important;
	min-height: 0 !important;
	padding: 0 !important;
	margin: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: #ef4444 !important;
	color: #fff !important;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18) !important;
	cursor: pointer;
}

.tm-gift-modal .tm-gift-modal__close:hover {
	background: #dc2626 !important;
}

.tm-gift-modal__stage {
	padding: 6px 4px 10px;
}

@keyframes tmGiftFade {
	from { opacity: 0; }
	to { opacity: 1; }
}

/* =========================================================
   Compact row in cart / checkout + details in a popup
   ========================================================= */
.tm-gift {
	margin: 0 0 12px;
}

.tm-gift .tm-gift__head {
	padding: 10px 12px;
	gap: 10px;
}

.tm-gift__icon {
	width: 36px;
	height: 36px;
}

.tm-gift__icon svg {
	width: 19px;
	height: 19px;
}

.tm-gift__title {
	font-size: 14.5px;
}

.tm-gift__sub {
	font-size: 12px;
}

/* The fields never show inside the cart / checkout box itself. */
.tm-gift > .tm-gift__body {
	display: none !important;
}

/* Summary after saving: "To: Sara 055…   Preview · Edit" */
.tm-gift__summary {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 12px;
	padding: 10px 12px;
	font-size: 13.5px;
	border-top: 1px dashed var(--tm-gift-border);
	background: color-mix(in srgb, var(--tm-gift-accent) 5%, var(--tm-gift-bg));
	border-radius: 0 0 var(--tm-gift-radius) var(--tm-gift-radius);
}

.tm-gift__summary[hidden] {
	display: none !important;
}

.tm-gift__summary-text {
	flex: 1 1 140px;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.tm-gift__summary-phone {
	margin-inline-start: 6px;
	color: color-mix(in srgb, var(--tm-gift-text) 60%, transparent);
}

.tm-gift .tm-gift__link {
	appearance: none;
	flex: 0 0 auto;
	width: auto !important;
	gap: 0;
	border-style: solid !important;
	min-height: 0;
	margin: 0;
	padding: 4px 10px;
	font: inherit;
	font-size: 13px;
	font-weight: 700;
	text-transform: none;
	letter-spacing: normal;
	color: var(--tm-gift-accent) !important;
	background: #fff !important;
	border: 1px solid color-mix(in srgb, var(--tm-gift-accent) 30%, transparent) !important;
	border-radius: 999px !important;
	box-shadow: none !important;
	cursor: pointer;
}

.tm-gift .tm-gift__link:hover {
	border-color: var(--tm-gift-accent) !important;
}

/* ---------- Popup ---------- */
.tm-gift.tm-gift-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 16px;
	background: rgba(15, 17, 23, 0.55);
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

.tm-gift-modal .tm-gift-modal__panel,
.tm-gift-modal > .tm-gift__body {
	display: block !important;
	position: relative;
	width: min(520px, 100%);
	max-height: 92vh;
	overflow: auto;
	margin: 0;
	padding: 0 16px 0;
	background: #fff;
	border: 0;
	border-radius: 18px;
	box-shadow: 0 24px 60px rgba(16, 24, 40, 0.28);
	outline: none;
	animation: tmGiftIn 0.2s ease;
}

.tm-gift__modal-head {
	position: sticky;
	top: 0;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin: 0 -16px;
	padding: 14px 16px 10px;
	background: #fff;
}

.tm-gift__modal-title {
	font-size: 16px;
	font-weight: 700;
	color: var(--tm-gift-text, #111827);
}

.tm-gift-modal .tm-gift__close {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 36px !important;
	height: 36px !important;
	min-width: 0 !important;
	min-height: 0 !important;
	padding: 0 !important;
	margin: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: #ef4444 !important;
	color: #fff !important;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18) !important;
	cursor: pointer;
}

.tm-gift-modal .tm-gift__close:hover {
	background: #dc2626 !important;
}

.tm-gift-modal .tm-gift__stage {
	max-width: 380px;
	margin: 4px auto 6px;
	padding: 6px 4px 10px;
}

.tm-gift-modal .tm-gift__status {
	margin: 12px 0 0;
	font-size: 13px;
	font-weight: 600;
	color: #dc2626;
}

.tm-gift-modal .tm-gift__actions {
	position: sticky;
	bottom: 0;
	z-index: 3;
	margin: 14px -16px 0;
	padding: 12px 16px 16px;
	background: linear-gradient(to top, #fff 75%, rgba(255, 255, 255, 0));
}

.tm-gift-modal .tm-gift__save {
	appearance: none;
	width: 100%;
	min-height: 48px;
	margin: 0;
	padding: 12px 16px;
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	text-transform: none;
	letter-spacing: normal;
	color: #fff !important;
	background: var(--tm-gift-accent) !important;
	border: 0 !important;
	border-radius: var(--tm-gift-radius) !important;
	box-shadow: none !important;
	cursor: pointer;
}

.tm-gift-modal .tm-gift__save:hover {
	filter: brightness(1.1);
}

/* Phone: bottom sheet */
@media (max-width: 600px) {
	.tm-gift.tm-gift-modal,
	.tm-gift-modal {
		align-items: flex-end;
		padding: 0;
	}

	.tm-gift-modal .tm-gift-modal__panel,
	.tm-gift-modal > .tm-gift__body {
		width: 100%;
		max-height: 90vh;
		border-radius: 18px 18px 0 0;
	}

	.tm-gift-modal .tm-gift__actions {
		padding-bottom: calc(16px + env(safe-area-inset-bottom));
	}

	.tm-gift-modal .tm-gift__stage {
		max-width: 320px;
	}
}

.tm-gift__summary-from[hidden] {
	display: none !important;
}

.tm-gift__arrow {
	display: inline-block;
	margin: 0 4px;
	color: var(--tm-gift-accent);
	font-weight: 700;
}

.tm-gift[dir="ltr"] .tm-gift__arrow {
	transform: scaleX(-1);
}

/* =========================================================
   Popup form layout
   ========================================================= */
.tm-gift-modal .tm-gift__grid {
	grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
	gap: 0 10px;
}

/* Row 1: sender | gift type — Row 2: recipient | phone */
.tm-gift-modal .tm-gift__grid {
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.tm-gift__select {
	position: relative;
	display: block;
}

.tm-gift .tm-gift__select select {
	appearance: none;
	-webkit-appearance: none;
	display: block;
	width: 100% !important;
	min-height: 44px;
	margin: 0;
	padding: 10px 14px;
	font: inherit;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--tm-gift-text);
	background: color-mix(in srgb, var(--tm-gift-accent) 5%, #fff);
	border: 1.5px solid var(--tm-gift-border);
	border-radius: var(--tm-gift-radius);
	box-shadow: none;
	cursor: pointer;
	text-overflow: ellipsis;
}

.tm-gift[dir="rtl"] .tm-gift__select select {
	padding-left: 34px;
}

.tm-gift[dir="ltr"] .tm-gift__select select {
	padding-right: 34px;
}

.tm-gift .tm-gift__select select:focus {
	outline: none;
	border-color: var(--tm-gift-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--tm-gift-accent) 16%, transparent);
}

.tm-gift__select::after {
	content: "";
	position: absolute;
	top: 50%;
	width: 8px;
	height: 8px;
	margin-top: -6px;
	border: solid var(--tm-gift-accent);
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
	pointer-events: none;
}

.tm-gift[dir="rtl"] .tm-gift__select::after {
	left: 14px;
}

.tm-gift[dir="ltr"] .tm-gift__select::after {
	right: 14px;
}

.tm-gift__summary-type {
	display: inline-block;
	margin-inline-start: 6px;
	padding: 1px 8px;
	font-size: 11.5px;
	font-weight: 700;
	color: var(--tm-gift-accent);
	background: #fff;
	border: 1px solid color-mix(in srgb, var(--tm-gift-accent) 25%, transparent);
	border-radius: 999px;
}

.tm-gift__summary-type[hidden] {
	display: none !important;
}

/* Phone with an icon, sized to a phone number */
.tm-gift__tel {
	position: relative;
	display: block;
}

.tm-gift__tel-icon {
	position: absolute;
	top: 50%;
	z-index: 1;
	display: flex;
	color: color-mix(in srgb, var(--tm-gift-text) 45%, transparent);
	transform: translateY(-50%);
	pointer-events: none;
}

.tm-gift[dir="rtl"] .tm-gift__tel-icon {
	right: 12px;
}

.tm-gift[dir="ltr"] .tm-gift__tel-icon {
	left: 12px;
}

.tm-gift[dir="rtl"] .tm-gift__tel .tm-gift__input {
	padding-right: 36px;
	padding-left: 10px;
	text-align: right;
}

.tm-gift[dir="ltr"] .tm-gift__tel .tm-gift__input {
	padding-left: 36px;
	padding-right: 10px;
}

.tm-gift .tm-gift__tel .tm-gift__input {
	letter-spacing: 0.04em;
	font-variant-numeric: tabular-nums;
}

.tm-gift[dir="rtl"] .tm-gift__tel .tm-gift__input::placeholder {
	text-align: right;
}

/* =========================================================
   Color library
   ========================================================= */
.tm-gift__pick:has(.tm-gift__colors) {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	gap: 8px 10px;
}

.tm-gift__pick:has(.tm-gift__colors) .tm-gift__pick-label {
	margin: 0;
}

.tm-gift__color-name {
	--c: var(--tm-gift-accent);
	unicode-bidi: plaintext; /* "#FF8800" keeps its order in Arabic */
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 3px 10px 3px 8px;
	font-size: 12px;
	font-weight: 700;
	color: var(--c);
	background: color-mix(in srgb, var(--c) 10%, #fff);
	border-radius: 999px;
	transition: color 0.3s ease, background-color 0.3s ease;
}

.tm-gift__color-name::before {
	content: "";
	width: 8px;
	height: 8px;
	background: var(--c);
	border-radius: 50%;
}

.tm-gift__colors {
	grid-column: 1 / -1;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
	gap: 8px;
	padding: 10px;
	background: #f7f8fa;
	border: 1px solid var(--tm-gift-border);
	border-radius: var(--tm-gift-radius);
}

.tm-gift .tm-gift__color {
	justify-self: center;
	padding: 2px;
	border-width: 2px;
	transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.18s ease;
}

.tm-gift .tm-gift__color:hover {
	transform: translateY(-2px) scale(1.1);
}

.tm-gift__dot {
	position: relative;
	width: 26px;
	height: 26px;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(16, 24, 40, 0.15);
	transition: box-shadow 0.2s ease;
}

.tm-gift .tm-gift__color.is-selected {
	animation: tmGiftPop 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tm-gift .tm-gift__color.is-selected .tm-gift__dot {
	box-shadow: 0 0 0 2px #fff inset, 0 2px 8px color-mix(in srgb, var(--c) 45%, transparent);
}

.tm-gift .tm-gift__color.is-selected .tm-gift__dot::after {
	margin-top: 5px;
}

/* Custom color: rainbow until picked, then the picked color */
.tm-gift__color--custom .tm-gift__dot {
	display: flex;
	align-items: center;
	justify-content: center;
	background: conic-gradient(from 0deg, #ef4444, #f59e0b, #eab308, #22c55e, #06b6d4, #3b82f6, #8b5cf6, #ec4899, #ef4444);
}

.tm-gift__color--custom.is-picked .tm-gift__dot {
	background: var(--c);
}

.tm-gift__color--custom.is-selected .tm-gift__dot svg {
	display: none;
}

.tm-gift .tm-gift__picker {
	position: absolute;
	inset: 0;
	z-index: 2;
	width: 100% !important;
	height: 100% !important;
	margin: 0;
	padding: 0;
	opacity: 0;
	cursor: pointer;
	border: 0;
}

@keyframes tmGiftPop {
	0% { transform: scale(0.85); }
	100% { transform: scale(1); }
}

/* Design tiles: gentle lift */
.tm-gift .tm-gift__design {
	transition: transform 0.18s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.tm-gift .tm-gift__design:hover {
	transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
	.tm-gift .tm-gift__color,
	.tm-gift .tm-gift__design {
		animation: none !important;
		transition: none !important;
	}
}

/* Summary wraps instead of cutting the gift type */
.tm-gift__summary-text {
	white-space: normal;
	overflow: visible;
	line-height: 1.7;
}

/* Gift type: the visible field shows "name ...... +price", the real <select> sits on top (invisible). */
.tm-gift__select {
	position: relative;
	display: block;
}

.tm-gift__select-view {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	min-height: 44px;
	padding: 9px 14px;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--tm-gift-text);
	background: color-mix(in srgb, var(--tm-gift-accent) 5%, #fff);
	border: 1.5px solid var(--tm-gift-border);
	border-radius: var(--tm-gift-radius);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tm-gift[dir="rtl"] .tm-gift__select-view {
	padding-left: 34px;
}

.tm-gift[dir="ltr"] .tm-gift__select-view {
	padding-right: 34px;
}

.tm-gift__select-name {
	min-width: 0;
	line-height: 1.3;
	white-space: normal; /* long names wrap instead of being cut */
}

.tm-gift__select-price {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	flex: 0 0 auto;
	font-weight: 800;
	color: inherit;
	white-space: nowrap;
}

.tm-gift__select-price .woocommerce-Price-amount,
.tm-gift__select-price bdi {
	color: inherit;
	font-weight: inherit;
}

.tm-gift__select-price svg {
	width: 0.9em;
	height: 0.9em;
	max-width: 0.9em;
	fill: currentColor;
}

.tm-gift__select-price.is-bump {
	animation: tmGiftPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tm-gift .tm-gift__select select {
	position: absolute !important;
	inset: 0;
	z-index: 2;
	width: 100% !important;
	height: 100% !important;
	min-height: 0 !important;
	opacity: 0;
	cursor: pointer;
}

.tm-gift .tm-gift__select:has(select:focus-visible) .tm-gift__select-view {
	border-color: var(--tm-gift-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--tm-gift-accent) 16%, transparent);
}

.tm-gift__select::after {
	z-index: 1;
}

/* Checkout: box sits above "Billing details" */
.tm-gift--checkout {
	margin: 0 0 22px;
}

/* =========================================================
   Thank-you page / My account → order: gift details table + card
   ========================================================= */
.tm-gift-order {
	margin: 24px 0;
}

.tm-gift-order__title {
	display: flex;
	align-items: center;
	gap: 10px;
}

.tm-gift-order__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	color: #fff;
	background: var(--wd-primary-color, #0b1b3f);
	border-radius: 50%;
}

.tm-gift-order__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 20px;
	align-items: start;
}

@media (min-width: 900px) {
	.tm-gift-order__grid {
		grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
	}
}

.tm-gift-table {
	width: 100%;
	margin: 0 !important;
}

.tm-gift-table th {
	width: 38%;
	font-weight: 700;
	white-space: nowrap;
	vertical-align: top;
}

.tm-gift-table td {
	vertical-align: top;
}

.tm-gift-table__row--message .tm-gift-table__text {
	white-space: pre-line;
	line-height: 1.8;
}

.tm-gift-table__swatch {
	display: inline-block;
	width: 14px;
	height: 14px;
	margin-inline-end: 6px;
	vertical-align: -2px;
	border-radius: 50%;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.tm-gift-table td svg,
.tm-gift-table .woocommerce-Price-amount svg {
	width: 0.9em;
	height: 0.9em;
	fill: currentColor;
}

.tm-gift-order__card {
	max-width: 420px;
	width: 100%;
	justify-self: center;
}

/* Cart page: box above the products table */
.tm-gift--cart {
	margin: 0 0 20px;
}


/* ---------- Deliver to the recipient (popup) ---------- */
.tm-gift__delivery {
	display: grid;
	gap: 10px;
	margin: 14px 0 0;
}

.tm-gift__deliver-only {
	display: grid;
	gap: 10px;
}

.tm-gift__deliver-only[hidden],
.tm-gift__summary-deliver[hidden] {
	display: none !important;
}

.tm-gift .tm-gift__check {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0;
	padding: 12px 14px;
	cursor: pointer;
	background: var(--tm-gift-soft);
	border: 1.5px solid var(--tm-gift-border);
	border-radius: var(--tm-gift-radius);
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.tm-gift .tm-gift__check:has(input:checked) {
	border-color: var(--tm-gift-accent);
}

.tm-gift .tm-gift__check input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}

.tm-gift__check-box {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	margin-top: 1px;
	background: #fff;
	border: 1.5px solid var(--tm-gift-border);
	border-radius: 6px;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.tm-gift__check input:checked + .tm-gift__check-box {
	background: var(--tm-gift-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 14px no-repeat;
	border-color: var(--tm-gift-accent);
}

.tm-gift__check input:focus-visible + .tm-gift__check-box {
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--tm-gift-accent) 25%, transparent);
}

.tm-gift__check-text {
	display: grid;
	gap: 2px;
	font-size: 14px;
	line-height: 1.45;
}

.tm-gift__check-text small {
	font-size: 12.5px;
	opacity: 0.7;
}

.tm-gift__note {
	margin: 0 !important;
	padding: 10px 14px;
	font-size: 13.5px;
	background: var(--tm-gift-soft);
	border-radius: var(--tm-gift-radius);
}

.tm-gift .tm-gift__field--buyer {
	margin: 0 !important;
}

.tm-gift__summary-deliver {
	display: inline-block;
	margin-inline-start: 6px;
	padding: 1px 8px;
	font-size: 11.5px;
	font-weight: 700;
	color: #0b6b3a;
	background: #ecfdf3;
	border: 1px solid #b7ebcb;
	border-radius: 999px;
}

.tm-gift__summary-deliver::before {
	content: "🚚 ";
}

/* ---------- Deliver to the recipient (checkout fields) ---------- */
html.tm-gift-delivering .woocommerce-shipping-fields {
	display: none !important;
}

.tm-gift-ship-note {
	margin: 0 0 14px !important;
	padding: 10px 14px;
	font-size: 13.5px;
	line-height: 1.6;
	color: #0b4a8b;
	background: #eef6ff;
	border: 1px solid #b9d6fb;
	border-radius: 10px;
}

.tm-gift-ship-note::before {
	content: "🚚 ";
}

.tm-gift-na-hint {
	display: block;
	margin-top: 6px;
	font-size: 12.5px;
	line-height: 1.55;
	color: #6b7280;
}
