/* ============================================================
   Arunda — Cookie consent bar
   Vrstva 1 (banner), Vrstva 2 (modal).
   Všetky štýly sú scoped pod #cc-root / .cc-* — nič neprepíše
   existujúce štýly stránky.
   Tokeny: Arunda DS v2 (colors.css, typography.css, effects.css).
   ============================================================ */

/* ---------- Shared button base (scoped, no conflict with ar-btn) ---------- */
.cc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  line-height: 1;
  letter-spacing: var(--tracking-tight);
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.cc-btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* Primary — red fill (Prijať všetko) */
.cc-btn-primary {
  background: var(--action-bg);
  color: var(--action-fg);
  border-color: var(--action-bg);
}
.cc-btn-primary:hover {
  background: var(--action-bg-hover);
  border-color: var(--action-bg-hover);
}
.cc-btn-primary:active {
  background: var(--action-bg-active);
  border-color: var(--action-bg-active);
}

/* Outline — equal weight on dark background (Odmietnuť) */
.cc-btn-outline {
  background: transparent;
  color: var(--paper-0);
  border-color: var(--grey-4);
}
.cc-btn-outline:hover {
  border-color: var(--paper-0);
  color: var(--paper-0);
}

/* Ghost — text-only small (Nastavenia) */
.cc-btn-ghost {
  background: transparent;
  color: var(--grey-4);
  border-color: transparent;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  padding: 9px 10px;
}
.cc-btn-ghost:hover {
  color: var(--paper-0);
}

/* ---------- Vrstva 1: spodná lišta ---------- */
#cc-root .cc-banner {
  position: fixed;
  left: clamp(12px, 3vw, 24px);
  right: clamp(12px, 3vw, 24px);
  bottom: clamp(12px, 3vw, 20px);
  z-index: 1000;
  background: var(--surface-inverse);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  animation: cc-slide-up 0.28s ease;
}
#cc-root .cc-banner[hidden] { display: none; }

#cc-root .cc-banner__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 18px clamp(16px, 3vw, 28px);
  max-width: 1100px;
  margin: 0 auto;
  flex-wrap: wrap;
}
#cc-root .cc-banner__text {
  flex: 1 1 280px;
  min-width: 0;
}
#cc-root .cc-banner__title {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--paper-0);
  margin: 0 0 5px;
}
#cc-root .cc-banner__desc {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--grey-4);
  margin: 0;
}
#cc-root .cc-banner__desc a {
  color: var(--red-300);
  text-decoration: underline;
}
#cc-root .cc-banner__desc a:hover {
  color: var(--paper-0);
}

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

/* ---------- Vrstva 2: modal ---------- */
#cc-root .cc-modal {
  position: fixed;
  inset: 0;
  z-index: 1010;
}
#cc-root .cc-modal[hidden] { display: none; }

#cc-root .cc-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(22, 25, 27, 0.72);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: cc-fade 0.2s ease;
}
#cc-root .cc-modal__dialog {
  position: relative;
  width: min(520px, calc(100vw - 2 * clamp(12px, 3vw, 24px)));
  max-height: calc(100dvh - 64px);
  margin: 32px auto;
  display: flex;
  flex-direction: column;
  background: var(--surface-inverse);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: cc-slide-up 0.28s ease;
}

#cc-root .cc-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  flex: none;
}
#cc-root .cc-modal__title {
  font-family: var(--font-display);
  font-size: var(--text-h5);
  font-weight: var(--weight-bold);
  color: var(--paper-0);
  margin: 0;
  letter-spacing: var(--tracking-tight);
}
#cc-root .cc-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  cursor: pointer;
  border-radius: var(--radius-sm);
  color: var(--grey-5);
  font-size: 16px;
  font-family: var(--font-sans);
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
#cc-root .cc-modal__close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--paper-0);
  border-color: var(--grey-4);
}
#cc-root .cc-modal__close:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

#cc-root .cc-modal__body {
  padding: 18px 24px;
  overflow-y: auto;
  flex: 1 1 auto;
}
#cc-root .cc-modal__intro {
  font-size: var(--text-sm);
  color: var(--grey-4);
  margin: 0 0 20px;
  line-height: var(--leading-normal);
}
#cc-root .cc-modal__intro a {
  color: var(--red-300);
  text-decoration: underline;
}
#cc-root .cc-modal__intro a:hover {
  color: var(--paper-0);
}

/* ---------- Kategórie ---------- */
#cc-root .cc-cat {
  padding: 16px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
#cc-root .cc-cat:first-of-type {
  border-top: none;
  padding-top: 0;
}
#cc-root .cc-cat__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
#cc-root .cc-cat__label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
#cc-root .cc-cat__name {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--paper-0);
}
#cc-root .cc-cat__badge {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: rgba(228, 20, 22, 0.18);
  color: var(--red-300);
  white-space: nowrap;
}
#cc-root .cc-cat__desc {
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--grey-5);
  margin: 6px 0 0;
}

/* ---------- Switch (toggle) ---------- */
#cc-root .cc-switch {
  position: relative;
  display: inline-block;
  flex: none;
  width: 44px;
  height: 24px;
  cursor: pointer;
}
#cc-root .cc-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
#cc-root .cc-switch__track {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-pill);
  background: var(--grey-6);
  transition: background 0.2s ease;
}
#cc-root .cc-switch__track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--paper-2);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease;
}
#cc-root .cc-switch input:checked + .cc-switch__track {
  background: var(--action-bg);
}
#cc-root .cc-switch input:checked + .cc-switch__track::after {
  transform: translateX(20px);
}
#cc-root .cc-switch input:focus-visible + .cc-switch__track {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
#cc-root .cc-switch--locked {
  cursor: not-allowed;
  opacity: 0.75;
}

/* ---------- Modal footer ---------- */
#cc-root .cc-modal__foot {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(0, 0, 0, 0.18);
  flex: none;
}

/* ---------- Animácie ---------- */
@keyframes cc-slide-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes cc-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

/* ---------- Mobil ---------- */
@media (max-width: 600px) {
  #cc-root .cc-banner__inner {
    padding: 14px 16px;
    gap: 14px;
  }
  #cc-root .cc-banner__actions {
    width: 100%;
    flex-wrap: wrap;
  }
  #cc-root .cc-banner__actions .cc-btn-primary,
  #cc-root .cc-banner__actions .cc-btn-outline {
    flex: 1 1 0;
    min-width: 0;
  }
  #cc-root .cc-banner__actions .cc-btn-ghost {
    width: 100%;
    text-align: center;
  }
  #cc-root .cc-modal__foot {
    flex-wrap: wrap;
  }
  #cc-root .cc-modal__foot .cc-btn {
    flex: 1 1 0;
    justify-content: center;
  }
}
