/*
 * Bounce Commerce Dashboard — Figma-Design-System über w3.css.
 * w3.css liefert Grid/Utilities, diese Datei die Brand-Tokens
 * und Komponenten aus dem Figma-Spec (Tabelle, Tag, Dropdown,
 * Status-Panel, Progress, Radio).
 **/

:root {
  --bc-teal:         #00a29d;
  --bc-teal-hover:   #006f6c;
  --bc-teal-dark:    #00312f;
  --bc-dark:         #182a3d;
  --bc-red:          #db1420;
  --bc-green:        #4caf50;
  --bc-text:         #182a3d;
  --bc-text-muted:   #595959;
  --bc-border:       #d1d1d1;
  --bc-border-soft:  #e6e6e6;
  --bc-zebra:        #eaeaea;
  --bc-bg:           #ffffff;
  --bc-bg-muted:     #f6f6f6;
  --bc-radius-pill:  30px;
  --bc-divider:      3px solid var(--bc-teal);
}

html, body {
  margin: 0;
  padding: 0;
  color: var(--bc-text);
  background: var(--bc-bg);
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 18px;
  line-height: 21px;
}

a { color: var(--bc-teal); text-decoration: none; }
a:hover { color: var(--bc-teal-hover); text-decoration: underline; }

/* Topbar */
.bc-topbar {
  background: var(--bc-dark);
  color: #fff;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.bc-topbar__brand {
  font-weight: 800;
  font-size: 19px;
  color: #fff;
}
.bc-topbar__brand:hover { color: #fff; text-decoration: none; }
.bc-topbar__nav { display: flex; gap: 16px; margin-left: auto; }
.bc-topbar__nav a {
  color: #fff;
  opacity: 0.85;
  font-size: 15px;
  font-weight: 500;
}
.bc-topbar__nav a:hover { opacity: 1; text-decoration: none; }
.bc-topbar__nav a.is-active { opacity: 1; border-bottom: 2px solid var(--bc-teal); padding-bottom: 2px; }
.bc-topbar__user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: rgba(255,255,255,0.85);
}
.bc-topbar__user a { color: #fff; opacity: 0.85; }
.bc-topbar__user a:hover { opacity: 1; text-decoration: none; }

/* Main */
.bc-main {
  max-width: 1280px;
  margin: 24px auto;
  padding: 0 24px;
}

h1, h2, h3 { color: var(--bc-dark); font-weight: 800; }
h1 { font-size: 22px; margin: 0 0 12px; }
h2 { font-size: 16px; margin: 0 0 8px; font-weight: 700; text-transform: none; }
h3 { font-size: 14px; margin: 12px 0 6px; font-weight: 700; }

/* Page-Header — Titel links, Aktionen rechts */
.bc-page-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.bc-page-header h1 { margin: 0; }
.bc-page-header__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--bc-text-muted);
  font-size: 14px;
}
.bc-page-header__actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}
.bc-back-link {
  display: inline-block;
  font-size: 13px;
  margin-bottom: 4px;
  color: var(--bc-text-muted);
}
.bc-back-link:hover { color: var(--bc-teal); }

/* Card — Grundbaustein für alle Seiten.
   Default: subtil (1px Border, 12px Radius, leichter Schatten) → ruhig
            auch bei 5+ Cards auf einer Seite.
   --accent:  Figma-Status-Card mit 3px Teal + 30px Pill-Radius.
              Nur für hervorgehobene Status-/Übersichts-Cards (max 1 pro Seite).
   --danger:  rote Kante für Gefahren-Zone (Delete, Rollback, etc.).
*/
.bc-card {
  background: #fff;
  border: 1px solid var(--bc-border-soft);
  border-radius: 12px;
  padding: 18px 22px;
  margin-bottom: 14px;
  box-shadow: 0 1px 2px rgba(24, 42, 61, 0.04);
}
.bc-card--accent {
  border: 3px solid var(--bc-teal);
  border-radius: var(--bc-radius-pill);
  padding: 20px 28px;
  box-shadow: none;
}
.bc-card--danger {
  border-color: #f5c2c6;
  background: #fff8f8;
  box-shadow: none;
}
.bc-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.bc-card__head h2,
.bc-card__head h3 { margin: 0; }
.bc-card__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Section — logische Trennung innerhalb einer Card */
.bc-section {
  padding: 14px 0;
  border-top: 1px solid var(--bc-border-soft);
}
.bc-section:first-child { border-top: 0; padding-top: 0; }
.bc-section__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--bc-text-muted);
  font-weight: 700;
  margin-bottom: 8px;
}

/* Toolbar — Filter/Search/Aktionen oberhalb einer Tabelle */
.bc-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.bc-toolbar__spacer { flex: 1; }

/* KPI-Kacheln (Stats-Overview) */
.bc-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.bc-kpi {
  background: #fff;
  border: 1px solid var(--bc-border-soft);
  border-left: 3px solid var(--bc-teal);
  border-radius: 8px;
  padding: 14px 18px;
  box-shadow: 0 1px 2px rgba(24, 42, 61, 0.04);
}
.bc-kpi__label {
  font-size: 12px;
  color: var(--bc-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
}
.bc-kpi__value {
  font-size: 28px;
  font-weight: 900;
  color: var(--bc-dark);
  margin-top: 4px;
  line-height: 1.2;
}
.bc-kpi__delta {
  font-size: 12px;
  margin-top: 4px;
}
.bc-kpi__delta--up   { color: var(--bc-green); }
.bc-kpi__delta--down { color: var(--bc-red); }

/* Tabs innerhalb einer Card (z.B. Popup vs. Content-Modul) */
.bc-tabs {
  display: flex;
  gap: 6px;
  margin: -4px 0 16px;
  border-bottom: 2px solid var(--bc-border-soft);
}
.bc-tabs__btn {
  appearance: none;
  background: none;
  border: 0;
  padding: 8px 16px;
  cursor: pointer;
  color: var(--bc-text-muted);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s;
}
.bc-tabs__btn:hover { color: var(--bc-dark); }
.bc-tabs__btn.is-active {
  color: var(--bc-dark);
  font-weight: 700;
  border-bottom-color: var(--bc-teal);
}
.bc-tab-panel { display: none; }
.bc-tab-panel.is-active { display: block; }

/* Subnav */
.bc-subnav {
  display: flex;
  gap: 2px;
  margin: 16px 0 24px;
  border-bottom: 1px solid var(--bc-border-soft);
}
.bc-subnav a {
  padding: 10px 18px;
  color: var(--bc-text-muted);
  font-weight: 500;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}
.bc-subnav a:hover { color: var(--bc-dark); text-decoration: none; }
.bc-subnav a.is-active {
  color: var(--bc-dark);
  border-bottom-color: var(--bc-teal);
  font-weight: 700;
}

/* Banner für Flash-Meldungen */
.bc-banner {
  padding: 10px 14px;
  background: #e8f5e9;
  color: var(--bc-green);
  border-radius: 6px;
  margin-bottom: 14px;
  font-size: 14px;
}
.bc-banner--warn { background: #fff3e0; color: #e65100; }
.bc-banner--err  { background: #ffebee; color: var(--bc-red); }

/* Form-Elemente — globales Styling für alle Text-artigen Inputs, selects,
   textareas innerhalb des Dashboards. Checkbox/Radio bleiben Default.
   Klassen .bc-input / .bc-select sind damit nicht mehr Pflicht — nur noch
   für Varianten (--sm, --num) nötig. */
input[type="text"],
input[type="number"],
input[type="url"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="date"],
input[type="datetime-local"],
select,
textarea,
.bc-input,
.bc-select {
  padding: 8px 12px;
  border: 1px solid var(--bc-border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  color: var(--bc-dark);
  background: #fff;
  box-sizing: border-box;
}
input[type="text"]:focus,
input[type="number"]:focus,
input[type="url"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
select:focus,
textarea:focus,
.bc-input:focus,
.bc-select:focus {
  outline: 2px solid var(--bc-teal);
  outline-offset: -1px;
  border-color: var(--bc-teal);
}
.bc-input--sm  { padding: 5px 9px; font-size: 13px; }
.bc-input--num { width: 80px; text-align: right; }

.bc-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bc-field__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--bc-text);
}
.bc-help {
  font-size: 12px;
  color: var(--bc-text-muted);
  line-height: 1.5;
}
.bc-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
}

/* Form-Rows */
.bc-form-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 12px;
}
.bc-form-row .bc-field { flex: 1; min-width: 180px; }
.bc-form-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--bc-border-soft);
}

/* Favoriten-Stern */
.bc-fav-btn {
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 20px;
  padding: 2px 6px;
  color: var(--bc-border);
  transition: color 0.15s, transform 0.15s;
}
.bc-fav-btn:hover { transform: scale(1.15); }
.bc-fav-btn.is-favorite { color: #f5b301; }

/* Favicon/Deklarations-Hilfe — z.B. Favorit als Zeilenheader */
.bc-cell-primary  { font-weight: 700; color: var(--bc-dark); }
.bc-cell-muted    { font-size: 12px; color: var(--bc-text-muted); }
.bc-cell-num      { font-family: 'Roboto Mono', ui-monospace, Menlo, monospace; font-size: 14px; text-align: right; }

/* Compact Tag — kleinerer Pill für Tabellen-Actions */
.bc-tag--sm {
  padding: 5px 12px;
  font-size: 13px;
  line-height: 16px;
  border-width: 2px;
}

/* Website-Detail-spezifische Helper (vorher lokal in _styles.twig) */

/* Grid für kompakte Form-Zeilen (mehrere Eingaben nebeneinander) */
.bc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  max-width: 720px;
  margin-bottom: 12px;
}

/* Feed-Karten-Header (Titel + Status-Badge rechts) */
.bc-feed-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--bc-border-soft);
  flex-wrap: wrap;
  gap: 10px;
}
.bc-feed-head .bc-badge { margin-left: 6px; }

/* Ausklappbare Unter-Sektionen (<details> mit <summary>) */
.bc-fold {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--bc-border-soft);
}
.bc-fold summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: var(--bc-dark);
  padding: 4px 0;
  list-style: none;
}
.bc-fold summary::-webkit-details-marker { display: none; }
.bc-fold summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 6px;
  transition: transform 0.15s;
}
.bc-fold[open] > summary::before { transform: rotate(90deg); }
.bc-fold summary:hover { color: var(--bc-teal); }
.bc-fold[open] summary { margin-bottom: 8px; }
.bc-fold__help { font-size: 13px; margin: 8px 0 12px; color: var(--bc-text-muted); }

/* Embedded Form-Panel (z.B. Embedding-Config innerhalb einer Card) */
.bc-embed-form {
  padding: 12px;
  margin-top: 8px;
  background: #fafafa;
  border: 1px solid var(--bc-border-soft);
  border-radius: 6px;
}

/* Mehrere Checkboxen nebeneinander */
.bc-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}
.bc-checks label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--bc-dark);
  font-weight: 400;
  cursor: pointer;
}

/* Inline-Form (Label + Input + Submit auf einer Zeile) */
.bc-inline-form {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-top: 10px;
}
.bc-inline-form .bc-field { margin: 0; }

/* Feld-Varianten innerhalb .bc-field: volle Breite mit sinnvollem Maximum.
   Basis-Styling (border, padding, focus) kommt aus dem globalen Input-Block. */
.bc-field input[type=text],
.bc-field input[type=number],
.bc-field input[type=url],
.bc-field input[type=password],
.bc-field input[type=email],
.bc-field input[type=search],
.bc-field select,
.bc-field textarea {
  width: 100%;
  max-width: 460px;
}

/* Tabelle — kompakt, Header fett, dünner Teal-Divider, Zebra-Zeilen.
   Figma-Pill-Rahmen hat auf Content-Tabellen zu viel Platzbedarf, deshalb
   dezentes Styling innerhalb der Card statt eigener Container. */
.bc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.4;
  color: var(--bc-dark);
}
.bc-table thead th {
  padding: 8px 12px;
  text-align: left;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--bc-text-muted);
  border-bottom: 2px solid var(--bc-teal);
  background: transparent;
}
.bc-table tbody td {
  padding: 9px 12px;
  border: 0;
  font-weight: 400;
  vertical-align: middle;
}
.bc-table tbody tr:nth-child(odd) td { background: #fafafa; }
.bc-table tbody tr:nth-child(even) td { background: #fff; }
.bc-table tbody tr:hover td { background: #f0f9f8; }

/* Tag/Pill — kompakter als die Figma-Spec (die ist für Marketing-Landing-
   Pages mit viel Whitespace gedacht, nicht für Admin-Dashboards mit vielen
   Aktionen). 14px Schriftgröße statt 19px, 8px vertical padding. */
.bc-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 16px;
  border-radius: var(--bc-radius-pill);
  font-size: 14px;
  line-height: 18px;
  font-weight: 500;
  border: 2px solid transparent;
  background: var(--bc-teal);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}
.bc-tag:hover { text-decoration: none; }
.bc-tag:focus-visible {
  outline: 2px solid var(--bc-dark);
  outline-offset: 2px;
}
.bc-tag--dark       { background: var(--bc-dark); color: #fff; }
.bc-tag--outline    { background: transparent; border-color: var(--bc-teal); color: var(--bc-teal); font-weight: 700; }
.bc-tag--outline-dark { background: transparent; border-color: var(--bc-dark); color: var(--bc-dark); font-weight: 700; }

/* Skip-Link für Tastatur-User: unsichtbar bis :focus, dann oben links */
.bc-skip-link {
  position: absolute;
  top: -100px;
  left: 8px;
  background: var(--bc-dark);
  color: #fff;
  padding: 10px 16px;
  z-index: 100000;
  text-decoration: none;
  border-radius: 4px;
}
.bc-skip-link:focus {
  top: 8px;
  outline: 2px solid var(--bc-teal);
}

/* Radio (Checkliste) — 3px Teal-Ring + gefüllter Kern */
.bc-radio {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 20px;
  font-size: 18px;
  line-height: 21px;
  cursor: pointer;
  color: var(--bc-dark);
}
.bc-radio__dot {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  border: 3px solid var(--bc-teal);
  box-sizing: border-box;
  position: relative;
  flex: none;
}
.bc-radio--checked .bc-radio__dot::after {
  content: "";
  position: absolute;
  inset: 20%;
  border-radius: 50%;
  background: var(--bc-teal);
}

/* Dropdown — Text + Chevron-Icon, 3px Teal-Unterstrich */
.bc-dropdown {
  position: relative;
  width: 237px;
  font-size: 18px;
  line-height: 21px;
}
.bc-dropdown__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 31px;
  font-weight: 800;
  color: var(--bc-dark);
  border-bottom: var(--bc-divider);
  cursor: pointer;
}
.bc-dropdown__head::after {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-right: 3px solid var(--bc-teal);
  border-bottom: 3px solid var(--bc-teal);
  transform: rotate(45deg);
  margin-bottom: 4px;
}
.bc-dropdown--open .bc-dropdown__head::after { transform: rotate(-135deg); margin-bottom: -4px; }
.bc-dropdown__list {
  display: none;
  background: #fff;
  border: 1px solid var(--bc-border-soft);
  border-top: 0;
}
.bc-dropdown--open .bc-dropdown__list { display: block; }
.bc-dropdown__option {
  padding: 12px 20px;
  cursor: pointer;
  color: var(--bc-dark);
}
.bc-dropdown__option:hover { background: var(--bc-zebra); }

/* Status-Fenster — Teal-Header + Body mit Key/Value */
.bc-status-card {
  box-sizing: border-box;
  border: 3px solid var(--bc-teal);
  border-radius: var(--bc-radius-pill);
  overflow: hidden;
  background: #fff;
}
.bc-status-card--sm { width: 365px; }
.bc-status-card--lg { width: 100%; max-width: 974px; }
.bc-status-card__head {
  background: var(--bc-teal);
  color: #fff;
  padding: 10px 28px;
  font-weight: 700;
  font-size: 19px;
  line-height: 22px;
}
.bc-status-card__live {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px 0;
  font-weight: 700;
  font-size: 19px;
  line-height: 22px;
  color: var(--bc-dark);
}
.bc-status-card__live::before {
  content: "";
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--bc-teal);
}
.bc-status-card__body {
  padding: 12px 20px 20px;
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 40px;
  row-gap: 2px;
  font-size: 19px;
  line-height: 22px;
}
.bc-status-card__body dt { font-weight: 400; color: var(--bc-dark); }
.bc-status-card__body dd { margin: 0; font-weight: 700; color: var(--bc-dark); }

.bc-status-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 20px 28px 4px;
  align-items: center;
}
.bc-status-card__section {
  padding: 20px 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
}
.bc-status-card__divider {
  height: 0;
  border-top: var(--bc-divider);
  margin: 8px 28px;
}

.bc-demo-section {
  margin: 32px 0;
  padding: 16px 0;
  border-top: 1px solid var(--bc-border-soft);
}
.bc-demo-section:first-of-type { border-top: 0; }
.bc-demo-section__label {
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--bc-text-muted);
  margin-bottom: 12px;
}
.bc-demo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

/* Indeterminierter Ladebalken — während AJAX-Requests. Einblenden per
   .is-active-Klasse, sonst display:none. */
.bc-loader {
  display: none;
  position: relative;
  width: 100%;
  max-width: 400px;
  height: 6px;
  background: var(--bc-border-soft);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
}
.bc-loader.is-active { display: block; }
.bc-loader::after {
  content: "";
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  background: var(--bc-teal);
  animation: bc-loader-slide 1.1s ease-in-out infinite;
}
@keyframes bc-loader-slide {
  0%   { left: -40%; }
  100% { left: 100%; }
}

/* Progress-Bar — 5 Segmente, erste N gefüllt */
.bc-progress {
  display: flex;
  width: 100%;
}
.bc-progress__seg {
  flex: 1;
  height: 18px;
  border: 3px solid var(--bc-teal);
  background: transparent;
  box-sizing: border-box;
  margin-left: -3px;
}
.bc-progress__seg:first-child { margin-left: 0; border-radius: 30px 0 0 30px; }
.bc-progress__seg:last-child  { border-radius: 0 30px 30px 0; }
.bc-progress__seg--filled { background: var(--bc-teal); }

/* Buttons — w3.css-Button mit Brand-Look */
.w3-button.bc-primary {
  background: var(--bc-teal);
  color: #fff;
  border-radius: var(--bc-radius-pill);
  font-weight: 500;
}
.w3-button.bc-primary:hover { background: var(--bc-teal-hover) !important; color: #fff !important; }
.w3-button.bc-danger  { background: var(--bc-red); color: #fff; border-radius: var(--bc-radius-pill); }
.w3-button.bc-danger:hover { background: #ac1019 !important; color: #fff !important; }

/* Helfer */
.bc-muted { color: var(--bc-text-muted); }
.bc-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--bc-radius-pill);
  font-size: 13px;
  font-weight: 500;
  background: var(--bc-border-soft);
  color: var(--bc-dark);
}
.bc-badge--ok    { background: #e8f5e9; color: var(--bc-green); }
.bc-badge--warn  { background: #fff3e0; color: #e65100; }
.bc-badge--err   { background: #ffebee; color: var(--bc-red); }

footer {
  margin-top: 64px;
  padding: 16px 24px;
  border-top: 1px solid var(--bc-border-soft);
  color: var(--bc-text-muted);
  font-size: 14px;
  text-align: center;
}
