/*
 * rubinul.ro, pachetul p15: pagina de produs a pandantivelor religioase.
 * Încărcat doar când produsul e în categoria „Bijuterii religioase” (rb_p15_religious_page.xml), cu ?v=.
 * Totul stă sub .rb-prel (clasa de pe #product-product): niciun alt produs nu e atins.
 *
 * Direcția: aceeași pagină Journal, cu opțiunile puse în ordinea în care le gândește clientul
 * (ce pui în compartiment, ce culoare de rășină, ce gravezi). Culorile și fonturile brandului rămân.
 */

.rb-prel {
	--prel-brand: #a12525;
	--prel-brand-deep: #7a1818;
	--prel-brand-tint: rgba(161, 37, 37, 0.08);
	--prel-ink: #222222;
	--prel-ink-soft: #555555;
	--prel-line: #cfcfcf;
	--prel-line-strong: #8f8f8f;
	--prel-radius: 5px;
	--prel-target: 44px;
}

/* ---------- Sub titlu ---------- */
.rb-prel .product-details .rb-prel-subtitle {
	margin: 14px 0 0;
	font-size: 15px;
	line-height: 1.5;
	font-style: italic;
	color: var(--prel-ink-soft);
}

.rb-prel .product-details .rb-prel-lead {
	margin: 12px 0 18px;
	padding: 2px 0 2px 12px;
	border-left: 3px solid var(--prel-brand);
	font-size: 15px;
	line-height: 1.5;
	color: var(--prel-ink);
}

/* ---------- Opțiuni: eticheta pe rândul ei, controalele dedesubt, pe toată lățimea ---------- */
html .rb-prel .product-details .product-options .form-group.rb-opt {
	display: block;
	width: 100%;
	margin: 0 0 22px;
}

html .rb-prel .product-details .product-options .form-group.rb-opt > .control-label {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	max-width: none;
	margin: 0 0 10px;
	padding: 0;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.3;
	color: var(--prel-ink);
	text-align: left;
}

/* iconița de lângă etichetă (Font Awesome 4, deja încărcat de Journal) */
html .rb-prel .product-details .product-options .form-group.rb-opt > .control-label::before {
	display: block;
	flex: 0 0 20px;
	width: 20px;
	font-family: FontAwesome;
	font-size: 17px;
	font-weight: 400;
	line-height: 1;
	text-align: center;
	color: var(--prel-brand);
}

.rb-prel .rb-opt-compartiment > .control-label::before { content: "\f187"; }
.rb-prel .rb-opt-rasina > .control-label::before { content: "\f043"; }
.rb-prel .rb-opt-gravura > .control-label::before { content: "\f040"; }
.rb-prel .rb-opt-font > .control-label::before { content: "\f031"; }

html .rb-prel .product-details .product-options .form-group.rb-opt > div[id^="input-option"] {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	width: 100%;
}

/* ---------- Pastilele (radio) ---------- */
html .rb-prel .product-details .product-options .rb-opt .radio {
	display: block;
	margin: 0;
	width: auto;
}

html .rb-prel .product-details .product-options .rb-opt .radio > label {
	display: block;
	margin: 0;
	padding: 0;
	cursor: pointer;
}

html .rb-prel .product-details .product-options .rb-opt .radio .option-wrapper {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: var(--prel-target);
	min-height: var(--prel-target);
	padding: 0 18px;
	border: 1px solid var(--prel-line-strong);
	border-radius: 999px;
	background: #ffffff;
	color: var(--prel-ink);
	font-size: 15px;
	line-height: 1.2;
	box-shadow: none;
}

html .rb-prel .product-details .product-options .rb-opt .radio .option-value {
	display: block;
	position: static;
	width: auto;
	height: auto;
	min-height: 0;
	clip: auto;
	overflow: visible;
	margin: 0;
	padding: 0;
	font-size: inherit;
	color: inherit;
	white-space: nowrap;
}

html .rb-prel .product-details .product-options .rb-opt .radio:hover .option-wrapper {
	border-color: var(--prel-brand);
}

html .rb-prel .product-details .product-options .rb-opt .radio input:checked + .option-wrapper {
	border-color: var(--prel-brand);
	background: var(--prel-brand-tint);
	color: var(--prel-brand-deep);
	font-weight: 500;
	box-shadow: inset 0 0 0 1px var(--prel-brand);
}

html .rb-prel .product-details .product-options .rb-opt .radio input:focus-visible + .option-wrapper {
	outline: 2px solid var(--prel-ink);
	outline-offset: 3px;
}

/* previzualizarea fontului de gravură (p08 pune .customFontSelect în pastilă) */
.rb-prel .rb-opt-font .customFontSelect {
	font-size: 18px;
	line-height: 1.1;
}

/* ---------- Culoarea rășinii: bulină + nume dedesubt ---------- */
html .rb-prel .product-details .product-options .rb-opt-rasina .radio .option-wrapper {
	flex-direction: column;
	gap: 6px;
	width: 76px;
	min-width: 76px;
	padding: 8px 4px 6px;
	border-color: transparent;
	border-radius: var(--prel-radius);
	background: transparent;
	box-shadow: none;
}

html .rb-prel .product-details .product-options .rb-opt-rasina .radio .option-wrapper img {
	display: block;
	width: 40px;
	height: 40px;
	max-width: none;
	margin: 0;
	border-radius: 50%;
	object-fit: cover;
	box-shadow: 0 0 0 2px #ffffff, 0 0 0 3px var(--prel-line);
}

html .rb-prel .product-details .product-options .rb-opt-rasina .radio .option-value {
	font-size: 13px;
	line-height: 1.25;
	text-align: center;
	white-space: normal;
}

html .rb-prel .product-details .product-options .rb-opt-rasina .radio:hover .option-wrapper {
	border-color: transparent;
}

html .rb-prel .product-details .product-options .rb-opt-rasina .radio:hover .option-wrapper img {
	box-shadow: 0 0 0 2px #ffffff, 0 0 0 3px var(--prel-brand);
}

html .rb-prel .product-details .product-options .rb-opt-rasina .radio input:checked + .option-wrapper {
	border-color: transparent;
	background: transparent;
	box-shadow: none;
}

html .rb-prel .product-details .product-options .rb-opt-rasina .radio input:checked + .option-wrapper img {
	box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--prel-brand);
}

html .rb-prel .product-details .product-options .rb-opt-rasina .radio input:checked + .option-wrapper .option-value {
	color: var(--prel-brand-deep);
	font-weight: 500;
}

/* ---------- Gravura: câmp pe toată lățimea + text ajutător ---------- */
html .rb-prel .product-details .product-options .rb-opt-gravura input[type="text"] {
	display: block;
	width: 100%;
	max-width: none;
	min-height: var(--prel-target);
	padding: 10px 14px;
	border: 1px solid var(--prel-line-strong);
	border-radius: var(--prel-radius);
	font-size: 16px;
	line-height: 1.3;
	color: var(--prel-ink);
	background: #ffffff;
}

html .rb-prel .product-details .product-options .rb-opt-gravura input[type="text"]:focus-visible {
	outline: 2px solid var(--prel-ink);
	outline-offset: 2px;
	border-color: var(--prel-brand);
}

html .rb-prel .product-details .product-options .rb-prel-help {
	margin: 8px 0 0;
	font-size: 13px;
	line-height: 1.45;
	color: var(--prel-ink-soft);
}

/* eroarea de la „Adaugă în coș” (OpenCart pune .text-danger sub câmp) */
html .rb-prel .product-details .product-options .rb-opt .text-danger {
	display: block;
	width: 100%;
	margin: 8px 0 0;
	font-size: 13px;
	line-height: 1.4;
}

html .rb-prel .product-details .product-options .rb-opt.has-error .option-wrapper,
html .rb-prel .product-details .product-options .rb-opt.has-error input[type="text"] {
	border-color: #b3261e;
}

/* ---------- Nota „se execută pe comandă” ---------- */
.rb-prel .rb-prel-note {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 0 0 20px;
	font-size: 14px;
	line-height: 1.45;
	color: var(--prel-ink-soft);
}

.rb-prel .rb-prel-note .fa {
	flex: 0 0 20px;
	width: 20px;
	margin-top: 1px;
	font-size: 16px;
	text-align: center;
	color: var(--prel-brand);
}

/* ---------- Descrierea din tabul „Descriere” ---------- */
.rb-prel .product-extra-description .block-content {
	max-width: 65ch;
	font-size: 16px;
	line-height: 1.6;
	color: var(--prel-ink);
}

.rb-prel .product-extra-description .block-content p {
	margin: 0 0 1em;
	font-size: inherit;
	line-height: inherit;
	color: inherit;
}

.rb-prel .product-extra-description .block-content h2 {
	margin: 1.9em 0 0.5em;
	font-size: 21px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--prel-ink);
}

.rb-prel .product-extra-description .block-content > h2:first-child {
	margin-top: 0;
}

/* Desktop: coloana de 65ch lăsa două treimi din lățime goale. Primul paragraf rămâne introducere pe toată lățimea,
   iar secțiunile (h2 + paragrafe) curg pe coloane. Sub 1100px rămâne o singură coloană, ca mai sus. */
@media (min-width: 1100px) {
	.rb-prel .product-extra-description .block-content {
		max-width: none;
		padding-top: 28px;
		columns: 2;
		column-gap: 56px;
		column-rule: 1px solid #e6e2dc;
	}

	.rb-prel .product-extra-description .block-content > p:first-child {
		column-span: all;
		max-width: 72ch;
		margin-bottom: 32px;
		font-size: 18px;
		line-height: 1.55;
	}

	.rb-prel .product-extra-description .block-content h2 {
		margin-top: 0;
		break-after: avoid;
	}

	.rb-prel .product-extra-description .block-content p,
	.rb-prel .product-extra-description .block-content li {
		break-inside: avoid;
	}

	.rb-prel .product-extra-description .block-content p + h2,
	.rb-prel .product-extra-description .block-content ul + h2 {
		margin-top: 1.6em;
	}

	/* Exact trei secțiuni (structura standard a colecției): câte una pe coloană, cu titlurile pe aceeași linie */
	.rb-prel .product-extra-description .block-content:has(> h2:nth-of-type(3)):not(:has(> h2:nth-of-type(4))) {
		columns: 3;
	}

	.rb-prel .product-extra-description .block-content:has(> h2:nth-of-type(3)):not(:has(> h2:nth-of-type(4))) > h2 {
		margin-top: 0;
		break-before: column;
	}

	.rb-prel .product-extra-description .block-content:has(> h2:nth-of-type(3)):not(:has(> h2:nth-of-type(4))) > h2:first-of-type {
		break-before: auto;
	}
}

/* ---------- Mișcare: doar tranziții scurte (sub 300ms), apăsarea scale(0.97) la 160ms ---------- */
/* Journal scalează .option-wrapper:active cu 50ms; aici apăsarea e fără mișcare și se adaugă mai jos doar când mișcarea e permisă */
html .rb-prel .product-details .product-options .rb-opt .radio .option-wrapper:active {
	transform: none;
	transition: none;
}

@media (prefers-reduced-motion: no-preference) {
	html .rb-prel .product-details .product-options .rb-opt .radio .option-wrapper {
		transition: border-color 160ms ease-out, background-color 160ms ease-out, box-shadow 160ms ease-out, transform 160ms ease-out;
	}

	html .rb-prel .product-details .product-options .rb-opt-rasina .radio .option-wrapper img {
		transition: box-shadow 160ms ease-out;
	}

	html .rb-prel .product-details .product-options .rb-opt .radio .option-wrapper:active {
		transform: scale(0.97);
		transition: transform 160ms ease-out;
	}
}

@media (max-width: 480px) {
	html .rb-prel .product-details .product-options .rb-opt .radio .option-wrapper {
		padding: 0 16px;
	}

	html .rb-prel .product-details .product-options .rb-opt-rasina .radio .option-wrapper {
		width: 72px;
		min-width: 72px;
	}
}
