/* OstuGrupp AIO — küpsiste nõusolek (front-end) */

.oga-cc-root {
	--oga-cc-primary: #17a2b8;
	--oga-cc-primary-text: #ffffff;
	--oga-cc-bg: #ffffff;
	--oga-cc-text: #1f2d2f;
	--oga-cc-radius: 8px;
	--oga-cc-muted: #5b6b6d;
	--oga-cc-border: #e3e8e9;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.oga-cc-root [hidden] { display: none !important; }

/* Tume kujundus (roheline/tume, nagu OstuGrupu teema). Klass lisatakse rooti seadetest. */
.oga-cc-dark {
	--oga-cc-muted: #b7c4cb;
	--oga-cc-border: rgba( 255, 255, 255, 0.18 );
}
.oga-cc-dark .oga-cc-ghost:hover { background: rgba( 255, 255, 255, 0.08 ); }
.oga-cc-dark .oga-cc-decl-table th { background: rgba( 255, 255, 255, 0.06 ); }
.oga-cc-dark .oga-cc-modal-backdrop { background: rgba( 4, 10, 12, 0.62 ); }
.oga-cc-dark .oga-cc-float { box-shadow: 0 2px 14px rgba( 0, 0, 0, 0.4 ); }

.oga-cc-bar,
.oga-cc-bar-inner,
.oga-cc-modal-box,
.oga-cc-btn,
.oga-cc-float { box-sizing: border-box; }

.oga-cc-btn {
	appearance: none;
	border: 1px solid transparent;
	border-radius: var(--oga-cc-radius);
	padding: 11px 18px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: filter .15s ease, background .15s ease;
}
.oga-cc-btn:focus-visible { outline: 2px solid var(--oga-cc-primary); outline-offset: 2px; }

.oga-cc-primary {
	background: var(--oga-cc-primary);
	color: var(--oga-cc-primary-text);
}
.oga-cc-primary:hover { filter: brightness(0.94); }

.oga-cc-ghost {
	background: transparent;
	color: var(--oga-cc-text);
	border-color: var(--oga-cc-border);
}
.oga-cc-ghost:hover { background: rgba(0, 0, 0, 0.04); }

.oga-cc-link { color: var(--oga-cc-primary); text-decoration: underline; }

/* --- Alumine riba --- */
.oga-cc-bar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 999999;
	background: var(--oga-cc-bg);
	color: var(--oga-cc-text);
	box-shadow: 0 -2px 18px rgba(0, 0, 0, 0.14);
	border-top: 1px solid var(--oga-cc-border);
	animation: oga-cc-up .28s ease;
}
@keyframes oga-cc-up { from { transform: translateY(100%); } to { transform: translateY(0); } }

.oga-cc-bar-inner {
	max-width: 1180px;
	margin: 0 auto;
	padding: 16px 20px;
	display: flex;
	align-items: center;
	gap: 18px 24px;
	flex-wrap: wrap;
}
.oga-cc-bar-text { flex: 1 1 380px; min-width: 260px; }
.oga-cc-title { display: block; font-size: 15px; margin-bottom: 3px; }
.oga-cc-text { font-size: 13.5px; line-height: 1.55; color: var(--oga-cc-muted); }
.oga-cc-bar-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* --- Modaal --- */
.oga-cc-modal { position: fixed; inset: 0; z-index: 1000000; }
.oga-cc-modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 24, 0.55); }
.oga-cc-modal-box {
	position: relative;
	max-width: 560px;
	width: calc(100% - 32px);
	max-height: calc(100vh - 64px);
	margin: 32px auto;
	background: var(--oga-cc-bg);
	color: var(--oga-cc-text);
	border-radius: calc(var(--oga-cc-radius) + 4px);
	box-shadow: 0 12px 48px rgba(0, 0, 0, 0.3);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}
.oga-cc-close {
	position: absolute; top: 10px; right: 12px;
	background: none; border: 0; font-size: 26px; line-height: 1;
	color: var(--oga-cc-muted); cursor: pointer; padding: 4px 8px;
}
.oga-cc-modal-title { margin: 0; padding: 22px 24px 6px; font-size: 19px; }
.oga-cc-modal-body { padding: 8px 24px; overflow-y: auto; }
.oga-cc-modal-actions {
	display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end;
	padding: 16px 24px; border-top: 1px solid var(--oga-cc-border);
}

/* --- Kategooriad --- */
.oga-cc-cat { padding: 14px 0; border-bottom: 1px solid var(--oga-cc-border); }
.oga-cc-cat:last-child { border-bottom: 0; }
.oga-cc-toggle { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; cursor: pointer; }
.oga-cc-toggle input { width: 18px; height: 18px; accent-color: var(--oga-cc-primary); }
.oga-cc-toggle input[disabled] { opacity: .6; cursor: not-allowed; }
.oga-cc-cat-label em { color: var(--oga-cc-muted); font-weight: 500; font-size: 12px; }
.oga-cc-cat-desc { margin: 6px 0 0 28px; font-size: 13px; line-height: 1.5; color: var(--oga-cc-muted); }
.oga-cc-decl { margin: 8px 0 0 28px; }
.oga-cc-decl > summary { cursor: pointer; color: var(--oga-cc-primary); font-size: 12.5px; font-weight: 600; }
.oga-cc-decl-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 12px; }
.oga-cc-decl-table th, .oga-cc-decl-table td { text-align: left; padding: 5px 8px; border: 1px solid var(--oga-cc-border); vertical-align: top; word-break: break-word; }
.oga-cc-decl-table th { background: rgba(0, 0, 0, 0.03); font-weight: 600; }

/* --- Hõljuv nupp --- */
.oga-cc-float {
	position: fixed; bottom: 18px; z-index: 999998;
	background: var(--oga-cc-bg); color: var(--oga-cc-text);
	border: 1px solid var(--oga-cc-border);
	border-radius: 999px;
	padding: 9px 15px; font-size: 13px; font-weight: 600;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.16); cursor: pointer;
}
.oga-cc-float:hover { filter: brightness(0.97); }
.oga-cc-float-left { left: 18px; }
.oga-cc-float-right { right: 18px; }

/* --- Deklaratsioon (lühikood) --- */
.oga-cc-decl-full .oga-cc-decl-table { margin-bottom: 18px; }

@media (max-width: 600px) {
	.oga-cc-bar-inner { padding: 14px 16px; gap: 12px; }
	.oga-cc-bar-text { flex-basis: 100%; min-width: 0; }
	/* Nupud virnastuvad täislaiuses — mahuvad ja on suured puutepinnad. */
	.oga-cc-bar-actions,
	.oga-cc-modal-actions { width: 100%; flex-direction: column; align-items: stretch; gap: 8px; }
	.oga-cc-bar-actions .oga-cc-btn,
	.oga-cc-modal-actions .oga-cc-btn { width: 100%; }
	.oga-cc-btn { padding: 13px 18px; }
	.oga-cc-modal-box { margin: 12px auto; width: calc(100% - 24px); max-height: calc(100vh - 24px); }
	.oga-cc-close { font-size: 30px; padding: 6px 12px; }
	/* Hõljuv nupp mobiilis: tõsta üle teema alumise menüüriba (+ iOS safe-area), või peida. */
	.oga-cc-float { font-size: 12.5px; padding: 8px 13px; }
	.oga-cc-float--m-raise { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
	.oga-cc-float--m-hide { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
	.oga-cc-bar { animation: none; }
	.oga-cc-btn { transition: none; }
}
