/* ===== základ ===== */
.lwcc {
	--lwcc-from: translateY(110%);
	--lwcc-o: 1;
	position: fixed;
	z-index: 999999;
	box-sizing: border-box;
	max-height: 92vh;
	overflow: auto;
	background: var(--lwcc-bg, #fff);
	color: var(--lwcc-text, #1f2937);
	font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	box-shadow: 0 -2px 24px rgba(0, 0, 0, .18);
	transform-origin: 50% 100%;
}
.lwcc[hidden], .lwcc [hidden], .lwcc-fab[hidden] { display: none !important; }
.lwcc *, .lwcc *::before, .lwcc *::after { box-sizing: border-box; }

.lwcc--bar { left: 0; right: 0; bottom: 0; padding: 16px 20px; }
.lwcc--bar .lwcc__inner { max-width: 1100px; margin: 0 auto; }

.lwcc--box { bottom: 20px; width: 420px; max-width: calc(100vw - 20px); padding: 20px; border-radius: 12px; box-shadow: 0 8px 32px rgba(0, 0, 0, .25); }
.lwcc--box.lwcc--left { left: 20px; --lwcc-from: translateX(-115%); transform-origin: 0 100%; }
.lwcc--box.lwcc--right { right: 20px; --lwcc-from: translateX(115%); transform-origin: 100% 100%; }

.lwcc__head { display: flex; align-items: center; gap: 12px; margin: 0 0 6px; }
.lwcc__title { margin: 0; font-size: 16px; font-weight: 700; color: inherit; }
.lwcc__text { margin: 0 0 14px; color: inherit; }
.lwcc__text a { color: var(--lwcc-accent, #1d4ed8); text-decoration: underline; }

/* cookie ikona */
.lwcc__icon, .lwcc-fab svg { color: var(--lwcc-accent, #1d4ed8); }
.lwcc__icon { width: 34px; height: 34px; flex: none; cursor: default; }
.lwcc__icon .c, .lwcc-fab .c { fill: var(--lwcc-bg, #fff); }

.lwcc__prefs { margin: 0 0 14px; display: grid; gap: 10px; }
.lwcc__cat { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.lwcc__cat input { margin-top: 3px; accent-color: var(--lwcc-accent, #1d4ed8); width: 16px; height: 16px; }
.lwcc__cat strong { display: block; }
.lwcc__cat small { display: block; opacity: .75; font-size: 13px; }

.lwcc__buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.lwcc--bar .lwcc__buttons { justify-content: flex-end; }

.lwcc__btn {
	cursor: pointer;
	padding: .6em 1.2em;
	border: 2px solid var(--lwcc-accent, #1d4ed8);
	border-radius: 6px;
	background: var(--lwcc-accent, #1d4ed8);
	color: var(--lwcc-accent-text, #fff);
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.lwcc__btn--ghost { background: transparent; color: var(--lwcc-text, #1f2937); border-color: currentColor; opacity: .85; }
.lwcc__btn:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(0, 0, 0, .18); filter: brightness(1.06); }
.lwcc__btn:active { transform: translateY(0) scale(.97); box-shadow: none; }
.lwcc__btn:focus-visible, .lwcc__cat input:focus-visible, .lwcc-fab:focus-visible { outline: 3px solid var(--lwcc-accent, #1d4ed8); outline-offset: 2px; }

/* ===== plovoucí tlačítko pro změnu souhlasu ===== */
.lwcc-fab {
	position: fixed;
	bottom: 16px;
	z-index: 999998;
	width: 52px;
	height: 52px;
	padding: 8px;
	border: 0;
	border-radius: 50%;
	background: var(--lwcc-bg, #fff);
	box-shadow: 0 4px 18px rgba(0, 0, 0, .28);
	cursor: pointer;
	transition: transform .25s cubic-bezier(.34, 1.56, .64, 1), box-shadow .2s ease;
}
.lwcc-fab--left { left: 16px; }
.lwcc-fab--right { right: 16px; }
.lwcc-fab svg { display: block; width: 100%; height: 100%; }
.lwcc-fab:hover { transform: rotate(-14deg) scale(1.12); box-shadow: 0 6px 22px rgba(0, 0, 0, .35); }
.lwcc-fab:active { transform: scale(.94); }

/* ===== animace (vypnuto, když je data-anim="none") ===== */
.lwcc[data-anim="fade"]   { --lwcc-from: translateY(16px); --lwcc-o: 0; }
.lwcc[data-anim="pop"]    { --lwcc-from: scale(.8); --lwcc-o: 0; }
.lwcc[data-anim="bounce"] { --lwcc-from: translateY(120%); }

.lwcc:not([data-anim="none"]).lwcc--enter { animation: lwcc-in .55s cubic-bezier(.22, 1, .36, 1) .1s both; }
.lwcc[data-anim="pop"].lwcc--enter { animation-timing-function: cubic-bezier(.34, 1.56, .64, 1); }
.lwcc[data-anim="bounce"].lwcc--enter { animation-name: lwcc-bounce; animation-duration: .95s; animation-timing-function: ease-out; }
.lwcc:not([data-anim="none"]).lwcc--leave { animation: lwcc-out .35s ease-in both; }

/* ikona se do lišty "dokutálí" a při najetí myší zavrtí */
.lwcc:not([data-anim="none"]).lwcc--enter .lwcc__icon { animation: lwcc-roll 1s cubic-bezier(.34, 1.3, .64, 1) .25s both; }
.lwcc .lwcc__icon:hover { animation: lwcc-wiggle .6s ease-in-out !important; }

/* kategorie se po otevření nastavení postupně vynoří */
.lwcc:not([data-anim="none"]) .lwcc__prefs:not([hidden]) .lwcc__cat { animation: lwcc-rise .45s cubic-bezier(.22, 1, .36, 1) both; }
.lwcc .lwcc__cat:nth-child(2) { animation-delay: .05s !important; }
.lwcc .lwcc__cat:nth-child(3) { animation-delay: .1s !important; }
.lwcc .lwcc__cat:nth-child(4) { animation-delay: .15s !important; }

/* plovoucí tlačítko vyskočí a občas jemně zavrtí */
.lwcc-fab:not([hidden]) { animation: lwcc-fab-in .55s cubic-bezier(.34, 1.56, .64, 1) both, lwcc-fab-nudge 6s ease-in-out 3s infinite; }

@keyframes lwcc-in     { from { opacity: var(--lwcc-o); transform: var(--lwcc-from); } to { opacity: 1; transform: none; } }
@keyframes lwcc-out    { from { opacity: 1; transform: none; } to { opacity: var(--lwcc-o); transform: var(--lwcc-from); } }
@keyframes lwcc-bounce { 0% { transform: translateY(120%); } 55% { transform: translateY(-14px); } 75% { transform: translateY(5px); } 90% { transform: translateY(-2px); } 100% { transform: none; } }
@keyframes lwcc-roll   { from { opacity: 0; transform: translateX(-60px) rotate(-300deg) scale(.4); } to { opacity: 1; transform: none; } }
@keyframes lwcc-wiggle { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-16deg); } 45% { transform: rotate(14deg); } 70% { transform: rotate(-8deg); } }
@keyframes lwcc-rise   { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes lwcc-fab-in { from { opacity: 0; transform: scale(0) rotate(-180deg); } to { opacity: 1; transform: none; } }
@keyframes lwcc-fab-nudge { 0%, 92%, 100% { transform: none; } 94% { transform: rotate(-12deg); } 96% { transform: rotate(10deg); } 98% { transform: rotate(-5deg); } }

/* ===== rozložení ===== */
@media (min-width: 761px) {
	.lwcc--bar .lwcc__inner { display: grid; grid-template-columns: 1fr auto; column-gap: 24px; align-items: center; }
	.lwcc--bar .lwcc__head { grid-column: 1; }
	.lwcc--bar .lwcc__text { grid-column: 1; margin-bottom: 0; }
	.lwcc--bar .lwcc__prefs { grid-column: 1 / -1; grid-row: 3; margin-top: 14px; }
	.lwcc--bar .lwcc__buttons { grid-column: 2; grid-row: 1 / span 2; }
}
@media (max-width: 520px) {
	.lwcc--box.lwcc--left, .lwcc--box.lwcc--right { left: 10px; right: 10px; bottom: 10px; width: auto; }
	.lwcc[data-anim="slide"].lwcc--box.lwcc--left, .lwcc[data-anim="slide"].lwcc--box.lwcc--right { --lwcc-from: translateY(110%); }
	.lwcc__btn { flex: 1 1 100%; }
}

/* ===== přístupnost: respektuj "omezit pohyb" ===== */
@media (prefers-reduced-motion: reduce) {
	.lwcc, .lwcc *, .lwcc-fab { animation: none !important; transition: none !important; }
}
