/**
 * GDPR cookie consent banner + preferences modal - Custom Classifieds UK.
 * Self-contained (defines its own design tokens) and styled to the site.
 */

.cc-cookie, .cc-cookie-modal {
	--gold: #a59055;
	--gold-hover: #c9b47a;
	--ink: #171610;
	--card: #fff;
	--hair: #e2ded4;
	--body: #5c584e;
	--muted: #8a857a;
	--dark-text: #f0ede6;
	--dark-muted: #b5b1a8;
}

/* ===================== BANNER ===================== */
.cc-cookie {
	position: fixed;
	left: 0; right: 0; bottom: 0;
	z-index: 1200;
	background: var(--ink);
	color: var(--dark-text);
	border-top: 2px solid var(--gold);
	box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.25);
	font-family: 'Barlow', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.cc-cookie[hidden] { display: none; }
.cc-cookie-bar {
	max-width: 1440px;
	margin: 0 auto;
	padding: 16px 56px;
	display: flex;
	align-items: center;
	gap: 28px;
}
.cc-cookie-text {
	margin: 0;
	font-size: 14px;
	line-height: 1.5 !important;
	color: var(--dark-muted);
	flex: 1 1 auto;
	min-height: 21px;
}
/* Production hardening: a parent/plugin style was collapsing the flex children
   to zero height (so the whole bar rendered 0px tall). Force explicit line
   heights and a min height so the banner always lays out and is visible. */
.cc-cookie-bar { min-height: 60px !important; }
.cc-cookie-actions { min-height: 40px !important; }
.cc-cookie-text a { color: var(--gold); text-decoration: underline; text-underline-offset: 2px; }
.cc-cookie-text a:hover { color: var(--gold-hover); }
.cc-cookie-actions {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 0 0 auto;
}

/* Buttons (shared with the modal) */
.cc-cookie-btn {
	font-family: 'Bebas Neue', 'bebas-neue', sans-serif;
	font-weight: 400;
	font-size: 18px;
	line-height: 1.2 !important;
	letter-spacing: 1px;
	text-transform: uppercase;
	padding: 11px 22px !important;
	border: 0;
	border-radius: 0;
	cursor: pointer;
	white-space: nowrap;
	transition: background-color 0.15s ease, color 0.15s ease;
}
.cc-cookie-accept { background: var(--gold); color: var(--ink); }
.cc-cookie-accept:hover { background: var(--gold-hover); color: var(--ink); }
.cc-cookie-reject {
	background: transparent;
	color: var(--dark-text);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}
.cc-cookie-reject:hover { box-shadow: inset 0 0 0 1px #fff; background: rgba(255, 255, 255, 0.08); }
.cc-cookie-link {
	background: none;
	border: 0;
	color: var(--dark-muted);
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 2px;
	white-space: nowrap;
}
.cc-cookie-link:hover { color: var(--gold); }

/* ===================== PREFERENCES MODAL ===================== */
.cc-cookie-modal {
	position: fixed;
	inset: 0;
	z-index: 1300;
	display: none;
	font-family: 'Barlow', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.cc-cookie-modal.is-open { display: block; }
.cc-cookie-modal-overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.55); }
.cc-cookie-modal-panel {
	position: absolute;
	left: 50%; top: 50%;
	transform: translate(-50%, -50%);
	width: 92%;
	max-width: 520px;
	max-height: 90vh;
	overflow-y: auto;
	background: var(--card);
	box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
	padding: 0;
}
.cc-cookie-modal-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 26px;
	border-bottom: 1px solid var(--hair);
}
.cc-cookie-modal-title {
	font-family: 'Bebas Neue', 'bebas-neue', sans-serif;
	font-weight: 400;
	font-size: 26px;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	color: var(--ink);
	line-height: 1;
}
.cc-cookie-modal-close {
	background: none; border: 0; cursor: pointer;
	font-size: 28px; line-height: 1; color: var(--muted); padding: 0 4px;
}
.cc-cookie-modal-close:hover { color: var(--ink); }
.cc-cookie-modal-intro {
	margin: 0;
	padding: 20px 26px 6px;
	font-size: 15px;
	line-height: 1.6;
	color: var(--body);
}
.cc-cookie-cats { padding: 8px 26px 6px; }
.cc-cookie-cat {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 18px;
	padding: 16px 0;
	border-bottom: 1px solid var(--hair);
}
.cc-cookie-cat:last-child { border-bottom: 0; }
.cc-cookie-cat-name {
	display: block;
	font-weight: 700;
	font-size: 15px;
	color: var(--ink);
	margin-bottom: 3px;
}
.cc-cookie-cat-desc { display: block; font-size: 13px; line-height: 1.5; color: var(--muted); }
.cc-cookie-cat input[type="checkbox"] {
	flex: 0 0 auto;
	width: 20px; height: 20px;
	margin-top: 2px;
	accent-color: var(--gold);
	cursor: pointer;
}
.cc-cookie-cat.is-locked input { cursor: not-allowed; }
.cc-cookie-modal-actions {
	display: flex;
	gap: 12px;
	justify-content: flex-end;
	padding: 18px 26px 22px;
	border-top: 1px solid var(--hair);
}
.cc-cookie-modal-actions .cc-cookie-btn { font-size: 18px; }
.cc-cookie-save { background: var(--ink); color: #fff; }
.cc-cookie-save:hover { background: #000; color: #fff; }

/* ===================== MOBILE (minimal) ===================== */
@media (max-width: 767px) {
	.cc-cookie-bar {
		flex-direction: column;
		align-items: stretch;
		gap: 12px;
		padding: 14px 18px calc(14px + env(safe-area-inset-bottom, 0px));
	}
	.cc-cookie-text { font-size: 13px; }
	.cc-cookie-actions { flex-wrap: wrap; gap: 10px; }
	.cc-cookie-accept, .cc-cookie-reject { flex: 1 1 0; text-align: center; padding: 12px 14px; font-size: 17px; }
	.cc-cookie-link { flex: 1 0 100%; text-align: center; order: 3; }
	.cc-cookie-modal-actions { flex-direction: column; }
	.cc-cookie-modal-actions .cc-cookie-btn { width: 100%; text-align: center; }
}
