/* ===== Numix Product Configurator — Konfigurator produktu (shortcode) ===== */

.trw-configurator {
	display: flex;
	flex-direction: column;
	gap: 20px;
	margin: 0;
	padding: 0;
	width: 100%;
	box-sizing: border-box;
	font-family: 'Inter', sans-serif;
}
.trw-configurator *,
.trw-configurator *::before,
.trw-configurator *::after {
	box-sizing: border-box;
}

.trw-block {
	background: #fff;
	border-radius: 15px;
	box-shadow: 0 4px 25px rgba(0, 0, 0, 0.15);
	padding: 20px;
}

.trw-block--spaced {
	padding-top: 36px;
	padding-bottom: 36px;
}

.trw-block-header {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	margin-bottom: 16px;
}

.trw-block-header-text {
	flex: 1 1 auto;
	min-width: 0;
}

.trw-block-title-row {
	display: flex;
	align-items: center;
	gap: 8px;
}

.trw-step-badge {
	flex: 0 0 auto;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: #000;
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: 'Space Grotesk', sans-serif;
	font-weight: 700;
	font-size: 20px;
	line-height: 1;
}

.trw-block-title {
	margin: 0;
	font-family: 'Space Grotesk', sans-serif;
	font-weight: 700;
	font-size: 18px;
	color: #373737;
}

.trw-block-subtitle {
	margin: 2px 0 0;
	font-family: 'Inter', sans-serif;
	font-weight: 300;
	font-size: 14px;
	color: #535353;
}

/* Przycisk "i" otwierający legendę wykończeń */
.trw-info-trigger {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	border: 1.5px solid #84524A;
	background: #fff;
	color: #84524A;
	font-family: 'Space Grotesk', sans-serif;
	font-weight: 700;
	font-style: italic;
	font-size: 12px;
	line-height: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
	appearance: none;
	-webkit-appearance: none;
}
.trw-info-trigger:hover,
.trw-info-trigger:focus-visible {
	background: #84524A;
	color: #fff;
	outline: none;
}

/* ---- Modal "Legenda wykończeń" ---- */

.trw-modal-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	z-index: 100000;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
.trw-modal-overlay.is-open {
	display: flex;
}

.trw-modal {
	position: relative;
	background: #fff;
	border-radius: 15px;
	padding: 28px 24px 24px;
	max-width: 460px;
	width: 100%;
	max-height: 85vh;
	overflow-y: auto;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
	font-family: 'Inter', sans-serif;
}

.trw-modal h3 {
	margin: 0 0 16px;
	font-family: 'Space Grotesk', sans-serif;
	font-weight: 700;
	font-size: 18px;
	color: #373737;
	padding-right: 24px;
}

.trw-modal-close {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 28px;
	height: 28px;
	border: none;
	background: transparent;
	font-size: 22px;
	line-height: 1;
	color: #8a8d93;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
}
.trw-modal-close:hover {
	color: #373737;
}

.trw-legend-list {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.trw-legend-list li {
	font-weight: 300;
	font-size: 14px;
	color: #535353;
	line-height: 1.5;
}
.trw-legend-list strong {
	font-weight: 600;
	color: #373737;
}
.trw-legend-note {
	color: #84524A;
	font-weight: 500;
}

/* ---- Krok 1: karty typu tablicy (klikalne) ---- */

.trw-plate-cards {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 12px;
}

.trw-plate-card {
	border: 2px solid #F9F9F9;
	background: #F9F9F9;
	border-radius: 12px;
	padding: 12px;
	cursor: pointer;
	user-select: none;
	transition: border-color .12s ease;
}

.trw-plate-card:hover {
	border-color: #e2cdc9;
}

.trw-plate-card:focus-visible {
	outline: 2px solid #84524A;
	outline-offset: 2px;
}

.trw-plate-card.is-selected {
	border-color: #84524A;
}

.trw-plate-card.is-selected .trw-plate-name {
	color: #84524A;
}

.trw-plate-preview {
	height: 64px;
	margin-bottom: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	border-radius: 6px;
	background: #fff;
}

.trw-plate-preview img {
	height: 100% !important;
	width: auto !important;
	max-width: 100% !important;
	max-height: 100% !important;
	object-fit: contain !important;
	display: block;
}

.trw-plate-name {
	display: block;
	font-family: 'Inter', sans-serif;
	font-weight: 500;
	font-size: 13px;
	color: #373737;
	line-height: 1.3;
	margin-bottom: 4px;
	transition: color .12s ease;
}

.trw-plate-dim {
	display: block;
	font-family: 'Inter', sans-serif;
	font-weight: 300;
	font-size: 12px;
	color: #8a8d93;
}

.trw-dimensions-field {
	margin-top: 14px;
}

.trw-dimensions-field label {
	display: block;
	font-family: 'Inter', sans-serif;
	font-size: 13px;
	font-weight: 500;
	color: #373737;
	margin-bottom: 6px;
}

.trw-dimensions-field input[type="text"] {
	width: 100%;
	max-width: 320px;
	padding: 10px 12px;
	border: 1px solid #d7d7d9;
	border-radius: 8px;
	font-family: 'Inter', sans-serif;
	font-size: 14px;
}

.trw-dimensions-field input.trw-invalid {
	border-color: #c0392b;
}

.trw-required {
	color: #c0392b;
}

.trw-field-error {
	display: block;
	color: #c0392b;
	font-size: 12px;
	margin-top: 4px;
	font-family: 'Inter', sans-serif;
}

/* ---- Kroki 2–4: swatche kolorów / wykończeń ---- */

.trw-swatches {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
	gap: 10px;
}

.trw-swatch {
	position: relative;
	aspect-ratio: 1 / 1;
	border-radius: 10px;
	border: 1px solid transparent;
	padding: 1px;
	background: #fff;
	cursor: pointer;
	transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease;
}

.trw-swatch:hover {
	transform: translateY(-2px);
}

.trw-swatch:focus-visible {
	outline: 2px solid #84524A;
	outline-offset: 2px;
}

.trw-swatch.is-selected {
	border-color: #84524A;
	box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
}

.trw-swatch-fill {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 8px;
}

.trw-swatch::after {
	content: attr(data-label);
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%) translateY(4px);
	white-space: nowrap;
	background: #fff;
	border: 1px solid #ececec;
	border-radius: 6px;
	box-shadow: 0 4px 12px rgba(0,0,0,0.12);
	padding: 5px 10px;
	font-family: 'Inter', sans-serif;
	font-weight: 300;
	font-size: 12px;
	color: #535353;
	opacity: 0;
	pointer-events: none;
	z-index: 5;
	transition: opacity .12s ease, transform .12s ease;
}

.trw-swatch:hover::after,
.trw-swatch:focus-visible::after {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

.trw-selected-label {
	margin: 14px 0 0;
	font-family: 'Inter', sans-serif;
	font-size: 13px;
	color: #373737;
}

.trw-selected-label-text {
	font-weight: 300;
	color: #535353;
}

/* ---- Krok 5: uwagi ---- */

.trw-notes {
	width: 100%;
	border: 1px solid #d7d7d9;
	border-radius: 10px;
	padding: 12px;
	font-family: 'Inter', sans-serif;
	font-weight: 300;
	font-size: 14px;
	color: #373737;
	resize: vertical;
}

/* ---- Info box (zamówienie indywidualne) ---- */

.trw-infobox {
	display: flex;
	align-items: flex-start;
	gap: 8px;
}

.trw-infobox-icon {
	flex: 0 0 auto;
	width: 14px;
	height: 14px;
	margin-top: 2px;
	opacity: 0.3;
}

.trw-infobox span {
	font-family: 'Inter', sans-serif;
	font-weight: 300;
	font-size: 12px;
	color: #535353;
	line-height: 1.5;
}

/* ---- Cena ---- */

.trw-price-wrap {
	padding: 16px 0;
}

.trw-price {
	font-family: 'Space Grotesk', sans-serif;
	font-weight: 700;
	font-size: 30px;
	color: #373737;
}
.trw-price .woocommerce-Price-amount {
	font-family: inherit;
	font-weight: inherit;
	font-size: inherit;
	color: inherit;
}
.trw-price del {
	opacity: .5;
	font-size: 0.6em;
	margin-right: 8px;
}

.trw-price-note {
	margin-top: 6px;
	font-family: 'Inter', sans-serif;
	font-weight: 300;
	font-size: 12px;
	color: #8a8d93;
	min-height: 1em;
}

/* ---- Ilość + Dodaj do koszyka ---- */

.trw-purchase-row {
	display: flex;
	align-items: stretch;
	gap: 12px;
	flex-wrap: wrap;
}

.trw-qty-select-wrap {
	position: relative;
	flex: 0 0 auto;
}

.trw-qty-select {
	appearance: none !important;
	-webkit-appearance: none !important;
	-moz-appearance: none !important;
	width: 90px;
	height: 100%;
	min-height: 52px;
	padding: 10px 30px 10px 16px;
	border: 1px solid #D0D0D0 !important;
	border-radius: 10px !important;
	background: #fff;
	font-family: 'Inter', sans-serif;
	font-weight: 300;
	font-size: 14px;
	color: #373737;
	cursor: pointer;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M1 3L5 7L9 3' stroke='%23000000' stroke-width='1.4' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
}

.trw-qty-select:focus {
	outline: none;
	border-color: #84524A !important;
}

/*
 * Reset "na twardo" — motyw/Elementor narzuca globalne style dla <button>
 * (widoczne np. jako różowe obramowanie z globalnej palety kolorów
 * akcentu Elementora). !important jest tu celowe i konieczne, żeby
 * wygrać z tą kaskadą niezależnie od kolejności ładowania arkuszy CSS.
 */
button.trw-add-to-cart-btn {
	all: unset;
	box-sizing: border-box !important;
	display: flex !important;
	flex: 1 1 auto !important;
	min-height: 52px !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 10px !important;
	padding: 0 24px !important;
	border: none !important;
	border-radius: 15px !important;
	cursor: pointer !important;
	background: linear-gradient(90deg, #7D4840 0%, #B4918C 100%) !important;
	outline: none !important;
	box-shadow: none !important;
}

.trw-add-to-cart-btn span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-family: 'Space Grotesk', sans-serif !important;
	font-weight: 700 !important;
	font-size: 16px !important;
	line-height: 1;
	color: #fff !important;
}

.trw-add-to-cart-btn img {
	display: block;
	width: 24px;
	height: 24px;
	flex: 0 0 auto;
	filter: brightness(0) invert(1);
}

.trw-add-to-cart-btn:hover,
.trw-add-to-cart-btn:active {
	filter: brightness(0.9);
}

.trw-add-to-cart-btn:focus-visible {
	outline: 2px solid #7D4840 !important;
	outline-offset: 2px;
}

@media (max-width: 480px) {
	.trw-plate-cards {
		grid-template-columns: 1fr;
	}
	.trw-add-to-cart-btn {
		width: 100%;
	}
}
