/**
 * B&M Meal Prep Add-Ons — Product page customization UI
 *
 * Matches the existing ordering flow style (radio groups, checkboxes,
 * special instructions) while using the B&M design system tokens.
 *
 * @package BM_Child
 * @since   1.3.0
 */

/* ==========================================================================
   Add-On Container
   ========================================================================== */

.bm-addons {
	margin: var(--bm-space-xl) 0;
	border-top: 1px solid var(--bm-border-light);
}

/* ==========================================================================
   Group — each add-on section (Side, Veggies, Personalize, etc.)
   ========================================================================== */

.bm-addons__group {
	padding: var(--bm-space-lg) 0;
	border-bottom: 1px solid var(--bm-border-light);
}

.bm-addons__group:last-child {
	border-bottom: none;
}

.bm-addons__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	margin-bottom: var(--bm-space-md);
	gap: var(--bm-space-sm);
}

.bm-addons__label-wrap {
	flex: 1;
}

.bm-addons__label {
	font-family: var(--bm-font-accent);
	font-size: var(--bm-text-lg);
	font-weight: 700;
	color: var(--bm-black);
	margin: 0;
	line-height: 1.3;
}

.bm-addons__hint {
	display: block;
	font-size: var(--bm-text-sm);
	color: var(--bm-grey);
	margin-top: 2px;
}

.bm-addons__required {
	display: inline-block;
	font-family: var(--bm-font-accent);
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--bm-grey);
	background: var(--bm-light);
	padding: 4px 10px;
	border-radius: var(--bm-radius-full);
	white-space: nowrap;
	flex-shrink: 0;
}

/* ==========================================================================
   Options list (radios and checkboxes)
   ========================================================================== */

.bm-addons__options {
	display: flex;
	flex-direction: column;
}

.bm-addons__option {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: var(--bm-space-md) 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.05);
	cursor: pointer;
	transition: background var(--bm-transition);
	margin: 0;
	gap: var(--bm-space-md);
}

.bm-addons__option:last-child {
	border-bottom: none;
}

.bm-addons__option:hover {
	background: rgba(0, 0, 0, 0.015);
}

/* Hide native inputs */
.bm-addons__option input[type="radio"],
.bm-addons__option input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
	pointer-events: none;
}

/* ==========================================================================
   Custom Radio Mark
   ========================================================================== */

.bm-addons__radio-mark {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	min-width: 22px;
	border: 2px solid var(--bm-silver);
	border-radius: 50%;
	transition: border-color var(--bm-transition);
	flex-shrink: 0;
}

.bm-addons__radio-mark::after {
	content: '';
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--bm-primary);
	transform: scale(0);
	transition: transform var(--bm-transition);
}

.bm-addons__option input[type="radio"]:checked ~ .bm-addons__radio-mark {
	border-color: var(--bm-primary);
}

.bm-addons__option input[type="radio"]:checked ~ .bm-addons__radio-mark::after {
	transform: scale(1);
}

/* ==========================================================================
   Custom Checkbox Mark
   ========================================================================== */

.bm-addons__check-mark {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	min-width: 22px;
	border: 2px solid var(--bm-silver);
	border-radius: var(--bm-radius-sm);
	transition: border-color var(--bm-transition), background var(--bm-transition);
	flex-shrink: 0;
}

.bm-addons__check-mark::after {
	content: '';
	width: 6px;
	height: 11px;
	border: solid var(--bm-white);
	border-width: 0 2.5px 2.5px 0;
	transform: rotate(45deg) scale(0);
	transition: transform var(--bm-transition);
	margin-top: -2px;
}

.bm-addons__option input[type="checkbox"]:checked ~ .bm-addons__check-mark {
	background: var(--bm-primary);
	border-color: var(--bm-primary);
}

.bm-addons__option input[type="checkbox"]:checked ~ .bm-addons__check-mark::after {
	transform: rotate(45deg) scale(1);
}

/* ==========================================================================
   Option Labels & Pricing
   ========================================================================== */

.bm-addons__option-label {
	font-family: var(--bm-font-body);
	font-size: var(--bm-text-base);
	color: var(--bm-black);
	flex: 1;
}

.bm-addons__option-info {
	display: flex;
	flex-direction: column;
	flex: 1;
}

.bm-addons__option-desc {
	font-size: var(--bm-text-sm);
	color: var(--bm-grey);
	line-height: 1.4;
	margin-top: 2px;
}

.bm-addons__price {
	font-size: var(--bm-text-sm);
	color: var(--bm-grey);
	white-space: nowrap;
}

/* ==========================================================================
   Textarea (Special Instructions)
   ========================================================================== */

.bm-addons__textarea-wrap textarea {
	width: 100%;
	padding: var(--bm-space-md);
	border: 1px solid var(--bm-toasted-tan);
	border-radius: var(--bm-radius-md);
	font-family: var(--bm-font-body);
	font-size: var(--bm-text-base);
	color: var(--bm-black);
	background: var(--bm-white);
	resize: vertical;
	transition: border-color var(--bm-transition), box-shadow var(--bm-transition);
	line-height: 1.5;
}

.bm-addons__textarea-wrap textarea::placeholder {
	color: var(--bm-silver);
}

.bm-addons__textarea-wrap textarea:focus {
	outline: none;
	border-color: var(--bm-primary);
	box-shadow: 0 0 0 3px rgba(216, 106, 61, 0.12);
}

/* Advisory note */
.bm-addons__advisory {
	display: flex;
	align-items: flex-start;
	gap: var(--bm-space-xs);
	margin-top: var(--bm-space-sm);
	font-size: var(--bm-text-sm);
	color: var(--bm-grey);
	line-height: 1.45;
}

.bm-addons__advisory-icon {
	font-size: 1rem;
	line-height: 1;
	flex-shrink: 0;
	margin-top: 1px;
}

/* ==========================================================================
   Selected state highlight (entire row)
   ========================================================================== */

.bm-addons__option.is-selected {
	background: rgba(216, 106, 61, 0.04);
	margin: 0 calc(-1 * var(--bm-space-md));
	padding-left: var(--bm-space-md);
	padding-right: var(--bm-space-md);
	border-radius: var(--bm-radius-sm);
}

/* ==========================================================================
   Validation error state
   ========================================================================== */

.bm-addons__group.has-error .bm-addons__label {
	color: var(--bm-error);
}

.bm-addons__group.has-error .bm-addons__required {
	color: var(--bm-white);
	background: var(--bm-error);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 480px) {
	.bm-addons__option {
		padding: var(--bm-space-sm) 0;
	}

	.bm-addons__option-desc {
		font-size: 0.8rem;
	}
}
