/* Cookie consent theme overrides, an die Salonado-Akzentfarbe (Violett) angepasst */

/* Primary buttons in violet, links use the same accent */
#cc-main {
  --cc-btn-primary-bg: #8b5cf6;
  --cc-btn-primary-border-color: #8b5cf6;
  --cc-btn-primary-hover-bg: #7c3aed;
  --cc-btn-primary-hover-border-color: #7c3aed;
  --cc-btn-primary-color: #fff;
  --cc-btn-primary-hover-color: #fff;
}

#cc-main a {
  color: #7c3aed;
  font-weight: 500;
  text-decoration: none;
}

#cc-main a:hover {
  color: #6d28d9;
}

/* No browser default focus outline on the cookie UI, matching the app's global *:focus-visible { outline: none } */
#cc-main a,
#cc-main button,
#cc-main input,
#cc-main .pm__badge {
  outline: none;
}

/* Even, slightly darker glow around the initial consent banner for better contrast against the white page */
#cc-main .cm {
  box-shadow: 0 0 28px 2px rgba(15, 23, 42, 0.5) !important;
}

/* Floating widget to reopen the cookie preferences */
.cc-toggle {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  background-color: #8b5cf6;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  z-index: 30;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.cc-toggle:hover,
.cc-toggle:focus {
  background-color: #7c3aed;
  color: #fff;
  transform: scale(1.08);
  text-decoration: none;
  outline: none;
}

.cc-toggle svg {
  width: 22px;
  height: 22px;
}

/* Under 640px the icon sits closer to the corner, half the spacing */
@media (max-width: 640px) {
  .cc-toggle {
    bottom: 10px;
    left: 10px;
  }
}

/* Cookie-Button anheben, solange die Warenkorb-Insel im Seiteninhalt vorhanden ist, damit sie ihn nicht verdeckt.
   Ab xl steht die Insel zentriert und schmaler, dort ist keine Anhebung noetig. */
body:has(.cart-island) .cc-toggle {
  bottom: 104px;
}

/* Unter 1024px verdeckt die Insel den Button, dort wird er ganz ausgeblendet.
   Greift ab dem ersten Paint, da die Insel bei gefuelltem Warenkorb serverseitig gerendert ist. */
@media (max-width: 1023px) {
  body:has(.cart-island) .cc-toggle {
    display: none;
  }
}

@media (min-width: 1280px) {
  body:has(.cart-island) .cc-toggle {
    bottom: 20px;
  }
}

/* Cookie settings modal: same overlay look as the app's other modals (slate-900/40 with blur) */
#cc-main .pm-overlay {
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(var(--blur-sm, 8px));
  -webkit-backdrop-filter: blur(var(--blur-sm, 8px));
}

/* On mobile both cookie boxes are centered and sized to fit the screen, instead of the library's full-screen layout.
   The preferences body keeps the library's own scroll (flex: 1; overflow-y: auto), so title and footer stay fixed.
   max-height uses dvh so mobile browser bars are accounted for and the box never exceeds the visible area. */
@media screen and (max-width: 640px) {
  #cc-main .cm,
  #cc-main .pm {
    top: 50%;
    bottom: auto;
    left: 1rem;
    right: 1rem;
    margin: 0;
    height: auto;
    max-height: calc(100dvh - 2rem);
    border-radius: var(--cc-modal-border-radius);
    transform: translateY(-50%) !important;
  }
  /* The library applies the shown-state transform with higher specificity, so match it to keep the box centered */
  .show--consent #cc-main .cc--anim .cm,
  .show--preferences #cc-main .cc--anim .pm {
    transform: translateY(-50%) !important;
  }
}
