/* ------------------------------------------------
   Matjari Variation Radio Options
   Inline radio buttons with small color dots.
   RTL-compatible via CSS logical properties.
   ------------------------------------------------ */

/* ---- Hide original select ---- */
.mj-variation {
	display: none !important;
}

/* ---- Variation field ---- */
.mj-field-variation label:first-child {
	display: block;
	font-size: 14px;
	font-weight: 700;
	color: var(--mj-text, #1f2937);
	margin-bottom: 8px;
}

/* ---- Radio options container ---- */
.mj-radio-options {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 12px;
}

/* ---- Individual radio option ---- */
.mj-radio-opt {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 14px;
	border: 2px solid var(--mj-border, #e5e7eb);
	border-radius: 10px;
	background: #fff;
	cursor: pointer;
	transition: border-color .2s, box-shadow .2s, background .2s;
	font-size: 14px;
	color: var(--mj-text, #374151);
	user-select: none;
	-webkit-user-select: none;
}

.mj-radio-opt:hover {
	border-color: var(--mj-primary, #c2185b);
	background: #fdf2f8;
}

/* Hide the native radio inside */
.mj-radio-opt input[type="radio"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
	pointer-events: none;
}

/* Active / selected state */
.mj-radio-opt:has(input:checked) {
	border-color: var(--mj-primary, #c2185b);
	background: #fdf2f8;
	box-shadow: 0 0 0 1px var(--mj-primary, #c2185b);
}

.mj-radio-opt:has(input:checked) .mj-radio-label {
	font-weight: 700;
	color: var(--mj-primary, #c2185b);
}

/* ---- Color dot ---- */
.mj-radio-dot {
	display: inline-block;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	border: 2px solid var(--mj-border, #d1d5db);
	box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
	flex-shrink: 0;
	background-size: cover;
	background-position: center;
}

.mj-radio-opt:has(input:checked) .mj-radio-dot {
	border-color: var(--mj-primary, #c2185b);
	box-shadow: 0 0 0 2px rgba(194, 24, 91, .15);
}

/* ---- Label ---- */
.mj-radio-label {
	white-space: nowrap;
	line-height: 1;
}

/* ---- No-color fallback (no hex) ---- */
.mj-radio-dot:not([style]) {
	background-color: #e5e7eb;
}

/* ------------------------------------------------
   Mobile adjustments
   ------------------------------------------------ */
@media (max-width: 480px) {
	.mj-radio-options {
		gap: 6px;
	}

	.mj-radio-opt {
		padding: 6px 10px;
		font-size: 13px;
	}

	.mj-radio-dot {
		width: 18px;
		height: 18px;
	}
}
