.cardis-cart-protection {
	margin: 32px 0;
	padding: 24px;
	border: 1px solid #d8d8d8;
	border-radius: 12px;
	background: #fff;
}

.cardis-cart-protection__title {
	margin: 0 0 16px;
	font-size: 22px;
	line-height: 1.2;
}

.cardis-cart-protection__plan {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 16px;
	border: 1px solid #d8d8d8;
	border-radius: 12px;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cardis-cart-protection__plan + .cardis-cart-protection__plan {
	margin-top: 12px;
}

.cardis-cart-protection__plan--added {
	border-color: #0b5497;
	box-shadow: 0 0 0 2px rgba(15, 76, 129, 0.12);
}

.cardis-cart-protection__plan-info {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.cardis-cart-protection__plan-product {
	font-size: 13px;
	color: #5f5f5f;
}

.cardis-cart-protection__plan-name {
	font-weight: 600;
}

.cardis-cart-protection__plan-price {
	font-weight: 700;
	color: #1a2b5f;
}

.cardis-cart-protection__btn {
	flex-shrink: 0;
	padding: 10px 20px;
	border-radius: 999px;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: opacity 0.2s ease, background 0.2s ease;
	white-space: nowrap;
}

.cardis-cart-protection__btn:disabled {
	opacity: 0.6;
	pointer-events: none;
}

.cardis-cart-protection__btn--add {
	border: 2px solid #0b5497;
	background: #0b5497;
	color: #fff;
}

.cardis-cart-protection__btn--add:hover {
	background: #0b3a63;
	border-color: #0b3a63;
}

.cardis-cart-protection__btn--added {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	border: 2px solid #0b5497;
	background: #fff;
	color: #0b5497;
}

.cardis-cart-protection__btn--added:hover {
	background: #f0f4f8;
}

.cardis-cart-protection__check {
	display: inline-block;
	vertical-align: middle;
}

@media (max-width: 767px) {
	.cardis-cart-protection {
		padding: 18px;
	}

	.cardis-cart-protection__plan {
		flex-direction: column;
		align-items: stretch;
		text-align: center;
	}

	.cardis-cart-protection__plan-info {
		align-items: center;
	}

	.cardis-cart-protection__btn {
		width: 100%;
	}
}

/* ==========================================================================
   Column alignment with the cart table (desktop)
   ==========================================================================
   The plan rows (protection plans + the mattress removal row, which reuses
   these classes) mimic the cart table's columns: name | price | qty | trash |
   state. Track sizes are tuned so the price sits under the cart's Price
   column, the qty box under Quantity, the trash under the remove column, and
   the Add / Added state hugs the right edge like Subtotal.
   Selectors are parent-scoped (two classes) on purpose: functions.php loads
   style.css a second time at priority 999 ("load_style_last"), so a bare
   .cardis-cart-protection__plan-action rule here loses to style.css by order
   no matter where this file is enqueued.
*/
@media (min-width: 768px) {
	.cardis-cart-protection__plan .cardis-cart-protection__plan-info {
		flex: 1 1 auto;
		display: grid;
		grid-template-columns: 85% 1fr;
		align-items: center;
		gap: 0;
	}

	.cardis-cart-protection__plan .cardis-cart-protection__plan-action {
		display: grid;
		flex: 0 0 37.7%;
		grid-template-columns: 31% max-content 1fr;
		align-items: center;
		gap: 0;
	}

	.cardis-cart-protection__plan .cardis-mattress-removal__qty {
		grid-column: 1;
		justify-self: start;
	}

	.cardis-cart-protection__plan .cardis-cart-protection__btn--added {
		grid-column: 2;
		justify-self: start;
	}

	.cardis-cart-protection__plan .added-text,
	.cardis-cart-protection__plan .cardis-cart-protection__btn--add {
		grid-column: 3;
		justify-self: end;
	}
}

/* Keep the check icon and "Added" on one line. */
.added-text {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	white-space: nowrap;
}
