/*
 * Returns & Complaints for WooCommerce - style formularza.
 *
 * Zasada: wtyczka odpowiada za układ, a wygląd dziedziczy z motywu.
 * - Krój, rozmiar i kolor tekstu, wygląd przycisków i pól pochodzą z motywu.
 *   Przyciski mają klasy "button" / "button alt" (do zmiany filtrem
 *   sascom_rc_form_classes), pola używają font: inherit.
 * - Wszystkie reguły wyglądu są zapisane w :where(), czyli mają zerową
 *   specyficzność: dowolna reguła motywu je nadpisuje, bez !important
 *   i bez zależności od kolejności ładowania arkuszy.
 * - Pełną specyficzność mają tylko reguły, bez których formularz nie działa
 *   (ukrywanie kroków, pułapka antyspamowa).
 */

/* ---------- Działanie formularza (nie do nadpisywania) ---------- */

/* Kroki, komunikaty i pola pokazuje i ukrywa skrypt atrybutem hidden. */
.sascom-rc [hidden] {
	display: none !important;
}

/* Pułapka antyspamowa: poza ekranem (celowo nie display:none). */
.sascom-rc-hp {
	position: absolute;
	left: -9999px;
	top: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ---------- Układ (zerowa specyficzność) ---------- */

:where(.sascom-rc) {
	max-width: 40em;
}

:where(.sascom-rc-form h3) {
	margin: 0 0 1em;
}

:where(.sascom-rc-field) {
	margin: 0 0 1.2em;
}

:where(.sascom-rc-field label, .sascom-rc-label) {
	display: block;
	margin-bottom: .35em;
}

:where(.sascom-rc-field) :where(input[type="text"], input[type="email"], select, textarea) {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	font: inherit;
	color: inherit;
}

:where(.sascom-rc-radio) {
	display: block;
	margin: .25em 0;
}

:where(.sascom-rc-order-summary) {
	margin-bottom: 1.2em;
}

:where(.sascom-rc-order-summary p) {
	margin: .2em 0;
}

:where(.sascom-rc-product) {
	display: flex;
	align-items: center;
	gap: .5em;
	padding: .35em 0;
}

:where(.sascom-rc-product-label) {
	flex: 1;
	margin: 0;
}

:where(.sascom-rc-product-qty) {
	width: 4.5em;
	font: inherit;
	color: inherit;
}

:where(.sascom-rc-actions) {
	display: flex;
	flex-wrap: wrap;
	gap: .6em;
	margin: 1.4em 0 0;
}

:where(.sascom-rc-message) {
	margin: 1em 0;
}

:where(.sascom-rc-bank-note) {
	margin: 0 0 .5em;
}

/* ---------- Stany (zerowa specyficzność) ---------- */

/* Tekst pomocniczy: ten sam kolor co treść, tylko lżejszy. */
:where(.sascom-rc-order-meta, .sascom-rc-product-hint, .sascom-rc-product-reason, .sascom-rc-bank-note) {
	font-size: .9em;
	opacity: .75;
}

:where(.sascom-rc-product-unavailable .sascom-rc-product-label) {
	text-decoration: line-through;
	opacity: .6;
}

:where(.sascom-rc-button:disabled) {
	opacity: .5;
	cursor: not-allowed;
}

:where(.sascom-rc-radio input:disabled, .sascom-rc-radio input:disabled + *) {
	cursor: not-allowed;
}

:where(.sascom-rc-radio:has( input:disabled )) {
	opacity: .55;
}

/* Komunikaty: bez własnych teł i ramek. Wyróżnienie to pasek w kolorze tekstu,
   a błąd i ostrzeżenie mają kolor ostrzegawczy - motyw może podać własny. */
:where(.sascom-rc-message) {
	padding-left: .8em;
	border-left: 3px solid currentColor;
}

:where(.sascom-rc-message-error, .sascom-rc-message-warning, .sascom-rc-required) {
	color: #b32d2e;
}
