/**
 * Cookie Consent – Stylesheet
 * violet-beauty.at – Web-Refresh 2026 Design-System
 *
 * Nutzt direkt die Design-Tokens aus /assets/css/style.css (:root), damit
 * der Banner automatisch mitzieht, falls sich das Farb-/Typo-System ändert.
 * Muss deshalb IMMER nach style.css eingebunden werden.
 */

:root {
  --vb-radius:   24px;
  --vb-shadow:   0 24px 60px -20px rgba(90,45,15,0.35), 0 0 0 1px rgba(160,110,70,0.08);
  --vb-z-banner: 99990;
  --vb-z-modal:  99999;
  --vb-z-overlay:99998;
}

/* ── Hidden utility ─────────────────────────────────────────────────────────── */
#vb-cookie-banner[hidden],
#vb-cookie-modal[hidden],
#vb-cookie-overlay[hidden] {
  display: none !important;
}

/* ── Banner: schwebende Karte über der mobilen Sticky-Action-Bar ─────────────── */
@keyframes vbBannerIn {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

#vb-cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: var(--vb-z-banner);
  background: var(--ivory, #FBF7F3);
  box-shadow: var(--vb-shadow);
  border: 1px solid var(--line, #EADBCD);
  border-radius: var(--vb-radius);
  padding: 22px;
  font-family: var(--font-body, 'Manrope', 'Helvetica Neue', Arial, sans-serif);
  font-size: 14px;
  color: var(--ink, #231C18);
  line-height: 1.55;
  animation: vbBannerIn 0.45s cubic-bezier(.2,.8,.2,1) both;
}

@media (min-width: 641px) {
  #vb-cookie-banner {
    left: 24px;
    right: auto;
    bottom: 24px;
    max-width: 420px;
    padding: 26px;
  }
}

.vb-banner-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.vb-banner-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 99px;
  background: var(--peach, #F2C3A2);
  color: var(--terra-deep, #8A4722);
  flex-shrink: 0;
  margin-bottom: 2px;
}
.vb-banner-icon svg { width: 22px; height: 22px; }

.vb-banner-title {
  font-family: var(--font-body, 'Manrope', 'Helvetica Neue', Arial, sans-serif);
  font-weight: 800;
  font-size: 19px;
  line-height: 1.2;
  color: var(--ink, #231C18);
  margin: 0 0 8px 0;
}

.vb-banner-text {
  margin: 0;
  color: var(--muted, #5E534C);
}

.vb-banner-links {
  display: inline-flex;
  gap: 16px;
  font-size: 13px;
  font-weight: 600;
  flex-wrap: wrap;
  margin-top: 2px;
}

.vb-banner-links a {
  color: var(--terra-dark, #A2562A);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.vb-banner-links a:hover,
.vb-banner-links a:focus-visible {
  color: var(--terra-deep, #8A4722);
}

.vb-banner-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vb-banner-actions-row {
  display: flex;
  gap: 10px;
}
.vb-banner-actions-row .vb-btn { flex: 1; }

/* ── Buttons (folgt dem Site-weiten .btn-System: Pille, 44px hoch) ───────────── */
.vb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  font-family: var(--font-body, 'Manrope', 'Helvetica Neue', Arial, sans-serif);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  border-radius: 99px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
  border: 1.5px solid transparent;
}

.vb-btn:focus-visible {
  outline: 3px solid var(--terra-dark, #A2562A);
  outline-offset: 2px;
}

/* Primary – Alle akzeptieren */
.vb-btn-primary {
  background: var(--terra-dark, #A2562A);
  color: #fff;
  border-color: var(--terra-dark, #A2562A);
}

.vb-btn-primary:hover,
.vb-btn-primary:focus {
  background: var(--terra-deep, #8A4722);
  border-color: var(--terra-deep, #8A4722);
  color: #fff;
}

/* Secondary – Alle ablehnen (gleich prominent) */
.vb-btn-secondary {
  background: transparent;
  color: var(--ink, #231C18);
  border-color: var(--ink, #231C18);
}

.vb-btn-secondary:hover,
.vb-btn-secondary:focus {
  background: var(--ink, #231C18);
  color: var(--ivory, #FBF7F3);
}

/* Tertiary – Einstellungen: dezenter Text-Link statt Button (moderner, weniger Klickdruck) */
.vb-btn-tertiary {
  background: none;
  border: none;
  color: var(--muted, #5E534C);
  padding: 8px 4px;
  min-height: auto;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  align-self: center;
}

.vb-btn-tertiary:hover,
.vb-btn-tertiary:focus-visible {
  color: var(--terra-dark, #A2562A);
  background: none;
}

#vb-cookie-banner .vb-btn-tertiary { align-self: stretch; text-align: center; }

/* Im Modal-Footer bleiben alle drei Buttons gleich prominent als Pillen */
.vb-modal-footer .vb-btn-tertiary {
  background: transparent;
  border: 1.5px solid var(--line, #EADBCD);
  color: var(--muted, #5E534C);
  padding: 0 22px;
  min-height: 44px;
  text-decoration: none;
}
.vb-modal-footer .vb-btn-tertiary:hover,
.vb-modal-footer .vb-btn-tertiary:focus-visible {
  background: var(--cream, #F3E3D5);
  border-color: var(--peach, #F2C3A2);
  color: var(--ink, #231C18);
}

/* ── Overlay ─────────────────────────────────────────────────────────────────── */
#vb-cookie-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--vb-z-overlay);
  background: rgba(23,17,14,0.55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

/* ── Modal ───────────────────────────────────────────────────────────────────── */
@keyframes vbModalIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.97); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

#vb-cookie-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: var(--vb-z-modal);
  background: var(--ivory, #FBF7F3);
  border-radius: 28px;
  box-shadow: var(--vb-shadow);
  width: 90%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body, 'Manrope', 'Helvetica Neue', Arial, sans-serif);
  font-size: 14px;
  color: var(--ink, #231C18);
  line-height: 1.5;
  overflow: hidden;
  animation: vbModalIn 0.25s cubic-bezier(.2,.8,.2,1) both;
}

.vb-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px 18px;
  border-bottom: 1px solid var(--line, #EADBCD);
  flex-shrink: 0;
}

.vb-modal-title {
  font-family: var(--font-body, 'Manrope', 'Helvetica Neue', Arial, sans-serif);
  font-weight: 800;
  font-size: 21px;
  color: var(--ink, #231C18);
  margin: 0;
}

.vb-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted, #5E534C);
  font-size: 22px;
  line-height: 1;
  width: 40px;
  height: 40px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
}

.vb-modal-close:hover,
.vb-modal-close:focus-visible {
  background: var(--cream, #F3E3D5);
  color: var(--ink, #231C18);
  outline: 2px solid var(--terra-dark, #A2562A);
}

.vb-modal-body {
  overflow-y: auto;
  padding: 22px 28px;
  flex: 1;
}

.vb-modal-footer {
  padding: 18px 28px;
  border-top: 1px solid var(--line, #EADBCD);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  flex-shrink: 0;
  background: var(--cream-2, #F0DAC8);
}

/* ── Category Blocks ─────────────────────────────────────────────────────────── */
.vb-category {
  margin-bottom: 14px;
  border: 1px solid var(--line, #EADBCD);
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
}
.vb-category:last-child { margin-bottom: 0; }

.vb-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: transparent;
  cursor: pointer;
  gap: 12px;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.vb-category-header:hover {
  background: var(--cream, #F3E3D5);
}

.vb-category-header:focus-visible {
  outline: 2px solid var(--terra-dark, #A2562A);
  outline-offset: -2px;
}

.vb-category-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--ink, #231C18);
  flex: 1;
}

.vb-category-chevron {
  color: var(--muted, #5E534C);
  font-size: 12px;
  transition: transform 0.2s ease;
  flex-shrink: 0;
  margin-left: 4px;
  display: inline-block;
}

.vb-category[aria-expanded="true"] .vb-category-chevron {
  transform: rotate(180deg);
}

.vb-category-body {
  padding: 0 18px 16px;
  display: none;
  border-top: 1px solid var(--line, #EADBCD);
  padding-top: 14px;
}

.vb-category[aria-expanded="true"] .vb-category-body {
  display: block;
}

.vb-category-desc {
  margin: 0 0 12px 0;
  color: var(--muted, #5E534C);
  font-size: 13px;
}

/* ── Toggle Switch ───────────────────────────────────────────────────────────── */
.vb-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.vb-always-active {
  font-size: 12px;
  font-weight: 700;
  color: var(--open, #5B8C5A);
  white-space: nowrap;
}

.vb-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
}

.vb-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.vb-toggle-slider {
  position: absolute;
  inset: 0;
  background: #DDD0C4;
  border-radius: 99px;
  transition: background 0.2s ease;
  cursor: pointer;
}

.vb-toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.vb-toggle input:checked + .vb-toggle-slider {
  background: var(--terra-dark, #A2562A);
}

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

.vb-toggle input:focus-visible + .vb-toggle-slider {
  outline: 3px solid var(--terra-dark, #A2562A);
  outline-offset: 2px;
}

.vb-toggle input:disabled + .vb-toggle-slider {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── Service Table ───────────────────────────────────────────────────────────── */
.vb-service-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 4px;
}

.vb-service-table thead th {
  background: var(--cream, #F3E3D5);
  border: 1px solid var(--line, #EADBCD);
  padding: 8px 10px;
  font-weight: 700;
  text-align: left;
  color: var(--ink, #231C18);
}

.vb-service-table tbody td {
  border: 1px solid var(--line, #EADBCD);
  padding: 8px 10px;
  vertical-align: top;
  color: var(--ink, #231C18);
}

.vb-service-table tbody tr:nth-child(even) td {
  background: var(--ivory, #FBF7F3);
}

/* ── Toast ───────────────────────────────────────────────────────────────────── */
#vb-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100000;
  background: var(--espresso, #2A221E);
  color: var(--ivory, #FBF7F3);
  padding: 14px 22px;
  border-radius: 99px;
  font-family: var(--font-body, 'Manrope', 'Helvetica Neue', Arial, sans-serif);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 16px 40px -16px rgba(0,0,0,0.5);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

#vb-toast.vb-toast-show {
  opacity: 1;
  transform: translateY(0);
}

/* ── Media Placeholder ───────────────────────────────────────────────────────── */
.vb-media-placeholder {
  position: relative;
  background: var(--espresso, #2A221E);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 20px;
  border-radius: var(--vb-radius);
  color: var(--ivory, #fff);
  min-height: 200px;
  font-family: var(--font-body, 'Manrope', 'Helvetica Neue', Arial, sans-serif);
}

.vb-media-placeholder p {
  margin: 0 0 12px;
  font-size: 13px;
  color: rgba(255,255,255,0.8);
  max-width: 380px;
}

.vb-media-placeholder .vb-placeholder-title {
  font-family: var(--font-body, 'Manrope', 'Helvetica Neue', Arial, sans-serif);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--peach, #F2C3A2);
}

.vb-media-placeholder .vb-btn {
  background: var(--terra-dark, #A2562A);
  color: #fff;
  border-color: var(--terra-dark, #A2562A);
  font-size: 13px;
  min-height: 40px;
  padding: 0 18px;
}
.vb-media-placeholder .vb-btn:hover { background: var(--terra-deep, #8A4722); }

/* ── Footer Trigger ──────────────────────────────────────────────────────────── */
.vb-cookie-footer-link {
  cursor: pointer;
  color: inherit;
  text-decoration: none;
  background: none;
  border: none;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  padding: 0;
  text-align: left;
  width: 100%;
  justify-content: flex-start;
}

.vb-cookie-footer-link:hover,
.vb-cookie-footer-link:focus-visible {
  color: var(--terra-dark, #A2562A);
  outline: none;
}

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  #vb-cookie-modal {
    width: calc(100% - 24px);
    max-height: 92vh;
  }

  .vb-modal-header,
  .vb-modal-body,
  .vb-modal-footer {
    padding-left: 18px;
    padding-right: 18px;
  }

  .vb-modal-footer {
    flex-direction: column;
  }

  .vb-modal-footer .vb-btn {
    width: 100%;
    justify-content: center;
  }

  .vb-service-table thead { display: none; }

  .vb-service-table tbody td {
    display: block;
    border: none;
    padding: 2px 0;
  }

  .vb-service-table tbody td::before {
    content: attr(data-label) ': ';
    font-weight: 700;
  }

  .vb-service-table tbody tr {
    display: block;
    border: 1px solid var(--line, #EADBCD);
    border-radius: 14px;
    padding: 10px 12px;
    margin-bottom: 8px;
  }

  #vb-toast {
    bottom: 12px;
    right: 12px;
    left: 12px;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  #vb-cookie-banner,
  #vb-cookie-modal,
  .vb-btn,
  .vb-toggle-slider,
  .vb-toggle-slider::before,
  .vb-category-chevron,
  #vb-toast {
    transition: none;
    animation: none;
  }
}
