/* ============================================================
   Cookie consent — zladené s PrestaServer Design System tokenmi.
   Vrstva 1 (banner), Vrstva 2 (modal), plávajúce tlačidlo (FAB).
   Dark-mode funguje automaticky cez DS tokeny (--surface-card atď.).
   ============================================================ */

/* ---------- Vrstva 1: spodná lišta ---------- */
.cc-banner {
  position: fixed;
  left: var(--space-4);
  right: var(--space-4);
  bottom: var(--space-4);
  z-index: 1000;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: cc-slide-up 0.28s ease;
}
.cc-banner[hidden] { display: none; }

.cc-banner__inner {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  padding: var(--space-5) var(--space-6);
  max-width: 1100px;
  margin: 0 auto;
  flex-wrap: wrap;
}
.cc-banner__text { flex: 1 1 320px; min-width: 0; }
.cc-banner__title {
  font-size: var(--size-body);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin: 0 0 4px;
}
.cc-banner__desc {
  font-size: var(--size-small);
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0;
}
.cc-banner__desc a { color: var(--text-link); text-decoration: underline; }

.cc-banner__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: 0 0 auto;
  flex-wrap: wrap;
}
/* Prijať a Odmietnuť rovnako veľké (EDPB/ÚREKaPS: rovnocenné na prvej vrstve) */
.cc-banner__actions .btn--primary,
.cc-banner__actions .btn--secondary { min-width: 150px; justify-content: center; }

/* ---------- Vrstva 2: modal ---------- */
.cc-modal { position: fixed; inset: 0; z-index: 1010; }
.cc-modal[hidden] { display: none; }
.cc-modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(15, 17, 23, 0.55);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  animation: cc-fade 0.2s ease;
}
.cc-modal__dialog {
  position: relative;
  width: min(520px, calc(100vw - 2 * var(--space-4)));
  max-height: calc(100vh - 2 * var(--space-8));
  margin: var(--space-8) auto;
  display: flex; flex-direction: column;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: cc-slide-up 0.28s ease;
}
.cc-modal__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
}
.cc-modal__title { font-size: var(--size-body-lg); font-weight: var(--weight-bold); color: var(--text-primary); margin: 0; }
.cc-modal__close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex: none;
  border: none; background: transparent; cursor: pointer;
  border-radius: var(--radius-sm); color: var(--text-secondary);
}
.cc-modal__close:hover { background: var(--color-bg-alt); color: var(--text-primary); }
.cc-modal__close .ico { width: 18px; height: 18px; }

.cc-modal__body { padding: var(--space-5) var(--space-6); overflow-y: auto; }
.cc-modal__intro { font-size: var(--size-small); color: var(--text-secondary); margin: 0 0 var(--space-5); line-height: 1.5; }

.cc-cat { padding: var(--space-4) 0; border-top: 1px solid var(--border-subtle); }
.cc-cat:first-of-type { border-top: none; padding-top: 0; }
.cc-cat__row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.cc-cat__label { display: flex; align-items: center; gap: var(--space-3); }
.cc-cat__name { font-size: var(--size-body); font-weight: var(--weight-semibold); color: var(--text-primary); }
.cc-cat__badge {
  font-size: 11px; font-weight: var(--weight-medium);
  padding: 2px 8px; border-radius: var(--radius-full);
  background: var(--interactive-tint); color: var(--brand-primary);
}
.cc-cat__desc { font-size: var(--size-small); line-height: 1.5; color: var(--text-secondary); margin: 6px 0 0; }

/* ---------- Switch (toggle) ---------- */
.cc-switch { position: relative; display: inline-block; flex: none; width: 44px; height: 24px; cursor: pointer; }
.cc-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.cc-switch__track {
  position: absolute; inset: 0; border-radius: var(--radius-full);
  background: var(--border-subtle); transition: background 0.2s ease;
}
.cc-switch__track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  transition: transform 0.2s ease;
}
.cc-switch input:checked + .cc-switch__track { background: var(--brand-primary); }
.cc-switch input:checked + .cc-switch__track::after { transform: translateX(20px); }
.cc-switch input:focus-visible + .cc-switch__track { box-shadow: var(--shadow-focus-ring); }
.cc-switch--locked { cursor: not-allowed; opacity: 0.85; }

.cc-modal__foot {
  display: flex; gap: var(--space-3); justify-content: flex-end;
  padding: var(--space-5) var(--space-6);
  border-top: 1px solid var(--border-subtle);
  background: var(--color-bg-alt);
}

/* ---------- Plávajúce tlačidlo (trvalé odvolanie) ---------- */
.cc-fab {
  position: fixed; left: var(--space-4); bottom: var(--space-4); z-index: 990;
  width: 44px; height: 44px; border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle); background: var(--surface-card);
  box-shadow: var(--shadow-card-hover); cursor: pointer;
  font-size: 20px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 0.15s ease;
}
.cc-fab[hidden] { display: none; }
.cc-fab:hover { transform: translateY(-2px); }

/* Footer "Nastavenia cookies" — vyzerá ako footer link */
.footer-link-btn {
  background: none; border: none; padding: 0; cursor: pointer;
  font: inherit; color: var(--text-secondary); text-decoration: underline;
}
.footer-link-btn:hover { color: var(--brand-primary); }

@keyframes cc-slide-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes cc-fade { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .cc-banner, .cc-modal__dialog, .cc-modal__backdrop, .cc-fab { animation: none; transition: none; }
}

/* ---------- Mobil ---------- */
@media (max-width: 640px) {
  .cc-banner__inner { padding: var(--space-4); gap: var(--space-4); }
  .cc-banner__actions { width: 100%; }
  .cc-banner__actions .btn--primary,
  .cc-banner__actions .btn--secondary { flex: 1 1 0; min-width: 0; }
  .cc-banner__actions .btn--ghost { width: 100%; }
  .cc-modal__foot .btn { flex: 1 1 0; justify-content: center; }
}
