/* ─────────────────────────────────────────────────────────
   Bulli Garage v1.0
   ───────────────────────────────────────────────────────── */

/* ── Loading ─────────────────────────────────────────────── */
.bulli-garage__loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 60px 0;
}

.garage-loader {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(0,0,0,0.1);
  border-top-color: var(--e-global-color-accent, #2e7d32);
  border-radius: 50%;
  animation: garageLoaderSpin 0.7s linear infinite;
}

@keyframes garageLoaderSpin {
  to { transform: rotate(360deg); }
}

/* ── Empty State ─────────────────────────────────────────── */
.bulli-garage__empty {
  text-align: center;
  padding: 80px 20px;
  color: #666;
}

.garage-empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
  line-height: 1;
}

.bulli-garage__empty h3 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #222;
  margin: 0 0 10px;
}

.bulli-garage__empty p {
  font-size: 0.95rem;
  margin: 0 0 28px;
  color: #888;
}

/* ── Grid ────────────────────────────────────────────────── */
.bulli-garage__grid {
  display: grid;
  /* max 2 pro Reihe ab ~1200px Container-Breite, sonst 1 pro Reihe */
  grid-template-columns: repeat(auto-fill, minmax(580px, 1fr));
  gap: 20px;
}

/* ── Karte (NEU: horizontal Bild | Body) ──────────────── */
.bulli-garage-card {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: box-shadow 0.25s ease, transform 0.25s ease, opacity 0.3s ease;
  animation: garageCardIn 0.35s ease both;
  display: flex;
  flex-direction: row;
  align-items: stretch;
}

@keyframes garageCardIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bulli-garage-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.10);
  transform: translateY(-2px);
}

/* Löschen-Animation */
.bulli-garage-card.is-removing {
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
}

/* ── Preview (LINKS auf Desktop, OBEN auf Mobile) ────────
   Wichtig: die Preview-SPALTE stretcht in Höhe (für gleichmäßige
   Hintergrundfarbe wenn der Body durch viele Chips wächst).
   Die EIGENTLICHE Vorschau (.bulli-vorschau) drinnen bleibt aber
   strikt 1:1 quadratisch und centered — sonst zerschießt sich das
   Hintergrundbild. */
.bulli-garage-card__preview {
  flex: 0 0 260px;
  width: 260px;
  background: #f5f5f5;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  /* KEIN aspect-ratio hier — die Spalte folgt der Body-Höhe */
}

/* Innere Bulli-Vorschau bleibt 1:1, max 260×260 */
.bulli-garage-card__preview .bulli-vorschau {
  width: 260px !important;
  height: 260px !important;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

/* ── Dunkle Overlay-Fläche ───────────────────────────────── */
.bulli-garage-card__preview::before {
  content: '';
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0.5;
  z-index: 4;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

/* ── Garagentor (geriffelt, schiebt sich hoch) ───────────── */
.bulli-garage-card__preview::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    180deg,
    #7a7a7a 0px,
    #7a7a7a 6px,
    #9e9e9e 6px,
    #9e9e9e 10px,
    #878787 10px,
    #878787 14px,
    #b0b0b0 14px,
    #b0b0b0 16px
  );
  transform: translateY(-50%); /* 70% sichtbar von oben */
  z-index: 5;
  transition: transform 0.48s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(0,0,0,0.4);
}

/* ── Hover: Tor schiebt sich auf ~25% ────────────────────── */
.bulli-garage-card:not(.is-active-card):hover .bulli-garage-card__preview::before {
  opacity: 0.25;
}
.bulli-garage-card:not(.is-active-card):hover .bulli-garage-card__preview::after {
  transform: translateY(-85%);
}

/* ── Aktive Konfiguration: Garage offen ──────────────────── */
.bulli-garage-card.is-active-card .bulli-garage-card__preview::before {
  opacity: 0;
}
.bulli-garage-card.is-active-card .bulli-garage-card__preview::after {
  transform: translateY(-100%);
}

/* Preview-Content unter den Overlays halten — Maße kommen aus der
   Haupt-Regel oben (width/height: 260px) */
.bulli-garage-card__preview .bulli-vorschau {
  position: relative;
  z-index: 1;
}

/* Hintergrund-Layer innerhalb der Karte */
.bulli-garage-card__preview .bulli-pa_hintergrundbild {
  position: absolute;
  background-size: cover;
  background-position: center right;
  opacity: 0;
  transition: opacity 0.3s ease;
  left: 50% !important;
  max-width: 50% !important;
  width: 50% !important;
}

.bulli-garage-card__preview .bulli-pa_hintergrundbild.ist-aktiv {
  opacity: 1;
}

/* SVG / Elementor Template innerhalb der Karte */
.bulli-garage-card__preview .bulli-vorschau > *:not(.bulli-pa_hintergrundbild) {
  position: relative;
  z-index: 1;
  width: 100%;
  max-height: 100%;
}

/* Elementor-Container in der Karte normalisieren */
.bulli-garage-card__preview .elementor,
.bulli-garage-card__preview .elementor-section-wrap,
.bulli-garage-card__preview .elementor-section,
.bulli-garage-card__preview .elementor-container,
.bulli-garage-card__preview .elementor-widget-wrap,
.bulli-garage-card__preview .elementor-widget {
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

.bulli-garage-card__preview svg {
  width: 100%;
  height: auto;
}

/* ── Body (RECHTS auf Desktop, UNTEN auf Mobile) ───────── */
.bulli-garage-card__body {
  flex: 1 1 auto;
  min-width: 0;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Header-Row (Name + Active-Badge) ───────────────────── */
.bulli-garage-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.bulli-garage-card__name {
  flex: 1 1 auto;
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a1a;
  padding: 4px 6px;
  margin: -4px -6px;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: border-color 0.2s ease, background 0.2s ease;
  outline: none;
  cursor: text;
  min-height: 1.5em;
  word-break: break-word;
}
.bulli-garage-card__name:hover {
  border-color: #ddd;
  background: #fafafa;
}
.bulli-garage-card__name:focus {
  border-color: var(--e-global-color-accent, #2e7d32);
  background: #fafafa;
}

/* Active-Badge: standardmäßig versteckt, nur sichtbar wenn Karte aktiv */
.garage-active-badge {
  display: none;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding: 4px 10px;
  background: #2e7d32;
  color: #fff;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: "Roboto Mono", sans-serif;
}
.bulli-garage-card.is-active-card .garage-active-badge {
  display: inline-flex;
}

/* ── Chips (Specs als kompakte Pills) ───────────────────── */
.bulli-garage-card__chips {
  flex: 1 1 auto;
  min-height: 0;
}
.garage-chips {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}
.garage-chip {
  background: #f6f6f6;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 7px 10px;
  min-width: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.garage-chip:hover {
  background: #f0f0f0;
}
.garage-chip__label {
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #999;
  font-weight: 600;
  margin-bottom: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: "Roboto Mono", sans-serif;
}
.garage-chip__value {
  font-size: 12.5px;
  font-weight: 600;
  color: #222;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.garage-chip__value > * { min-width: 0; }
.garage-chips-empty {
  color: #bbb;
  font-style: italic;
  font-size: 0.85rem;
  padding: 8px 0;
}

.garage-color-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.15);
  flex-shrink: 0;
}

/* ── Footer (Actions + Datum) ───────────────────────────── */
.bulli-garage-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: auto;
}
.garage-card-date {
  font-size: 0.7rem;
  color: #bbb;
  white-space: nowrap;
  font-family: "Roboto Mono", sans-serif;
}

/* ── "+ Neuer Bulli" Add-Card ──────────────────────────── */
.bulli-garage-card--new {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  text-decoration: none;
  color: inherit;
  background: #f9f9f9;
  border: 2px dashed #d6d6d6;
  border-radius: 14px;
  min-height: 260px;
  cursor: pointer;
  padding: 24px;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: none;
  animation: garageCardIn 0.35s ease both;
  /* Über-Reset des horizontalen Card-Layouts */
  flex-direction: column !important;
}
.bulli-garage-card--new:hover {
  background: #fff;
  border-color: var(--e-global-color-accent, #c62828);
  color: var(--e-global-color-accent, #c62828);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}
.bulli-garage-card--new:focus-visible {
  outline: none;
  border-color: var(--e-global-color-accent, #c62828);
  box-shadow: 0 0 0 3px rgba(198,40,40,0.15);
}

.bulli-garage-card--new__icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #d6d6d6;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
}
.bulli-garage-card--new:hover .bulli-garage-card--new__icon {
  border-color: var(--e-global-color-accent, #c62828);
  color: var(--e-global-color-accent, #c62828);
  transform: scale(1.06);
}

.bulli-garage-card--new__label {
  font-family: "Roboto Mono", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.95rem;
  color: #444;
  transition: color 0.2s ease;
}
.bulli-garage-card--new:hover .bulli-garage-card--new__label {
  color: var(--e-global-color-accent, #c62828);
}

.bulli-garage-card--new__hint {
  font-size: 0.8rem;
  color: #999;
  margin-top: -4px;
}

/* ── Aktions-Buttons (Primary + 2 Icon-Buttons) ────────── */
.bulli-garage-card__actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}
.garage-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-family: "Roboto Mono", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.garage-btn svg { flex-shrink: 0; }

/* Primary "Anwenden" — kompakt, accent color */
.garage-btn--apply {
  padding: 9px 14px;
  background: var(--e-global-color-accent, #c62828);
  color: var(--e-global-color-secondary, #fff);
}
.garage-btn--apply:hover {
  filter: brightness(0.92);
  transform: translateY(-1px);
}
.garage-btn--apply.is-active-config {
  background: #2e7d32;
  color: #fff;
}

/* Icon-Buttons (Edit, Delete) — quadratisch, ghost-styled */
.garage-icon-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: 1px solid #e8e8e8;
  color: #666;
}
.garage-icon-btn:hover {
  background: #f4f4f4;
  color: #222;
  border-color: #ddd;
  transform: translateY(-1px);
}
.garage-icon-btn--danger:hover {
  background: #ffebee;
  color: #c62828;
  border-color: #f5b3b3;
}

/* ── Park-Button (im Konfigurator) ───────────────────────── */
.bulli-config-park {
  background: #1565c0 !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(21,101,192,0.3) !important;
}

.bulli-config-park:hover {
  background: #0d47a1 !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(21,101,192,0.4) !important;
}

.bulli-config-park.is-saved {
  background: #1976d2 !important;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .bulli-garage__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Karte stapelt: Bild oben, Body unten */
  .bulli-garage-card {
    flex-direction: column;
    min-height: 0;
  }
  .bulli-garage-card__preview {
    flex: 0 0 auto;
    width: 100%;
    aspect-ratio: 1 / 1;
  }

  .bulli-garage-card__body {
    padding: 14px;
  }

  /* Chips: bleibt 2-spaltig auf Mobile, weil schmal aber ok */
  .garage-chips {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Footer: stackt vertikal — Actions in voller Breite oben, Datum klein rechts unten */
  .bulli-garage-card__footer {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  .bulli-garage-card__actions {
    width: 100%;
  }
  .garage-btn--apply {
    flex: 1 1 auto;
  }
  .garage-card-date {
    text-align: right;
    align-self: flex-end;
  }
}

/* Sehr schmal: Chips einspaltig */
@media (max-width: 380px) {
  .garage-chips {
    grid-template-columns: 1fr;
  }
}

/* ── Edit-Mode Hinweis (im Konfigurator) ─────────────────── */
.bk-edit-mode-hint {
  width: 100%;
  padding: 8px 12px;
  background: #e3f2fd;
  border: 1px solid #90caf9;
  border-radius: 6px;
  font-size: 0.82rem;
  color: #1565c0;
  font-weight: 500;
  margin-bottom: 4px;
}

.bulli-config-save-garage {
  background: #1565c0 !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(21,101,192,0.3) !important;
}

.bulli-config-save-garage:hover {
  background: #0d47a1 !important;
  transform: translateY(-2px);
}


/* ── Bulli Community Static — nur position:absolute ergänzen, 50%-Design bleibt ── */
.bulli-static .bulli-pa_hintergrundbild {
  position: absolute;
  height: 100%;
}
