/* ==========================================================================
   TOKAMA CookieBanner – Styles (namespaced)
   Datei: /assets/cookiebanner/cookiebanner.css
   Hinweis: Corporate-Variablen in cookiebanner_brand.css
   ========================================================================== */

/* Namespace reset-ish */
.tokama-cb, .tokama-cb *{
  box-sizing: border-box;
  font-family: var(--tokama-cb-font);
}

/* Backdrop */
.tokama-cb-backdrop{
  position: fixed;
  inset: 0;
  background: var(--tokama-cb-backdrop);
  backdrop-filter: blur(var(--tokama-cb-blur));
  -webkit-backdrop-filter: blur(var(--tokama-cb-blur));
  z-index: 2147483646;
}

/* Banner container */
.tokama-cb-banner{
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 14px;
  width: min(980px, calc(100vw - 24px));
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01)) , var(--tokama-cb-surface);
  border: 1px solid var(--tokama-cb-border);
  border-radius: var(--tokama-cb-radius-lg);
  box-shadow: var(--tokama-cb-shadow);
  overflow: hidden;
  z-index: 2147483647;
}

/* Header */
.tokama-cb-banner__inner{
  padding: 18px 18px 14px 18px;
}

.tokama-cb-title{
  margin: 0 0 6px 0;
  font-size: var(--tokama-cb-title-size);
  font-weight: 650;
  color: var(--tokama-cb-text);
}

.tokama-cb-text{
  margin: 0;
  font-size: var(--tokama-cb-text-size);
  line-height: 1.45;
  color: var(--tokama-cb-muted);
}

/* Links row */
.tokama-cb-links{
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

.tokama-cb-links a{
  color: var(--tokama-cb-link);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
  opacity: 0.95;
}

.tokama-cb-links a:hover{ opacity: 1; }

/* Divider */
.tokama-cb-divider{
  height: 1px;
  background: var(--tokama-cb-divider);
  opacity: 1;
}

/* Buttons row */
.tokama-cb-actions{
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  padding: 14px 18px 18px 18px;
}

@media (max-width: 720px){
  .tokama-cb-actions{
    grid-template-columns: 1fr;
  }
}

/* Buttons */
.tokama-cb-btn{
  width: 100%;
  appearance: none;
  border: 1px solid var(--tokama-cb-btn-border);
  background: var(--tokama-cb-btn-bg);
  color: var(--tokama-cb-btn-text);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform .06s ease,
    background .15s ease,
    border-color .15s ease,
    opacity .15s ease,
    box-shadow .15s ease,
    filter .15s ease;
}

.tokama-cb-btn:hover{
  background: var(--tokama-cb-btn-bg-hover);
}

.tokama-cb-btn:active{
  transform: translateY(1px);
}

/* Deutlich sichtbarer Fokus (Tastatur/Accessibility) */
.tokama-cb-btn:focus-visible{
  outline: none;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.18);
}

/* PRIMARY-Button im Banner: letzter Button = "Alle akzeptieren" (dezenter) */
.tokama-cb-actions .tokama-cb-btn:last-child{
  background: linear-gradient(180deg, rgba(255,255,255,0.14), rgba(255,255,255,0.06));
  border-color: rgba(255,255,255,0.26);
  box-shadow:
    0 6px 16px rgba(0,0,0,0.38),
    0 0 0 1px rgba(255,255,255,0.06) inset;
  filter: saturate(1.02);
}

.tokama-cb-actions .tokama-cb-btn:last-child:hover{
  background: linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.08));
  border-color: rgba(255,255,255,0.32);
}

.tokama-cb-actions .tokama-cb-btn:last-child:active{
  transform: translateY(1px);
}


/* Modal */
.tokama-cb-modal{
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(920px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01)) , var(--tokama-cb-surface);
  border: 1px solid var(--tokama-cb-border);
  border-radius: var(--tokama-cb-radius-lg);
  box-shadow: var(--tokama-cb-shadow);
  overflow: hidden;
  z-index: 2147483647;
}

.tokama-cb-modal__header{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 18px 10px 18px;
}

.tokama-cb-modal__title{
  margin: 0;
  font-size: 20px;
  font-weight: 650;
  color: var(--tokama-cb-text);
}

.tokama-cb-modal__close{
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--tokama-cb-btn-border);
  background: var(--tokama-cb-btn-bg);
  cursor: pointer;

  /* Exaktes Zentrieren */
  display: flex;
  align-items: center;
  justify-content: center;

  /* "×" verstecken (falls im HTML vorhanden) */
  font-size: 0;
  line-height: 0;
  color: transparent;

  position: relative;
}

.tokama-cb-modal__close::before{
  content: "";
  width: 18px;
  height: 18px;
  display: block;

  /* PNG Fallback */
  background: url("./close_512dp_E3E3E3.png") center / contain no-repeat;

  /* WebP wenn unterstützt */
  background-image: image-set(
    url("./close_512dp_E3E3E3.webp") type("image/webp"),
    url("./close_512dp_E3E3E3.png") type("image/png")
  );
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.tokama-cb-modal__close:hover{
  background: var(--tokama-cb-btn-bg-hover);
}


.tokama-cb-modal__body{
  padding: 0 0 6px 0;
  overflow: auto;
  max-height: calc(100vh - 170px);
}

.tokama-cb-row{
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  padding: 14px 18px;
}

.tokama-cb-row__title{
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  color: var(--tokama-cb-text);
}

.tokama-cb-row__desc{
  margin: 6px 0 0 0;
  font-size: 13px;
  color: var(--tokama-cb-muted);
  line-height: 1.35;
}

/* Right side (label + switch) */
.tokama-cb-row__right{
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 150px;
  justify-content: flex-end;
}

.tokama-cb-rightlabel{
  color: var(--tokama-cb-muted);
  font-size: 13px;
  white-space: nowrap;
}

/* Switch (custom) */
.tokama-cb-switch{
  position: relative;
  width: 48px;
  height: 26px;
  border-radius: 999px;
  background: var(--tokama-cb-switch-track-off);
  border: 1px solid var(--tokama-cb-border);
  cursor: pointer;
  transition: background .15s ease;
}

.tokama-cb-switch[data-on="1"]{
  background: var(--tokama-cb-switch-track-on);
}

.tokama-cb-switch::after{
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--tokama-cb-switch-knob);
  transition: transform .15s ease;
}

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

/* Modal footer */
.tokama-cb-modal__footer{
  padding: 14px 18px 18px 18px;
}

.tokama-cb-modal__actions{
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

@media (max-width: 720px){
  .tokama-cb-modal__actions{
    grid-template-columns: 1fr;
  }
}

/* Re-open button */
.tokama-cb-reopen{
  display: none;
  
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 2147483645;
  border: 1px solid var(--tokama-cb-btn-border);
  background: var(--tokama-cb-btn-bg);
  color: var(--tokama-cb-btn-text);
  border-radius: 999px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  opacity: 0.92;
  box-shadow: 0 12px 30px rgba(0,0,0,0.45);
}

.tokama-cb-reopen:hover{
  background: var(--tokama-cb-btn-bg-hover);
  opacity: 1;
}

.tokama-cb-hidden{ display:none !important; }