/*!
 * TG Cookie Consent – Styles
 * Version 1.0.0
 * License GPLv2 or later
 */

/* ════════════════════════════════════════════════════════════
   OVERLAY (für Settings-Modal)
   ════════════════════════════════════════════════════════════ */
#tgCookieOverlay {
  position: fixed;
  inset: 0;
  background: rgba(30, 24, 20, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

#tgCookieOverlay.tgVisible {
  opacity: 1;
  visibility: visible;
}

/* ════════════════════════════════════════════════════════════
   BANNER (initial unten)
   ════════════════════════════════════════════════════════════ */
#tgCookieBanner {
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: 20px;
  max-width: 720px;
  margin: 0 auto;
  z-index: 99999;
  background: hsl(38 30% 96%);
  border: 1px solid hsl(38 20% 87%);
  box-shadow:
    0 24px 48px -16px rgba(30, 24, 20, 0.25),
    0 12px 24px -8px rgba(30, 24, 20, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(40px);
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0.5s ease,
              transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

#tgCookieBanner.tgVisible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#tgCookieBanner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, hsl(28 35% 75%), hsl(28 45% 60%));
}

#tgCookieBanner .tg-banner-inner {
  padding: 32px;
}

@media (max-width: 600px) {
  #tgCookieBanner .tg-banner-inner { padding: 24px 20px; }
}

#tgCookieBanner .tg-banner-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

#tgCookieBanner .tg-banner-eyebrow-line {
  width: 28px;
  height: 1px;
  background: hsl(28 35% 75%);
}

#tgCookieBanner .tg-banner-eyebrow-text {
  font-family: 'Jost', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: hsl(28 40% 55%);
}

#tgCookieBanner h2 {
  font-family: 'Playfair Display', serif;
  font-weight: 400;
  font-size: 22px;
  line-height: 1.2;
  color: hsl(30 15% 8%);
  margin: 0 0 12px 0;
}

#tgCookieBanner p {
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  font-size: 14px;
  line-height: 1.7;
  color: hsl(30 8% 35%);
  margin: 0 0 24px 0;
}

#tgCookieBanner p a {
  color: hsl(28 40% 55%);
  text-decoration: none;
  border-bottom: 1px solid hsl(28 35% 75% / 0.5);
  transition: border-color 0.3s ease;
}

#tgCookieBanner p a:hover {
  border-color: hsl(28 40% 55%);
}

#tgCookieBanner .tg-banner-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 600px) {
  #tgCookieBanner .tg-banner-actions {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

#tgCookieBanner button {
  cursor: pointer;
  padding: 14px 20px;
  font-family: 'Jost', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

#tgCookieBanner .tg-btn-primary {
  background: hsl(28 35% 75%);
  color: hsl(30 15% 8%);
}

#tgCookieBanner .tg-btn-primary:hover {
  background: hsl(28 45% 60%);
  color: hsl(38 30% 96%);
}

#tgCookieBanner .tg-btn-secondary {
  background: transparent;
  border-color: hsl(30 15% 8%);
  color: hsl(30 15% 8%);
}

#tgCookieBanner .tg-btn-secondary:hover {
  background: hsl(30 15% 8%);
  color: hsl(38 30% 96%);
}

#tgCookieBanner .tg-btn-tertiary {
  background: transparent;
  border-color: hsl(38 20% 80%);
  color: hsl(30 8% 35%);
}

#tgCookieBanner .tg-btn-tertiary:hover {
  border-color: hsl(28 40% 55%);
  color: hsl(28 40% 55%);
}

/* ════════════════════════════════════════════════════════════
   SETTINGS MODAL
   ════════════════════════════════════════════════════════════ */
#tgCookieModal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: calc(100% - 40px);
  max-width: 600px;
  max-height: calc(100vh - 40px);
  background: hsl(38 30% 96%);
  border: 1px solid hsl(38 20% 87%);
  box-shadow:
    0 32px 64px -16px rgba(30, 24, 20, 0.4),
    0 16px 32px -8px rgba(30, 24, 20, 0.2);
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

#tgCookieModal.tgVisible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

#tgCookieModal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, hsl(28 35% 75%), hsl(28 45% 60%));
}

#tgCookieModal .tg-modal-header {
  padding: 32px 32px 24px;
  border-bottom: 1px solid hsl(38 20% 87%);
}

@media (max-width: 600px) {
  #tgCookieModal .tg-modal-header { padding: 24px 20px 20px; }
}

#tgCookieModal .tg-modal-eyebrow {
  font-family: 'Jost', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: hsl(28 40% 55%);
  margin: 0 0 8px 0;
}

#tgCookieModal h2 {
  font-family: 'Playfair Display', serif;
  font-weight: 400;
  font-size: 26px;
  line-height: 1.2;
  color: hsl(30 15% 8%);
  margin: 0 0 12px 0;
}

#tgCookieModal .tg-modal-intro {
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  font-size: 14px;
  line-height: 1.7;
  color: hsl(30 8% 35%);
  margin: 0;
}

#tgCookieModal .tg-modal-body {
  padding: 24px 32px;
  overflow-y: auto;
  flex: 1;
}

@media (max-width: 600px) {
  #tgCookieModal .tg-modal-body { padding: 20px; }
}

#tgCookieModal .tg-category {
  padding: 20px 0;
  border-bottom: 1px solid hsl(38 20% 87%);
}

#tgCookieModal .tg-category:last-child {
  border-bottom: none;
}

#tgCookieModal .tg-category-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

#tgCookieModal .tg-category-name {
  font-family: 'Playfair Display', serif;
  font-weight: 400;
  font-size: 18px;
  color: hsl(30 15% 8%);
  margin: 0;
}

#tgCookieModal .tg-category-required {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  background: hsl(28 35% 75% / 0.15);
  border: 1px solid hsl(28 35% 75% / 0.4);
  font-family: 'Jost', sans-serif;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: hsl(28 40% 55%);
  line-height: 1.4;
  vertical-align: middle;
}

#tgCookieModal .tg-category-desc {
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  font-size: 13px;
  line-height: 1.7;
  color: hsl(30 8% 35%);
  margin: 0 0 12px 0;
}

#tgCookieModal .tg-category-services {
  font-family: 'Jost', sans-serif;
  font-size: 11px;
  color: hsl(30 8% 50%);
  line-height: 1.6;
  letter-spacing: 0.05em;
  margin: 0;
}

#tgCookieModal .tg-category-services strong {
  font-weight: 500;
  color: hsl(30 8% 35%);
}

/* ───────── TOGGLE SWITCH ───────── */
#tgCookieModal .tg-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  margin-top: 2px;
}

#tgCookieModal .tg-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

#tgCookieModal .tg-toggle-slider {
  position: absolute;
  inset: 0;
  background: hsl(38 20% 80%);
  border: 1px solid hsl(38 20% 75%);
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 24px;
}

#tgCookieModal .tg-toggle-slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: hsl(38 30% 96%);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
}

#tgCookieModal .tg-toggle input:checked + .tg-toggle-slider {
  background: hsl(28 35% 75%);
  border-color: hsl(28 45% 60%);
}

#tgCookieModal .tg-toggle input:checked + .tg-toggle-slider::before {
  transform: translateX(20px);
}

#tgCookieModal .tg-toggle input:disabled + .tg-toggle-slider {
  background: hsl(28 35% 75%);
  border-color: hsl(28 45% 60%);
  cursor: not-allowed;
  opacity: 0.7;
}

#tgCookieModal .tg-toggle input:disabled + .tg-toggle-slider::before {
  transform: translateX(20px);
}

/* Modal Footer */
#tgCookieModal .tg-modal-footer {
  padding: 20px 32px 32px;
  border-top: 1px solid hsl(38 20% 87%);
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 600px) {
  #tgCookieModal .tg-modal-footer {
    grid-template-columns: 1fr 1fr 1.2fr;
  }
}

@media (max-width: 600px) {
  #tgCookieModal .tg-modal-footer { padding: 16px 20px 24px; }
}

#tgCookieModal .tg-modal-footer button {
  cursor: pointer;
  padding: 13px 18px;
  font-family: 'Jost', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

#tgCookieModal .tg-modal-footer .tg-btn-primary {
  background: hsl(28 35% 75%);
  color: hsl(30 15% 8%);
}

#tgCookieModal .tg-modal-footer .tg-btn-primary:hover {
  background: hsl(28 45% 60%);
  color: hsl(38 30% 96%);
}

#tgCookieModal .tg-modal-footer .tg-btn-secondary {
  background: transparent;
  border-color: hsl(30 15% 8%);
  color: hsl(30 15% 8%);
}

#tgCookieModal .tg-modal-footer .tg-btn-secondary:hover {
  background: hsl(30 15% 8%);
  color: hsl(38 30% 96%);
}

#tgCookieModal .tg-modal-footer .tg-btn-tertiary {
  background: transparent;
  border-color: hsl(38 20% 80%);
  color: hsl(30 8% 35%);
}

#tgCookieModal .tg-modal-footer .tg-btn-tertiary:hover {
  border-color: hsl(28 40% 55%);
  color: hsl(28 40% 55%);
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  #tgCookieBanner,
  #tgCookieModal,
  #tgCookieOverlay {
    transition: opacity 0.2s ease, visibility 0.2s ease;
  }
  #tgCookieBanner.tgVisible { transform: none; }
  #tgCookieModal.tgVisible { transform: translate(-50%, -50%); }
}
