/* Custom styles for Deepak AI Product Configurator - Figma accurate Chat */

/* --- General Styles --- */
body, html {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
  font-family: 'Inter', sans-serif;
  height: 100%;
  overflow-x: hidden !important; /* Prevent horizontal scroll */
}

/* --- Overview Container --- */
.overview {
  min-height: 95vh;
  gap: 32px !important;
  /* Removed max-height and overflow constraints to allow natural page scrolling */
}

/* --- Bootstrap Grid Layout Structure --- */
.top-section {
  margin-bottom: 32px;
}

/* Ensure proper spacing and alignment for the new Bootstrap layout */
.top-section .product-display {
  height: 100%;
  min-height: 350px;
}

.top-section .configurator {
  height: 100%;
}

.bottom-section {
  width: 100%;
}

/* Product card styling for Bootstrap grid */
.product-card {
  height: 100%;
  margin: 0;
}

/* Responsive adjustments for Bootstrap grid layout */
@media (max-width: 991px) {
  .top-section .product-display {
    min-height: 250px;
  }
}

@media (max-width: 767px) {
  .top-section .product-display {
    min-height: 200px;
  }
}

/* --- Chatbot update fields --- */

@keyframes highlight-field-animation {
  from {
    background-color: #fffbe5; /* Een zachte, lichte geeltint */
    box-shadow: 0 0 8px rgba(255, 204, 0, 0.6); /* Een subtiele gloed */
  }
  to {
    background-color: transparent;
    box-shadow: none;
  }
}

.field-updated {
  /* Pas de animatie toe op het element */
  animation: highlight-field-animation 1.5s ease-out;
}

/* --- Chat Section --- */
.chat-container {
  max-width: 440px;
  position: sticky; /* Changed to sticky */
  top: 20px; /* Small offset from top */
  align-self: flex-start;
  height: 95vh; /* Full viewport height */
  display: flex;
  flex-direction: column;
  flex-shrink: 0; /* Prevent shrinking */
  z-index: 10; /* Ensure it stays on top when sticky */
}

/* --- Table Container --- */
.table-container {
  /* Removed height constraints and overflow properties */
  flex: 1; /* Take remaining space */
  /* Allow natural content flow - no height restrictions */
}

/* Removed custom scrollbar styles for table container since it won't scroll */

/* Ensure table-container-2 doesn't interfere with natural flow */
.table-container-2 {
  /* Removed min-height constraint */
}

.chat {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  border: 1px solid #eae7e7;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%; /* Take full height of container */
}

.chat__header {
  flex-shrink: 0;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

.chat__title {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 20px;
  color: #030404;
}

.chat__arrow i {
  font-size: 22px;
  color: #030404;
  transition: all 0.3s ease;
}

/* Updated chat body for internal scrolling only */
.chat__body {
  flex-grow: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #e0e0e0 transparent;
  padding-right: 8px;
}

.chat__body::-webkit-scrollbar {
  width: 6px;
}

.chat__body::-webkit-scrollbar-track {
  background: transparent;
}

.chat__body::-webkit-scrollbar-thumb {
  background-color: #e0e0e0;
  border-radius: 20px;
}

/* Updated message container styling */
.chat__message-container {
  margin-bottom: 16px;
}

.chat__message {
  display: flex;
  flex-direction: column;
}

.chat__message-wrapper {
  display: flex;
  align-items: flex-start;
}

/* Chat Avatar styles - updated to match image */
.chat__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

/* Updated chat text styling */
.chat__text {
  font-size: 16px;
  max-width: 300px;
  word-break: break-word;
  font-family: 'Inter', sans-serif;
  line-height: 1.5;
  border-radius: 18px !important;
}

.chat__text--user {
  background: #deeffa !important;
  color: #030404;
}

.chat__text--bot {
  background: #f5f5f5 !important;
  color: #030404;
}

/* Updated time positioning to match image */
.chat__time {
  font-size: 12px;
  color: #686868;
  margin-top: 4px;
  align-self: flex-start;
}

/* Updated input bar to match image */
.chat__input-bar {
  flex-shrink: 0;
  padding: 14px 16px !important;
  border-top: 1px solid rgba(0,0,0,0.1);
  background-color: #ffffff;
}

.chat__input-field {
  font-size: 15px;
  background: transparent;
  outline: none;
  padding: 8px 0;
  border-bottom: 1px solid transparent !important;
  border-radius: 8px !important;
}

.chat__input-field:focus {
  border-bottom: 1px solid rgba(31, 160, 66, 0.2) !important;
}

/* Updated send button to match image */
.chat__send-btn {
  width: 44px;
  height: 44px;
  background: #1a1a1a;
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.chat__send-btn:hover {
  background: #333333;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.chat__send-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Loading dots */
.chat__loading-indicator {
  margin: 0;
  padding: 0;
}

.chat__loading-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  animation: blink 1.4s infinite both;
}

@keyframes blink {
  0%, 80%, 100% { opacity: 0.3; }
  40% { opacity: 1; }
}

/* --- Product Display Section --- */
.product-display {
  background: #f2f2f2 !important;
  min-height: 180px;
}

/* --- Parameter Group Section --- */
.parameter-group__label {
  font-size: 16px;
  color: #030404;
}

.parameter-group__input {
  font-size: 14px;
  border-radius: 8px !important;
  height: 42px; /* Ensure consistent height for all inputs */
}

.parameter-group__input--highlighted {
  border-color: #bbdfc5 !important;
}

.parameter-group__value {
  font-size: 14px;
  color: #030404;
  width: 100%;
  border-radius: 8px !important;
}

.parameter-group__icon {
  width: 18px;
  height: 18px;
}

/* Updated styles for the dimension inputs to take full width */
.parameter-group__item {
  flex: 1;
  min-width: 0; /* Allow shrinking below default min-width */
  max-width: none; /* Remove max-width constraint */
}

/* Ensure consistent height for all form elements */
.parameter-group select,
.parameter-group input[type="number"],
.color-selector__button {
  height: 36px; /* Updated consistent height for all input elements */
}

/* First row dimension inputs should be equal width */
.parameter-group:first-of-type .parameter-group__item {
  flex: 1 1 33.33%; /* Equal distribution of space */
}

/* Input fields with flex-fill should expand properly */
.parameter-group__item.flex-fill {
  flex: 1 1 100%;
}

/* --- Color Selector Section --- */
.color-selector__button {
  background: #f5f5f5;
  color: #030404;  /* Ensure text is dark by default */
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  font-size: 14px !important;
  border: none;
  border-radius: 8px !important;
  padding: 6px 16px !important; /* Reduced padding */
  height: 36px; /* Fixed height to match other inputs */
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 80px; /* Ensure buttons have consistent minimum width */
}

.color-selector__button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.color-selector__button:active {
  transform: translateY(0);
}

.color-selector__button--active {
  background: #1fa042 !important;
  color: #fff !important;  /* White text only for active button */
}

/* Fix for color selector - ensure text is visible on inactive button */
.color-selector__button:not(.color-selector__button--active) {
  color: #030404 !important;  /* Force dark text color for inactive buttons */
  background-color: #f5f5f5 !important;
}

/* Fix for consistent color selector spacing */
.color-selector {
  display: flex;
  gap: 8px !important; /* Consistent gap between buttons */
}

.color-selector__text {
  font-weight: 500;
  font-size: 14px;
}

/* --- Upload Card Section --- */
.upload-card__label {
  font-size: 16px;
  color: #030404;
}

.upload-card__frame-label {
  border-radius: 8px 0 0 8px !important;
}

.upload-card__input {
  border-radius: 0 8px 8px 0 !important;
}

/* --- Action Buttons Section --- */
.action-buttons__primary {
  background: #1fa042 !important;
  border-radius: 8px !important;
  padding: 12px 24px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  border: none !important;
  transition: all 0.2s ease;
}

.action-buttons__secondary {
  background-color: #ffffff !important;
  color: #030404 !important;
  font-weight: 500 !important;
  padding: 12px 24px !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  border: 1px solid #e5e5e5 !important;
  transition: all 0.2s ease;
}

/* Ensure proper spacing in action buttons container */
.action-buttons {
  gap: 12px !important;
}

/* --- Product Card Section --- */
.product-card__image {
  width: 56px;
  height: 56px;
  object-fit: cover;
}

.product-card__title {
  color: #030404;
}

.product-card__meta {
  color: #686868;
}

.product-card__button:hover {
  background: #1fa042 !important;
  color: #fff !important;
}

/* --- Enhanced Product Card Styles --- */
.product-card {
  transition: all 0.3s ease;
  border: 1px solid #e5e5e5 !important;
}

.product-card.card-hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
  border-color: #d0d0d0 !important;
}

/* Product card actions */
.product-card__actions {
  min-width: 100px;
  flex-shrink: 0;
}

.product-card__button {
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  background: #f8f9fa !important;
  border: 1px solid #e9ecef !important;
  color: #495057 !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  padding: 6px 16px !important;
  border-radius: 6px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none !important;
  min-height: 34px;
}

.product-card__button:hover {
  background: #1fa042 !important;
  color: #fff !important;
  border-color: #1fa042 !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(31, 160, 66, 0.2);
}

.product-card__button i {
  font-size: 11px;
  margin-right: 6px !important;
}

.product-card__button.loading {
  background: #f8f9fa !important;
  color: #6c757d !important;
  cursor: not-allowed;
  border-color: #dee2e6 !important;
}

.product-card__button.loading i {
  animation: spin 1s linear infinite;
}

.product-card__button.success {
  background: #1fa042 !important;
  color: #fff !important;
  border-color: #1fa042 !important;
}

.product-card__button.error {
  background: #dc3545 !important;
  color: #fff !important;
  border-color: #dc3545 !important;
}

.product-card__view-btn {
  font-size: 13px !important;
  font-weight: 500 !important;
  padding: 6px 16px !important;
  border-radius: 6px !important;
  transition: all 0.2s ease;
  background: #fff !important;
  border: 1px solid #dee2e6 !important;
  color: #6c757d !important;
  text-decoration: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
}

.product-card__view-btn:hover {
  background: #1fa042 !important;
  color: #fff !important;
  border-color: #1fa042 !important;
}

.product-card__view-btn i {
  font-size: 11px;
  margin-right: 6px !important;
}

.product-card__view-btn.clicked {
  transform: scale(0.98);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Fallback image for products without images */
.product-card__image.bg-light {
  width: 56px;
  height: 56px;
  font-size: 18px;
}

/* --- Notification Styles --- */
.add-to-cart-notification {
  animation: slideInRight 0.3s ease-out;
  max-width: 350px;
}

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

.add-to-cart-notification .btn-close {
  font-size: 0.8rem;
}

/* --- Product Card Layout Improvements --- */
.product-card__info {
  min-width: 0; /* Allow text truncation */
}

.product-card__title {
  font-size: 14px;
  line-height: 1.3;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-card__meta {
  font-size: 12px;
  line-height: 1.2;
}

/* --- Responsive Product Card --- */
@media (max-width: 768px) {
  .product-card {
    flex-direction: column;
    text-align: center;
  }
  
  .product-card__image {
    width: 80px;
    height: 80px;
    margin: 0 auto 12px;
  }
  
  .product-card__actions {
    flex-direction: row;
    justify-content: center;
    min-width: auto;
    margin-top: 12px;
  }
}

/* --- Drag Handle Section --- */
.drag-handle {
  display: none;
}

/* --- Search Field --- */
.search-field-container {
  position: relative;
}

.search-field-wrapper {
  border: 1px solid #e5e5e5 !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
  height: 42px; /* Match other input heights */
}

.search-field-wrapper:hover {
  border-color: #d0d0d0 !important;
}

.search-field-wrapper:focus-within {
  border-color: #1fa042 !important;
  box-shadow: 0 0 0 2px rgba(31, 160, 66, 0.1) !important;
}

.search-field-icon {
  color: #686868 !important;
  font-size: 14px;
  min-width: 16px;
  transition: color 0.2s ease;
}

.search-field-wrapper:focus-within .search-field-icon {
  color: #1fa042 !important;
}

.search-field-input {
  font-family: 'Inter', sans-serif !important;
  font-size: 14px !important;
  color: #030404 !important;
  outline: none !important;
  background: transparent !important;
  border: none !important;
  width: 100%;
  height: 100%;
  padding: 0 !important;
}

.search-field-input::placeholder {
  color: #9ca3af !important;
  font-size: 14px;
}

.search-field-input:focus {
  box-shadow: none !important;
  outline: none !important;
}

/* --- Product Loading & Empty States --- */
.product-loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #f0f0f0;
  margin: 20px 0;
}

.product-loading-spinner {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  position: relative;
}

.product-loading-spinner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #1fa042;
  border-radius: 50%;
  animation: productLoadingSpin 1s linear infinite;
}

.product-loading-text {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: #030404;
  margin-bottom: 4px;
}

.product-loading-subtext {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: #686868;
}

@keyframes productLoadingSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Pulse animation for loading dots */
.product-loading-dots {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.product-loading-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #1fa042;
  animation: productLoadingPulse 1.5s ease-in-out infinite;
}

.product-loading-dot:nth-child(1) { animation-delay: -0.3s; }
.product-loading-dot:nth-child(2) { animation-delay: -0.15s; }
.product-loading-dot:nth-child(3) { animation-delay: 0s; }

@keyframes productLoadingPulse {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* --- No Products Found State --- */
.no-products-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  text-align: center;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #f0f0f0;
  margin: 20px 0;
}

.no-products-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #f8f9fa 0%, #f0f0f0 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  animation: noProductsFloat 3s ease-in-out infinite;
}

.no-products-icon i {
  font-size: 28px;
  color: #9ca3af;
  transition: color 0.3s ease;
}

.no-products-container:hover .no-products-icon i {
  color: #1fa042;
}

/* Error state styling */
.no-products-container .no-products-icon i.fa-exclamation-triangle {
  color: #dc3545;
}

.no-products-container:hover .no-products-icon i.fa-exclamation-triangle {
  color: #c82333;
}

@keyframes noProductsFloat {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-8px);
  }
}

.no-products-title {
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: #030404;
  margin-bottom: 8px;
}

.no-products-message {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: #686868;
  line-height: 1.5;
  margin-bottom: 20px;
  max-width: 400px;
}

.no-products-suggestions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: #9ca3af;
}

.no-products-suggestion {
  display: flex;
  align-items: center;
  gap: 8px;
}

.no-products-suggestion i {
  font-size: 10px;
  color: #1fa042;
}

/* --- Responsive adjustments --- */
@media (max-width: 768px) {
  .product-loading-container,
  .no-products-container {
    padding: 32px 16px;
    margin: 16px 0;
  }
  
  .no-products-icon {
    width: 56px;
    height: 56px;
    margin-bottom: 16px;
  }
  
  .no-products-icon i {
    font-size: 24px;
  }
  
  .no-products-title {
    font-size: 16px;
  }
  
  .no-products-message {
    font-size: 13px;
  }
}

/* --- Form Fields --- */
.product-config-form input,
.product-config-form select {
  outline: none;
  font-family: 'Inter', sans-serif;
  border-radius: 8px !important;
}

.product-config-form input:focus,
.product-config-form select:focus {
  box-shadow: none;
}

.parameter-group__value {
  font-size: 14px;
  color: #030404;
  width: 100%;
  border-radius: 8px !important;
}

.parameter-group__input--highlighted input {
  color: #030404;
}

/* --- Form Number Inputs --- */
.parameter-group__input input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
  width: 100%;
}

.parameter-group__input input[type="number"]::-webkit-outer-spin-button,
.parameter-group__input input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Make sure the unit is properly aligned */
.parameter-group__unit {
  min-width: 26px;
  text-align: right;
}

/* --- Color Selector --- */
.color-selector__button,
.color-selector__button-wrapper {
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.color-selector__button:hover,
.color-selector__button-wrapper:hover {
  opacity: 0.9;
}

.color-selector__button--active {
  background: #1fa042 !important;
  color: #fff !important;
}

/* --- File Upload --- */
.upload-card__frame {
  cursor: pointer;
}

.upload-card__frame-label {
  cursor: pointer;
}

.upload-card__file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 90%;
}

/* --- Number Input Controls --- */
.number-controls {
  margin-left: 4px;
}

.number-control {
  border: none!important;
  background: transparent;
  background-color: transparent!important;
  padding: 0;
  width: 18px;
  height: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #686868;
  cursor: pointer;
  transition: color 0.2s ease;
}

.number-control:hover {
  color: #1fa042;
  background-color: transparent!important;
  border: none!important;
}

.number-control:active {
  color: #1b9039;
  background-color: transparent!important;
  border: none!important;
}

.number-control--up {
  margin-bottom: 1px;
}

.number-control--down {
  margin-top: 1px;
}

/* --- Product Header --- */
.product-header__title {
  font-size: 24px;
  color: #030404;
}

.product-header__description {
  font-size: 14px;
  color: #686868;
}

/* --- Delivery Info --- */
.delivery-info {
  font-size: 14px;
}

.delivery-info__item {
  line-height: 1.5;
}

.delivery-info__item i {
  color: #1fa042;
  font-size: 14px;
}

.delivery-info__item strong {
  font-weight: 600;
  color: #030404;
}

/* --- Payment Methods --- */
.payment-methods {
  margin-top: 20px;
}

.payment-methods__icon {
  filter: grayscale(30%);
  transition: filter 0.3s ease, transform 0.3s ease;
}

.payment-methods__icon:hover {
  filter: grayscale(0%);
  transform: translateY(-2px);
}

/* --- Enhanced Hover Effects --- */

/* --- Custom Select Styling --- */
.parameter-group__input select {
  appearance: base-select;
  color: #030404;
  background-color: transparent;
  box-sizing: border-box;
  border: none;
  border-radius: 8px !important;
  font-size: 14px;
  cursor: pointer;
  width: 100%;
  font-family: inherit;
  padding-right: 20px;
  background-repeat: no-repeat;
  background-position: right center;
  background-size: 16px;
  padding: 6px;
}

.parameter-group__input select:focus {
  outline: none;
}

.parameter-group__input select > button {
  display: flex;
  width: 100%;
  font-family: inherit;
  color: currentColor;
}

.parameter-group__input select::picker(select) {
  appearance: base-select;
  border: 1px solid #e4e4e7;
  padding: 0.25rem;
  margin-top: 0.25rem;
  border-radius: calc(0.5rem - 2px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
   0 2px 4px -2px rgba(0, 0, 0, 0.1);
  cursor: default;
  transition: opacity 225ms ease-in-out, transform 225ms ease-in-out;
  transform-origin: top;
  transform: translateY(0);
  opacity: 1;
  z-index: 100;
  background-color: white;
  
}

.parameter-group__input select::picker-icon {
  font-family: "Font Awesome 5 Free";
  content: "\f078";
  font-weight: 900;
  font-size: 0.75em;
  padding-top: 4px;
}

@supports (selector(:has(:focus))) {
  .parameter-group__input:has(select:focus) {
    border-color: #1fa042 !important;
    box-shadow: 0 0 0 1px rgba(31, 160, 66, 0.1);
  }
}

.parameter-group__input select::picker(select) option:hover {
  background-color: rgba(31, 160, 66, 0.1);
}

.parameter-group__input select option:not(:checked){
  border-radius: 4px;
  transition: background-color 0.2s ease;
  padding: 8px 12px!important;
}

.parameter-group__input select option:checked {
  background-color: #f5f5f5 !important;
  padding: 8px 12px!important;
  font-weight: 500;
}

@starting-style {
  .parameter-group__input select::picker(select) {
    transform: translateY(-0.25rem) scale(0.95);
    opacity: 0;
  }
}

/* Hide default select arrow in IE/Edge */
.parameter-group__input select::-ms-expand {
  display: none;
}

/* Custom styling for the select container */
.parameter-group__input:has(select) {
  position: relative;
  padding-right: 0.5rem;
}

/* --- Chat Toggle Functionality --- */
.chat__arrow {
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
  user-select: none;
}

.chat__arrow:hover,
.chat__arrow.chat-arrow-hover {
  background-color: rgba(31, 160, 66, 0.1);
}

.chat__arrow:hover i,
.chat__arrow.chat-arrow-hover i {
  color: #1fa042;
  transform: scale(1.1);
}

.chat__arrow:active {
  transform: scale(0.95);
}

/* Chat container states */
.chat-container.chat-expanded {
  /* Default expanded state */
}

.chat-container.chat-collapsed {
  /* Collapsed state - entire chat hidden */
  position: relative;
}

.chat-container.chat-collapsed .chat {
  /* Hide the entire chat when collapsed */
  display: none;
}

/* Smooth transitions for chat elements */
.chat__body,
.chat__input-bar {
  transition: all 0.3s ease;
}

/* Animation for arrow rotation */
.chat__arrow i {
  display: inline-block;
  transform-origin: center;
}

/* Optional: Add a subtle pulsing effect when collapsed */
.chat-container.chat-collapsed .chat__arrow {
  animation: subtle-pulse 2s infinite;
}

@keyframes subtle-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Ensure chat header remains visible when collapsed */
.chat-container.chat-collapsed .chat__header {
  border-bottom: 1px solid rgba(0,0,0,0.1);
  border-radius: 0 0 16px 16px;
}

/* Prevent content jumping during animation */
.chat-container .chat {
  overflow: hidden;
}

/* Add visual feedback for interactive arrow */
.chat__arrow {
  position: relative;
}

.chat__arrow::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(31, 160, 66, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.3s ease;
  z-index: -1;
}

.chat__arrow:hover::after {
  width: 100%;
  height: 100%;
}

/* Floating Chat Toggle Button */
.chat-toggle-btn {
  bottom: 20px;
  right: 20px;
  background: #1fa042;
  color: white;
  padding: 12px 20px;
  border-radius: 25px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(31, 160, 66, 0.3);
  transition: all 0.3s ease;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
  font-weight: 500;
  font-size: 14px;
}

.chat-toggle-btn:hover {
  background: #1b9039;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(31, 160, 66, 0.4);
}

.chat-toggle-btn:active {
  transform: translateY(0);
}

.chat-toggle-btn i {
  font-size: 16px;
}

.chat-toggle-text {
  font-weight: 500;
}

/* 3D model */
#scene-container {
    background-color: #f0f2f5; /* Lichte achtergrondkleur zoals in je voorbeeld */
    cursor: grab;
}

#scene-container:grabbing {
    cursor: grabbing;
}

#scene-container canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Animatie voor veld-updates door de chatbot */
.scene-controls-overlay {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
}

.button-container {
    display: flex;
    gap: 0.5rem;
}

.action-button {
    padding: 0.5rem 1rem!important;
    border-radius: 6px!important; /* Iets rondere hoeken */
    font-weight: 500!important; /* Iets minder dik lettertype */
    font-size: 0.875rem!important; /* 14px */
    color: white!important;
    background-color: #222!important; /* Neutraal donkergrijs/zwart */
    transition: background-color 0.2s, opacity 0.2s;
    border: none!important;
    cursor: pointer!important;
}

.action-button:hover:not(:disabled) {
    background-color: #444!important;
}

.action-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.hidden {
    display: none !important;
}

#loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(240, 242, 245, 0.95); /* Achtergrondkleur van de scene, maar semi-transparant */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 20; /* Hoger dan de knoppen (die op 10 staan) */
    transition: opacity 0.5s ease-out; /* Vloeiende fade-out animatie */
    pointer-events: none; /* Standaard niet-klikbaar */
    opacity: 0; /* Standaard verborgen */
}

#loader-overlay.is-loading {
    opacity: 1; /* Zichtbaar maken */
    pointer-events: auto; /* Klikbaar maken om interactie met de scene te blokkeren */
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(0, 0, 0, 0.1);
    border-top-color: #333; /* Donkere kleur voor de draaiende indicator */
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loader-text {
    margin-top: 1rem;
    font-weight: 500;
    color: #333;
}

/* De animatie die de spinner laat draaien */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* --- Responsive Chat Modal & Toggle Button --- */
@media (max-width: 1199px) {
  .chat-container {
    position: fixed !important;
    bottom: 80px !important;
    right: 20px !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    margin: 0 !important;
    width: 95vw !important;
    max-width: 400px !important;
    height: 65vh !important;
    z-index: 2001 !important;
    box-shadow: none!important;
    display: none;
    background: transparent;
    align-self: unset;
  }
  
  /* Prevent viewport height changes when keyboard opens */
  body.chat-modal-open {
    position: fixed;
    width: 100%;
    height: 100vh; /* Use fixed viewport height */
    overflow: hidden;
    /* Prevent scrolling behind modal */
    -webkit-overflow-scrolling: touch;
  }
  
  body.chat-modal-open .chat-container {
    position: fixed !important;
    height: 65vh !important;
    /* Use viewport height units that ignore keyboard */
    max-height: calc(100vh - 160px) !important;
    /* Ensure container stays in place during keyboard events */
    bottom: 80px !important;
  }
  
  /* Specific input handling for mobile */
  body.chat-modal-open .chat__input-field {
    /* Prevent zoom on iOS */
    font-size: 16px !important;
    /* Ensure input stays accessible */
    transform: none !important;
    position: relative !important;
  }
  
  /* Prevent input zoom on iOS */
  .chat__input-field {
    font-size: 16px !important;
    -webkit-text-size-adjust: 100% !important;
  }
  
  .chat__arrow {
    display: none !important;
  }
  body.chat-modal-open .chat-container {
    display: flex !important;
    padding-left: 30px;
    box-shadow: none!important;
  }
  .chat-toggle-btn {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    z-index: 2002 !important;
    display: flex !important;
  }
  /* Overlay for modal effect */
  .chat-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.25);
    z-index: 2000;
    display: none;
    /* Prevent touch events from propagating */
    touch-action: none;
    /* Prevent scrolling */
    overflow: hidden;
  }
  body.chat-modal-open .chat-modal-overlay {
    display: block;
  }
  
  .product-card {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    width: 100% !important;
    margin: 0 0 12px 0 !important;
    box-sizing: border-box;
    padding: 12px !important;
  }

  .product-card__actions {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    margin-top: 0 !important;
  }
  .product-card__image {
    width: 56px !important;
    height: 56px !important;
    margin: 0 12px 0 0 !important;
    flex-shrink: 0;
  }
  .product-card__info {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-right: 12px;
  }
  .product-card__title, .product-card__meta {
    writing-mode: horizontal-tb !important;
    white-space: normal !important;
    overflow: visible !important;
    width: 100% !important;
    display: block !important;
    text-align: left !important;
    transform: none !important;
    word-break: break-word !important;
  }
  html, body {
    font-size: 14px !important;
  }
  h1 { font-size: 1.7rem !important; }
  h2 { font-size: 1.4rem !important; }
  h3 { font-size: 1.2rem !important; }
  h4 { font-size: 1.1rem !important; }
  h5 { font-size: 1rem !important; }
  h6 { font-size: 0.95rem !important; }
  .product-header__title, .chat__title, .product-card__title {
    font-size: 1.1rem !important;
  }
  .product-header__description, .parameter-group__label {
    font-size: 0.95rem !important;
  }
  .chat__text, .chat__input-field {
    font-size: 0.98rem !important;
  }
  .action-buttons__primary, .action-buttons__secondary {
    font-size: 0.98rem !important;
  }
  /* Responsive font-size for upload card section */
  .upload-card__label {
    font-size: 1.05rem !important;
  }
  /* Responsive margin for upload card */
  .upload-card,
  .upload-card.mb-3 {
    margin-bottom: 1.25rem !important; /* 20px */
  }
}


@media (min-width: 992px) {
  .chat-modal-overlay {
    display: none !important;
  }
}

@media (max-width: 991px) {
  .overview {
    flex-direction: column !important;
    width: 100% !important;
    box-sizing: border-box;
  }
  .table-container, .table-container-2 {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
    margin: 0 !important;
  }
  .table-container {
    border-radius: 0 !important;
    border: none !important;
  }
  .configurator__container, .configurator__inner, .configurator__content, .product-header {
    width: 100% !important;
    box-sizing: border-box;
  }
  .parameter-group {
    flex-direction: column !important;
    gap: 0 !important;
    width: 100% !important;
  }
  .parameter-group__item {
    width: 100% !important;
    margin-bottom: 10px !important;
  }
  .product-list {
    width: 100% !important;
    box-sizing: border-box;
  }

  /* Updated for Bootstrap grid layout */
  .top-section .product-display {
    min-height: 250px !important;
  }

  #scene-container {
    width: 100% !important;
    min-width: 0 !important;
    height: 220px !important;
    box-sizing: border-box;
  }
}

@media (max-width: 767px) {
  .overview {
    padding: 0 2vw !important;
  }
  .table-container, .table-container-2 {
    padding: 0 !important;
  }
  .product-header {
    padding: 12px 0 0 0 !important;
  }
  .configurator__container, .configurator__inner, .configurator__content {
    padding: 0 !important;
  }
  .parameter-group__item {
    margin-bottom: 8px !important;
  }
  .product-card {
    flex-direction: column !important;
    align-items: flex-start !important;
    padding: 10px !important;
  }
  .product-card__image {
    margin: 0 0 8px 0 !important;
    width: 60px !important;
    height: 60px !important;
  }
  .product-card__actions {
    flex-direction: row !important;
    justify-content: flex-start !important;
    width: 100% !important;
    margin-top: 8px !important;
  }
  
  /* Updated for Bootstrap grid layout */
  .top-section .product-display {
    min-height: 200px !important;
  }
  
  #scene-container {
    height: 180px !important;
  }
}

@media (max-width: 1199px) {
  .overview {
    background: #fff !important;
  }
}

/* Responsive font sizes using class-based selectors instead of global html, body, h1-h6 */
.product-header__title, .chat__title, .product-card__title {
  font-size: 1.1rem !important;
}
.product-header__description, .parameter-group__label {
  font-size: 0.95rem !important;
}
.chat__text, .chat__input-field {
  font-size: 0.98rem !important;
}
.action-buttons__primary, .action-buttons__secondary {
  font-size: 0.98rem !important;
}
.overview h1 { font-size: 1.7rem !important; }
.overview h2 { font-size: 1.4rem !important; }
.overview h3 { font-size: 1.2rem !important; }
.overview h4 { font-size: 1.1rem !important; }
.overview h5 { font-size: 1rem !important; }
.overview h6 { font-size: 0.95rem !important; }

/* --- Sustainability Information Section --- */
.sustainability-info {
  background: linear-gradient(135deg, #f8fffe 0%, #f0f9f6 100%);
  border: 1px solid #e3f2e8;
  border-radius: 12px !important;
  transition: all 0.3s ease;
  padding: 16px !important; /* Reduced padding */
}

.sustainability-info:hover {
  border-color: #d1e7dd;
  box-shadow: 0 2px 8px rgba(25, 135, 84, 0.1);
}

.sustainability-header {
  margin-bottom: 8px !important; /* Reduced margin */
}

.sustainability-icon {
  width: 20px; /* Reduced size */
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(25, 135, 84, 0.1);
  border-radius: 50%;
}

.sustainability-icon i {
  font-size: 12px; /* Reduced size */
  color: #198754 !important;
}

.sustainability-title {
  font-size: 14px; /* Reduced size */
  font-weight: 600;
  color: #198754;
  margin: 0;
}

.sustainability-content {
  animation: fadeIn 0.3s ease;
}

/* Compact metric styles */
.sustainability-metric-compact {
  text-align: center;
}

.metric-label-small {
  font-size: 11px; /* Small label */
  color: #6c757d;
  font-weight: 500;
  margin-bottom: 2px;
  line-height: 1.2;
}

.sustainability-metric-compact strong {
  font-size: 14px; /* Compact value size */
  display: block;
  line-height: 1.2;
}

.sustainability-badge {
  font-size: 10px; /* Smaller badge */
  padding: 3px 6px;
  border-radius: 10px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 3px;
}

.sustainability-badge i {
  font-size: 9px;
}

.sustainability-tooltip {
  cursor: help;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.sustainability-tooltip:hover {
  opacity: 1;
}

/* Compact progress bar */
.sustainability-progress-compact {
  margin-top: 8px;
}

.progress-label-small {
  font-size: 10px;
  font-weight: 500;
  color: #6c757d;
  text-align: center;
  line-height: 1.2;
}

.progress {
  background-color: rgba(25, 135, 84, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar {
  background: linear-gradient(90deg, #198754, #20c997);
  transition: width 0.6s ease;
  border-radius: 2px;
}

/* Remove old styles that are no longer needed */
.sustainability-metric,
.metric-label,
.metric-value-container,
.sustainability-progress,
.progress-label {
  display: none; /* Hide old elements */
}

/* Responsive adjustments for sustainability section */
@media (max-width: 991px) {
  .sustainability-info {
    margin-top: 12px;
    padding: 12px !important;
  }
  
  .sustainability-metric-compact {
    margin-bottom: 8px;
  }
}

@media (max-width: 767px) {
  .sustainability-info {
    margin-top: 10px;
    padding: 10px !important;
  }
  
  .sustainability-title {
    font-size: 13px;
  }
  
  .metric-label-small {
    font-size: 10px;
  }
  
  .sustainability-metric-compact strong {
    font-size: 13px;
  }
  
  .sustainability-badge {
    font-size: 9px;
    padding: 2px 5px;
  }
}

/* Animation for progress bar */
@keyframes progressAnimation {
  0% { width: 0%; }
  100% { width: var(--progress-width); }
}

.progress-bar.animate {
  animation: progressAnimation 1s ease-out;
}

/* Eco-friendly styling enhancements */
.sustainability-badge.bg-success {
  background: linear-gradient(135deg, #198754, #20c997) !important;
  color: white;
  box-shadow: 0 1px 3px rgba(25, 135, 84, 0.3);
}

.sustainability-badge.bg-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(25, 135, 84, 0.4);
}

/* Visual indicators for different sustainability levels */
.sustainability-level-excellent .sustainability-badge {
  background: linear-gradient(135deg, #198754, #20c997) !important;
}

.sustainability-level-good .sustainability-badge {
  background: linear-gradient(135deg, #fd7e14, #ffc107) !important;
}

.sustainability-level-moderate .sustainability-badge {
  background: linear-gradient(135deg, #ffc107, #ffca2c) !important;
}

.sustainability-level-good .sustainability-badge {
  background: linear-gradient(135deg, #fd7e14, #ffc107) !important;
}

.sustainability-level-moderate .sustainability-badge {
  background: linear-gradient(135deg, #ffc107, #ffca2c) !important;
}

/* --- Product Modal Styles --- */
.product-modal-content {
  border-radius: 16px !important;
  border: none !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important;
  overflow: hidden;
  font-family: 'Inter', sans-serif;
}

.product-modal-header {
  background: #1fa042 !important;
  color: #ffffff !important;
  border-bottom: none !important;
  padding: 20px 24px !important;
}

.product-modal-title {
  font-size: 18px !important;
  font-weight: 600 !important;
  color: #ffffff !important;
  margin: 0 !important;
  line-height: 1.3 !important;
  word-break: break-word !important;
  white-space: normal !important;
}

.product-modal-close {
  background: none !important;
  border: none !important;
  color: #ffffff !important;
  opacity: 0.8 !important;
  font-size: 20px !important;
  padding: 0 !important;
  width: 24px !important;
  height: 24px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: opacity 0.2s ease !important;
}

.product-modal-close:hover {
  opacity: 1 !important;
  background: rgba(255, 255, 255, 0.1) !important;
  border-radius: 4px !important;
}

.product-modal-body {
  padding: 24px !important;
}

.product-modal-image-container {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  border-radius: 12px;
  padding: 16px;
  height: 280px;
  overflow: hidden;
}

.product-modal-image {
  max-width: 100% !important;
  max-height: 100% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  border-radius: 8px !important;
}

.product-modal-price {
  font-size: 20px !important;
  font-weight: 600 !important;
  color: #1fa042 !important;
  margin: 0 0 16px 0 !important;
}

.product-modal-description-container {
  position: relative;
  margin-bottom: 16px;
  height: 400px;
  overflow-y: auto;
}

@media (max-width: 768px) {
  .product-modal-description-container {
    height: 200px;
  }
}

.product-modal-description {
  font-size: 14px !important;
  line-height: 1.6 !important;
  color: #030404 !important;
  word-break: break-word;
  transition: max-height 0.3s ease-out;
}

.product-modal-description.collapsed {
  max-height: 150px !important;
  overflow: hidden !important;
}

.product-modal-description-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(transparent, #ffffff);
  pointer-events: none;
  display: none;
}

.product-modal-toggle-btn {
  background: #f8f9fa !important;
  color: #1fa042 !important;
  border: 1px solid #e9ecef !important;
  border-radius: 8px !important;
  padding: 8px 16px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  font-family: 'Inter', sans-serif !important;
  transition: all 0.2s ease !important;
  cursor: pointer !important;
}

.product-modal-toggle-btn:hover {
  background: #1fa042 !important;
  color: #ffffff !important;
  border-color: #1fa042 !important;
  transform: translateY(-1px);
}

.product-modal-footer {
  padding: 16px 24px !important;
  border-top: 1px solid #e9ecef !important;
  background: #f8f9fa !important;
}

.product-modal-close-btn {
  background: #1fa042 !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 10px 20px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  font-family: 'Inter', sans-serif !important;
  transition: all 0.2s ease !important;
  cursor: pointer !important;
}

.product-modal-close-btn:hover {
  background: #1b9039 !important;
  transform: translateY(-1px);
}

/* Responsive modal styles */
@media (max-width: 768px) {
  .modal-dialog {
    margin: 40px 30px 110px 30px !important;
    max-width: calc(100vw - 20px) !important;
    max-height: calc(100vh - 20px) !important;
  }
  
  .product-modal-content {
    border-radius: 12px !important;
    margin: 0 !important;
    max-height: 100% !important;
    overflow-y: auto !important;
  }
  
  .product-modal-header {
    padding: 16px 20px !important;
  }
  
  .product-modal-title {
    font-size: 16px !important;
    margin-right: 10px !important;
  }
  
  .product-modal-body {
    padding: 16px !important;
  }
  
  .product-modal-body .row {
    margin: 0 !important;
  }
  
  .product-modal-body .col-md-5,
  .product-modal-body .col-md-7 {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  
  .product-modal-image-container {
    height: 200px;
    margin-bottom: 16px;
  }
  
  .product-modal-price {
    font-size: 18px !important;
  }
  
  .product-modal-description {
    font-size: 13px !important;
  }
  
  .product-modal-footer {
    padding: 16px 20px !important;
  }
}





@media (max-width: 768px) {
  .product-modal-body {
      padding: 28px !important;
  }
}

/* Stijlen voor de knoppen onder de suggesties */
.suggestions-controls {
    border-top: 1px solid #e9ecef; /* Een lichte scheidingslijn */
    padding-top: 1rem;
}

#toggle-suggestions-btn,
.view-all-products-btn {
    font-weight: 500;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

/* Subtiel hover-effect voor de knoppen */
#toggle-suggestions-btn:hover,
.view-all-products-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.product-description-content {
    max-height: 200px;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.product-description-content.collapsed-description {
    max-height: 100px;
}