/*
 * Legal Hub Compliance — Cookie Notice Bar  v1.3.1
 * © Aksoy Software · https://www.aksoysoftware.com
 *
 * THEME ISOLATION
 * ───────────────────────────────────────────────────────────────────────
 * 1.  #lhc-bar and all its children get `all: initial` to strip every
 *     inherited theme style so no theme rule can bleed in.
 * 2.  ID selector (#lhc-bar) gives maximum CSS specificity.
 * 3.  Structural properties carry `!important` to survive aggressive themes.
 * 4.  CSS custom properties are scoped inside #lhc-bar.
 * 5.  box-sizing is explicitly re-declared because `all:initial` resets it.
 * 6.  GPU-accelerated transform animations (no layout thrash).
 */

/* ── Reset ────────────────────────────────────────────────────────────── */
#lhc-bar,
#lhc-bar * {
	all: initial;
	box-sizing: border-box !important;
}

/* ── Design tokens (scoped) ───────────────────────────────────────────── */
#lhc-bar {
	/* Colours */
	--lhc-bg:             #0f172a;
	--lhc-bg-alpha:       rgba(10, 16, 34, 0.97);
	--lhc-border:         rgba(255,255,255,0.09);
	--lhc-text:           #cbd5e1;
	--lhc-text-strong:    #f1f5f9;
	--lhc-link:           #93c5fd;
	--lhc-link-hover:     #ffffff;
	--lhc-sep:            #334155;
	/* Accept button */
	--lhc-accept-bg:      #2563eb;
	--lhc-accept-hover:   #1d4ed8;
	--lhc-accept-text:    #ffffff;
	/* Reject button */
	--lhc-reject-border:  rgba(255,255,255,0.25);
	--lhc-reject-text:    #94a3b8;
	--lhc-reject-hover-bg:#1e293b;
	--lhc-reject-hover-text:#e2e8f0;
	/* Close */
	--lhc-close:          #64748b;
	--lhc-close-hover:    #e2e8f0;
	--lhc-close-hover-bg: rgba(255,255,255,0.08);
	/* Focus ring */
	--lhc-focus:          #60a5fa;
	/* Typography */
	--lhc-font:           -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
	                       "Helvetica Neue", Arial, sans-serif;
	--lhc-size-notice:    0.875rem;    /* 14 px */
	--lhc-size-link:      0.8125rem;   /* 13 px */
	--lhc-size-btn:       0.8125rem;
	/* Layout */
	--lhc-shadow:         0 -4px 40px rgba(0,0,0,0.35);
	--lhc-duration:       0.3s;
	--lhc-ease:           cubic-bezier(0.22, 1, 0.36, 1);
	--lhc-radius-btn:     6px;
}

/* ── Root bar ─────────────────────────────────────────────────────────── */
#lhc-bar {
	display:    block !important;
	position:   fixed !important;
	left:       0     !important;
	right:      0     !important;
	bottom:     0     !important;
	z-index:    2147483640 !important;

	background: var(--lhc-bg-alpha);
	border-top: 1px solid var(--lhc-border);
	box-shadow: var(--lhc-shadow);
	padding:    14px 52px 14px 20px;
	padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));

	/* Entrance: slide up from below */
	transform:  translateY(100%);
	opacity:    0;
	transition: transform var(--lhc-duration) var(--lhc-ease),
	            opacity 0.22s linear;
	will-change: transform;
}

#lhc-bar[data-lhc-visible] {
	transform: translateY(0);
	opacity:   1;
}
#lhc-bar[data-lhc-closing] {
	transform: translateY(100%);
	opacity:   0;
}

/* ── Inner wrapper ────────────────────────────────────────────────────── */
#lhc-bar .lhc-inner {
	display:         flex !important;
	flex-wrap:       wrap !important;
	align-items:     center !important;
	gap:             10px 20px !important;
	max-width:       1200px !important;
	margin:          0 auto !important;
}

/* ── Notice text ──────────────────────────────────────────────────────── */
#lhc-bar .lhc-notice {
	display:     block !important;
	flex:        1 1 260px !important;
	margin:      0 !important;
	padding:     0 !important;
	color:       var(--lhc-text) !important;
	font-family: var(--lhc-font) !important;
	font-size:   var(--lhc-size-notice) !important;
	line-height: 1.55 !important;
}

#lhc-bar .lhc-notice strong {
	display:     inline !important;
	color:       var(--lhc-text-strong) !important;
	font-family: var(--lhc-font) !important;
	font-size:   var(--lhc-size-notice) !important;
	font-weight: 600 !important;
	line-height: 1.55 !important;
}

/* ── Policy links strip ───────────────────────────────────────────────── */
#lhc-bar .lhc-links {
	display:     flex !important;
	flex-wrap:   wrap !important;
	align-items: center !important;
	gap:         2px 4px !important;
	flex-shrink: 0 !important;
}

#lhc-bar .lhc-link {
	display:         inline !important;
	color:           var(--lhc-link) !important;
	font-family:     var(--lhc-font) !important;
	font-size:       var(--lhc-size-link) !important;
	font-weight:     400 !important;
	line-height:     1.5 !important;
	text-decoration: underline !important;
	text-underline-offset: 2px !important;
	text-decoration-color: rgba(147, 197, 253, 0.35) !important;
	white-space:     nowrap !important;
	cursor:          pointer !important;
	transition:      color 0.15s ease, text-decoration-color 0.15s ease !important;
}

#lhc-bar .lhc-link:hover {
	color:                   var(--lhc-link-hover) !important;
	text-decoration-color:   rgba(255,255,255,0.55) !important;
}

#lhc-bar .lhc-link:focus-visible {
	outline:       2px solid var(--lhc-focus) !important;
	outline-offset: 3px !important;
	border-radius: 2px !important;
}

#lhc-bar .lhc-sep {
	display:     inline !important;
	color:       var(--lhc-sep) !important;
	font-family: var(--lhc-font) !important;
	font-size:   var(--lhc-size-link) !important;
	line-height: 1.5 !important;
	user-select: none !important;
	cursor:      default !important;
	margin:      0 1px !important;
}

/* ── Action buttons ───────────────────────────────────────────────────── */
#lhc-bar .lhc-actions {
	display:     flex !important;
	align-items: center !important;
	gap:         8px !important;
	flex-shrink: 0 !important;
}

/* Shared button base */
#lhc-bar .lhc-btn {
	display:         inline-flex !important;
	align-items:     center !important;
	justify-content: center !important;
	padding:         7px 16px !important;
	border-radius:   var(--lhc-radius-btn) !important;
	font-family:     var(--lhc-font) !important;
	font-size:       var(--lhc-size-btn) !important;
	font-weight:     600 !important;
	line-height:     1 !important;
	white-space:     nowrap !important;
	cursor:          pointer !important;
	transition:      background 0.18s ease, color 0.18s ease,
	                 border-color 0.18s ease, box-shadow 0.18s ease !important;
	-webkit-appearance: none !important;
	appearance:      none !important;
}

/* Accept All — filled primary */
#lhc-bar .lhc-btn--accept {
	background:  var(--lhc-accept-bg) !important;
	color:       var(--lhc-accept-text) !important;
	border:      1px solid var(--lhc-accept-bg) !important;
}
#lhc-bar .lhc-btn--accept:hover {
	background:  var(--lhc-accept-hover) !important;
	border-color: var(--lhc-accept-hover) !important;
	box-shadow:  0 0 0 3px rgba(37, 99, 235, 0.35) !important;
}
#lhc-bar .lhc-btn--accept:focus-visible {
	outline:        2px solid var(--lhc-focus) !important;
	outline-offset: 2px !important;
}
#lhc-bar .lhc-btn--accept:active {
	box-shadow: none !important;
	background: #1e40af !important;
}

/* Reject — ghost */
#lhc-bar .lhc-btn--reject {
	background:  transparent !important;
	color:       var(--lhc-reject-text) !important;
	border:      1px solid var(--lhc-reject-border) !important;
}
#lhc-bar .lhc-btn--reject:hover {
	background:  var(--lhc-reject-hover-bg) !important;
	color:       var(--lhc-reject-hover-text) !important;
	border-color: rgba(255,255,255,0.4) !important;
}
#lhc-bar .lhc-btn--reject:focus-visible {
	outline:        2px solid var(--lhc-focus) !important;
	outline-offset: 2px !important;
}

/* ── Close (×) button ─────────────────────────────────────────────────── */
#lhc-bar .lhc-close {
	display:     flex !important;
	align-items: center !important;
	justify-content: center !important;
	position:    absolute !important;
	top:         50% !important;
	right:       14px !important;
	transform:   translateY(-50%) !important;
	width:       30px !important;
	height:      30px !important;
	padding:     0 !important;
	margin:      0 !important;
	border:      none !important;
	background:  transparent !important;
	color:       var(--lhc-close) !important;
	font-family: var(--lhc-font) !important;
	font-size:   1.2rem !important;
	line-height: 1 !important;
	cursor:      pointer !important;
	border-radius: 4px !important;
	transition:  color 0.15s ease, background 0.15s ease !important;
	-webkit-appearance: none !important;
	appearance:  none !important;
}
#lhc-bar .lhc-close:hover {
	color:      var(--lhc-close-hover) !important;
	background: var(--lhc-close-hover-bg) !important;
}
#lhc-bar .lhc-close:focus-visible {
	outline:        2px solid var(--lhc-focus) !important;
	outline-offset: 2px !important;
}
#lhc-bar .lhc-close:active {
	background: rgba(255,255,255,0.15) !important;
}

/* ── Body bottom-padding compensation ─────────────────────────────────── */
/* Kept in sync by ResizeObserver in JS. This is the fallback. */
body.lhc-active {
	padding-bottom: var(--lhc-bar-height, 72px) !important;
}

/* ── Tablet (≤ 768 px) — stack text above links + buttons ─────────────── */
@media (max-width: 768px) {
	#lhc-bar {
		padding: 12px 44px 12px 14px !important;
		padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
	}

	#lhc-bar .lhc-inner {
		flex-direction: column !important;
		align-items:    stretch !important;
		gap:            8px !important;
	}

	#lhc-bar .lhc-notice {
		flex: none !important;
		font-size: 0.8125rem !important;
	}

	#lhc-bar .lhc-links {
		justify-content: center !important;
	}

	#lhc-bar .lhc-actions {
		justify-content: flex-end !important;
	}
}

/* ── Mobile (≤ 480 px) ────────────────────────────────────────────────── */
@media (max-width: 480px) {
	#lhc-bar .lhc-actions {
		justify-content: center !important;
	}

	#lhc-bar .lhc-btn {
		flex:    1 !important;
		padding: 9px 12px !important;
	}
}

/* ── Reduced motion ───────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
	#lhc-bar {
		transition: none !important;
	}
}
