/**
 * Frontend styles for Buy More Save More.
 *
 * Styles for 3 clickable option boxes.
 */

.bmsm-discount-wrapper {
	margin: 2em 0;
	border: none;
	border-radius: 0;
	background: transparent;
	clear: both;
	display: block !important; /* Override inline style when shown */
	width: 100%;
}

.bmsm-discount-wrapper[style*="display: none"] {
	display: none !important;
}

/* Hide discount wrapper when subscription option is selected */
.wcsatt-options-prompt-radio:checked ~ .bmsm-discount-wrapper,
.wcsatt-options-prompt-radio:checked + * .bmsm-discount-wrapper,
body:has(.wcsatt-options-prompt-radio:checked) .bmsm-discount-wrapper {
	display: none !important;
}

.bmsm-title {
	margin: 0 0 1.5em 0;
	font-family: 'DM Serif Display', serif;
	font-size: 17px;
	font-weight: 400;
	color: #113D3C;
	text-align: center;
}

.bmsm-options-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1em;
	margin-top: 1em;
}

.bmsm-option-box {
	border: none;
	border-radius: 8px;
	padding: 0;
	text-align: left;
	cursor: pointer;
	transition: all 0.3s ease;
	background: transparent;
	position: relative;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	width: 100%;
}

.bmsm-option-box:hover {
	transform: translateY(-2px);
}

.bmsm-option-box.bmsm-loading {
	cursor: not-allowed;
	opacity: 0.6;
}

.bmsm-option-box.bmsm-selected {
	opacity: 1;
}

.bmsm-option-box.bmsm-selected .bmsm-option-radio {
	background-color: #fff;
	border-color: #FC9E01;
}

/* Top section with orange background */
.bmsm-option-top {
	background: #FC9E01;
	color: #fff;
	border-radius: 8px 8px 0 0;
	padding: 12px 16px;
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 50px;
}

.bmsm-option-radio {
	width: 20px;
	height: 20px;
	margin: 0;
	cursor: pointer;
	flex-shrink: 0;
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	border: 2px solid #FC9E01;
	border-radius: 50%;
	background-color: #fff;
	position: relative;
	display: block;
}

.bmsm-option-radio:checked {
	background-color: #fff;
	border-color: #FC9E01;
}

.bmsm-option-radio:checked::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background-color: #FC9E01;
	display: block;
}

.bmsm-option-label {
	font-family: 'DM Serif Display', serif;
	font-size: 15px;
	font-weight: 400;
	color: #fff;
	flex: 1;
	cursor: pointer;
}

/* Bottom section with white background and border */
.bmsm-option-bottom {
	background: #fff;
	border: 2px solid #FC9E01;
	border-top: none;
	border-radius: 0 0 8px 8px;
	padding: 12px 16px;
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 8px;
	min-height: 60px;
	justify-content: flex-start;
}

.bmsm-option-price-original {
	font-family: 'DM Serif Display', serif;
	font-size: 16px;
	font-weight: 400;
	color: #8C8C8C;
	text-decoration: line-through;
}

.bmsm-option-price {
	font-family: 'DM Serif Display', serif;
	font-size: 16px;
	font-weight: 400;
	color: #025960;
}

.bmsm-option-price .woocommerce-Price-amount {
	font-size: inherit;
	font-weight: inherit;
	color: #025960;
}

.bmsm-option-price .woocommerce-Price-amount .woocommerce-Price-currencySymbol,
.bmsm-option-price .woocommerce-Price-amount bdi {
	color: #025960;
}

.bmsm-option-quantity {
	display: none;
}

.bmsm-option-discount {
	display: none;
}

/* Responsive */
@media (max-width: 768px) {
	.bmsm-options-grid {
		grid-template-columns: repeat(3, 1fr);
		gap: 0.5em;
	}

	.bmsm-option-top {
		padding: 8px 10px;
		min-height: 45px;
		gap: 8px;
	}

	.bmsm-option-bottom {
		padding: 10px 12px;
		min-height: 50px;
	}

	.bmsm-option-radio {
		width: 18px;
		height: 18px;
	}

	.bmsm-option-label {
		font-size: 12px;
		white-space: nowrap;
		text-overflow: ellipsis;
	}

	.bmsm-option-price-original,
	.bmsm-option-price {
		font-size: 14px;
	}
}

@media (min-width: 769px) and (max-width: 1024px) {
	.bmsm-options-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

/* Cart and Checkout Discount Display */
.bmsm-cart-discount {
	color: #025960;
	font-weight: 500;
	font-size: 0.9em;
}

.bmsm-cart-discount-row,
.bmsm-checkout-discount-row {
	background: #f0f7f8;
}

.bmsm-cart-discount-row th,
.bmsm-checkout-discount-row th {
	color: #025960;
	font-weight: 600;
}

.bmsm-cart-discount-row td,
.bmsm-checkout-discount-row td {
	color: #025960;
	font-weight: 600;
}

/* Strikethrough pricing in cart */
.bmsm-cart-discount-row del,
.bmsm-checkout-discount-row del {
	opacity: 0.6;
	margin-right: 0.5em;
}

.bmsm-cart-discount-row ins,
.bmsm-checkout-discount-row ins {
	text-decoration: none;
	color: #025960;
}
