/* =============================================================
   BikePass Warenkorb — Side-Drawer + Sticky-Button
   Eigenständiges Modul: läuft auf /bestellen/ UND (Teil B) auf der
   WordPress-Produktseite. Braucht designkit/tokens.css im Dokument.
   ============================================================= */

/* ---------- Sticky-Cart-Button (unten rechts) ---------- */
.bp-cart-fab {
  position: fixed;
  right: clamp(0.9rem, 2.5vw, 1.6rem);
  bottom: clamp(0.9rem, 2.5vw, 1.6rem);
  z-index: 70;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-teal-deep) 0%, var(--brand-teal) 100%);
  box-shadow: 0 10px 30px -8px rgba(13, 148, 136, 0.55), 0 2px 8px rgba(15, 23, 42, 0.12);
  transition: transform 300ms cubic-bezier(0.32, 0.72, 0, 1), box-shadow 300ms cubic-bezier(0.32, 0.72, 0, 1);
}
.bp-cart-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 34px -8px rgba(13, 148, 136, 0.6), 0 3px 10px rgba(15, 23, 42, 0.14); }
.bp-cart-fab:active { transform: scale(0.94); }
.bp-cart-fab svg { flex-shrink: 0; }

.bp-cart-fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--brand-ink, #0f172a);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  transform: scale(0);
  transition: transform 350ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.bp-cart-fab-badge.is-on { transform: scale(1); }

/* Kurzer „Pop" beim Hinzufügen */
@keyframes bp-cart-pop { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }
.bp-cart-fab.is-pop { animation: bp-cart-pop 420ms cubic-bezier(0.34, 1.56, 0.64, 1); }

/* ---------- Overlay + Drawer ---------- */
.bp-cart-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, 0.45);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 350ms cubic-bezier(0.32, 0.72, 0, 1);
}
.bp-cart-overlay.is-open { opacity: 1; pointer-events: auto; }

.bp-cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  width: min(430px, 100vw);
  background: #fff;
  display: flex;
  flex-direction: column;
  transform: translateX(102%);
  visibility: hidden; /* zugeklappt komplett raus (kein Phantom-Overflow, nicht fokussierbar) */
  transition: transform 480ms cubic-bezier(0.32, 0.72, 0, 1), visibility 0s linear 480ms;
  box-shadow: -18px 0 60px rgba(15, 23, 42, 0.18);
}
.bp-cart-drawer.is-open {
  transform: translateX(0);
  visibility: visible;
  transition: transform 480ms cubic-bezier(0.32, 0.72, 0, 1);
}
body.bp-cart-locked { overflow: hidden; }

.bp-cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.4rem 1rem;
  border-bottom: 1px solid var(--slate-200, #e2e8f0);
}
.bp-cart-title {
  font-family: var(--font-display, 'Bebas Neue', sans-serif);
  font-size: 1.7rem;
  letter-spacing: 0.02em;
  color: var(--brand-ink, #0f172a);
  margin: 0;
  font-weight: 400;
}
.bp-cart-close {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--slate-500, #64748b);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 200ms ease-out, color 200ms ease-out, transform 100ms ease-out;
}
.bp-cart-close:hover { background: var(--slate-100, #f1f5f9); color: var(--brand-ink, #0f172a); }
.bp-cart-close:active { transform: scale(0.92); }

/* ---------- Positionen ---------- */
.bp-cart-items {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1.1rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.bp-cart-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 0.85rem;
  align-items: start;
}
.bp-cart-item-thumb {
  width: 72px;
  height: 72px;
  border: 1px solid var(--slate-200, #e2e8f0);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.bp-cart-item-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bp-cart-item-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--brand-ink, #0f172a);
  line-height: 1.3;
  margin: 0 0 0.5rem;
}
.bp-cart-item-sub {
  font-size: 0.78rem;
  color: var(--slate-500, #64748b);
  margin: -0.35rem 0 0.5rem;
}
.bp-cart-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
}
.bp-cart-item-remove {
  border: 0;
  background: transparent;
  color: var(--slate-400, #94a3b8);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.3rem;
  border-radius: 8px;
  transition: color 200ms ease-out, background 200ms ease-out;
}
.bp-cart-item-remove:hover { color: var(--err-text, #b91c1c); background: var(--slate-100, #f1f5f9); }
.bp-cart-item-price {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--brand-ink, #0f172a);
  font-size: 0.95rem;
  white-space: nowrap;
}

/* Kompakter Mengen-Stepper in der Zeile */
.bp-cart-qty {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--slate-200, #e2e8f0);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.bp-cart-qty button {
  width: 32px;
  height: 30px;
  border: 0;
  background: transparent;
  color: var(--brand-ink, #0f172a);
  font-size: 1rem;
  cursor: pointer;
  transition: background 150ms ease-out;
}
.bp-cart-qty button:hover { background: var(--slate-50, #f8fafc); }
.bp-cart-qty button:disabled { color: var(--slate-300, #cbd5e1); cursor: not-allowed; }
.bp-cart-qty output {
  min-width: 1.9rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--brand-ink, #0f172a);
}

/* Leerer Warenkorb */
.bp-cart-empty {
  margin: auto;
  text-align: center;
  color: var(--slate-500, #64748b);
  font-size: 0.95rem;
  padding: 2rem 1rem;
}
.bp-cart-empty svg { color: var(--slate-300, #cbd5e1); margin-bottom: 0.8rem; }

/* ---------- Fuß: Rabattcode + Summen + CTA ---------- */
.bp-cart-foot {
  border-top: 1px solid var(--slate-200, #e2e8f0);
  padding: 1rem 1.4rem calc(1.1rem + env(safe-area-inset-bottom, 0px));
  background: #fff;
}
.bp-cart-promo-label {
  text-align: center;
  font-size: 0.85rem;
  color: var(--slate-500, #64748b);
  margin: 0 0 0.55rem;
}
.bp-cart-promo {
  display: flex;
  border: 1.5px solid var(--slate-200, #e2e8f0);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.bp-cart-promo:focus-within { border-color: var(--brand-teal, #36D0BC); box-shadow: 0 0 0 3px rgba(54, 208, 188, 0.18); }
.bp-cart-promo input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  padding: 0.7rem 0.9rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--brand-ink, #0f172a);
  outline: none;
  background: transparent;
}
.bp-cart-promo button {
  border: 0;
  background: var(--slate-100, #f1f5f9);
  color: var(--brand-ink, #0f172a);
  font-family: var(--font-display, 'Bebas Neue', sans-serif);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  padding: 0 1.1rem;
  cursor: pointer;
  transition: background 200ms ease-out;
}
.bp-cart-promo button:hover { background: var(--slate-200, #e2e8f0); }
.bp-cart-promo-chip[hidden] { display: none; }
.bp-cart-promo-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.55rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brand-teal-deep, #0d9488);
  background: var(--brand-teal-light, #e6f7f5);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
}
.bp-cart-promo-chip button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  padding: 0;
}
.bp-cart-promo-hint {
  font-size: 0.72rem;
  color: var(--slate-400, #94a3b8);
  margin: 0.35rem 0 0;
}

.bp-cart-lines { margin-top: 0.9rem; border-top: 1px solid var(--slate-100, #f1f5f9); padding-top: 0.7rem; }
.bp-cart-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--slate-600, #475569);
  padding: 0.15rem 0;
  font-variant-numeric: tabular-nums;
}
.bp-cart-line.is-total {
  font-weight: 800;
  color: var(--brand-ink, #0f172a);
  font-size: 1rem;
  padding-top: 0.35rem;
}
.bp-cart-vat {
  font-size: 0.72rem;
  color: var(--slate-400, #94a3b8);
  margin: 0.1rem 0 0;
}

.bp-cart-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  margin-top: 0.85rem;
  padding: 1rem 1.4rem;
  border: 0;
  border-radius: 8px; /* wie die Checkout-CTAs (Chris 22.08.) */
  cursor: pointer;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(90deg, var(--brand-teal-deep, #0d9488) 0%, var(--brand-teal, #36D0BC) 100%);
  /* Schrift wie der Kaufen-Button (Chris 22.08.): Inter statt Bebas-Versalien */
  font-family: var(--font-sans, 'Inter', sans-serif) !important;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
  transition: transform 100ms ease-out, filter 200ms ease-out;
}
.bp-cart-cta:hover { filter: brightness(1.04); }
.bp-cart-cta:active { transform: scale(0.98); }
.bp-cart-cta[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  .bp-cart-drawer, .bp-cart-overlay, .bp-cart-fab, .bp-cart-fab-badge { transition: none; }
  .bp-cart-fab.is-pop { animation: none; }
}

/* ---------- Härtung gegen fremde Globals (WP/Elementor-Kit) ----------
   Auf der Live-Produktseite stylen Theme/Elementor `button` global
   (Padding/Line-Height/Min-Height) und verschieben sonst die +/−-Stepper.
   Deshalb hier alles Strittige explizit und mit höherer Spezifität. */
.bp-cart-drawer, .bp-cart-drawer *, .bp-cart-fab { box-sizing: border-box; }
.bp-cart-drawer button, .bp-cart-fab {
  margin: 0;
  font-family: inherit;
  text-transform: none;
  letter-spacing: normal;
  box-shadow: none;
  min-height: 0;
  appearance: none;
  -webkit-appearance: none;
}
.bp-cart-drawer .bp-cart-qty {
  line-height: 1;
}
.bp-cart-drawer .bp-cart-qty button {
  width: 32px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--brand-ink, #0f172a);
  font-size: 1rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.bp-cart-drawer .bp-cart-qty button:hover { background: var(--slate-50, #f8fafc); }
.bp-cart-drawer .bp-cart-qty output {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.bp-cart-drawer .bp-cart-close,
.bp-cart-drawer .bp-cart-item-remove {
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
  min-width: 0 !important;
  /* !important: Site-Globals setzen button-color weiß -> unsichtbares × */
  color: var(--slate-500, #64748b) !important;
}
.bp-cart-drawer .bp-cart-close:hover { color: var(--brand-ink, #0f172a) !important; }
.bp-cart-drawer .bp-cart-item-remove:hover { color: var(--err-text, #b91c1c) !important; }
.bp-cart-drawer .bp-cart-close {
  width: 38px !important;
  height: 38px !important;
  border-radius: 50% !important;
}
.bp-cart-drawer .bp-cart-close:hover { background: var(--slate-100, #f1f5f9) !important; }
.bp-cart-drawer .bp-cart-item-remove { padding: 0.15rem 0.3rem !important; border-radius: 8px !important; }
.bp-cart-drawer .bp-cart-qty button {
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  min-height: 0 !important;
  width: 32px !important;
  height: 30px !important;
  background: transparent;
}
.bp-cart-drawer .bp-cart-promo button {
  border: 0;
  border-radius: 0;
  background: var(--slate-100, #f1f5f9);
  color: var(--brand-ink, #0f172a);
  padding: 0 1.1rem;
  line-height: 1;
}
.bp-cart-drawer .bp-cart-cta {
  border: 0;
  line-height: 1.2;
  text-decoration: none;
}
.bp-cart-fab {
  border: 0 !important;
  padding: 0 !important;
  width: 58px !important;
  height: 58px !important;
  border-radius: 50% !important; /* Site-Globals machten den Kreis eckig */
}
/* Blauer Site-Fokus-Ring auf dem Schließen-Button (programmatischer Fokus
   beim Öffnen) → eigener Stil: kein Ring bei Maus/JS, Teal bei Tastatur */
.bp-cart-drawer .bp-cart-close {
  font-size: 1.5rem !important;
  font-weight: 400 !important;
  line-height: 1 !important;
}
.bp-cart-drawer .bp-cart-close:focus {
  outline: none;
  box-shadow: none !important;
}
.bp-cart-drawer .bp-cart-close:focus-visible {
  outline: 2px solid var(--brand-teal-deep, #0d9488);
  outline-offset: 2px;
}
