/* =======================================================================
   TMT Cookie Consent – clean baseline
   - Black-ish strip under header, centered content
   - Dark modal sheet with aligned toggles & equal-width buttons
   - No native checkbox “checkmark” visible
   ======================================================================= */

:root {
  --cc-offset: 0px; /* set by JS based on header height */
}

/* ========= Top banner strip ========================================== */

#cc-banner {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--cc-offset);
  z-index: 2147483646;
  display: none; /* JS toggles this */
  margin: 0;
  padding: 0;
  background: rgba(0, 0, 0, 0.90);
  color: #fff;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

#cc-banner[hidden] {
  display: none !important;
}

/* Inner container, centered with max-width */

#cc-banner .cc-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  box-sizing: border-box;
}

#cc-banner p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
}

#cc-banner a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Actions: desktop – keep one row, no wrap */

#cc-banner .cc-actions {
  margin-left: auto;
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
}

#cc-banner .cc-btn {
  font-size: 0.9rem;
}

/* Mobile: 2 rows – row1: Settings + Reject, row2: Accept (full width) */

@media (max-width: 700px) {
  #cc-banner .cc-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  #cc-banner .cc-actions {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  #cc-open,
  #cc-reject-banner {
    flex: 0 1 auto;
  }

  #cc-accept-banner {
    flex: 0 0 100%;
    text-align: center;
  }
}

/* ========= Shared button styling ===================================== */

.cc-btn {
  appearance: none;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 0.45rem 0.85rem;
  background: rgba(12, 12, 12, 0.9);
  color: #fff;
  font-size: 0.9rem;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition:
    transform 0.1s ease,
    box-shadow 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.cc-btn.primary {
  background: #f5f5f5;
  color: #111;
  border-color: #f5f5f5;
}

.cc-btn.dark {
  background: #111;
  color: #fff;
  border-color: #444;
}

.cc-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
}

.cc-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

/* ========= Modal overlay & sheet ===================================== */

#cc-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
}

#cc-modal[aria-hidden="true"] {
  display: none;
  opacity: 0;
  visibility: hidden;
}

#cc-modal[aria-hidden="false"],
#cc-modal.show {
  display: block;
  opacity: 1;
  visibility: visible;
}

/* Dark backdrop */

#cc-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

/* The sheet itself */

.cc-sheet {
  position: fixed;
  left: 50%;
  top: var(--cc-offset);
  transform: translateX(-50%);
  width: min(620px, 100% - 2rem);
  margin: 0 auto;
  background: #111;
  color: #fff;
  border-radius: 20px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.6);
  max-height: calc(100vh - var(--cc-offset) - 2rem);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/* “Grip” bar at very top (mobile sheet look) */

.cc-grip {
  width: 52px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  margin: 0.6rem auto 0;
}

/* Header */

.cc-header {
  padding: 0.6rem 1.5rem 0.8rem;
}

.cc-header h2 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.cc-header .sub {
  margin: 0;
  font-size: 0.86rem;
  color: #d4d4d4;
}

/* Body (scrollable if needed) */

.cc-sheet .body {
  padding: 0.5rem 1.5rem 1rem;
  overflow-y: auto;
  flex: 1 1 auto;
  box-sizing: border-box;
}

/* Cards (each cookie category) */

.cc-card {
  background: #181818;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 0.85rem 1rem;
  margin-bottom: 0.7rem;
  display: block;
}

.cc-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.75rem;
}

.cc-row-between {
  justify-content: space-between;
}

.cc-card h3 {
  margin: 0 0 0.15rem;
  font-size: 0.94rem;
}

.cc-card p {
  margin: 0;
  font-size: 0.85rem;
  color: #e0e0e0;
}

/* ========= Toggle switch ============================================= */

.cc-toggle-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* Hide native checkbox: no visual checkmark */

.cc-toggle-wrap .cc-toggle-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
}

/* Visual toggle */

.cc-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: 42px;
  height: 22px;
  border-radius: 999px;
  background: #333;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  cursor: pointer;
  transition:
    background 0.18s ease,
    box-shadow 0.18s ease;
}

/* Knob */

.cc-toggle::before {
  content: "";
  position: absolute;
  left: 4px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #f5f5f5;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.55);
  transition: transform 0.18s ease;
}

/* Checked state */

.cc-toggle-input:checked + .cc-toggle {
  background: #16a34a;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5);
}

.cc-toggle-input:checked + .cc-toggle::before {
  transform: translateX(18px);
}

/* Disabled (essential) */

.cc-toggle-input:disabled + .cc-toggle {
  opacity: 0.5;
  cursor: default;
}

/* ========= Footer buttons ============================================ */

.cc-footer {
  padding: 0.75rem 1.5rem 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

#cc-note {
  font-size: 0.78rem;
  color: #d4d4d4;
}

/* Buttons: 2 rows
   - Row 1: Reject + Accept (same width, half each)
   - Row 2: Save (full width)
*/

.cc-footer .cc-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: space-between;
  align-items: stretch;
}

#cc-reject,
#cc-accept {
  flex: 1 1 calc(50% - 0.3rem);
  text-align: center;
}

#cc-save {
  flex: 1 1 100%;
  text-align: center;
}

/* Make sure all still look like proper buttons */

.cc-footer .cc-btns .cc-btn {
  min-width: 0;
}

@media (max-width: 600px) {
  .cc-sheet {
    width: min(100% - 1.5rem, 540px);
  }
}

/* ========= Close button ============================================== */

.cc-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition:
    background 0.15s ease,
    transform 0.1s ease,
    box-shadow 0.15s ease;
}

.cc-close:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
}

.cc-close:active {
  transform: translateY(0);
  box-shadow: none;
}

/* ========= Body lock while modal open ================================ */

body.cc-lock {
  overflow: hidden;
}

/* ========= Small typography tweaks =================================== */

@media (max-width: 480px) {
  #cc-banner p {
    font-size: 0.88rem;
  }
  .cc-header h2 {
    font-size: 1rem;
  }
  .cc-header .sub {
    font-size: 0.82rem;
  }
  .cc-card p {
    font-size: 0.83rem;
  }
}
/* =========================================================
   Banner layout override:
   Line 1: Preferences (full width)
   Line 2: Reject + Accept (two equal buttons, full width)
   ========================================================= */

#cc-banner .cc-inner {
  flex-direction: column;
  align-items: flex-start;
}

#cc-banner .cc-actions {
  margin-left: 0;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

/* Row 1: Preferences – full width */
#cc-open {
  flex: 0 0 100%;
  text-align: center;
}

/* Row 2: Reject + Accept – two equal buttons sharing the row */
#cc-reject-banner,
#cc-accept-banner {
  flex: 1 1 calc(50% - 0.25rem);
  text-align: center;
}
/* =========================================================
   Banner layout override:
   Line 1: Preferences (full width)
   Line 2: Reject + Accept (two equal buttons, full width)
   ========================================================= */

#cc-banner .cc-inner {
  flex-direction: column;
  align-items: flex-start;
}

#cc-banner .cc-actions {
  margin-left: 0;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

/* Row 1: Preferences – full width */
#cc-open {
  flex: 0 0 100%;
  text-align: center;
}

/* Row 2: Reject + Accept – two equal buttons sharing the row */
#cc-reject-banner,
#cc-accept-banner {
  flex: 1 1 calc(50% - 0.25rem);
  text-align: center;
}
/* =========================================================
   Fix long labels (e.g. German "Alle akzeptieren") in modal
   ========================================================= */

/* Allow button text to wrap instead of overflowing */
#cc-modal .cc-footer .cc-btn {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.2;
}

/* On very small screens, slightly reduce font size & padding */
@media (max-width: 480px) {
  #cc-modal .cc-footer .cc-btn {
    font-size: 0.9rem;
    padding-inline: 0.6rem;
  }
}
/* =========================================================
   Fix long labels (e.g. German "Alle akzeptieren") in modal
   ========================================================= */

/* Allow button text to wrap instead of overflowing */
#cc-modal .cc-footer .cc-btn {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.2;
}

/* On very small screens, slightly reduce font size & padding */
@media (max-width: 480px) {
  #cc-modal .cc-footer .cc-btn {
    font-size: 0.9rem;
    padding-inline: 0.6rem;
  }
}
