/*
 * Celasta — Privacy & Cookie Consent styles (Phase 7)
 * ------------------------------------------------------------------
 * Uses the theme's design tokens (--c-gold, --c-charcoal, --c-surface,
 * --c-border, --c-text, --c-muted) so it inherits the active Design
 * Module preset. Written with logical properties (inline-start/end)
 * where it matters so it flips cleanly under RTL (see rtl.css).
 */

/* ── Cookie consent banner ─────────────────────────────────────── */
.celasta-cc {
	position: fixed;
	inset-inline: 0;
	inset-block-end: 0;
	z-index: 99990;
	background: var(--c-white, #fff);
	border-block-start: 1px solid var(--c-border, #e7e1d6);
	box-shadow: 0 -8px 30px rgba(20, 18, 14, 0.12);
	transform: translateY(110%);
	transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
	max-height: 90vh;
	overflow-y: auto;
}
.celasta-cc.is-visible { transform: translateY(0); }

.celasta-cc-inner {
	max-width: 1180px;
	margin: 0 auto;
	padding: 18px 22px;
	display: flex;
	gap: 20px;
	align-items: center;
	flex-wrap: wrap;
}
.celasta-cc-main { flex: 1 1 460px; min-width: 0; }
.celasta-cc-title {
	font-size: 1.05rem;
	margin: 0 0 6px;
	color: var(--c-charcoal, #1c1a17);
	letter-spacing: 0.2px;
}
.celasta-cc-text {
	margin: 0;
	font-size: 0.9rem;
	line-height: 1.6;
	color: var(--c-muted, #6b655c);
}
.celasta-cc-link { color: var(--c-gold-text, #8a6d1f); text-decoration: underline; }

.celasta-cc-actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	align-items: center;
}
.celasta-cc-btn {
	font: inherit;
	font-size: 0.85rem;
	padding: 11px 18px;
	border-radius: 8px;
	cursor: pointer;
	border: 1px solid var(--c-border, #e7e1d6);
	background: transparent;
	color: var(--c-charcoal, #1c1a17);
	min-height: 44px;
	transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.celasta-cc-ghost:hover { border-color: var(--c-gold, #c8a94e); color: var(--c-gold-text, #8a6d1f); }
.celasta-cc-solid {
	background: var(--c-charcoal, #1c1a17);
	color: #fff;
	border-color: var(--c-charcoal, #1c1a17);
}
.celasta-cc-solid:hover { background: var(--c-gold, #c8a94e); border-color: var(--c-gold, #c8a94e); color: #1c1a17; }

/* Preferences drawer */
.celasta-cc-prefs {
	max-width: 1180px;
	margin: 0 auto;
	padding: 6px 22px 22px;
	border-block-start: 1px solid var(--c-border, #e7e1d6);
	display: grid;
	gap: 14px;
}
.celasta-cc-cat {
	background: var(--c-surface, #f7f3ec);
	border: 1px solid var(--c-border, #e7e1d6);
	border-radius: 10px;
	padding: 14px 16px;
}
.celasta-cc-cat-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-block-end: 6px;
}
.celasta-cc-cat p { margin: 0; font-size: 0.82rem; color: var(--c-muted, #6b655c); line-height: 1.55; }
.celasta-cc-locked { font-size: 0.75rem; color: var(--c-gold-text, #8a6d1f); font-weight: 600; }

.celasta-cc-switch { position: relative; display: inline-block; width: 44px; height: 26px; flex: none; }
.celasta-cc-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.celasta-cc-switch span {
	position: absolute; inset: 0; border-radius: 999px;
	background: #cfc7b8; transition: background 0.2s;
}
.celasta-cc-switch span::before {
	content: ""; position: absolute; height: 20px; width: 20px;
	inset-block-start: 3px; inset-inline-start: 3px;
	background: #fff; border-radius: 50%; transition: transform 0.2s;
}
.celasta-cc-switch input:checked + span { background: var(--c-gold, #c8a94e); }
.celasta-cc-switch input:checked + span::before { transform: translateX(18px); }
.celasta-cc-switch input:focus-visible + span { outline: 2px solid var(--c-gold-text, #8a6d1f); outline-offset: 2px; }

.celasta-cc-prefs-actions { display: flex; justify-content: flex-end; }

/* Floating re-open button */
.celasta-cc-reopen {
	position: fixed;
	inset-block-end: 18px;
	inset-inline-start: 18px;
	z-index: 99980;
	width: 46px; height: 46px;
	border-radius: 50%;
	border: 1px solid var(--c-border, #e7e1d6);
	background: var(--c-white, #fff);
	color: var(--c-charcoal, #1c1a17);
	box-shadow: 0 6px 20px rgba(20, 18, 14, 0.15);
	cursor: pointer;
	display: flex; align-items: center; justify-content: center;
}
.celasta-cc-reopen svg { width: 22px; height: 22px; }
.celasta-cc-reopen:hover { color: var(--c-gold-text, #8a6d1f); border-color: var(--c-gold, #c8a94e); }

@media (max-width: 640px) {
	.celasta-cc-inner { flex-direction: column; align-items: stretch; }
	.celasta-cc-actions { justify-content: stretch; }
	.celasta-cc-actions .celasta-cc-btn { flex: 1 1 auto; }
}

/* ── Account "Privacy & Data" endpoint ─────────────────────────── */
.cacc-panel.cacc-danger { border-color: #e4b4b4; background: #fdf6f6; }
.cacc-panel.cacc-danger h3 { color: #a12b2b; }
.cacc-checkline {
	display: flex; align-items: flex-start; gap: 9px;
	font-size: 0.85rem; color: var(--c-text, #2a2620); margin: 10px 0 14px; line-height: 1.5;
}
.cacc-checkline input { margin-block-start: 3px; }
.cl-btn.cl-btn-danger { background: #a12b2b; border-color: #a12b2b; color: #fff; }
.cl-btn.cl-btn-danger:hover:not([disabled]) { background: #8a2020; border-color: #8a2020; }
.cl-btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* Toast */
.cacc-toast {
	position: fixed; inset-block-end: 24px; inset-inline: 0;
	margin-inline: auto; width: max-content; max-width: 90vw;
	background: var(--c-charcoal, #1c1a17); color: #fff;
	padding: 12px 20px; border-radius: 10px; font-size: 0.88rem;
	box-shadow: 0 10px 30px rgba(0,0,0,0.25);
	opacity: 0; transform: translateY(12px);
	transition: opacity 0.28s, transform 0.28s; z-index: 100000;
}
.cacc-toast.show { opacity: 1; transform: translateY(0); }
.cacc-toast.is-ok { background: #22633f; }
.cacc-toast.is-err { background: #a12b2b; }
