/* =============================================================================
   CSCC Banner — CSS
   Colors are injected as CSS custom properties by PHP (wp_add_inline_style).
   ============================================================================= */

:root {
	--cscc-bg: #ffffff;
	--cscc-text: #111111;
	--cscc-accent: #0073aa;
	--cscc-radius: 6px;
	--cscc-border: 0px solid #dddddd;
	--cscc-shadow: 0 2px 16px rgba(0, 0, 0, .15);
	--cscc-z: 99999;
	--cscc-font: inherit;
	--cscc-btn-border-width: 1px;
	--cscc-secondary-border: currentColor;
	--cscc-secondary-decoration: none;
}

/* -----------------------------------------------------------------------------
   Base banner
   ----------------------------------------------------------------------------- */

.cscc-banner {
	position: fixed;
	z-index: var(--cscc-z);
	background: var(--cscc-bg);
	color: var(--cscc-text);
	/* font-family intentionally not set — inherits from theme */
	font-size: 1rem;
	line-height: 1.5;
	box-shadow: var(--cscc-shadow);
	border: var(--cscc-border);
	box-sizing: border-box;
	outline: none;
	/* suppress focus ring — banner is a container, not interactive */
}

.cscc-banner:focus-visible {
	outline: none;
}

.cscc-banner__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px;
	padding: 16px 20px;
	max-width: 1200px;
	margin: 0 auto;
	box-sizing: border-box;
}

/* -----------------------------------------------------------------------------
   Positions
   ----------------------------------------------------------------------------- */

/* Full-width bars */
.cscc-position-bottom-bar {
	bottom: 0;
	left: 0;
	right: 0;
}

.cscc-position-top-bar {
	top: 0;
	left: 0;
	right: 0;
}

/* Corner boxes */
.cscc-position-bottom-left,
.cscc-position-bottom-right {
	bottom: 20px;
	width: 360px;
	max-width: calc(100vw - 40px);
	border-radius: var(--cscc-radius);
}

.cscc-position-bottom-left {
	left: 20px;
}

.cscc-position-bottom-right {
	right: 20px;
}

/* Corner boxes stack content vertically */
.cscc-position-bottom-left .cscc-banner__inner,
.cscc-position-bottom-right .cscc-banner__inner {
	flex-direction: column;
	align-items: flex-start;
}

/* In column layouts content should not stretch — fix excess banner height */
.cscc-position-bottom-left .cscc-banner__content,
.cscc-position-bottom-right .cscc-banner__content,
.cscc-position-center-modal .cscc-banner__content {
	flex: none;
	width: 100%;
}

/* Center modal */
.cscc-position-center-modal {
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 480px;
	max-width: calc(100vw - 40px);
	border-radius: var(--cscc-radius);
}

.cscc-position-center-modal .cscc-banner__inner {
	flex-direction: column;
	align-items: flex-start;
}

/* Overlay backdrop for center modal — separate element, not ::before */
.cscc-banner-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, .45);
	z-index: calc(var(--cscc-z) - 1);
}

/* -----------------------------------------------------------------------------
   Content
   ----------------------------------------------------------------------------- */

.cscc-banner__content {
	flex: 1 1 260px;
}

/* Logo + title on the same line */
.cscc-banner__header {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 6px;
}

.cscc-banner__logo {
	max-height: 28px;
	max-width: 120px;
	width: auto;
	height: auto;
	display: block;
	flex-shrink: 0;
	object-fit: contain;
}

.cscc-banner__title {
	margin: 0;
	font-weight: 700;
	font-size: 1.2rem;
	color: var(--cscc-text);
}

.cscc-banner__text {
	margin: 0;
	font-size: 0.9rem;
	color: var(--cscc-text);
}

/* -----------------------------------------------------------------------------
   Buttons
   ----------------------------------------------------------------------------- */

.cscc-banner__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	flex-shrink: 0;
}

.cscc-btn {
	display: inline-block;
	padding: 8px 16px;
	border-radius: var(--cscc-radius);
	font-size: 0.85rem;
	font-weight: 600;
	cursor: pointer;
	border: var(--cscc-btn-border-width) solid transparent;
	line-height: 1.4;
	white-space: nowrap;
	transition: background-color .15s ease, color .15s ease,
		border-color .15s ease, opacity .15s ease;
	/* Prevent theme styles from bleeding in */
	text-transform: none;
	letter-spacing: normal;
	text-decoration: none;
}

/* Accept */
.cscc-btn--accept {
	background: var(--cscc-accent);
	color: #fff !important;
	border-color: var(--cscc-accent);
}

.cscc-btn--accept:hover,
.cscc-btn--accept:focus {
	background: var(--cscc-accent);
	color: #fff !important;
	border-color: var(--cscc-accent);
	opacity: .85;
}

/* Deny */
.cscc-btn--deny {
	background: transparent;
	color: var(--cscc-text) !important;
	border-color: var(--cscc-secondary-border);
	text-decoration: var(--cscc-secondary-decoration);
}

.cscc-btn--deny:hover,
.cscc-btn--deny:focus {
	background: rgba(0, 0, 0, .05);
	color: var(--cscc-text) !important;
	border-color: var(--cscc-secondary-border);
	opacity: 1;
}

/* Preferences — outline button, same weight as deny */
.cscc-btn--preferences {
	background: transparent;
	color: var(--cscc-text) !important;
	border-color: var(--cscc-secondary-border);
	text-decoration: var(--cscc-secondary-decoration);
}

.cscc-btn--preferences:hover,
.cscc-btn--preferences:focus {
	background: rgba(0, 0, 0, .05);
	color: var(--cscc-text) !important;
	border-color: var(--cscc-secondary-border);
	opacity: 1;
}

/* In column layouts actions take full width so buttons don't truncate */
.cscc-position-bottom-left .cscc-banner__actions,
.cscc-position-bottom-right .cscc-banner__actions,
.cscc-position-center-modal .cscc-banner__actions {
	width: 100%;
}

/* -----------------------------------------------------------------------------
   Legal links
   ----------------------------------------------------------------------------- */

.cscc-banner__links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25em 0.75em;
	width: 100%;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 0.8rem;
	opacity: .75;
}

/* Let theme control link colour and decoration */
.cscc-banner__links a {
	text-decoration: inherit;
}

/* -----------------------------------------------------------------------------
   Responsive — stack everything on small screens
   ----------------------------------------------------------------------------- */

@media (max-width: 600px) {
	.cscc-banner__inner {
		flex-direction: column;
		align-items: flex-start;
	}

	.cscc-banner__actions {
		width: 100%;
	}

	.cscc-btn {
		flex: 1 1 auto;
		text-align: center;
	}

	.cscc-position-bottom-left,
	.cscc-position-bottom-right {
		left: 0;
		right: 0;
		bottom: 0;
		width: 100%;
		max-width: 100%;
		border-radius: 0;
	}
}

/* =============================================================================
   CSCC Preferences Modal
   ============================================================================= */

.cscc-modal__overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, .5);
	z-index: calc(var(--cscc-z) + 1);
}

.cscc-modal__box {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: calc(var(--cscc-z) + 2);
	background: var(--cscc-bg);
	color: var(--cscc-text);
	border-radius: var(--cscc-radius);
	box-shadow: var(--cscc-shadow);
	width: 520px;
	max-width: calc(100vw - 32px);
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	padding: 28px 24px 24px;
	box-sizing: border-box;
}

.cscc-modal__close {
	position: absolute;
	top: 12px;
	right: 14px;
	background: transparent !important;
	border: var(--cscc-btn-border-width) solid var(--cscc-secondary-border) !important;
	border-radius: var(--cscc-radius);
	font-size: 18px;
	font-weight: 600;
	cursor: pointer;
	color: var(--cscc-text) !important;
	line-height: 1;
	padding: 4px 8px;
	box-shadow: none !important;
	outline: none;
	text-decoration: none;
	transition: background-color .15s ease, color .15s ease, opacity .15s ease;
}

.cscc-modal__close:focus,
.cscc-modal__close:focus-visible {
	background: transparent !important;
	color: var(--cscc-text) !important;
	border-color: var(--cscc-secondary-border) !important;
	box-shadow: none !important;
	outline: none;
}

.cscc-modal__close:hover {
	background: rgba(0, 0, 0, .05) !important;
	color: var(--cscc-text) !important;
	border-color: var(--cscc-secondary-border) !important;
	opacity: 1;
}

.cscc-modal__title {
	margin: 0 0 8px;
	font-size: 1.2rem;
	font-weight: 600;
	color: var(--cscc-text);
}

.cscc-modal__intro {
	margin: 0 0 20px;
	font-size: 0.9rem;
	opacity: .8;
}

/* -----------------------------------------------------------------------------
   Categories
   ----------------------------------------------------------------------------- */

.cscc-modal__categories {
	display: flex;
	flex-direction: column;
	gap: 0;
	margin-bottom: 20px;
}

.cscc-modal__category {
	padding: 0.9rem 0;
	border-bottom: 1px solid rgba(0, 0, 0, .08);
}

.cscc-modal__category:last-child {
	border-bottom: none;
}

.cscc-modal__category-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 6px;
}

.cscc-modal__category-name {
	font-weight: 600;
	font-size: 1rem;
}

.cscc-modal__category-desc {
	margin: 0;
	font-size: 0.9rem;
	opacity: .75;
}

.cscc-modal__always-on {
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--cscc-accent);
}

/* -----------------------------------------------------------------------------
   Toggle switch
   ----------------------------------------------------------------------------- */

.cscc-toggle {
	position: relative;
	display: inline-block;
	width: 40px;
	height: 22px;
	flex-shrink: 0;
	cursor: pointer;
}

.cscc-toggle__input {
	opacity: 0;
	width: 0;
	height: 0;
	position: absolute;
}

.cscc-toggle__slider {
	position: absolute;
	inset: 0;
	background: #ccc;
	border-radius: 22px;
	transition: background .2s ease;
}

.cscc-toggle__slider::before {
	content: '';
	position: absolute;
	width: 16px;
	height: 16px;
	left: 3px;
	top: 3px;
	background: #fff;
	border-radius: 50%;
	transition: transform .2s ease;
}

.cscc-toggle__input:checked+.cscc-toggle__slider {
	background: var(--cscc-accent);
}

.cscc-toggle__input:checked+.cscc-toggle__slider::before {
	transform: translateX(18px);
}

.cscc-toggle__input:focus-visible+.cscc-toggle__slider {
	outline: 2px solid var(--cscc-accent);
	outline-offset: 2px;
}

/* -----------------------------------------------------------------------------
   Modal footer
   ----------------------------------------------------------------------------- */

.cscc-modal__footer {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	padding-top: 8px;
}

/* =============================================================================
   Floating preferences icon
   ============================================================================= */

.cscc-preferences-icon {
	position: fixed;
	bottom: 20px;
	left: 20px;
	z-index: var(--cscc-z);
	width: 40px;
	height: 40px;
	border-radius: 50% !important;
	background: var(--cscc-accent) !important;
	color: #fff !important;
	border: none !important;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .25) !important;
	transition: opacity .2s ease, transform .2s ease;
	padding: 0;
	outline: none;
}

.cscc-preferences-icon:hover,
.cscc-preferences-icon:focus {
	opacity: .9;
	transform: scale(1.08);
	background: var(--cscc-accent) !important;
	color: #fff !important;
	border: none !important;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .25) !important;
}

.cscc-preferences-icon svg {
	display: block;
}

/* Shortcode link — no default styling, inherits theme */
.cscc-preferences-link {
	cursor: pointer;
}

/* =============================================================================
   [cscc_cookie_list] shortcode
   Intentionally minimal — table appearance is inherited from the active theme.
   Only structural/functional rules are defined here.
   ============================================================================= */

.cscc-cookie-list__group {
	margin-bottom: 2em;
}

/* Category badge headings */
.cscc-cookie-list__heading {
	font-size: 1em;
	font-weight: 700;
	padding: .3em .7em;
	border-radius: 4px;
	margin-bottom: .75em;
	display: inline-block;
}

.cscc-cookie-list__heading--necessary {
	background: #d7f0e0;
	color: #1a6b3c;
}

.cscc-cookie-list__heading--analytics {
	background: #d0e8f8;
	color: #0a4b78;
}

.cscc-cookie-list__heading--marketing {
	background: #fde8c8;
	color: #7a4500;
}

.cscc-cookie-list__heading--functional {
	background: #ede8fd;
	color: #3a1a7a;
}

/* Scroll wrapper — horizontal scroll on narrow viewports */
.cscc-cookie-list__scroll {
	width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

/* min-width triggers the scroll before columns become unreadable */
.cscc-cookie-list__table {
	min-width: 520px;
}

/* Duration cell — never break mid-value */
.cscc-cookie-list__duration {
	white-space: nowrap;
}

/* Cookie name — allow long names to break so they don't blow the layout */
.cscc-cookie-list__name {
	word-break: break-all;
}

.cscc-cookie-list__empty {
	font-style: italic;
}