/* =========================================================
   Kariérna nahlodávačka — cookies consent
   Samostatný modul, nezávislý od zvyšku style.css.
   Používa vlastný namespace .cc- aby sa nezrážal s ničím iným.
   ========================================================= */

.cc,
.cc *,
.cc *::before,
.cc *::after {
  box-sizing: border-box;
}

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

.cc {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  font-family: 'Space Grotesk', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: #101418;
}

.cc__overlay {
  position: absolute;
  inset: 0;
  background: rgba(16, 20, 24, 0.55);
  backdrop-filter: blur(2px);
}

.cc__modal {
  position: relative;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  width: 100%;
  max-width: 640px;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  outline: 0;
}

/* ---------- Hlavička s logom + oddeľovacia čiara ---------- */
.cc__header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid #e5e7ea;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cc__logo {
  display: block;
  height: 36px;
  width: auto;
}

/* ---------- Taby — rozdelené rovnomerne na plnú šírku ---------- */
.cc__tabs {
  display: flex;
  gap: 0;
  padding: 0;
  border-bottom: 1px solid #e5e7ea;
  flex-wrap: nowrap;
}
.cc__tab {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 14px 6px;
  margin-bottom: -1px;
  color: #6b7078;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  line-height: 1.2;
  flex: 1 1 0;
  text-align: center;
}
.cc__tab:hover { color: #101418; }
.cc__tab.is-active {
  color: #FF6600;
  border-bottom-color: #FF6600;
}
.cc__tab:focus-visible {
  outline: 2px solid #0073FF;
  outline-offset: 4px;
  border-radius: 4px;
}

/* ---------- Telo (rolovateľné) ---------- */
.cc__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 20px 28px 8px;
  -webkit-overflow-scrolling: touch;
}
.cc__panel { margin: 0; }
.cc__panel[hidden] { display: none; }

.cc__title {
  margin: 0 0 12px;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
}
.cc__text {
  margin: 0 0 18px;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: #333a42;
}
.cc__text a { color: #0073FF; text-decoration: underline; }

/* ---------- Kategórie v tabe Súhlas — prepínače so štítkom vľavo ---------- */
.cc__categories {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 8px;
}
.cc__cat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 4px;
  border-bottom: 1px solid #f0f2f4;
  font-size: 1rem;
  font-weight: 500;
  color: #101418;
}
.cc__cat:last-child { border-bottom: 0; }
.cc__cat__label { flex: 1; }

/* ---------- Rozbaľovacie detaily ---------- */
.cc__detail {
  border: 1px solid #e5e7ea;
  border-radius: 10px;
  margin-bottom: 8px;
  background: #fff;
}
.cc__detail[open] { border-color: #d0d4d9; }
.cc__detail summary {
  list-style: none;
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 0.95rem;
}
.cc__detail summary::-webkit-details-marker { display: none; }
.cc__detail summary::before {
  content: "";
  width: 10px;
  height: 10px;
  border-right: 2px solid #6b7078;
  border-bottom: 2px solid #6b7078;
  transform: rotate(-45deg);
  transition: transform 0.15s;
  margin-right: 2px;
  flex-shrink: 0;
}
.cc__detail[open] summary::before {
  transform: rotate(45deg);
}
.cc__detail summary:focus-visible {
  outline: 2px solid #0073FF;
  outline-offset: -2px;
  border-radius: 8px;
}
.cc__detail__label {
  flex: 1;
}
.cc__detail__body {
  padding: 0 16px 14px;
  font-size: 0.9rem;
  line-height: 1.55;
  color: #444;
}
.cc__detail__body p { margin: 0; }

/* Zoznam cookies v detaile kategórie */
.cc__cookies {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}
.cc__cookie {
  border-top: 1px solid #e5e7ea;
  padding: 10px 0;
}
.cc__cookie:last-child { padding-bottom: 0; }
.cc__cookie dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 2px 12px;
  margin: 0;
}
.cc__cookie dt {
  color: #6b7078;
  font-size: 0.85rem;
}
.cc__cookie dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.cc__cookie__name {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  font-weight: 600;
  color: #1a1d21;
}
.cc__detail__body .cc__note {
  margin-top: 10px;
  font-size: 0.85rem;
  color: #6b7078;
}
@media (max-width: 380px) {
  .cc__cookie dl { grid-template-columns: 1fr; gap: 0; }
  .cc__cookie dd + dt { margin-top: 4px; }
}

/* Prepínač (switch) v hlavičke detailu */
.cc__switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.cc__switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.cc__switch__ui {
  position: absolute;
  inset: 0;
  background: #cfd3d8;
  border-radius: 999px;
  transition: background 0.15s;
}
.cc__switch__ui::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.15s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.cc__switch input:checked + .cc__switch__ui {
  background: #FF6600;
}
.cc__switch input:checked + .cc__switch__ui::before {
  transform: translateX(18px);
}
.cc__switch input:disabled + .cc__switch__ui {
  background: #b9bdc2;
  cursor: not-allowed;
}
.cc__switch input:focus-visible + .cc__switch__ui {
  outline: 2px solid #0073FF;
  outline-offset: 2px;
}

/* ---------- Tlačidlá (spodná lišta) ---------- */
.cc__actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 16px 20px 22px;
  border-top: 1px solid #e5e7ea;
  background: #fff;
}
.cc__actions .cc__btn { width: 100%; }
@media (min-width: 720px) {
  .cc__actions {
    grid-template-columns: 1fr 1fr 1fr;
    padding: 16px 28px 22px;
    /* Poradie na desktope: Odmietnuť, Povoliť výber, Povoliť všetko (zľava doprava). */
  }
  .cc__actions .cc__btn:nth-child(1) { order: 3; }
  .cc__actions .cc__btn:nth-child(2) { order: 2; }
  .cc__actions .cc__btn:nth-child(3) { order: 1; }
}
.cc__btn {
  appearance: none;
  padding: 12px 14px;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  border: 2px solid #FF6600;
  transition: background 0.15s, color 0.15s, transform 0.05s;
  text-align: center;
  line-height: 1.2;
}
.cc__btn:hover { transform: translateY(-1px); }
.cc__btn:active { transform: translateY(0); }
.cc__btn:focus-visible {
  outline: 2px solid #0073FF;
  outline-offset: 2px;
}
.cc__btn--secondary {
  background: #ffffff;
  color: #FF6600;
}
.cc__btn--secondary:hover {
  background: #FFF3EB;
}
.cc__btn--primary {
  background: #FF6600;
  color: #ffffff;
}
.cc__btn--primary:hover {
  background: #E55A00;
  border-color: #E55A00;
}

/* ---------- Odkaz v pätičke (Nastavenia cookies) ---------- */
.footer__links a[data-cc-open] {
  cursor: pointer;
}

/* ---------- Mobilné rozloženie ---------- */
@media (max-width: 640px) {
  .cc { padding: 12px; align-items: flex-end; }
  .cc__modal { max-height: calc(100vh - 24px); border-radius: 14px; }
  .cc__header { padding: 16px 20px; }
  .cc__body { padding: 18px 20px 4px; }
  .cc__actions { padding: 14px 20px 18px; }
}
@media (max-width: 420px) {
  .cc { padding: 16px; }
  .cc__header { padding: 14px 16px; }
  .cc__body { padding: 14px 16px 4px; }
  .cc__actions { padding: 12px 16px 16px; }
  .cc__tab { font-size: 0.95rem; padding: 12px 4px; }
}

@media (max-width: 380px) {
  .cc__categories { grid-template-columns: 1fr; }
}

/* ---------- Prefers-reduced-motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .cc__btn,
  .cc__switch__ui,
  .cc__switch__ui::before,
  .cc__detail summary::before {
    transition: none;
  }
}
