/* ===== Panel Navigation Tabs ===== */
.panel-tabs {
  display: flex;
  gap: 4px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  z-index: 10;
}

.panel-tab {
  flex: 1;
  padding: 8px 4px; /* Weniger Padding spart horizontal massiv Platz */
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: var(--radius, 8px);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 10px; /* Einen Punkt kleiner macht bei langen Wörtern viel aus */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 50px; /* Etwas flacher wirkt moderner */
  justify-content: center;
  text-align: center;
  hyphens: auto; /* Erlaubt Silbentrennung, falls ein Wort zu lang ist */
}

.panel-tab:hover:not(.active) {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.panel-tab.active {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.6);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.panel-tab .tab-icon {
  font-size: 18px;
  line-height: 1;
}

.panel-tab img.tab-icon {
  width: auto;
  height: 18px; /* Oder die Größe, die zu deinen anderen Icons passt */
  object-fit: contain;
}
.panel-tab .tab-title {
  font-size: 12px;
  line-height: 1.8;
  text-align: center;
  font-weight: 500;
}

#panel-title {
  position: absolute;
  color: #ff0000;
  width: 100%;
  text-align: center;
  font-size: 20px;
  font-weight: 600;
  margin-top: 100px;
}


/* Mobile Panel-Tabs Menü */
#panel-tabs-mobile-menu {
  display: none;
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  z-index: 1002;
  flex-direction: column;
  padding: 10px 0;
}

#panel-tabs-mobile-menu .panel-tab {
  width: 100%;
  text-align: left;
  padding: 12px 20px;
  border: none;
  background: none;
  font-size: 1.1em;
  border-bottom: 1px solid #eee;
}

#panel-tabs-mobile-menu .panel-tab:last-child {
  border-bottom: none;
}



/* ===== Panel Container & Sliding ===== */
.layout-panel {
  position: absolute;
  top: 80px;
  left: 0;
  right: 0;
  bottom: 0;
  overflow-y: auto;
  overflow-x: hidden;
  opacity: 1;
  transform: translateX(0%);
}

.layout-panel:not(:first-child) {
  display: none;
}

.layout-panel.second-panel {
  top: 160px;
}

/* Slide Animations */
.slide-out-next {
  animation: slideOutLeft 0.4s ease-out forwards;
}

.slide-out-prev {
  animation: slideOutRight 0.4s ease-out forwards;
}

.slide-in-next {
  animation: slideInRight 0.4s ease-out forwards;
}

.slide-in-prev {
  animation: slideInLeft 0.4s ease-out forwards;
}

@keyframes slideOutLeft {
  from {
    transform: translateX(0%);
    opacity: 1;
  }

  to {
    transform: translateX(-100%);
    opacity: 0;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0%);
    opacity: 1;
  }

  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0%);
    opacity: 1;
  }
}

@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }

  to {
    transform: translateX(0%);
    opacity: 1;
  }
}

/* Section Slide Animations (für Garage-Seiten) */
.section-slide-out-next,
.section-slide-out-prev,
.section-slide-in-next,
.section-slide-in-prev {
  /* Override disabled state during animation for smooth transitions */
  opacity: 1 !important;
  pointer-events: auto !important;
  filter: none !important;
}

.section-slide-out-next {
  animation: sectionSlideOutLeft 0.3s ease-out forwards;
}

.section-slide-out-prev {
  animation: sectionSlideOutRight 0.3s ease-out forwards;
}

.section-slide-in-next {
  animation: sectionSlideInRight 0.3s ease-out forwards;
}

.section-slide-in-prev {
  animation: sectionSlideInLeft 0.3s ease-out forwards;
}

@keyframes sectionSlideOutLeft {
  from {
    transform: translateX(0%);
    opacity: 1;
  }

  to {
    transform: translateX(-100%);
    opacity: 0;
  }
}

@keyframes sectionSlideOutRight {
  from {
    transform: translateX(0%);
    opacity: 1;
  }

  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

@keyframes sectionSlideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0%);
    opacity: 1;
  }
}

@keyframes sectionSlideInLeft {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }

  to {
    transform: translateX(0%);
    opacity: 1;
  }
}

/* ===== Panel: Überschriften & Toggle ===== */
.panel-section h3 {
  margin: 0px 0px 10px 0px;
  font-size: 16px;
  text-align: center;
}

.panel-section h4 {
  margin: 10px 0;
  font-size: 14px;
  text-align: center;
}

#panel-dims {
  display: block;
}

/* ===== Sektionen: Rahmen & Abstände ===== */
.panel-section {
  background: var(--c-bg-panel, #fafafa);
  padding: 12px;
  margin: 12px;
}

.selection-panel {
  display: none;
  padding: 0px;
  background: none;
  opacity: 0.8;
}

.opener-panel {
  display: none;
}

.is-hidden {
  display: none !important;
}

/* ===== Grids (allgemein): responsive statt fix ===== */
.type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--gap, 6px);
}

/* Optional nutzbare Utility-Varianten (werden durch MQs übersteuert) */
.type-grid.cols-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.type-grid.cols-4, .cols-4-extras {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.type-grid.cols-3, .cols-3-extras {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.type-grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.type-grid.cols-1 {
  grid-template-columns: 1fr;
}

/* ===== Kachel: Struktur & Interaktionen ===== */
.type-tile {
  display: grid;
  grid-template-rows: 1fr auto;
  /* Bild + Label */
  padding: 0;
  text-align: center;
  line-height: 1.15;
  border: 1px solid var(--c-border, #ccc);
  border-radius: var(--radius, 8px);
  background: var(--c-bg-panel, #fafafa);
  cursor: pointer;
  opacity: 0.8;
  transition: border-color .15s ease, box-shadow .15s ease, transform .06s ease;
}

.type-tile:hover {
  border-color: var(--c-primary, #007bff);
  box-shadow: 0 2px 8px var(--c-shadow, rgba(0, 0, 0, .12));
  opacity: 0.8;
}

.type-tile:active {
  transform: translateY(1px);
}

.type-tile:focus-visible {
  outline: 2px solid var(--c-primary, #007bff);
  outline-offset: 2px;
}

/* aktive Auswahl */
.type-tile[aria-checked="true"] {
  border: 2px solid var(--c-primary, #007bff);
  opacity: 1;
}

/* Toggle-Variante (aria-pressed) */
.type-tile[aria-pressed="true"] {
  border-color: var(--c-primary, #007bff);
  outline: 2px solid var(--c-primary, #007bff);
  outline-offset: 2px;
}

/* Kacheln ohne Bild nicht zusammenfallen lassen */
.type-tile__img {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-top-left-radius: var(--radius, 8px);
  border-top-right-radius: var(--radius, 8px);
  min-height: 56px;
  /* Basis-Höhe ohne Bild */
}

.type-tile__img:empty {
  min-height: 72px;
  background: repeating-linear-gradient(45deg, #eee 0 8px, #f7f7f7 8px 16px);
}

.type-tile__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.type-tile__label {
  padding: 6px 8px;
  text-align: center;
  line-height: 1.2;
}


/* ===== Abmessungen / Slider ===== */
.dimension-control {
  padding: 10px;
  font-size: .9em;
}

.dimension-control label {
  display: block;
  text-align: center;
  font-weight: 600;
}

.dim-value {
  display: inline-block;
  padding: 0 2px;
  white-space: nowrap;
}

.dim-hint {
  margin-top: 5px;
  font-size: 12px;
  color: #666;
  float: left;
}

/* einheitlicher Slider-Block (WebKit & Firefox) */
.dimension-slider {
  width: 100%;
  height: 32px;
  /* bessere Klickfläche */
  background: transparent;
  margin-top: 8px;
  cursor: pointer;
  accent-color: #1f6fff;
  /* Fallback */
  --accent: #1f6fff;
  --track: #a6c5ff;
  --thumb-bg: #fff;
  --track-h: 8px;
  --thumb: 18px;
}

.dimension-slider.is-invalid {
  --accent: #fc9393;
  --track: #fc9393;
  --thumb-bg: #fc9393;
}

.dim-value.is-invalid {
  color: #d63b3b;
  font-weight: 600;
}

.dimension-slider[disabled] {
  opacity: .3;
  cursor: not-allowed;
}

/* WebKit */
.dimension-slider::-webkit-slider-runnable-track {
  height: var(--track-h);
  background:
    linear-gradient(var(--accent) 0 0) 0/var(--_sx, 0%) 100% no-repeat,
    var(--track);
  border-radius: 999px;
}

.dimension-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: var(--thumb);
  height: var(--thumb);
  border-radius: 50%;
  background: var(--thumb-bg);
  border: 2px solid var(--accent);
  margin-top: calc((var(--track-h) - var(--thumb)) / 2);
  box-shadow: 0 0 0 2px #fff inset;
  transition: transform .12s ease;
}

.dimension-slider:hover::-webkit-slider-thumb {
  transform: scale(1.06);
}

.dimension-slider:active::-webkit-slider-thumb {
  transform: scale(1.1);
}

/* Firefox */
.dimension-slider::-moz-range-track {
  height: var(--track-h);
  background: var(--track);
  border-radius: 999px;
}

.dimension-slider::-moz-range-progress {
  height: var(--track-h);
  background: var(--accent);
  border-radius: 999px;
}

.dimension-slider::-moz-range-thumb {
  width: var(--thumb);
  height: var(--thumb);
  border-radius: 50%;
  background: var(--thumb-bg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 2px #fff inset;
  transition: transform .12s ease;
}

.dimension-slider:hover::-moz-range-thumb {
  transform: scale(1.06);
}

.dimension-slider:active::-moz-range-thumb {
  transform: scale(1.1);
}

/* Linke Distanzregler optional spiegeln (falls gewünscht) */
#right-window-distance,
#right-door-distance,
#back-window-distance,
#back-door-distance {
  transform: scaleX(-1);
}

/* Fokus-Ring */
.dimension-slider:focus-visible {
  outline: none;
}

.dimension-slider:focus-visible::-webkit-slider-thumb,
.dimension-slider:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 6px rgba(31, 111, 255, .25), 0 0 0 2px #fff inset;
}

/* Disabled-Zustände */
.is-disabled {
  opacity: .45;
  filter: grayscale(.05);
  cursor: not-allowed;
}

.is-disabled * {
  pointer-events: none;
}

.details.is-disabled {
  display: none !important;
}

/* ===== Öffnungen-Bereich ===== */
#panel-openings {
  display: grid;
  grid-template-columns: 1fr;
  /* mobil: 1 Spalte */
  gap: var(--gap, 6px);
  position: relative;
  /* Für absolute Positionierung der Section-Animationen */
}

#panel-openings>h3 {
  grid-column: 1 / -1;
  margin-bottom: 6px;
  text-align: center;
}

#panel-openings>.panel-section {
  margin: 0;
  background: #fff;
  border: 1px solid var(--c-border, #ccc);
  border-radius: var(--radius, 8px);
  padding: 10px;
  box-shadow: none;
}

#panel-openings>.panel-section>h3 {
  margin: 6px 0 8px;
  text-align: center;
}

#panel-openings .type-grid {
  margin-top: 6px;
}

.opener-panel .type-grid {
  padding-inline: 5px;
  margin-bottom: 25px;
}

.details {
  overflow: hidden;
  text-align: center;
}

.details.is-visible {
  display: block;
}

#panel-openings .details {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed var(--c-border, #ccc);
}

#panel-openings .details h4 {
  margin: 6px 0;
  font-size: 14px;
  text-align: center;
}

#panel-openings input[type="number"] {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
  border: 1px solid var(--c-border, #ccc);
  border-radius: 6px;
  background: #fff;
}

#panel-openings .dimension-control label {
  display: block;
  text-align: center;
  font-weight: 600;
}

/* Linke Distanzregler optional spiegeln (falls gewünscht) */
input[type="range"][data-store="sides.left.window.distance"],
input[type="range"][data-store="sides.left.door.distance"] {
  transform: scaleX(-1);
}

/* ===== Farbpalette (Swatches) ===== */
/* ----- Swatches: exakt in 10 Spalten einpassen ----- */

/* Container bündig und ohne links-Überstand */
.swatch-row {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  margin: 10px;
  padding: 0 8px;
  align-items: stretch;
}

/* Swatches füllen die Zelle komplett und bleiben quadratisch */
.swatch {
  width: 100%;
  height: auto;
  /* Höhe kommt von aspect-ratio */
  aspect-ratio: 1 / 1;
  /* perfekte Quadrate */
  border: 1px solid var(--c-border, #ccc);
  border-radius: 6px;
  background: var(--sw, #fff);
  cursor: pointer;
  transition: transform .06s ease, box-shadow .12s ease, border-color .12s ease;
}

/* Hover/Active/Focus bleiben wie gehabt */
.swatch:hover {
  border-color: var(--c-primary, #007bff);
}

.swatch:active {
  transform: translateY(1px);
}

.swatch:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--c-primary, #007bff) 35%, transparent);
}

.swatch[aria-checked="true"] {
  outline: 2px solid var(--c-primary, #007bff);
  outline-offset: 2px;
  border-color: var(--c-primary, #007bff);
}

.opener-button.is-disabled[data-disabled-reason]:after {
  content: attr(data-disabled-reason);
  position: absolute;
  left: 100%;
  margin-left: .5rem;
  font-size: 12px;
  color: #888;
  white-space: nowrap;
}

.type-tile__img {
  position: relative;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  aspect-ratio: 4 / 3;
  /* fixe Thumbnail-Form */
  background: #f6f6f7;
  overflow: hidden;
  position: relative;
}

.type-tile__img canvas {
  display: block;
  margin: auto;
  max-width: 100%;
  max-height: 100%;
  position: relative;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
}

.type-tile.car-toggle {
  cursor: pointer;
}

.type-tile.car-toggle:hover .type-tile__img {
  filter: brightness(1.03);
}

/* ===== Gate Menu ===== */
.gate-menu {
  position: fixed;
  background: white;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
}

.gate-menu:hover {
  background: #f0f0f0;
}

/* NEUE Window-Menu Styles */
.window-menu {
  position: fixed;
  background: white;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  z-index: 9999;
  font-size: 14px;
  min-width: 140px;
}

.window-menu-header {
  padding: 10px 12px 6px 12px;
  font-weight: bold;
  color: #333;
  border-bottom: 1px solid #eee;
  background: #f8f9fa;
  border-radius: 6px 6px 0 0;
}

.window-menu-item {
  padding: 8px 12px;
  cursor: pointer;
  transition: background-color 0.15s;
  border-bottom: 1px solid #f0f0f0;
}

.window-menu-item:last-child {
  border-bottom: none;
  border-radius: 0 0 6px 6px;
}

.window-menu-item:hover {
  background: #f0f0f0;
}

.window-menu-item:active {
  background: #e0e0e0;
}

/* Door Menu - ähnlich wie Window Menu */
.door-menu {
  position: fixed;
  background: white;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  font-size: 14px;
  min-width: 120px;
}

.door-menu-header {
  padding: 8px 12px;
  font-weight: bold;
  color: #333;
  border-bottom: 1px solid #eee;
  background: #f8f9fa;
  border-radius: 4px 4px 0 0;
}

.door-menu-item {
  padding: 8px 12px;
  cursor: pointer;
  transition: background-color 0.15s;
}

.door-menu-item:hover {
  background: #f0f0f0;
}

.door-menu-item:last-child {
  border-radius: 0 0 4px 4px;
}

#garage-opinion {
  display: grid;
  padding: 8px 12px 0px 12px;
  margin: 0px 12px 0px 12px;
}

#open-front-gate-title {
  grid-column: 1 / -1;
  text-align: center;
  font-weight: 600;
}

.garage-rotate, .garage-selection {
  background: linear-gradient(180deg, #e9e9ef 0%, #cfd8dc 100%);
  color: #000;
  border: none;
  border-radius: 3px;
  box-shadow: 0 2px 8px rgba(60, 60, 90, 0.12), 0 1px 0 #fff inset;
  cursor: pointer;
  padding: 10px 0px;
  transition: box-shadow 0.18s, transform 0.12s, background 0.18s;
  outline: none;
  position: relative;
}

.garage-selection {
  padding: 0px;
}

.garage-rotate:hover, .garage-rotate:focus-visible {
  background: linear-gradient(180deg, #f5f5fa 0%, #b0bec5 100%);
  box-shadow: 0 4px 16px rgba(60, 60, 90, 0.18), 0 1px 0 #fff inset;
  transform: translateY(-2px) scale(1.04);
}

.garage-rotate:active {
  background: linear-gradient(180deg, #cfd8dc 0%, #b0bec5 100%);
  box-shadow: 0 1px 4px rgba(60, 60, 90, 0.10);
  transform: translateY(1px) scale(0.98);
}

.color-sektional {
  display: none;
}
.swatch-row-label {
  grid-column: 1 / -1;
  font-weight: 600;
  text-align: center;
  margin-bottom: 6px;
}