/* =========================================================
   R316 Palette Switcher — Front-End Bar
   ========================================================= */

#r316-ps-bar {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 0 32px;
	height: 90px;
	background-color: #ffffff;
	box-shadow: 0 -2px 8px rgba(205, 205, 205, 0.2);
	box-sizing: border-box;
}

/* ── Label ─────────────────────────────────────────── */

.r316-ps-label {
	color: var(--global-palette3, #333);
	font-size: 15px;
	font-weight: 500;
	letter-spacing: 0.02em;
	white-space: nowrap;
	margin-right: 4px;
}

/* ── Buttons wrapper ────────────────────────────────── */

.r316-ps-buttons {
	display: flex;
	align-items: center;
	gap: 8px;
}

/* ── Individual palette button ──────────────────────── */

.r316-ps-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 0 16px 0 10px;
	height: 40px;
	border-radius: 100px;
	border: 1px solid var(--global-palette7, #e5e5e5);
	background: #ffffff;
	color: var(--global-palette3, #333);
	font-size: 14px;
	font-weight: 500;
	letter-spacing: 0.02em;
	cursor: pointer;
	transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
	white-space: nowrap;
	font-family: inherit;
	line-height: 1;
}

.r316-ps-btn:hover {
	background: var(--global-palette7, #f5f5f5);
	color: var(--global-palette3, #333);
}

/* Active state — uses palette 7 bg + palette 3 border, no box shadow */
.r316-ps-btn.r316-ps-active {
	background: var(--global-palette7, #f5f5f5);
	border-color: var(--global-palette3, #333);
	color: var(--global-palette3, #333);
}

/* ── 2×2 Color swatch icon ──────────────────────────── */

.r316-ps-swatch {
	display: grid;
	grid-template-columns: 1fr 1fr;
	grid-template-rows: 1fr 1fr;
	width: 18px;
	height: 18px;
	border-radius: 3px;
	overflow: hidden;
	flex-shrink: 0;
	border: 1px solid rgba(0, 0, 0, 0.08);
}

.r316-ps-swatch-cell {
	width: 9px;
	height: 9px;
}

/* ── CTA button group ───────────────────────────────── */

.r316-ps-cta-group {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-left: 4px;
}

/* ── Optional Button 1 — Secondary style ────────────── */
/* Uses Kadence global secondary button CSS vars so it
   automatically updates when the palette is switched.   */

.r316-ps-cta-outline {
	display: inline-flex;
	align-items: center;
	height: 40px;
	padding: 0 20px;
	border-radius: 100px;
	border: 0px none;
	background: var(--global-palette-btn-sec-bg, #f5f5f5);
	color: var(--global-palette-btn-sec, #333);
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease;
	font-family: inherit;
}

.r316-ps-cta-outline:hover {
	background: var(--global-palette-btn-sec-bg-hover, #e5e5e5);
	color: var(--global-palette-btn-sec-hover, #fff);
	text-decoration: none;
}

/* ── Optional Button 2 — Primary style ─────────────── */
/* Uses Kadence global primary button CSS vars so it
   automatically updates when the palette is switched.   */

.r316-ps-cta-solid {
	display: inline-flex;
	align-items: center;
	height: 40px;
	padding: 0 20px;
	border-radius: 100px;
	border: 0px none;
	background: var(--global-palette-btn-bg, #333);
	color: var(--global-palette-btn, #fff);
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease;
	font-family: inherit;
}

.r316-ps-cta-solid:hover {
	background: var(--global-palette-btn-bg-hover, #555);
	color: var(--global-palette-btn-hover, #fff);
	text-decoration: none;
}

/* ── Toast notification ─────────────────────────────── */

.r316-ps-toast {
	position: absolute;
	bottom: 76px;
	left: 50%;
	transform: translateX(-50%);
	background: rgba(0, 0, 0, 0.72);
	color: #fff;
	font-size: 13px;
	padding: 6px 16px;
	border-radius: 20px;
	white-space: nowrap;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.25s ease;
}

.r316-ps-toast.r316-ps-toast--visible {
	opacity: 1;
}

/* ── Add bottom padding to page body so content
      isn't hidden behind the fixed bar ─────────────── */

body.r316-ps-active-bar {
	padding-bottom: 68px !important;
}

/* ── Responsive: collapse label on small screens ───── */

@media ( max-width: 600px ) {
	.r316-ps-label {
		display: none;
	}
	.r316-ps-cta-group {
		display: none;
	}
	#r316-ps-bar {
		justify-content: center;
		padding: 0 16px;
	}
}
