/* Tridiora Cookie Consent (global, non-skippable) */
:root{
  --cc-z: 9999;
}

body.cc-locked{
  overflow: hidden !important;
  touch-action: none;
}

/* full-screen blocker */
.cc-backdrop{
  position: fixed;
  inset: 0;
  z-index: var(--cc-z);
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  /* Important for mobile: allow the backdrop to scroll if the modal is taller than the viewport */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  align-items: center;
  justify-content: center;
}

body.cc-locked .cc-backdrop{ display:flex; }

.cc-modal{
  /* Centered via flex on the backdrop */
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  width: min(720px, 100%);
  border-radius: 22px;
  background: rgba(18, 22, 35, .78);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 24px 80px rgba(0,0,0,.55);
  padding: 18px;
  /* Never exceed viewport height; content can scroll inside */
  max-height: calc(100vh - 32px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.cc-header{
  display:flex;
  gap:14px;
  align-items:flex-start;
  justify-content:space-between;
}

.cc-title{
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: .2px;
  margin: 0 0 6px 0;
}

.cc-desc{
  margin: 0;
  opacity: .88;
  line-height: 1.45;
  font-size: .98rem;
}

.cc-badge{
  font-size: .8rem;
  opacity: .9;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  white-space: nowrap;
}

.cc-body{
  margin-top: 14px;
  display: grid;
  gap: 10px;
  /* Make the body scrollable on small screens */
  overflow: auto;
  padding-right: 2px;
}

.cc-row{
  display:flex;
  gap: 12px;
  align-items:center;
  justify-content: space-between;
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
}

.cc-row h4{
  margin: 0 0 2px 0;
  font-size: .98rem;
  font-weight: 750;
}

.cc-row p{
  margin: 0;
  opacity: .82;
  font-size: .92rem;
  line-height: 1.35;
}

.cc-actions{
  margin-top: 14px;
  display:flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  /* Keep actions reachable even when body scrolls */
  position: sticky;
  bottom: 0;
  padding-top: 12px;
  background: linear-gradient(180deg, rgba(18,22,35,0), rgba(18,22,35,.78) 32%, rgba(18,22,35,.86));
}

.cc-actions .btn{
  min-width: 160px;
}

.cc-fine{
  margin-top: 10px;
  opacity: .75;
  font-size: .84rem;
  line-height: 1.35;
}

.cc-toggle{
  display:flex;
  align-items:center;
  gap:10px;
  flex: 0 0 auto;
}

.cc-switch{
  position: relative;
  width: 52px;
  height: 30px;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.14);
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}

.cc-switch::after{
  content:"";
  position:absolute;
  left: 4px;
  top: 4px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255,255,255,.88);
  transform: translateX(0);
  transition: transform .2s ease;
}

.cc-switch[data-on="1"]{
  background: rgba(255,255,255,.22);
  border-color: rgba(255,255,255,.22);
}

.cc-switch[data-on="1"]::after{
  transform: translateX(22px);
}

.cc-switch[aria-disabled="true"]{
  opacity: .55;
  cursor: not-allowed;
}

.cc-divider{
  height: 1px;
  background: rgba(255,255,255,.10);
  margin: 12px 0 6px 0;
}

/* Floating Cookie Icon (always available) */
.cc-fab{
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: calc(var(--cc-z) - 1);
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(18, 22, 35, .65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 14px 40px rgba(0,0,0,.38);
  display: grid;
  place-items: center;
  cursor: pointer;
  user-select: none;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.cc-fab:hover{
  transform: translateY(-2px);
  background: rgba(18, 22, 35, .78);
  border-color: rgba(255,255,255,.22);
}

.cc-fab:active{ transform: translateY(0); }

.cc-fab span{
  font-size: 20px;
  line-height: 1;
}

/* If consent modal is currently locking the page, keep the FAB visible but above content */
body.cc-locked .cc-fab{
  z-index: calc(var(--cc-z) + 1);
}

@media (max-width: 520px){
  .cc-fab{ right: 12px; bottom: 12px; width: 46px; height: 46px; }
  .cc-modal{ padding: 14px; border-radius: 18px; }
  .cc-actions{ justify-content: stretch; }
  .cc-actions .btn{ width: 100%; min-width: 0; }
}

/* Performance: Blur über den ganzen Viewport ist auf Mobil-GPUs teuer. */
@media (max-width: 900px), (hover: none), (pointer: coarse){
  .cc-backdrop,
  .cc-fab{
    backdrop-filter:none !important;
    -webkit-backdrop-filter:none !important;
  }
  .cc-backdrop{ background:rgba(0,0,0,.72); }
  .cc-modal{ background:rgba(18,22,35,.97); box-shadow:0 16px 44px rgba(0,0,0,.45); }
  .cc-fab{ background:rgba(18,22,35,.94); }
}
html.perf-low .cc-backdrop,
html.perf-low .cc-fab{
  backdrop-filter:none !important;
  -webkit-backdrop-filter:none !important;
}
