/* ============================================
   CART COLOR SELECTION - Finale Version
   ============================================ */

.cart-item-color-selection {
  background-color: #fde9f2 !important; /* Helles Pink */
  padding: 15px !important;
  margin: 15px 0 !important;
  display: block !important;
  width: calc(100% - 30px) !important; /* f fcr Padding innerhalb der Box */
  box-sizing: border-box !important;
  border-top: 2px solid #e91e63 !important; /* Pinke Linie oben */
  border-bottom: 2px solid #e91e63 !important; /* Pinke Linie unten */
  position: relative !important;
  /* Innerhalb eines .cart-item Grids soll die Leiste alle Spalten 
         einnehmen und nicht nur in einer Zelle kleben */
  grid-column: 1 / -1 !important;
  z-index: 5 !important;
}

/* Stelle sicher, dass die cart-item-Box die Farbauswahl nicht abschneidet */
/* Kein globales overflow-override mehr — die Leiste bleibt innerhalb der Box */

.cart-color-main-label {
  font-weight: 600 !important;
  margin-bottom: 10px !important;
  display: block !important;
  color: #333 !important;
}

.cart-color-options-scroll {
  display: flex !important;
  flex-direction: row !important;
  overflow-x: auto !important;
  gap: 15px !important;
  padding-bottom: 10px !important;
  scrollbar-width: thin !important;
  scrollbar-color: #e91e63 #fde9f2 !important;
  white-space: nowrap !important;
}

.cart-color-options-scroll::-webkit-scrollbar {
  height: 8px !important;
}

.cart-color-options-scroll::-webkit-scrollbar-track {
  background: #fde9f2 !important;
}

.cart-color-options-scroll::-webkit-scrollbar-thumb {
  background: #e91e63 !important;
  border-radius: 4px !important;
}

.cart-color-option {
  flex-shrink: 0 !important;
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 100px !important;
  max-width: 120px !important;
}

.cart-color-option label {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  border: 2px solid #e0e0e0 !important;
  padding: 8px !important;
  margin: 0 !important;
  border-radius: 8px !important;
  background-color: white !important;
  transition: all 0.2s ease !important;
  height: 100% !important;
  min-height: 120px !important;
  position: relative !important;
}

.cart-color-option label:hover {
  border-color: #e91e63 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1) !important;
}

.cart-color-option.selected label {
  border-color: #e91e63 !important; /* Pink für Auswahl passend zum Theme */
  background-color: #fff5f9 !important;
  box-shadow: 0 0 12px rgba(233, 30, 99, 0.3) !important;
}

.cart-color-option.selected .cart-color-image {
  transform: scale(1.05) !important;
}

.cart-color-option.selected label::after {
  content: "✓" !important;
  position: absolute !important;
  top: 5px !important;
  right: 5px !important;
  background-color: #e91e63 !important;
  color: white !important;
  width: 20px !important;
  height: 20px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 12px !important;
  font-weight: bold !important;
}

.cart-color-image {
  width: 80px !important;
  height: 80px !important;
  border-radius: 6px !important;
  object-fit: contain !important; /* Zeigt das ganze Bild */
  object-position: center !important; /* Zentriert das Bild */
  background-color: #f8f8f8 !important; /* Leicht grauer Hintergrund */
  border: 1px solid #e0e0e0 !important;
  padding: 5px !important; /* Mehr Padding für besseren Look */
  box-sizing: border-box !important;
  image-rendering: crisp-edges !important; /* Schärfere Darstellung */
  image-rendering: -webkit-optimize-contrast !important; /* Für Safari */
}

.cart-color-name {
  font-size: 12px !important;
  margin-top: 5px !important;
  text-align: center !important;
  color: #555 !important;
}

/* Mobile-spezifische Anpassungen */
@media (max-width: 768px) {
  .cart-color-option {
    min-width: 90px !important;
    max-width: 100px !important;
  }
  
  .cart-color-option label {
    padding: 6px !important;
    min-height: 110px !important;
  }
  
  .cart-color-image {
    width: 70px !important;
    height: 70px !important;
    padding: 4px !important; /* Etwas weniger Padding auf Mobile */
  }
  
  .cart-color-name {
    font-size: 11px !important;
  }
  
  .cart-color-options-scroll {
    gap: 10px !important;
    padding: 5px !important;
  }
}

/* Auf großen Bildschirmen: Leiste bleibt innerhalb der Artikel-Box (keine Ausdehnung)
   — sie ist genau so breit wie die Box und behält Padding für Inhalt */
@media (min-width: 1000px) {
  .cart-item-color-selection {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
  }

  /* Full-bleed Klassen bleiben als opt-in bestehen, aber sind nicht standardmäßig aktiv */
  .cart-item-color-selection.full-bleed,
  .cart-item-color-selection.force-full-bleed {
    /* Kleine Überlappung zur Box: ca. 20px pro Seite (container-relativ) */
    width: calc(100% + 40px) !important; /* 20px links + 20px rechts */
    max-width: none !important;
    margin-left: -20px !important;
    margin-right: -20px !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
    z-index: 999 !important;
  }
}
