* {
    font-family: "Assistant", sans-serif;
}

#chat-text-input-container{
    display: flex;
}

#chat-text-input-container-mobile{
    display: flex;
}

#chat-input{
    flex-grow: 1;
    font-size: 15px;
    padding: 10px;
    border: 1px solid rgb(96, 96, 96);
    font-family: "Assistant", sans-serif;
    outline: none;
    margin: 3px;
    box-sizing: border-box;
    border-radius: 0px;
    font-weight: 500; /* Leicht fetter als normal (400) */
}

#chat-input-mobile{
    flex-grow: 1;
    font-size: 15px;
    padding: 10px;
    border: 1px solid rgb(92, 92, 92);
    font-family: "Assistant", sans-serif;
    outline: none;
    margin: 3px;
    box-sizing: border-box;
    border-radius: 0px;
    font-weight: 500; /* Leicht fetter als normal (400) */
}

#chat-send-button{
    padding: 10px;
    font-size: 16px;
    cursor: pointer;
    font-family: "Assistant", sans-serif;
    margin: 3px;
    width: 10%;
    box-sizing: border-box;
    float: right;
    border-radius: 0px;
    font-weight: 500; /* Leicht fetter als normal (400) */
}

#chat-send-button-mobile{
    padding: 10px;
    font-size: 16px;
    cursor: pointer;
    font-family: "Assistant", sans-serif;
    margin: 3px;
    width: 15%;
    box-sizing: border-box;
    float: right;
    border-radius: 0px;
    font-weight: 500; /* Leicht fetter als normal (400) */
}

#chat-box{
    max-height: 80vh; /* 80% der Viewport-Höhe auf Desktop */
    overflow-y: scroll;
}

#chat-box-mobile{
    max-height: 60vh;
    overflow-y: scroll;
}
.vf-message {
    font-size: 16px;
    border-radius: 0px;
    padding: 6px 15px;
    display: block;
    box-sizing: border-box;
    font-family: "Assistant", sans-serif;
    font-weight: 500; /* Leicht fetter als normal (400) */
    line-height: 1.3;
}

.vf-message-user {
    float: right;
    max-width: 70%;
    /* Farbdefinitionen entfernt, damit die dynamischen Einstellungen aus openai_chat.liquid wirksam werden */
    margin: 5px 5px 5px auto; /* Rechts ausrichten */
    clear: both;
    font-weight: 500; /* Leicht fetter als normal (400) */
}

.vf-message-agent {
    float: left;
    max-width: 95%;
    background-color: transparent; /* Kein Hintergrund für Agent-Nachrichten - Chatbox-Hintergrund wird verwendet */
    margin: 2px auto 2px 5px; /* Links ausrichten */
    clear: both;
    border-radius: 0; /* Kein Border-Radius */
    box-shadow: none; /* Kein Schatten-Effekt */
}

/* Formatierung für fetten und kursiven Text */
.vf-message-agent strong,
.vf-message-agent b {
    font-weight: bold !important;
    color: inherit;
}

.vf-message-agent em,
.vf-message-agent i {
    font-style: italic !important;
    color: inherit;
}

/* Formatierung für Code-Blöcke */
.vf-message-agent code {
    background-color: rgba(0, 0, 0, 0.1);
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.vf-message-agent pre {
    background-color: rgba(0, 0, 0, 0.1);
    padding: 8px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 6px 0;
}

.vf-message-agent pre code {
    background-color: transparent;
    padding: 0;
}

/* Formatierung für Listen in Agentennachrichten */
.vf-message-agent ul {
    margin: 6px 0 !important;
    padding-left: 20px !important;
    list-style-type: disc !important;
}

.vf-message-agent ol {
    margin: 6px 0 !important;
    padding-left: 20px !important;
    list-style-type: decimal !important;
}

.vf-message-agent li {
    margin: 2px 0 !important;
    padding: 0 !important;
    line-height: 1.4 !important;
}

/* Verschachtelte Listen */
.vf-message-agent ul ul,
.vf-message-agent ol ol,
.vf-message-agent ul ol,
.vf-message-agent ol ul {
    margin: 1px 0 !important;
    padding-left: 16px !important;
}

/* Reduziere Abstände für leere Absätze und Zeilenumbrüche */
.vf-message-agent p:empty {
    margin: 0 !important;
    line-height: 0.5 !important;
}

.vf-message-agent br {
    line-height: 0.8 !important;
}

/* Reduziere Abstände zwischen aufeinanderfolgenden Elementen */
.vf-message-agent p + p {
    margin-top: 1px !important;
}

.vf-message-agent h1 + p,
.vf-message-agent h2 + p,
.vf-message-agent h3 + p,
.vf-message-agent h4 + p,
.vf-message-agent h5 + p,
.vf-message-agent h6 + p {
    margin-top: 1px !important;
}

.vf-message-agent ul + p,
.vf-message-agent ol + p {
    margin-top: 1px !important;
}

/* Container für die Nachricht und die Antwortvorschläge */
.vf-message-container {
    display: flex;
    flex-direction: column;
    margin-bottom: 4px; /* Abstand zwischen den Nachrichten */
    width: 100%;
    position: relative; /* Für absolute Positionierung von Elementen innerhalb des Containers */
}

/* Vorschläge-Container */
.vf-suggested-responses {
    margin-top: 8px;
    margin: 8px 5px 0 5px; /* Gleichmäßiger Rand links und rechts */
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center; /* Zentrierte Ausrichtung auf Desktop */
}

.vf-message-button{
    padding: 10px;
    font-size: 16px;
    cursor: pointer;
    font-family: "Assistant", sans-serif;
    margin: 5px;
    box-sizing: border-box;
    border-radius: 0px;
    font-weight: 500; /* Leicht fetter als normal (400) */
}

#chat-all-button-container{
    display: flex;
    justify-content: center;
}

#chat-all-button-container-mobile{
    display: flex;
    justify-content: center;
}

/* Die Stile für .chat-box-typing-indicator wurden in die openai_chat.liquid Datei verschoben,
   damit sie die Metafield-Einstellungen verwenden können */

/* Chat-Container als relative Position für Typing-Indicator */
#chat-container {
    position: relative;
}

/* Typing Indicator verwendet jetzt vf-message-agent Klassen - keine speziellen Styles nötig */


.chat-box-typing-indicator-mobile {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 24px;
}

/* Die Stile für .chat-box-typing-indicator span wurden in die openai_chat.liquid Datei verschoben,
   damit sie die Metafield-Einstellungen verwenden können */

.chat-box-typing-indicator span:nth-child(1) {
    animation-delay: 0s;
}

.chat-box-typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.chat-box-typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

/* Die Animation für den Typing Indicator wurde in die openai_chat.liquid Datei verschoben,
   damit sie mit den anderen Stilen konsistent ist */

.AIchatbot_mobile h2 {
    /* Farbdefinitionen entfernt, damit die dynamischen Einstellungen aus openai_chat.liquid wirksam werden */
    font-weight: bold !important;
    padding: 12px 18px !important; /* Höherer Balken */
    font-size: 18px !important;
    border-radius: 0px !important;
    text-align: center;
}

/* ===== JSON PRODUCT CARDS STYLES ===== */

/* Hauptcontainer für JSON Product Cards */
.json-product-cards-wrapper {
  margin: 20px 0;
  width: 100%;
  clear: both;
}

/* Horizontaler Container für Cards */
.json-product-cards-container {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 10px 0;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* Einzelne Produktkarte */
.json-product-card {
  flex: 0 0 280px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  min-height: auto; /* Dynamische Höhe basierend auf Inhalt */
  display: flex;
  flex-direction: column;
}

/* Card ohne Bild - kompaktere Darstellung */
.json-product-card.no-image {
  min-height: auto;
}

/* Card mit Bild - kompaktere Darstellung */
.json-product-card.has-image {
  min-height: auto;
}

.json-product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  /* border-color wird dynamisch per JavaScript gesetzt */
}

/* Produktbild Container */
.json-product-image-container {
  width: 100%;
  height: 250px; /* Erhöhte Bildhöhe für bessere Darstellung */
  overflow: hidden;
  background: #f9fafb;
  flex-shrink: 0;
  position: relative;
  cursor: pointer;
}

/* Bildcontainer für Cards ohne feste Höhe */
.json-product-card.no-image .json-product-image-container {
  height: auto;
  min-height: 200px; /* Minimale Höhe für Bilder in kompakten Cards */
}

/* Produktbild */
.json-product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.json-product-card:hover .json-product-image {
  transform: scale(1.05);
}

/* Content-Bereich */
.json-product-content {
  padding: 12px 16px; /* Reduziertes vertikales Padding */
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/* Produkttitel */
.json-product-title {
  font-size: 16px;
  font-weight: 500;
  color: #1f2937;
  margin: 0 0 6px 0; /* Reduzierter Abstand */
  line-height: 1.3; /* Kompaktere Zeilenhöhe */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Produktpreis */
.json-product-price {
  font-size: 18px;
  font-weight: 700;
  color: #059669;
  margin: 0; /* Kein unterer Abstand mehr */
}

/* Produktbeschreibung */
.json-product-description {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.5;
  margin: 0 0 12px 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
  font-weight: 500; /* Leicht fetter als normal (400) */
}

/* Highlights Container - über dem Bild positioniert */
.json-product-highlights {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  z-index: 2;
  pointer-events: none; /* Klicks gehen durch zu dem Bild darunter */
}

/* Einzelner Highlight - über dem Bild mit besserer Sichtbarkeit */
.json-product-highlight {
  background: rgba(255, 255, 255, 0.95); /* Weißer Hintergrund mit Transparenz */
  color: #1f2937; /* Dunkler Text für bessere Lesbarkeit */
  font-size: 11px;
  font-weight: 500;
  padding: 3px 6px;
  border-radius: 4px;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(2px);
}

/* Call-to-Action Button - Dynamische Farben werden per JavaScript gesetzt */
.json-product-cta {
  display: block;
  width: 100%;
  background: #3b82f6; /* Fallback-Farbe */
  color: white !important;
  text-decoration: none !important;
  text-align: center;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
  transition: background-color 0.3s ease;
  margin-top: auto;
  box-sizing: border-box;
}

/* Hover-Effekte werden dynamisch per JavaScript gesetzt */

/* Erklärungstext - Dynamische Farben werden per JavaScript gesetzt */
.json-product-explanation {
  margin: 16px 0 0 0;
  padding: 16px;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.6;
  color: #374151;
  border-left: 4px solid #3b82f6; /* Fallback-Farbe */
  font-weight: 500; /* Leicht fetter als normal (400) */
}

/* Responsive Design */
@media (max-width: 768px) {
  /* Typing-Indicator Mobile Anpassung */
  #chat-box-typing-indicator-container {
    bottom: 60px; /* Kleinerer Abstand auf Mobile */
  }

  /* Suggestion Buttons Mobile Optimierung */
  .vf-suggested-responses {
    margin: 8px 2px 0 0; /* Nur rechter Rand auf Mobile */
    gap: 6px; /* Kleinerer Abstand zwischen Buttons */
    justify-content: flex-end; /* Rechtsbündige Ausrichtung auf Mobile */
    flex-direction: column; /* Buttons untereinander auf Mobile */
    align-items: flex-end; /* Buttons rechtsbündig ausrichten */
  }

  .vf-suggestion-button {
    font-size: 1em !important; /* Normale Schriftgröße auf Mobile */
    padding: 8px 12px !important; /* Etwas mehr Padding für bessere Lesbarkeit */
    max-width: 100% !important; /* Volle Breite verfügbar */
    min-width: auto !important; /* Keine Mindestbreite */
    flex: 0 0 auto !important; /* Keine Flexibilität - jeder Button in eigener Reihe */
    word-break: break-word !important; /* Wortumbruch bei langen Texten */
    white-space: normal !important; /* Mehrzeiliger Text erlaubt */
    line-height: 1.3 !important; /* Bessere Zeilenhöhe für mehrzeiligen Text */
    width: auto !important; /* Automatische Breite basierend auf Inhalt */
  }

  .json-product-card {
    flex: 0 0 200px; /* Kleinere Breite auf Mobile */
    min-height: auto; /* Dynamische Höhe auf Mobile */
  }

  /* Cards mit Bild auf Mobile */
  .json-product-card.has-image {
    min-height: 300px; /* Reduzierte Mindesthöhe auf Mobile */
  }

  /* Cards ohne Bild bleiben kompakt */
  .json-product-card.no-image {
    min-height: auto;
  }

  .json-product-image-container {
    height: 200px; /* Reduzierte Bildhöhe auf Mobile */
  }

  /* Bildcontainer für kompakte Cards auf Mobile */
  .json-product-card.no-image .json-product-image-container {
    height: auto;
    min-height: 150px; /* Kleinere minimale Höhe auf Mobile */
  }

  .json-product-content {
    padding: 12px;
  }

  .json-product-title {
    font-size: 14px;
  }

  .json-product-price {
    font-size: 16px;
  }

  .json-product-cards-container {
    gap: 10px; /* Kleinerer Abstand auf Mobile */
  }
}

/* Extra kleine Bildschirme */
@media (max-width: 480px) {
  /* Suggestion Buttons für sehr kleine Bildschirme */
  .vf-suggested-responses {
    margin: 8px 1px 0 0; /* Nur rechter Rand auf sehr kleinen Bildschirmen */
    gap: 4px; /* Noch kleinerer Abstand zwischen Buttons */
    justify-content: flex-end; /* Rechtsbündige Ausrichtung auf sehr kleinen Bildschirmen */
    flex-direction: column; /* Buttons untereinander auch auf sehr kleinen Bildschirmen */
    align-items: flex-end; /* Buttons rechtsbündig ausrichten */
  }

  .vf-suggestion-button {
    font-size: 0.9em !important; /* Etwas kleinere aber gut lesbare Schriftgröße */
    padding: 7px 10px !important; /* Ausreichend Padding für Lesbarkeit */
    max-width: 100% !important; /* Volle Breite verfügbar */
    border-radius: 12px !important; /* Kleinerer Radius für kompaktere Darstellung */
    width: auto !important; /* Automatische Breite basierend auf Inhalt */
  }

  .json-product-card {
    flex: 0 0 180px; /* Noch kleinere Breite auf sehr kleinen Bildschirmen */
  }

  .json-product-card.has-image {
    min-height: 280px;
  }

  .json-product-image-container {
    height: 180px;
  }

  .json-product-card.no-image .json-product-image-container {
    min-height: 120px;
  }

  .json-product-content {
    padding: 10px;
  }

  .json-product-title {
    font-size: 13px;
  }

  .json-product-price {
    font-size: 15px;
  }

  .json-product-cards-container {
    gap: 8px;
  }
}

/* Scrollbar Styling für horizontales Scrollen */
.json-product-cards-container::-webkit-scrollbar {
  height: 6px;
}

.json-product-cards-container::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}

.json-product-cards-container::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.json-product-cards-container::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ===== ZOOM FUNKTIONALITÄT ===== */

/* Zoom-Icon auf dem Produktbild */
.json-product-zoom-icon {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  opacity: 1; /* Immer sichtbar */
  transition: background 0.3s ease, transform 0.2s ease;
  pointer-events: none;
  z-index: 3;
}

/* Zoom-Icon Hover-Effekt */
.json-product-image-container:hover .json-product-zoom-icon {
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.1);
}

/* Hover-Effekt für Bildcontainer */
.json-product-image-container:hover::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.1);
  transition: background 0.3s ease;
}

/* Modal für vergrößertes Bild */
.json-product-image-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  cursor: pointer;
}

.json-product-image-modal.active {
  opacity: 1;
  visibility: visible;
}

/* Vergrößertes Bild im Modal */
.json-product-image-modal img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.8);
  transition: transform 0.3s ease;
}

.json-product-image-modal.active img {
  transform: scale(1);
}

/* Schließen-Button im Modal */
.json-product-image-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s ease;
}

.json-product-image-modal-close:hover {
  background: white;
}

/* Mobile Anpassungen für Zoom und Highlights */
@media (max-width: 768px) {
  .json-product-zoom-icon {
    width: 28px;
    height: 28px;
    font-size: 12px;
    top: 6px;
    right: 6px;
  }

  .json-product-highlights {
    bottom: 6px;
    left: 6px;
    right: 6px;
    gap: 3px;
  }

  .json-product-highlight {
    font-size: 10px;
    padding: 2px 5px;
  }

  .json-product-image-modal img {
    max-width: 95%;
    max-height: 95%;
  }

  .json-product-image-modal-close {
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    font-size: 18px;
  }
}