/* ============================================
   Hundehalsband-Konfigurator — Stylesheet
   Nach Original myappenzell.com Struktur
   ============================================ */

/* === RESET & BASIS === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: #f5f0eb;
  color: #333;
  line-height: 1.5;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ol, ul { list-style: none; }

/* === HEADER === */
#header {
  background: #2c1810;
  padding: 14px 20px;
  text-align: center;
}

#header h1 {
  color: #f5e6d0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
}

#header p {
  color: #c9956b;
  font-size: 13px;
  margin-top: 3px;
}

/* === NAVIGATION === */
#navigation {
  background: #3d2518;
  padding: 0;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}

#navigation ul {
  display: flex;
  justify-content: center;
  min-width: max-content;
  list-style: none;
}

#navigation li {
  flex: 0 0 auto;
}

#navigation a {
  display: block;
  padding: 12px 16px;
  color: #c9b99a;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: background 0.2s, color 0.2s;
  border-bottom: 3px solid transparent;
  cursor: pointer;
}

#navigation a:hover {
  background: #4d3525;
  color: #fff;
}

#navigation a.active {
  color: #fff;
  border-bottom-color: #c9956b;
  background: #4d3525;
}

#navigation .step-number {
  display: inline-block;
  width: 20px;
  height: 20px;
  line-height: 20px;
  text-align: center;
  background: #c9956b;
  color: #2c1810;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  margin-right: 5px;
}

/* === CART / VORSCHAU-BEREICH (immer sichtbar) === */
#cart {
  background: #fff;
  border: 1px solid #d4c9b8;
  border-radius: 4px;
  margin: 15px auto;
  padding: 15px;
  position: relative;
  max-width: 960px;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.cart-title {
  font-size: 14px;
  font-weight: 600;
  color: #2c1810;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cart-actions {
  display: flex;
  gap: 10px;
}

#zoom, #trash {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition: background 0.2s, transform 0.2s;
  border: 1px solid #d4c9b8;
  background: #f9f6f2;
  color: #6b5744;
  user-select: none;
}

#zoom:hover, #trash:hover {
  background: #ede7df;
  transform: scale(1.05);
}

#trash.drag-hover {
  background: #e74c3c;
  color: #fff;
  border-color: #c0392b;
  transform: scale(1.15);
}

/* Scrollbarer Halsband-Bereich */
.scrollable-wrapper-cart {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #d4c9b8;
  border-radius: 3px;
  background: #e8ddd0;
  padding: 15px 10px;
}

/* === CART-INNER: Das Halsband selbst === */
.cart-inner {
  position: relative;
  height: 56px;
  min-width: 600px;
  background-color: #c4a06a;
  background-size: cover;
  background-repeat: repeat-x;
  transition: height 0.3s, background-color 0.3s;
  border-radius: 0 6px 6px 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* Breiten-Varianten */
.cart-inner.breite-15 { height: 36px; }
.cart-inner.breite-20 { height: 46px; }
.cart-inner.breite-25 { height: 56px; }
.cart-inner.breite-30 { height: 68px; }
.cart-inner.breite-40 { height: 84px; }

/* Schnalle ragt oben+unten über das Band hinaus */
.breite-15 .buckle-container { height: calc(100% + 24px); }
.breite-20 .buckle-container { height: calc(100% + 22px); }
.breite-25 .buckle-container { height: calc(100% + 20px); }
.breite-30 .buckle-container { height: calc(100% + 18px); }
.breite-40 .buckle-container { height: calc(100% + 16px); }

/* Belt-Höhe an Bandbreite anpassen */
.breite-15 #belt { height: 24px; }
.breite-15 #belt li img { height: 20px; }
.breite-20 #belt { height: 30px; }
.breite-20 #belt li img { height: 26px; }
.breite-25 #belt { height: 36px; }
.breite-25 #belt li img { height: 32px; }
.breite-30 #belt { height: 44px; }
.breite-30 #belt li img { height: 40px; }
.breite-40 #belt { height: 56px; }
.breite-40 #belt li img { height: 50px; }

/* Lederfarben */
.cart-inner.leder-natur       { background-color: #c4a06a; }
.cart-inner.leder-braun       { background-color: #8B5E3C; }
.cart-inner.leder-dunkelbraun { background-color: #5C3A1E; }
.cart-inner.leder-schwarz     { background-color: #1a1a1a; }
.cart-inner.leder-rot         { background-color: #8B2500; }
.cart-inner.leder-blau        { background-color: #2B4570; }
.cart-inner.leder-gruen       { background-color: #3B5E2B; }

/* === ZIERNAHT-SYSTEM (CSS-basiert) === */
#stitching-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

#topBottomLeftStitching {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  border: none;
  transition: border-color 0.3s;
}

#topBottomLeftStitching.schwarz { border: 2px dashed #1a1a1a; }
#topBottomLeftStitching.weiss   { border: 2px dashed #ffffff; }
#topBottomLeftStitching.rot     { border: 2px dashed #cc0000; }
#topBottomLeftStitching.braun   { border: 2px dashed #8B4513; }
#topBottomLeftStitching.blau    { border: 2px dashed #1a4a8a; }
#topBottomLeftStitching.gelb    { border: 2px dashed #DAA520; }
#topBottomLeftStitching.keine   { border: none; }

#rightStitching {
  position: absolute;
  right: 0;
  top: 0;
  width: 0;
  height: 100%;
}

#rightStitching.schwarz { border-right: 2px dashed #1a1a1a; }
#rightStitching.weiss   { border-right: 2px dashed #ffffff; }
#rightStitching.rot     { border-right: 2px dashed #cc0000; }
#rightStitching.braun   { border-right: 2px dashed #8B4513; }
#rightStitching.blau    { border-right: 2px dashed #1a4a8a; }
#rightStitching.gelb    { border-right: 2px dashed #DAA520; }
#rightStitching.keine   { border-right: none; }

/* === SCHNALLE (links, breiter als Band) === */
.buckle-container {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: calc(100% + 20px);
  z-index: 10;
  display: flex;
  align-items: center;
}

.buckle-container .buckleImg {
  height: 100%;
  width: auto;
  min-width: 50px;
  max-width: 70px;
  object-fit: contain;
  filter: drop-shadow(2px 1px 3px rgba(0,0,0,0.4));
}

/* === LÖCHER rechts (wie echtes Halsband) === */
.holes-container {
  position: absolute;
  right: 30px;
  top: 0;
  height: 100%;
  z-index: 9;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  align-items: center;
}

/* Löcher horizontal nebeneinander auf der Mittellinie */
.holes-container {
  flex-direction: row;
  top: 50%;
  transform: translateY(-50%);
  height: auto;
  gap: 8px;
  right: 20px;
}

.hole {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.6), 0 0 0 1px rgba(0,0,0,0.2);
}

/* Breiten-Anpassungen für Löcher */
.breite-15 .hole { width: 4px; height: 4px; }
.breite-20 .hole { width: 5px; height: 5px; }
.breite-30 .hole { width: 7px; height: 7px; }
.breite-40 .hole { width: 8px; height: 8px; }

/* === Abgerundetes Bandende rechts === */
.belt-end {
  position: absolute;
  right: -8px;
  top: 0;
  width: 16px;
  height: 100%;
  z-index: 7;
  border-radius: 0 8px 8px 0;
  background: inherit;
  /* Erbt die Lederfarbe vom Parent */
}

/* Belt-End Lederfarben erben */
.leder-natur .belt-end       { background-color: #c4a06a; }
.leder-braun .belt-end       { background-color: #8B5E3C; }
.leder-dunkelbraun .belt-end { background-color: #5C3A1E; }
.leder-schwarz .belt-end     { background-color: #1a1a1a; }
.leder-rot .belt-end         { background-color: #8B2500; }
.leder-blau .belt-end        { background-color: #2B4570; }
.leder-gruen .belt-end       { background-color: #3B5E2B; }

/* === BELT: Motivbereich auf dem Halsband === */
#belt {
  position: absolute;
  top: 50%;
  left: 65px;
  right: 80px;
  transform: translateY(-50%);
  height: 40px;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  padding: 2px 0;
}

#belt li {
  position: relative;
  cursor: move;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  list-style: none;
}

#belt li:hover {
  transform: scale(1.1);
  z-index: 20;
}

#belt li img {
  height: 36px;
  width: auto;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4));
}

/* Füllfarbe in Motiven — wird per JS gesetzt */
#belt li.has-fill img {
  /* Filter wird per JS inline gesetzt */
}

/* Platzhalter wenn leer */
#belt:empty::after {
  content: 'Motive hierher ziehen';
  color: rgba(255,255,255,0.5);
  font-size: 12px;
  font-style: italic;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  pointer-events: none;
}

#belt.drag-over {
  background: rgba(255,255,255,0.15);
  border-radius: 3px;
}

/* jQuery UI Sortable Platzhalter */
#belt .ui-sortable-placeholder {
  width: 36px;
  height: 36px;
  border: 2px dashed rgba(255,255,255,0.5);
  border-radius: 3px;
  visibility: visible !important;
  background: rgba(255,255,255,0.1);
}

/* === ORDER OVERVIEW TABELLE === */
#order-overview {
  width: 100%;
  margin-top: 12px;
  border-collapse: collapse;
  font-size: 13px;
}

#order-overview th {
  text-align: left;
  font-weight: 600;
  color: #2c1810;
  padding: 4px 8px;
  border-bottom: 1px solid #d4c9b8;
  font-size: 12px;
  text-transform: uppercase;
}

#order-overview td {
  padding: 4px 8px;
  border-bottom: 1px solid #eee;
  color: #555;
}

#order-overview td:last-child {
  text-align: right;
  font-weight: 600;
  color: #2c1810;
}

#order-overview .total-row td {
  border-top: 2px solid #2c1810;
  font-weight: 700;
  color: #2c1810;
  font-size: 15px;
  padding-top: 8px;
}

/* === PANELS (show/hide) === */
.panel {
  display: none;
  background: #fff;
  border: 1px solid #d4c9b8;
  border-radius: 4px;
  margin: 0 auto 15px;
  padding: 20px;
  max-width: 960px;
  animation: fadeIn 0.25s ease;
}

.panel.active {
  display: block;
}

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

.panel h2 {
  font-size: 18px;
  color: #2c1810;
  margin-bottom: 5px;
  font-weight: 600;
}

.panel .panel-subtitle {
  color: #888;
  font-size: 13px;
  margin-bottom: 15px;
}

/* === FLICKITY SLIDER === */
.slider-container {
  margin: 0 -5px;
  overflow: hidden;
  padding-bottom: 10px;
}

.slider-item {
  width: 120px;
  margin: 0 5px;
  text-align: center;
  cursor: pointer;
  padding: 8px;
  border: 2px solid transparent;
  border-radius: 6px;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.slider-item:hover {
  border-color: #c9956b;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.slider-item.selected {
  border-color: #c9956b;
  background: #fdf8f3;
  box-shadow: 0 2px 8px rgba(201,149,107,0.3);
}

.slider-item img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin: 0 auto 6px;
  border-radius: 4px;
}

.slider-item .item-name {
  font-size: 11px;
  font-weight: 600;
  color: #2c1810;
  margin-bottom: 2px;
}

.slider-item .item-price {
  font-size: 11px;
  color: #888;
}

/* Motive: Drag-Cursor */
.slider-item.motive {
  cursor: grab;
}

.slider-item.motive:active {
  cursor: grabbing;
}

/* Draggable Helper (Clone während Drag) */
.ui-draggable-dragging {
  z-index: 9999 !important;
  opacity: 0.85;
  transform: scale(1.1);
  pointer-events: none;
}

/* === GRÖSSEN-PANEL === */
.size-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.size-option {
  flex: 1 1 calc(50% - 10px);
  min-width: 200px;
  padding: 15px;
  border: 2px solid #d4c9b8;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.size-option:hover {
  border-color: #c9956b;
  background: #fdf8f3;
}

.size-option.selected {
  border-color: #c9956b;
  background: #fdf8f3;
  box-shadow: 0 2px 8px rgba(201,149,107,0.3);
}

.size-label {
  font-size: 18px;
  font-weight: 700;
  color: #2c1810;
  margin-bottom: 4px;
}

.size-detail {
  font-size: 12px;
  color: #888;
}

.size-price {
  font-size: 14px;
  font-weight: 600;
  color: #c9956b;
  margin-top: 4px;
}

/* Breite-Auswahl */
.width-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.width-option {
  padding: 10px 20px;
  border: 2px solid #d4c9b8;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: #2c1810;
  transition: all 0.2s;
}

.width-option:hover {
  border-color: #c9956b;
  background: #fdf8f3;
}

.width-option.selected {
  border-color: #c9956b;
  background: #c9956b;
  color: #fff;
}

/* === MOTIV-GRUPPEN === */
.motive-group {
  margin-bottom: 20px;
}

.motive-group h3 {
  font-size: 14px;
  color: #2c1810;
  margin-bottom: 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid #eee;
}

/* === BESTELLFORMULAR === */
#orderForm .form-group {
  margin-bottom: 15px;
}

#orderForm label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  color: #2c1810;
  margin-bottom: 4px;
}

#orderForm input,
#orderForm textarea,
#orderForm select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d4c9b8;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
}

#orderForm input:focus,
#orderForm textarea:focus,
#orderForm select:focus {
  outline: none;
  border-color: #c9956b;
  box-shadow: 0 0 0 3px rgba(201,149,107,0.15);
}

#orderForm textarea {
  min-height: 80px;
  resize: vertical;
}

.form-row {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}

.form-row .form-group {
  flex: 1;
  margin-bottom: 0;
}

.submit-btn {
  width: 100%;
  padding: 14px;
  background: #c9956b;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: background 0.2s;
  margin-top: 10px;
}

.submit-btn:hover {
  background: #b8845a;
}

/* Bestellübersicht-Box */
.order-summary-box {
  background: #fdf8f3;
  border: 1px solid #d4c9b8;
  border-radius: 6px;
  padding: 15px 20px;
  margin-bottom: 20px;
}

.order-summary-box h3 {
  font-size: 14px;
  color: #2c1810;
  margin-bottom: 10px;
}

.order-summary-box table {
  width: 100%;
  border-collapse: collapse;
}

.order-summary-box td {
  padding: 4px 0;
  font-size: 13px;
  color: #555;
  border-bottom: 1px solid #eee;
}

.order-summary-box td:first-child {
  font-weight: 600;
  color: #2c1810;
  width: 130px;
}

/* Zahlungsoptionen */
.payment-options {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.payment-option {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 14px;
  background: #fdf8f3;
  border: 1px solid #d4c9b8;
  border-radius: 6px;
  padding: 8px 16px;
  transition: border-color 0.2s;
}

.payment-option:has(input:checked) {
  border-color: #c9956b;
  background: #fdf8f3;
}

.payment-option input[type="radio"] {
  accent-color: #c9956b;
}

/* === FOOTER === */
#footer {
  background: #fff;
  border: 1px solid #d4c9b8;
  border-radius: 4px;
  margin: 0 auto 30px;
  padding: 15px 20px;
  max-width: 960px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  bottom: 0;
  z-index: 100;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
}

.price-display {
  font-size: 22px;
  font-weight: 700;
  color: #2c1810;
}

.price-display .currency {
  font-size: 14px;
  font-weight: 400;
  color: #888;
}

.btn-weiter {
  padding: 12px 40px;
  background: #c9956b;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: background 0.2s, transform 0.1s;
}

.btn-weiter:hover {
  background: #b8845a;
}

.btn-weiter:active {
  transform: scale(0.98);
}

/* === ZOOM OVERLAY === */
#zoom-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.85);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

#zoom-overlay.active {
  display: flex;
}

.zoom-content {
  max-width: 95vw;
  max-height: 85vh;
  overflow: auto;
  background: #fff;
  border-radius: 8px;
  padding: 30px;
}

.zoom-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 40px;
  color: #fff;
  cursor: pointer;
  line-height: 1;
}

.zoom-close:hover {
  color: #c9956b;
}

/* === ERFOLGSMELDUNG === */
.success-message {
  text-align: center;
  padding: 40px 20px;
}

.success-message .checkmark {
  font-size: 60px;
  color: #27ae60;
  margin-bottom: 15px;
}

.success-message h2 {
  color: #2c1810;
  margin-bottom: 10px;
}

.success-message p {
  color: #666;
  max-width: 420px;
  margin: 0 auto;
  line-height: 1.6;
}

/* === FLICKITY OVERRIDES === */
.flickity-enabled {
  outline: none;
}

.flickity-viewport {
  overflow: hidden;
}

.flickity-slider {
  position: relative;
}

.flickity-prev-next-button {
  width: 34px;
  height: 34px;
  background: #2c1810;
  color: #fff;
  border-radius: 50%;
  z-index: 10;
}

.flickity-prev-next-button:hover {
  background: #c9956b;
}

.flickity-prev-next-button .flickity-button-icon {
  fill: #fff;
}

.flickity-page-dots {
  bottom: -25px;
}

.flickity-page-dots .dot {
  background: #c9956b;
}

/* Slider-Items innerhalb Flickity korrekt positionieren */
.flickity-slider .slider-item {
  display: inline-block;
  vertical-align: top;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  #navigation a {
    padding: 10px 12px;
    font-size: 11px;
  }

  .slider-item {
    width: 100px;
  }

  .slider-item img {
    width: 60px;
    height: 60px;
  }

  .size-option {
    flex: 1 1 100%;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  #footer {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .btn-weiter {
    width: 100%;
  }

  .cart-inner {
    min-width: 500px;
  }
}

@media (max-width: 480px) {
  #navigation .step-number {
    display: none;
  }

  #navigation a {
    padding: 8px 10px;
    font-size: 10px;
  }

  .panel {
    padding: 15px;
  }

  .slider-item {
    width: 85px;
    padding: 5px;
  }

  .slider-item img {
    width: 50px;
    height: 50px;
  }

  .width-options {
    gap: 5px;
  }

  .width-option {
    padding: 8px 12px;
    font-size: 12px;
  }
}
