/* ===========================================
   Chat Widget Styles
   Progressive Plants - Marzipan Widget
   =========================================== */

/* Widget Container */
.pp-chat-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  font-family: 'Mulish', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Toggle Button */
.pp-chat-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--primary, #00b83d);
  color: white;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
}

.pp-chat-toggle:hover {
  background: var(--primary-light, #70ffa0);
  color: var(--black, #050505);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.pp-chat-toggle svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.pp-chat-toggle .toggle-label {
  white-space: nowrap;
}

/* Hide toggle when open */
.pp-chat-widget.open .pp-chat-toggle {
  display: none;
}

/* Chat Container */
.pp-chat-container {
  display: flex;           /* Always in DOM */
  opacity: 0;              /* Hidden via opacity */
  pointer-events: none;    /* Prevent interaction when hidden */
  position: absolute;
  bottom: 0;
  right: 0;
  width: 380px;
  height: 500px;
  background: var(--bg-page, #ffffff);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border-light, #e0e0e0);
  will-change: opacity, transform;
  transform: translateZ(0);
}

.pp-chat-widget.open .pp-chat-container {
  opacity: 1;
  pointer-events: auto;
  animation: pp-chat-slide-up 0.3s ease;
}

@keyframes pp-chat-slide-up {
  from {
    opacity: 0;
    transform: translateY(20px) translateZ(0);
  }
  to {
    opacity: 1;
    transform: translateY(0) translateZ(0);
  }
}

/* Chat Header */
.pp-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--primary, #00b83d);
  color: white;
  flex-shrink: 0;
}

.pp-chat-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pp-chat-header-title svg {
  width: 28px;
  height: 28px;
}

.pp-chat-header-title span {
  font-weight: 600;
  font-size: 1.1rem;
}

.pp-chat-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pp-chat-header-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.pp-chat-header-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.pp-chat-header-btn svg {
  width: 18px;
  height: 18px;
}

/* Messages Area */
.pp-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-page, #ffffff);
}

/* Welcome Message */
.pp-chat-welcome {
  text-align: center;
  padding: 20px 10px;
  color: var(--text-secondary, #666666);
}

.pp-chat-welcome h3 {
  color: var(--text-primary, #212529);
  font-size: 1.1rem;
  margin-bottom: 8px;
  font-weight: 600;
  padding-top: 0;
}

.pp-chat-welcome p {
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0 0 16px 0;
}

/* Login Notice for Guest Users */
.pp-chat-login-notice {
  background: rgba(0, 184, 61, 0.08);
  border: 1px solid rgba(0, 184, 61, 0.2);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 0 0 16px 0;
  font-size: 0.85rem;
  color: var(--text-secondary, #666666);
  text-align: center;
}

.pp-chat-login-notice a {
  color: var(--primary, #00b83d);
  text-decoration: none;
  font-weight: 600;
}

.pp-chat-login-notice a:hover {
  text-decoration: underline;
}

/* Dark mode support */
body.dark-mode .pp-chat-login-notice {
  background: rgba(0, 184, 61, 0.12);
  border-color: rgba(0, 184, 61, 0.3);
  color: var(--text-secondary, #aaaaaa);
}

.pp-chat-suggestions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pp-chat-suggestion {
  padding: 10px 14px;
  background: var(--bg-input, #ffffff);
  border: 1px solid var(--border-light, #e0e0e0);
  border-radius: 20px;
  color: var(--text-primary, #212529);
  cursor: pointer;
  font-size: 0.85rem;
  font-family: inherit;
  transition: all 0.2s ease;
  text-align: left;
}

.pp-chat-suggestion:hover {
  background: var(--primary, #00b83d);
  color: white;
  border-color: var(--primary, #00b83d);
}

/* Message Bubbles */
.pp-chat-message {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.5;
  word-wrap: break-word;
}

.pp-chat-message.user {
  align-self: flex-end;
  background: var(--primary, #00b83d);
  color: white;
  border-bottom-right-radius: 4px;
}

.pp-chat-message.assistant {
  align-self: flex-start;
  background: var(--bg-card, rgba(255, 255, 255, 0.85));
  color: var(--text-primary, #212529);
  border: 1px solid var(--border-light, #e0e0e0);
  border-bottom-left-radius: 4px;
}

.pp-chat-message.assistant a {
  color: var(--primary, #00b83d);
  text-decoration: none;
}

.pp-chat-message.assistant a:hover {
  text-decoration: underline;
}

.pp-chat-message.assistant strong {
  font-weight: 600;
}

.pp-chat-message.assistant p {
  margin: 0 0 8px 0;
}

.pp-chat-message.assistant p:last-child {
  margin-bottom: 0;
}

/* Staff Messages */
.pp-chat-message.staff {
  align-self: flex-start;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  border-bottom-left-radius: 4px;
}

.pp-chat-message.staff a {
  color: #b45309;
  text-decoration: underline;
}

.pp-chat-staff-name {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #78350f;
  margin-bottom: 4px;
}

.pp-chat-message.staff p {
  margin: 0 0 8px 0;
}

.pp-chat-message.staff p:last-child {
  margin-bottom: 0;
}

/* Product Cards */
.pp-chat-products {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  max-width: 100%;
}

.pp-chat-product-card {
  background: var(--bg-input, #ffffff);
  border: 1px solid var(--border-light, #e0e0e0);
  border-radius: 10px;
  padding: 10px;
  font-size: 0.85rem;
}

.pp-chat-product-name {
  font-weight: 600;
  font-style: italic;
  color: var(--primary, #00b83d);
  text-decoration: none;
  display: block;
  margin-bottom: 4px;
}

.pp-chat-product-name:hover {
  text-decoration: underline;
}

.pp-chat-product-common {
  color: var(--text-secondary, #666666);
  font-size: 0.8rem;
  margin-bottom: 6px;
}

.pp-chat-product-sizes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pp-chat-product-size {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-page, #ffffff);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  border: 1px solid var(--border-light, #e0e0e0);
}

.pp-chat-product-size .size-label {
  background: rgba(0, 184, 61, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--primary, #00b83d);
  font-weight: 600;
  font-size: 0.75rem;
}

.pp-chat-product-size .price {
  font-weight: 600;
  color: var(--text-primary, #212529);
}

.pp-chat-product-size .stock {
  color: var(--primary, #00b83d);
  font-size: 0.75rem;
}

.pp-chat-product-size .stock.out {
  color: var(--red, #e53424);
}

/* Product Loading State */
.pp-chat-products-loading {
  padding: 12px;
  color: var(--text-secondary, #666666);
  font-size: 0.85rem;
  font-style: italic;
  text-align: center;
  background: var(--bg-input, #ffffff);
  border-radius: 10px;
  margin-top: 8px;
}

body.dark-mode .pp-chat-products-loading {
  background: var(--bg-input, #2a2a2a);
}

/* Typing Indicator */
.pp-chat-typing {
  display: none;
  align-self: flex-start;
  padding: 12px 16px;
  gap: 5px;
}

.pp-chat-typing.visible {
  display: flex;
}

.pp-chat-typing span {
  width: 8px;
  height: 8px;
  background: var(--text-secondary, #666666);
  border-radius: 50%;
  animation: pp-typing-pulse 1.4s infinite ease-in-out;
}

.pp-chat-typing span:nth-child(1) { animation-delay: -0.32s; }
.pp-chat-typing span:nth-child(2) { animation-delay: -0.16s; }

@keyframes pp-typing-pulse {
  0%, 80%, 100% { opacity: 0.4; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

/* Input Area */
.pp-chat-input {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-light, #e0e0e0);
  background: var(--bg-page, #ffffff);
  flex-shrink: 0;
}

.pp-chat-input input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border-light, #e0e0e0);
  border-radius: 24px;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease;
  background: var(--bg-input, #ffffff);
  color: var(--text-primary, #212529);
}

.pp-chat-input input::placeholder {
  color: var(--text-secondary, #666666);
}

.pp-chat-input input:focus {
  border-color: var(--primary, #00b83d);
}

.pp-chat-input button {
  width: 40px;
  height: 40px;
  padding: 0;
  background: var(--primary, #00b83d);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.pp-chat-input button:hover {
  background: var(--primary-light, #70ffa0);
  color: var(--black, #050505);
}

.pp-chat-input button:disabled {
  background: var(--grey, #808080);
  cursor: not-allowed;
}

.pp-chat-input button svg {
  width: 18px;
  height: 18px;
}

/* Dark Mode Support */
body.dark-mode .pp-chat-container {
  background: var(--bg-page, #242424);
  border-color: var(--border-light, #404040);
}

body.dark-mode .pp-chat-messages {
  background: var(--bg-page, #242424);
}

body.dark-mode .pp-chat-message.assistant {
  background: var(--bg-card, rgba(0, 0, 0, 0.4));
  border-color: var(--border-light, #404040);
}

body.dark-mode .pp-chat-suggestion {
  background: var(--bg-input, #2a2a2a);
  border-color: var(--border-light, #404040);
}

body.dark-mode .pp-chat-product-card {
  background: var(--bg-input, #2a2a2a);
  border-color: var(--border-light, #404040);
}

body.dark-mode .pp-chat-product-size {
  background: var(--bg-page, #242424);
  border-color: var(--border-light, #404040);
}

body.dark-mode .pp-chat-input {
  background: var(--bg-page, #242424);
  border-color: var(--border-light, #404040);
}

body.dark-mode .pp-chat-input input {
  background: var(--bg-input, #2a2a2a);
  border-color: var(--border-light, #404040);
}

/* Mobile Styles - Full Screen */
@media (max-width: 768px) {
  .pp-chat-widget {
    bottom: 16px;
    right: 16px;
  }

  /* Toggle button - icon only on mobile */
  .pp-chat-toggle {
    width: 56px;
    height: 56px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
  }

  .pp-chat-toggle .toggle-label {
    display: none;
  }

  .pp-chat-toggle svg {
    width: 28px;
    height: 28px;
  }

  /* Full screen chat on mobile */
  .pp-chat-widget.open .pp-chat-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    z-index: 10000;
  }

  /* Prevent body scroll when chat is open */
  body.pp-chat-open {
    overflow: hidden;
  }

  /* Larger close button on mobile */
  .pp-chat-header-btn {
    width: 36px;
    height: 36px;
  }

  .pp-chat-header-btn svg {
    width: 20px;
    height: 20px;
  }

  /* Prevent iOS zoom on input focus */
  .pp-chat-input input {
    font-size: 16px;
  }

  /* Safe area padding for input */
  .pp-chat-input {
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

  /* Touch-friendly targets */
  .pp-chat-suggestion {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

/* Scrollbar styling */
.pp-chat-messages::-webkit-scrollbar {
  width: 6px;
}

.pp-chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.pp-chat-messages::-webkit-scrollbar-thumb {
  background: var(--grey-light, #dcdcdc);
  border-radius: 3px;
}

body.dark-mode .pp-chat-messages::-webkit-scrollbar-thumb {
  background: var(--grey-dark, #242424);
}

/* ===========================================
   @Mention Dropdown
   =========================================== */

/* Input area needs relative positioning for dropdown */
.pp-chat-input {
  position: relative;
}

.pp-chat-mention-dropdown {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  margin-bottom: 0.5rem;
  background: var(--bg-input, #ffffff);
  border: 1px solid var(--border-light, #e0e0e0);
  border-radius: 10px;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
  max-height: 180px;
  overflow-y: auto;
  z-index: 100;
}

.pp-chat-mention-dropdown.hidden {
  display: none;
}

.pp-chat-mention-option {
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.1s;
}

.pp-chat-mention-option:hover,
.pp-chat-mention-option.selected {
  background: var(--primary, #00b83d);
  color: white;
}

.pp-chat-mention-option .mention-name {
  font-weight: 600;
}

.pp-chat-mention-option .mention-fullname {
  font-size: 0.85rem;
  color: var(--text-secondary, #666666);
}

.pp-chat-mention-option:hover .mention-fullname,
.pp-chat-mention-option.selected .mention-fullname {
  color: rgba(255, 255, 255, 0.8);
}

/* Mention notification banner */
.pp-chat-mention-notification {
  align-self: center;
  background: #e8f5e9;
  border-left: 3px solid #4caf50;
  padding: 8px 14px;
  margin: 8px 0;
  border-radius: 6px;
  font-size: 0.8rem;
  color: #2e7d32;
  animation: mentionFadeIn 0.3s ease;
}

.pp-chat-mention-notification::before {
  content: '✓ ';
  font-weight: bold;
}

/* Dark mode mention styles */
body.dark-mode .pp-chat-mention-dropdown {
  background: var(--bg-input, #2a2a2a);
  border-color: var(--border-light, #404040);
}

body.dark-mode .pp-chat-mention-notification {
  background: #1b3d24;
  color: #81c784;
  border-left-color: #66bb6a;
}

@keyframes mentionFadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===========================================
   Expanded Mode Styles
   =========================================== */

/* Expanded overlay background */
body.pp-chat-expanded {
  overflow: hidden;
}

/* Expanded widget - full screen overlay */
.pp-chat-widget.expanded {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10001;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pp-chat-widget.expanded .pp-chat-toggle {
  display: none;
}

.pp-chat-widget.expanded .pp-chat-container {
  position: relative;
  width: 90vw;
  max-width: 800px;
  height: 90vh;
  max-height: 90vh;
  border-radius: 16px;
  animation: pp-expand-in 0.3s ease;
}

@keyframes pp-expand-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Mobile expanded mode - full viewport */
@media (max-width: 768px) {
  .pp-chat-widget.expanded .pp-chat-container {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    border-radius: 0;
  }
}

/* ===========================================
   Enhanced Product Cards for Expanded Mode
   =========================================== */

/* Product section headers */
.pp-chat-product-section {
  margin-bottom: 1rem;
}

.pp-chat-section-header {
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  margin-bottom: 0.5rem;
}

.pp-chat-section-header.in-stock {
  background: rgba(0, 184, 61, 0.1);
  color: var(--primary, #00b83d);
}

.pp-chat-section-header.out-of-stock {
  background: var(--bg-card, rgba(255, 255, 255, 0.5));
  color: var(--text-secondary, #666666);
}

/* Product card header with image */
.pp-chat-product-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.pp-chat-product-img {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.pp-chat-product-img:hover {
  opacity: 0.85;
}

.pp-chat-product-name-wrapper {
  flex: 1;
  min-width: 0;
}

/* Out of stock card styling */
.pp-chat-product-card.out-of-stock-card {
  opacity: 0.85;
}

.pp-chat-product-card.out-of-stock-card .pp-chat-product-name {
  color: var(--text-secondary, #666666);
}

/* Size info row for expanded cards */
.pp-chat-product-size .size-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Size with cart controls */
.pp-chat-product-size.with-cart {
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
  padding: 0.5rem 0.65rem;
}

/* Cart controls */
.pp-chat-cart-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.pp-chat-cart-qty {
  width: 50px;
  padding: 0.3rem 0.4rem;
  border: 1px solid var(--border-light, #e0e0e0);
  border-radius: 0.375rem;
  font-size: 0.85rem;
  text-align: center;
  background: var(--bg-input, #ffffff);
  color: var(--text-primary, #212529);
}

.pp-chat-cart-qty:focus {
  outline: none;
  border-color: var(--primary, #00b83d);
}

.pp-chat-cart-btn {
  background: var(--primary, #00b83d);
  color: white;
  border: none;
  padding: 0.35rem 0.65rem;
  border-radius: 0.375rem;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.pp-chat-cart-btn:hover {
  background: var(--primary-dark, #00963d);
}

.pp-chat-cart-btn:disabled {
  background: var(--grey, #808080);
  cursor: not-allowed;
}

.pp-chat-cart-btn.added {
  background: #059669;
}

/* Waitlist button */
.pp-chat-waitlist-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
  padding: 0.4rem 0.75rem;
  background: var(--primary, #00b83d);
  color: white;
  border: none;
  border-radius: 0.375rem;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.pp-chat-waitlist-btn:hover {
  background: var(--primary-dark, #00963d);
}

.pp-chat-waitlist-btn:disabled {
  background: var(--grey, #808080);
  cursor: not-allowed;
}

.pp-chat-waitlist-btn .btn-icon {
  font-size: 0.9rem;
}

.pp-chat-waitlist-added {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
  padding: 0.4rem 0.75rem;
  background: rgba(0, 184, 61, 0.12);
  color: var(--primary, #00b83d);
  border-radius: 0.375rem;
  font-size: 0.8rem;
  font-weight: 500;
}

/* System message */
.pp-chat-message.system {
  align-self: center;
  background: var(--bg-card, rgba(255, 255, 255, 0.85));
  color: var(--text-secondary, #666666);
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  max-width: 90%;
  text-align: center;
  border: 1px solid var(--border-light, #e0e0e0);
}

/* ===========================================
   Modals (Waitlist, Lightbox)
   =========================================== */

/* Generic modal styles */
.pp-chat-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10002;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.pp-chat-modal.visible {
  display: flex;
}

.pp-chat-modal-content {
  background: var(--bg-page, #ffffff);
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 400px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.pp-chat-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light, #e0e0e0);
}

.pp-chat-modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary, #212529);
}

.pp-chat-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary, #666666);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.15s;
}

.pp-chat-modal-close:hover {
  color: var(--text-primary, #212529);
}

/* Waitlist modal specific */
.pp-chat-waitlist-plant-info {
  background: var(--bg-card, rgba(255, 255, 255, 0.85));
  padding: 0.75rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  border: 1px solid var(--border-light, #e0e0e0);
}

.pp-chat-waitlist-plant-info .plant-name {
  font-weight: 600;
  font-style: italic;
  color: var(--primary, #00b83d);
  margin-bottom: 0.25rem;
}

.pp-chat-waitlist-plant-info .plant-details {
  font-size: 0.85rem;
  color: var(--text-secondary, #666666);
}

.pp-chat-waitlist-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pp-chat-waitlist-form label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary, #212529);
  margin-bottom: 0.25rem;
}

.pp-chat-waitlist-form input,
.pp-chat-waitlist-form select {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border-light, #e0e0e0);
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--bg-input, #ffffff);
  color: var(--text-primary, #212529);
  transition: border-color 0.15s;
}

.pp-chat-waitlist-form input:focus,
.pp-chat-waitlist-form select:focus {
  outline: none;
  border-color: var(--primary, #00b83d);
}

.pp-chat-waitlist-submit {
  margin-top: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--primary, #00b83d);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.pp-chat-waitlist-submit:hover {
  background: var(--primary-dark, #00963d);
}

.pp-chat-waitlist-submit:disabled {
  background: var(--grey, #808080);
  cursor: not-allowed;
}

/* Help Modal */
.pp-chat-help-content {
  max-width: 420px;
  max-height: 80vh;
  overflow-y: auto;
}

.pp-chat-help-content h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pp-chat-help-content h3 svg {
  flex-shrink: 0;
}

.pp-chat-help-intro {
  color: var(--text-secondary, #666666);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0 0 1rem 0;
}

.pp-chat-help-section {
  margin-bottom: 1rem;
}

.pp-chat-help-section-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary, #212529);
  margin-bottom: 0.5rem;
}

.pp-chat-help-section ul {
  margin: 0;
  padding-left: 1.25rem;
}

.pp-chat-help-section li {
  font-size: 0.85rem;
  color: var(--text-secondary, #666666);
  line-height: 1.5;
  margin-bottom: 0.4rem;
}

.pp-chat-help-section li strong {
  color: var(--text-primary, #212529);
}

.pp-chat-help-limitations {
  background: rgba(255, 193, 7, 0.1);
  border-radius: 8px;
  padding: 0.75rem;
  margin-left: -0.75rem;
  margin-right: -0.75rem;
}

.pp-chat-help-limitations .pp-chat-help-section-title {
  color: var(--warning, #d39e00);
}

.pp-chat-help-gotit {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--primary, #00b83d);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.pp-chat-help-gotit:hover {
  background: var(--primary-dark, #00963d);
}

/* Lightbox */
.pp-chat-lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 10003;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.pp-chat-lightbox.visible {
  display: flex;
}

.pp-chat-lightbox img {
  max-width: 95vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.pp-chat-lightbox-caption {
  color: white;
  margin-top: 12px;
  font-size: 14px;
  text-align: center;
  font-style: italic;
}

/* ===========================================
   Dark Mode for New Components
   =========================================== */

body.dark-mode .pp-chat-section-header.out-of-stock {
  background: var(--bg-card, rgba(0, 0, 0, 0.4));
}

body.dark-mode .pp-chat-cart-qty {
  background: var(--bg-input, #2a2a2a);
  border-color: var(--border-light, #404040);
}

body.dark-mode .pp-chat-message.system {
  background: var(--bg-card, rgba(0, 0, 0, 0.4));
  border-color: var(--border-light, #404040);
}

body.dark-mode .pp-chat-modal-content {
  background: var(--bg-page, #242424);
}

body.dark-mode .pp-chat-modal-header {
  border-color: var(--border-light, #404040);
}

body.dark-mode .pp-chat-waitlist-plant-info {
  background: var(--bg-card, rgba(0, 0, 0, 0.4));
  border-color: var(--border-light, #404040);
}

body.dark-mode .pp-chat-waitlist-form input,
body.dark-mode .pp-chat-waitlist-form select {
  background: var(--bg-input, #2a2a2a);
  border-color: var(--border-light, #404040);
}

body.dark-mode .pp-chat-help-intro,
body.dark-mode .pp-chat-help-section li {
  color: var(--text-secondary, #aaaaaa);
}

body.dark-mode .pp-chat-help-section-title,
body.dark-mode .pp-chat-help-section li strong {
  color: var(--text-primary, #ffffff);
}

body.dark-mode .pp-chat-help-limitations {
  background: rgba(255, 193, 7, 0.15);
}

/* ===========================================
   Image Upload Styles
   =========================================== */

/* Upload button */
.pp-chat-upload-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border-light, #e0e0e0);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  color: var(--text-secondary, #666666);
}

.pp-chat-upload-btn:hover {
  background: var(--bg-card, rgba(255, 255, 255, 0.85));
  border-color: var(--primary, #00b83d);
  color: var(--primary, #00b83d);
}

.pp-chat-upload-btn svg {
  width: 18px;
  height: 18px;
}

/* Image preview area */
.pp-chat-image-preview {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-light, #e0e0e0);
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card, rgba(255, 255, 255, 0.85));
}

.pp-chat-image-preview.hidden {
  display: none;
}

.pp-chat-image-preview img {
  max-height: 80px;
  max-width: 120px;
  border-radius: 8px;
  object-fit: cover;
}

.pp-chat-preview-remove {
  position: absolute;
  top: 4px;
  right: 8px;
  width: 24px;
  height: 24px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.pp-chat-preview-remove:hover {
  background: var(--red, #e53424);
}

/* Images in message bubbles */
.pp-chat-message-image-wrapper {
  margin-bottom: 8px;
}

.pp-chat-message-image {
  max-width: 200px;
  max-height: 150px;
  border-radius: 8px;
  cursor: pointer;
  object-fit: cover;
  transition: opacity 0.2s ease;
  display: block;
}

.pp-chat-message-image:hover {
  opacity: 0.85;
}

/* User message with image */
.pp-chat-message.user .pp-chat-message-image {
  border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Dark mode support for image upload */
body.dark-mode .pp-chat-upload-btn {
  border-color: var(--border-light, #404040);
  color: var(--text-secondary, #aaaaaa);
}

body.dark-mode .pp-chat-upload-btn:hover {
  background: var(--bg-card, rgba(0, 0, 0, 0.4));
}

body.dark-mode .pp-chat-image-preview {
  background: var(--bg-card, rgba(0, 0, 0, 0.4));
  border-color: var(--border-light, #404040);
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .pp-chat-upload-btn {
    width: 36px;
    height: 36px;
  }

  .pp-chat-upload-btn svg {
    width: 16px;
    height: 16px;
  }

  .pp-chat-image-preview img {
    max-height: 60px;
    max-width: 90px;
  }

  .pp-chat-message-image {
    max-width: 150px;
    max-height: 120px;
  }
}
