/**
 * Optic Bundle — Optic Cart drawer shim.
 *
 * The drawer gives every row a minus, a plus and a bin. On a line this plugin
 * created, all three fight the server: the next sync restores whatever they changed.
 * They are hidden rather than disabled, because a greyed-out control still invites a
 * click and still has to be explained.
 *
 * Scoped to `.optic-bundle-derived`, a class this plugin's shim adds. Nothing here
 * touches an ordinary cart row.
 */

.optic-cart-item.optic-bundle-derived .optic-cart-item-qty .optic-cart-qty-btn,
.optic-cart-item.optic-bundle-derived .optic-cart-item-remove {
	display: none !important;
}

/* The quantity still shows — a gift of two should say two. It just stops being a
   control, so it is centred where the buttons used to sit rather than left hanging. */
.optic-cart-item.optic-bundle-derived .optic-cart-item-qty {
	gap: 0;
}

.optic-cart-item.optic-bundle-derived .optic-cart-qty-value {
	opacity: 0.75;
}

.optic-cart-item.optic-bundle-derived .optic-cart-qty-value::before {
	content: "×";
	margin-right: 2px;
	opacity: 0.6;
}

/*
 * THE CART PAGE'S OWN ROW, which is different markup and renders on the same URL.
 *
 * /cart/ draws `.optic-item` from `Optic_Cart_Page`, while the drawer sitting on
 * top of it draws `.optic-cart-item`. Styling only the first would leave one copy
 * of the same line controlled and the other not.
 *
 * The REMOVE button is the part that genuinely needs this. No server-side quantity
 * rule can reach it — it is printed on every row unconditionally — and pressing it
 * fires `woocommerce_cart_item_removed`, which is one of the hooks `sync()` listens
 * on, so the gift is added back at the identical key before the page has finished
 * updating. The quantity rules below are belt-and-braces behind the Store API's
 * `editable` flag, which already stops the stepper being rendered at all.
 */
.optic-item.optic-bundle-derived .optic-qty__btn,
.optic-item.optic-bundle-derived .optic-item__remove {
	display: none !important;
}

.optic-item.optic-bundle-derived .optic-qty__input {
	pointer-events: none;
}

/* "FREE each" is not a sentence. The unit suffix goes with the number it qualified. */
.optic-item.optic-bundle-free .optic-item__each {
	display: none;
}

/* FREE, in the same green the cart page uses, so the two pages agree. */
.optic-cart-item .optic-bundle-free-label,
.optic-item .optic-bundle-free-label {
	font-weight: 700;
	color: #157347;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}
