/**
 * Uber Direct — Delivery / Pickup pill toggle.
 * Sits at the top of the WooCommerce review-order table (checkout) and
 * above / inside the cart_totals table (cart page).
 */

/* The toggle replaces the radio CONTROLS, but the selected shipping
   method's label + price must stay visible (e.g. "Delivery Fee  $7.99").
   So we only hide the radio inputs and their clickable labels — NOT the
   whole row. WooCommerce still prints the chosen rate's amount in the
   shipping total row, which we leave alone. */
.woocommerce-checkout #shipping_method,
.woocommerce-cart #shipping_method {
	list-style: none;
	margin: 0;
	padding: 0;
}
.woocommerce-checkout #shipping_method > li input.shipping_method,
.woocommerce-checkout #shipping_method > li label[for^="shipping_method"],
.woocommerce-cart #shipping_method > li input.shipping_method,
.woocommerce-cart #shipping_method > li label[for^="shipping_method"] {
	display: none !important;
}
/* Collapse the now-empty selector list so it doesn't add blank space. */
.woocommerce-checkout #shipping_method > li,
.woocommerce-cart #shipping_method > li {
	margin: 0;
	padding: 0;
	line-height: 0;
}
.woocommerce-checkout #shipping_method > li::after,
.woocommerce-cart #shipping_method > li::after {
	content: "";
	display: block;
	line-height: 0;
}
/* Keep any "no shipping available" plain-text notice visible. */
.woocommerce-checkout #shipping_method > li:only-child:not(:has(input)),
.woocommerce-cart #shipping_method > li:only-child:not(:has(input)) {
	display: list-item !important;
	line-height: normal;
}

/* We render our own clean "Delivery Fee  $7.99" row (.udi-fee-row),
   so hide WooCommerce's default shipping total row to avoid a
   duplicate / empty "Shipment" line. */
.woocommerce-checkout .woocommerce-shipping-totals.shipping,
.woocommerce-checkout tr.woocommerce-shipping-totals.shipping,
.woocommerce-cart .woocommerce-shipping-totals.shipping,
.woocommerce-cart tr.woocommerce-shipping-totals.shipping {
	display: none !important;
}

.udi-toggle-cell {
	padding: 14px 12px !important;
	background: transparent;
	border-bottom: 1px solid #e8e8e8;
}

.udi-dtoggle {
	display: flex;
	gap: 4px;
	width: 100%;
	max-width: 320px;
	margin: 0 auto;
	padding: 5px;
	background: #f0f1f3;
	border-radius: 999px;
	box-sizing: border-box;
}

.udi-dtoggle__btn {
	flex: 1 1 50%;
	appearance: none;
	-webkit-appearance: none;
	border: 0;
	background: transparent;
	color: #4a4a4a;
	font-size: 14px;
	font-weight: 600;
	padding: 10px 14px;
	border-radius: 999px;
	cursor: pointer;
	transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
	line-height: 1.2;
	text-align: center;
}

.udi-dtoggle__btn:hover:not(.is-active):not(:disabled) {
	color: #1f1f1f;
}

.udi-dtoggle__btn.is-active {
	background: #1aa861;
	color: #ffffff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14);
}

.udi-dtoggle__btn:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.udi-dtoggle__btn:focus-visible {
	outline: 2px solid #1aa861;
	outline-offset: 2px;
}

/* While the checkout is refreshing after a toggle, dim slightly. */
.udi-dtoggle.is-busy {
	opacity: 0.6;
	pointer-events: none;
}

/* Clean "Delivery Fee  ........  $7.99" row shown below the toggle. */
.udi-fee-row .udi-fee-label {
	text-align: left;
	font-weight: 600;
	padding: 12px 12px;
	border-bottom: 1px solid #e8e8e8;
}
.udi-fee-row .udi-fee-amount {
	text-align: right;
	font-weight: 600;
	padding: 12px 12px;
	border-bottom: 1px solid #e8e8e8;
	white-space: nowrap;
}
