/* ============================================================
   ELEGANTNÍ MYTÍ — Cookie consent (GDPR)
   Self-contained styling. Dědí paletu z styles.css (CSS vars),
   ale funguje i samostatně díky fallback hodnotám.
   Prefix .em-cc-* aby nekolidoval s webem.
   ============================================================ */

.em-cc-root{
  /* lokální aliasy s fallbackem na brand tokeny z styles.css */
  --emcc-navy:   var(--navy-900, #0F2141);
  --emcc-blue:   var(--blue-600, #2361AD);
  --emcc-gold:   var(--gold-500, #F9B233);
  --emcc-gold-2: var(--gold-600, #F5A81C);
  --emcc-muted:  var(--muted, #5B6B82);
  --emcc-line:   var(--line, rgba(19,42,77,.12));
  --emcc-radius: var(--radius, 20px);
  --emcc-shadow: var(--shadow-md, 0 12px 36px rgba(15,33,65,.12));
  --emcc-font-head: var(--font-head, 'Montserrat', system-ui, sans-serif);
  --emcc-font-body: var(--font-body, 'Nunito', system-ui, sans-serif);
  --emcc-bg: #ffffff;
}

/* ---------- Banner / dialog ---------- */
.em-cc-banner{
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translate(-50%, 130%);
  width: min(760px, calc(100% - 28px));
  z-index: 1300;                 /* nad headerem (1002) i msticky (999) */
  background: var(--emcc-bg);
  color: var(--emcc-navy);
  border: 1px solid var(--emcc-line);
  border-radius: var(--emcc-radius);
  box-shadow: 0 20px 60px rgba(15,33,65,.22), var(--emcc-shadow);
  padding: 20px 22px;
  font-family: var(--emcc-font-body);
  font-size: 15px;
  line-height: 1.6;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: transform .38s cubic-bezier(.22,.61,.36,1), opacity .3s ease, visibility .38s;
}
.em-cc-banner.is-open{
  transform: translate(-50%, 0);
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.em-cc-title{
  display: block;
  font-family: var(--emcc-font-head);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--emcc-navy);
  margin-bottom: 6px;
  letter-spacing: -.01em;
}
.em-cc-banner p{
  color: var(--emcc-muted);
  font-size: .92rem;
  margin: 0;
}
.em-cc-banner a.em-cc-inline{
  color: var(--emcc-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- Views ---------- */
.em-cc-view[hidden]{ display: none; }

.em-cc-view--compact{
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}
.em-cc-view--compact .em-cc-text{ flex: 1 1 300px; min-width: 240px; }

/* ---------- Actions ---------- */
.em-cc-actions{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.em-cc-actions--settings{ margin-top: 18px; }

.em-cc-btn{
  font-family: var(--emcc-font-head);
  font-weight: 700;
  font-size: .92rem;
  border: 0;
  border-radius: 12px;
  padding: 12px 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .18s cubic-bezier(.22,.61,.36,1), box-shadow .18s ease, background .18s ease;
}
.em-cc-btn:focus-visible{
  outline: 3px solid var(--emcc-blue);
  outline-offset: 2px;
}
.em-cc-btn--primary{
  background: linear-gradient(135deg, #FFC44D, var(--emcc-gold-2));
  color: var(--emcc-navy);
  box-shadow: 0 10px 26px rgba(245,168,28,.34);
}
.em-cc-btn--primary:hover{ transform: translateY(-1px); box-shadow: 0 14px 32px rgba(245,168,28,.42); }
.em-cc-btn--ghost{
  background: transparent;
  color: var(--emcc-navy);
  border: 1.5px solid var(--emcc-line);
}
.em-cc-btn--ghost:hover{ border-color: var(--emcc-navy); background: rgba(15,33,65,.03); }

.em-cc-link{
  background: none;
  border: 0;
  padding: 8px 6px;
  cursor: pointer;
  font-family: var(--emcc-font-head);
  font-weight: 700;
  font-size: .88rem;
  color: var(--emcc-blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.em-cc-link:hover{ color: var(--emcc-navy); }
.em-cc-link:focus-visible{ outline: 3px solid var(--emcc-blue); outline-offset: 2px; border-radius: 6px; }

/* ---------- Settings: category rows ---------- */
.em-cc-settings-head{ margin-bottom: 4px; }

.em-cc-cats{
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.em-cc-cat{
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 2px;
  border-top: 1px solid var(--emcc-line);
}
.em-cc-cat:first-child{ border-top: 0; }
.em-cc-cat__info{ flex: 1; }
.em-cc-cat__name{
  display: block;
  font-family: var(--emcc-font-head);
  font-weight: 700;
  font-size: .95rem;
  color: var(--emcc-navy);
  margin-bottom: 2px;
}
.em-cc-cat__desc{
  color: var(--emcc-muted);
  font-size: .84rem;
  line-height: 1.5;
}

/* ---------- Switch (role=switch button) ---------- */
.em-cc-switch{
  position: relative;
  flex: 0 0 auto;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  border: 0;
  background: #cdd6e2;
  cursor: pointer;
  padding: 0;
  transition: background .22s ease;
}
.em-cc-switch__knob{
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(15,33,65,.28);
  transition: transform .22s cubic-bezier(.22,.61,.36,1);
}
.em-cc-switch[aria-checked="true"]{
  background: linear-gradient(135deg, var(--emcc-gold), var(--emcc-gold-2));
}
.em-cc-switch[aria-checked="true"] .em-cc-switch__knob{ transform: translateX(20px); }
.em-cc-switch:focus-visible{ outline: 3px solid var(--emcc-blue); outline-offset: 3px; }
.em-cc-switch[aria-disabled="true"]{
  cursor: not-allowed;
  opacity: .85;
  background: linear-gradient(135deg, #b9c4d4, #aab6c9);
}

/* ---------- Floating reopen control (bottom-left, tiny) ---------- */
.em-cc-reopen{
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 900;                  /* pod sticky CTA (msticky = 999) */
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--emcc-font-head);
  font-weight: 700;
  font-size: .78rem;
  color: var(--emcc-navy);
  background: rgba(255,255,255,.94);
  border: 1px solid var(--emcc-line);
  border-radius: 999px;
  padding: 8px 13px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(15,33,65,.14);
  backdrop-filter: blur(6px);
  opacity: .82;
  transition: opacity .2s ease, transform .2s ease, box-shadow .2s ease;
}
.em-cc-reopen:hover{ opacity: 1; transform: translateY(-1px); box-shadow: 0 10px 24px rgba(15,33,65,.2); }
.em-cc-reopen:focus-visible{ outline: 3px solid var(--emcc-blue); outline-offset: 2px; opacity: 1; }
.em-cc-reopen[hidden]{ display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 560px){
  .em-cc-banner{ padding: 18px 16px; bottom: 12px; }
  .em-cc-view--compact{ gap: 14px; }
  .em-cc-actions{ width: 100%; }
  .em-cc-view--compact .em-cc-btn{ flex: 1 1 auto; }
  .em-cc-view--compact .em-cc-link{ flex: 1 0 100%; text-align: center; }
}

/* posuň plovoucí tlačítko NAD mobilní sticky lištu (#msticky), ať se nepřekrývají */
@media (max-width: 820px){
  .em-cc-reopen{ bottom: calc(78px + env(safe-area-inset-bottom)); }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce){
  .em-cc-banner,
  .em-cc-btn,
  .em-cc-switch,
  .em-cc-switch__knob,
  .em-cc-reopen{
    transition: none !important;
  }
  .em-cc-banner{ transform: translate(-50%, 0); }
  .em-cc-banner:not(.is-open){ transform: translate(-50%, 0); }
}
