/* Team Moon Options — shipping methods as cards (same look as customization choices). */

body.tm-ship-style {
	--tm-ship-accent: #807af8;
	--tm-ship-bg: #ffffff;
	--tm-ship-border: #e6e8f0;
	--tm-ship-text: #1e2130;
	--tm-ship-price: #16a34a;
	--tm-ship-radius: 12px;
	--tm-ship-icon: 40px;
}

/* The script makes the shipping cell span the whole table (both columns) and moves the title inside it. */
body.tm-ship-style tr.tm-ship-row > th {
	display: none !important;
}

body.tm-ship-style tr.tm-ship-row > td {
	width: 100% !important;
	max-width: none !important;
	text-align: start !important;
	padding-top: 12px !important;
}

body.tm-ship-style tr.tm-ship-row > td::before {
	display: none !important; /* responsive table title → our own title below */
}

body.tm-ship-style tr.tm-ship-row > td > * {
	width: 100% !important;
	max-width: none !important;
	flex: 1 1 100% !important;
}

body.tm-ship-style .tm-ship__title {
	display: block;
	margin: 0 0 4px;
	font-weight: 700;
	color: var(--wd-title-color, inherit);
	text-align: start;
}

body.tm-ship-style ul#shipping_method {
	display: flex !important;
	flex-direction: column;
	gap: 8px;
	width: 100% !important;
	margin: 0 0 10px !important;
	padding: 8px 8px 0 !important; /* room for the ✓ badge so it is not cut */
	list-style: none !important;
	text-align: start;
}

body.tm-ship-style ul#shipping_method > li {
	position: relative;
	display: block !important;
	width: 100% !important;
	float: none !important;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
	text-indent: 0;
}

body.tm-ship-style ul#shipping_method > li::before {
	display: none !important;
}

/* Native radio hidden (no circle), the whole card is clickable. */
body.tm-ship-style ul#shipping_method input.shipping_method {
	position: absolute !important;
	opacity: 0 !important;
	width: 1px !important;
	height: 1px !important;
	margin: 0 !important;
	pointer-events: none;
}

body.tm-ship-style ul#shipping_method label {
	position: relative;
	display: flex !important;
	align-items: center;
	gap: 10px;
	width: 100% !important;
	max-width: none !important;
	min-height: 54px;
	margin: 0 !important;
	padding: 10px 14px !important;
	font-family: "Tajawal", inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	color: var(--tm-ship-text);
	background: var(--tm-ship-bg);
	border: 1.5px solid var(--tm-ship-border);
	border-radius: var(--tm-ship-radius);
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

body.tm-ship-style ul#shipping_method label:hover {
	border-color: color-mix(in srgb, var(--tm-ship-accent) 55%, var(--tm-ship-border));
}

/* Selected (or the only method) */
body.tm-ship-style ul#shipping_method input.shipping_method:checked + label,
body.tm-ship-style ul#shipping_method input[type="hidden"].shipping_method + label {
	border-color: var(--tm-ship-accent);
	background: color-mix(in srgb, var(--tm-ship-accent) 9%, var(--tm-ship-bg));
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--tm-ship-accent) 14%, transparent);
}

body.tm-ship-style ul#shipping_method input.shipping_method:focus-visible + label {
	outline: 2px solid var(--tm-ship-accent);
	outline-offset: 2px;
}

.tm-ship__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: var(--tm-ship-icon);
	height: var(--tm-ship-icon);
	overflow: hidden;
	background: #fff;
	border: 1px solid var(--tm-ship-border);
	border-radius: 8px;
}

.tm-ship__icon img {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0 !important;
	object-fit: contain;
}

.tm-ship__name {
	flex: 1 1 auto;
	min-width: 0;
}

.tm-ship__price {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	flex: 0 0 auto;
	padding: 2px 10px;
	white-space: nowrap;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.6;
	color: var(--tm-ship-price);
	background: color-mix(in srgb, var(--tm-ship-price) 10%, transparent);
	border-radius: 999px;
}

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

.tm-ship__price svg {
	width: 0.9em;
	height: auto;
	fill: currentColor;
}

/* ✓ badge in the top-right corner of the chosen card */
.tm-ship__check {
	position: absolute;
	top: -8px;
	right: -8px;
	z-index: 2;
	display: none;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	color: #fff;
	background: var(--tm-ship-accent);
	border-radius: 50%;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

body.tm-ship-style ul#shipping_method input.shipping_method:checked + label .tm-ship__check,
body.tm-ship-style ul#shipping_method input[type="hidden"].shipping_method + label .tm-ship__check {
	display: inline-flex;
}

body.tm-ship-style .woocommerce-shipping-destination {
	margin: 0 0 6px;
	font-size: 13px;
}
