/**
 * Free swatches popup — Chesterfield only.
 */

.rs-cfb-swatches {
	--rs-swatch-ink: #1a1512;
	--rs-swatch-muted: #5f564e;
	--rs-swatch-line: rgba(26, 21, 18, 0.12);
	--rs-swatch-cream: #ffffff;
	--rs-swatch-accent: #6e4a2f;
	--rs-swatch-accent-deep: #4a3120;
	position: fixed;
	inset: 0;
	z-index: 100050;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
}

.rs-cfb-swatches[hidden] {
	display: none !important;
}

.rs-cfb-swatches__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0);
	transition: background 320ms ease;
}

.rs-cfb-swatches.is-open .rs-cfb-swatches__overlay {
	background: rgba(0, 0, 0, 0.9);
}

html.rs-cfb-swatches-open,
html.rs-cfb-swatches-open body {
	overflow: hidden;
}

.rs-cfb-swatches__dialog {
	position: relative;
	z-index: 1;
	width: min(480px, 100%);
	max-height: min(92vh, 720px);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	background: var(--rs-swatch-cream);
	border-radius: 18px;
	box-shadow:
		0 28px 80px rgba(0, 0, 0, 0.55),
		0 0 0 1px rgba(255, 255, 255, 0.08);
	box-sizing: border-box;
	opacity: 0;
	transform: translateY(18px) scale(0.96);
	transition: opacity 280ms ease, transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.rs-cfb-swatches.is-open .rs-cfb-swatches__dialog {
	opacity: 1;
	transform: translateY(0) scale(1);
}

.rs-cfb-swatches__close {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 3;
	margin: 0;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: rgba(20, 14, 10, 0.45);
	color: #fff;
	font-size: 1.45rem;
	line-height: 1;
	cursor: pointer;
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	transition: background 0.15s ease, transform 0.15s ease;
}

.rs-cfb-swatches__close:hover,
.rs-cfb-swatches__close:focus-visible {
	background: rgba(20, 14, 10, 0.7);
	transform: scale(1.05);
	outline: none;
}

.rs-cfb-swatches__media {
	position: relative;
	flex: 0 0 auto;
	height: 190px;
	overflow: hidden;
	background: #2a1f18;
}

.rs-cfb-swatches__photo {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center 40%;
	transform: scale(1.06);
	transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.rs-cfb-swatches.is-open .rs-cfb-swatches__photo {
	transform: scale(1);
}

.rs-cfb-swatches__media-shade {
	position: absolute;
	inset: 0;
	background:
		linear-gradient(180deg, rgba(12, 8, 5, 0.05) 0%, rgba(12, 8, 5, 0.15) 45%, rgba(12, 8, 5, 0.55) 100%),
		radial-gradient(120% 80% at 50% 0%, transparent 40%, rgba(12, 8, 5, 0.35) 100%);
	pointer-events: none;
}

.rs-cfb-swatches__body {
	padding: 1.2rem 1.5rem 1.3rem;
	text-align: center;
	overflow: auto;
	-webkit-overflow-scrolling: touch;
}

.rs-cfb-swatches__title {
	margin: 0 0 0.35rem;
	font-size: 1.55rem;
	font-weight: 800;
	line-height: 1.15;
	letter-spacing: -0.03em;
	color: var(--rs-swatch-ink);
}

.rs-cfb-swatches__sub {
	margin: 0 0 1rem;
	font-size: 0.95rem;
	line-height: 1.45;
	color: var(--rs-swatch-muted);
}

.rs-cfb-swatches__form {
	margin: 0;
	text-align: left;
}

.rs-cfb-swatches__label {
	display: block;
	margin: 0 0 0.28rem;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #8a7568;
}

.rs-cfb-swatches__phone-row {
	display: grid !important;
	grid-template-columns: auto minmax(0, 1fr) !important;
	align-items: stretch;
	margin: 0 0 0.85rem;
	border: 1px solid var(--rs-swatch-line);
	border-radius: 12px;
	overflow: hidden;
	background: #fff;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.rs-cfb-swatches__phone-row:focus-within {
	border-color: rgba(110, 74, 47, 0.55);
	box-shadow: 0 0 0 3px rgba(110, 74, 47, 0.16);
}

.rs-cfb-swatches__phone-row.is-invalid {
	border-color: #c00;
	box-shadow: 0 0 0 3px rgba(204, 0, 0, 0.12);
}

.rs-cfb-swatches__prefix {
	display: flex !important;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0 0.85rem 0 1rem;
	background: #f3f1ee;
	border-right: 1px solid var(--rs-swatch-line);
	font-size: 1.35rem;
	font-weight: 800;
	letter-spacing: 0.02em;
	line-height: 1;
	color: var(--rs-swatch-ink);
	user-select: none;
	white-space: nowrap;
}

html body .rs-cfb-swatches input.rs-cfb-swatches__phone {
	grid-column: 2;
	position: relative;
	z-index: 1;
	width: 100% !important;
	max-width: none !important;
	min-width: 0 !important;
	margin: 0 !important;
	padding: 0.85rem 1rem 0.85rem 0.9rem !important;
	border: 0 !important;
	background: #fff !important;
	font-size: 1.62rem !important;
	font-weight: 500 !important;
	letter-spacing: 0.01em;
	line-height: 1.2 !important;
	height: auto !important;
	min-height: 3.25rem !important;
	color: #111 !important;
	caret-color: #6e4a2f;
	-webkit-text-fill-color: #111 !important;
	box-sizing: border-box !important;
	box-shadow: none !important;
	transition: font-weight 120ms ease, letter-spacing 160ms ease, color 120ms ease;
}

html body .rs-cfb-swatches input.rs-cfb-swatches__phone::placeholder {
	font-weight: 400 !important;
	letter-spacing: 0;
	color: #9a9a9a !important;
	-webkit-text-fill-color: #9a9a9a !important;
	opacity: 1;
}

html body .rs-cfb-swatches input.rs-cfb-swatches__phone:not(:placeholder-shown),
html body .rs-cfb-swatches input.rs-cfb-swatches__phone.is-typing {
	font-weight: 800 !important;
	letter-spacing: 0.045em;
	color: #1a1512 !important;
	-webkit-text-fill-color: #1a1512 !important;
}

.rs-cfb-swatches__phone:focus {
	outline: none;
}

.rs-cfb-swatches__error {
	margin: 0 0 0.65rem;
	font-size: 0.82rem;
	line-height: 1.35;
	color: #b00000;
}

.rs-cfb-swatches__submit {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0.95rem 1rem;
	border: 0;
	border-radius: 12px;
	background: linear-gradient(180deg, #7d5638 0%, var(--rs-swatch-accent) 52%, var(--rs-swatch-accent-deep) 100%);
	color: #fff;
	font-size: 1.02rem;
	font-weight: 800;
	letter-spacing: -0.01em;
	cursor: pointer;
	box-shadow:
		0 10px 24px rgba(74, 49, 32, 0.32),
		inset 0 1px 0 rgba(255, 255, 255, 0.18);
	transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.rs-cfb-swatches__submit:hover,
.rs-cfb-swatches__submit:focus-visible {
	transform: translateY(-1px);
	filter: brightness(1.03);
	outline: none;
}

.rs-cfb-swatches__submit:active {
	transform: translateY(0);
}

.rs-cfb-swatches__submit:disabled {
	opacity: 0.6;
	cursor: wait;
	transform: none;
	filter: none;
}

.rs-cfb-swatches__note {
	margin: 0.7rem 0 0;
	font-size: 0.72rem;
	line-height: 1.4;
	text-align: center;
	color: #9a877a;
}

.rs-cfb-swatches__success {
	margin: 0.35rem 0 0;
	padding: 0.85rem 0.5rem;
	font-size: 1.02rem;
	line-height: 1.4;
	color: var(--rs-swatch-ink);
	font-weight: 700;
}

.rs-cfb-swatches.is-success .rs-cfb-swatches__form {
	display: none;
}

/* Fallback if theme screen-reader-text is unavailable */
.rs-cfb-swatches .screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

@media (min-width: 420px) {
	.rs-cfb-swatches__media {
		height: 220px;
	}
}

@media (max-width: 380px) {
	.rs-cfb-swatches__media {
		height: 160px;
	}

	.rs-cfb-swatches__title {
		font-size: 1.35rem;
	}

	.rs-cfb-swatches__body {
		padding: 1rem 1rem 1.05rem;
	}

	.rs-cfb-swatches__submit {
		font-size: 0.95rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.rs-cfb-swatches__overlay,
	.rs-cfb-swatches__dialog,
	.rs-cfb-swatches__photo,
	.rs-cfb-swatches__submit {
		transition: none;
	}

	.rs-cfb-swatches.is-open .rs-cfb-swatches__photo {
		transform: none;
	}
}
