/**
 * NexlyCart AI - Next-Gen Multi-Retailer Shopping Platform Stylesheet
 * Palette: Dark Navy foundation + Electric Blue + Violet + Cyan + Crisp White
 *
 * @package NexlyCart_AI
 * @version 2.0.0
 */

:root {
  --nexly-bg-dark: #0a0e17;
  --nexly-bg-surface: #111827;
  --nexly-bg-surface-elevated: #1a2234;
  --nexly-bg-glass: rgba(17, 24, 39, 0.75);
  --nexly-border-glass: rgba(255, 255, 255, 0.08);
  --nexly-border-glow: rgba(59, 130, 246, 0.4);

  --nexly-electric-blue: #2563eb;
  --nexly-electric-blue-light: #3b82f6;
  --nexly-violet: #7c3aed;
  --nexly-violet-light: #8b5cf6;
  --nexly-cyan: #06b6d4;
  --nexly-cyan-light: #22d3ee;
  
  --nexly-amazon-orange: #ff9900;
  --nexly-walmart-blue: #0071dc;
  --nexly-deal-red: #ef4444;
  --nexly-deal-green: #10b981;

  --nexly-text-primary: #f8fafc;
  --nexly-text-secondary: #94a3b8;
  --nexly-text-muted: #64748b;

  --nexly-radius-sm: 8px;
  --nexly-radius-md: 14px;
  --nexly-radius-lg: 20px;
  --nexly-radius-full: 9999px;

  --nexly-shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.15);
  --nexly-shadow-md: 0 10px 30px rgba(0, 0, 0, 0.25);
  --nexly-shadow-glow: 0 0 25px rgba(59, 130, 246, 0.25);
  --nexly-font: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ==========================================================================
   1. HERO SECTION (Phase 4)
   ========================================================================== */

.nexly-hero-section {
  position: relative;
  background: radial-gradient(circle at 50% 0%, #1e1b4b 0%, #0a0e17 70%);
  color: var(--nexly-text-primary);
  padding: 48px 20px 40px;
  border-radius: var(--nexly-radius-lg);
  margin: 16px auto 32px;
  max-width: 1200px;
  box-shadow: 0 20px 50px -10px rgba(10, 14, 23, 0.8);
  border: 1px solid var(--nexly-border-glass);
  overflow: hidden;
  font-family: var(--nexly-font);
}

.nexly-hero-bg-glow {
  position: absolute;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 350px;
  background: radial-gradient(ellipse at center, rgba(59, 130, 246, 0.25) 0%, rgba(124, 58, 237, 0.15) 50%, transparent 80%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}

.nexly-hero-container {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.nexly-hero-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 6px 16px;
  border-radius: var(--nexly-radius-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--nexly-cyan-light);
  letter-spacing: 0.3px;
  margin-bottom: 20px;
  backdrop-filter: blur(8px);
}

.nexly-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--nexly-cyan);
  box-shadow: 0 0 10px var(--nexly-cyan);
  animation: nexlyPulseDot 1.8s infinite ease-in-out;
}

@keyframes nexlyPulseDot {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.4); }
}

.nexly-hero-title {
  font-size: clamp(32px, 5vw, 54px);
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 14px;
  background: linear-gradient(135deg, #ffffff 30%, #93c5fd 70%, #c4b5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}

.nexly-hero-subtitle {
  font-size: clamp(16px, 2.2vw, 19px);
  color: var(--nexly-text-secondary);
  line-height: 1.5;
  margin: 0 auto 32px;
  max-width: 680px;
}

/* ==========================================================================
   2. RETAILER PILLS (Phase 6)
   ========================================================================== */

.nexly-retailer-pills {
  display: inline-flex;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--nexly-border-glass);
  padding: 4px;
  border-radius: var(--nexly-radius-full);
  margin-bottom: 16px;
  gap: 4px;
  backdrop-filter: blur(10px);
}

.nexly-retailer-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--nexly-text-secondary);
  padding: 8px 18px;
  border-radius: var(--nexly-radius-full);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nexly-retailer-pill:hover {
  color: #ffffff;
}

.nexly-retailer-pill.active {
  background: linear-gradient(135deg, var(--nexly-electric-blue) 0%, var(--nexly-violet) 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

/* ==========================================================================
   3. SEARCH INPUT BOX & ACTIONS (Phase 4 & 5)
   ========================================================================== */

.nexly-search-input-wrap {
  display: flex;
  align-items: center;
  background: rgba(17, 24, 39, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--nexly-radius-full);
  padding: 6px 8px 6px 20px;
  box-shadow: var(--nexly-shadow-md), 0 0 20px rgba(37, 99, 235, 0.12);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(16px);
}

.nexly-search-input-wrap:focus-within {
  border-color: var(--nexly-electric-blue-light);
  box-shadow: var(--nexly-shadow-glow), 0 0 0 3px rgba(59, 130, 246, 0.25);
  background: rgba(15, 23, 42, 0.98);
}

.nexly-search-icon {
  color: var(--nexly-cyan);
  display: flex;
  align-items: center;
  margin-right: 12px;
}

.nexly-search-input {
  flex: 1;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  color: #ffffff !important;
  font-size: 17px;
  font-family: inherit;
  padding: 10px 4px;
}

.nexly-search-input::placeholder {
  color: var(--nexly-text-muted);
}

.nexly-search-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nexly-action-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--nexly-border-glass);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--nexly-text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.nexly-action-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  color: var(--nexly-cyan-light);
  border-color: var(--nexly-cyan);
  transform: translateY(-1px);
}

.nexly-btn-clear {
  background: none;
  border: none;
  color: var(--nexly-text-muted);
  cursor: pointer;
  font-size: 15px;
  padding: 6px;
}

.nexly-btn-clear:hover {
  color: #ffffff;
}

.nexly-btn-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--nexly-electric-blue) 0%, var(--nexly-violet) 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--nexly-radius-full);
  padding: 11px 24px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
  white-space: nowrap;
}

.nexly-btn-search:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(37, 99, 235, 0.6);
  filter: brightness(1.1);
}

/* URL Drawer */
.nexly-url-drawer {
  margin-top: 14px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--nexly-border-glow);
  border-radius: var(--nexly-radius-md);
  padding: 16px;
  text-align: left;
  animation: nexlySlideDown 0.3s ease-out;
}

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

.nexly-url-hint {
  display: block;
  font-size: 13px;
  color: var(--nexly-text-secondary);
  margin-bottom: 10px;
}

.nexly-url-row {
  display: flex;
  gap: 10px;
}

.nexly-url-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.3) !important;
  border: 1px solid var(--nexly-border-glass) !important;
  border-radius: var(--nexly-radius-sm);
  color: #ffffff !important;
  padding: 10px 14px;
  font-size: 14px;
}

.nexly-btn-url-scan {
  background: linear-gradient(135deg, var(--nexly-cyan) 0%, var(--nexly-electric-blue) 100%);
  color: #0a0e17;
  font-weight: 700;
  border: none;
  border-radius: var(--nexly-radius-sm);
  padding: 10px 18px;
  cursor: pointer;
  white-space: nowrap;
}

/* ==========================================================================
   4. SUGGESTION CHIPS (Phase 4)
   ========================================================================== */

.nexly-suggestions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.nexly-suggestions-label {
  font-size: 13px;
  color: var(--nexly-text-muted);
}

.nexly-chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.nexly-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--nexly-border-glass);
  color: var(--nexly-text-secondary);
  padding: 6px 14px;
  border-radius: var(--nexly-radius-full);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nexly-chip:hover {
  background: rgba(59, 130, 246, 0.15);
  color: #ffffff;
  border-color: rgba(59, 130, 246, 0.5);
  transform: translateY(-1px);
}

/* ==========================================================================
   5. SMART FILTERS BAR (Phase 12)
   ========================================================================== */

.nexly-filters-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--nexly-border-glass);
  border-radius: var(--nexly-radius-md);
  padding: 12px 18px;
  margin-top: 28px;
}

.nexly-filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.nexly-filter-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--nexly-text-muted);
}

.nexly-select {
  background: rgba(30, 41, 59, 0.8) !important;
  border: 1px solid var(--nexly-border-glass) !important;
  color: var(--nexly-text-primary) !important;
  border-radius: var(--nexly-radius-sm);
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

/* ==========================================================================
   6. PRODUCT CARDS & GRID (Phase 7)
   ========================================================================== */

.nexly-results-container {
  margin-top: 36px;
  text-align: left;
}

.nexly-ai-banner {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.15) 0%, rgba(124, 58, 237, 0.15) 100%);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--nexly-radius-md);
  padding: 14px 20px;
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--nexly-cyan-light);
  display: flex;
  align-items: center;
  gap: 12px;
}

.nexly-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}

/* Modern Card */
.nexly-product-card {
  position: relative;
  background: var(--nexly-bg-surface);
  border: 1px solid var(--nexly-border-glass);
  border-radius: var(--nexly-radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--nexly-shadow-sm);
}

.nexly-product-card:hover {
  transform: translateY(-4px);
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 16px 36px -10px rgba(0, 0, 0, 0.5), 0 0 20px rgba(37, 99, 235, 0.15);
}

.nexly-card-media {
  position: relative;
  width: 100%;
  padding-top: 85%;
  background: #0f172a;
  overflow: hidden;
}

.nexly-card-media img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 16px;
  transition: transform 0.35s ease;
}

.nexly-product-card:hover .nexly-card-media img {
  transform: scale(1.04);
}

/* Badges on Image */
.nexly-card-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 2;
}

.nexly-retailer-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--nexly-radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nexly-badge-amazon {
  background: var(--nexly-amazon-orange);
  color: #111827;
}

.nexly-badge-walmart {
  background: var(--nexly-walmart-blue);
  color: #ffffff;
}

.nexly-discount-badge {
  background: var(--nexly-deal-red);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--nexly-radius-sm);
}

.nexly-card-save-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--nexly-border-glass);
  color: #ffffff;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}

.nexly-card-save-btn:hover,
.nexly-card-save-btn.saved {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}

/* Card Body */
.nexly-card-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.nexly-card-category {
  font-size: 12px;
  font-weight: 600;
  color: var(--nexly-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.nexly-card-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 10px;
  color: var(--nexly-text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.nexly-card-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.nexly-card-title a:hover {
  color: var(--nexly-electric-blue-light);
}

.nexly-card-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}

.nexly-card-price {
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
}

.nexly-card-was-price {
  font-size: 14px;
  color: var(--nexly-text-muted);
  text-decoration: line-through;
}

/* AI Recommendation Pill inside card */
.nexly-card-ai-reason {
  background: rgba(59, 130, 246, 0.08);
  border-left: 3px solid var(--nexly-electric-blue-light);
  padding: 6px 10px;
  border-radius: 0 var(--nexly-radius-sm) var(--nexly-radius-sm) 0;
  font-size: 12px;
  color: #bfdbfe;
  line-height: 1.4;
  margin-bottom: 14px;
}

/* Card Action Buttons */
.nexly-card-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: auto;
}

.nexly-card-cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--nexly-electric-blue) 0%, var(--nexly-violet) 100%);
  color: #ffffff !important;
  text-decoration: none !important;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 14px;
  border-radius: var(--nexly-radius-sm);
  transition: all 0.2s ease;
  text-align: center;
}

.nexly-card-cta-btn:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

.nexly-card-secondary-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.nexly-btn-ask-ai,
.nexly-btn-add-compare {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--nexly-border-glass);
  color: var(--nexly-text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 10px;
  border-radius: var(--nexly-radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.nexly-btn-ask-ai:hover {
  background: rgba(124, 58, 237, 0.2);
  color: #d8b4fe;
  border-color: var(--nexly-violet-light);
}

.nexly-btn-add-compare:hover,
.nexly-btn-add-compare.active {
  background: rgba(6, 182, 212, 0.2);
  color: var(--nexly-cyan-light);
  border-color: var(--nexly-cyan);
}

/* ==========================================================================
   7. AI SHOPPING CHAT ASSISTANT (Phase 10)
   ========================================================================== */

.nexly-chat-wrapper {
  background: var(--nexly-bg-dark);
  border: 1px solid var(--nexly-border-glass);
  border-radius: var(--nexly-radius-lg);
  overflow: hidden;
  max-width: 1200px;
  margin: 32px auto;
  box-shadow: var(--nexly-shadow-md);
  font-family: var(--nexly-font);
}

.nexly-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: rgba(17, 24, 39, 0.95);
  border-bottom: 1px solid var(--nexly-border-glass);
}

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

.nexly-chat-bot-icon {
  font-size: 26px;
}

.nexly-chat-header-title h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
}

.nexly-chat-header-title small {
  color: var(--nexly-text-muted);
  font-size: 12px;
}

.nexly-chat-reset-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--nexly-border-glass);
  color: var(--nexly-text-secondary);
  border-radius: var(--nexly-radius-sm);
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}

.nexly-chat-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  min-height: 520px;
}

.nexly-chat-convo-pane {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--nexly-border-glass);
  background: rgba(10, 14, 23, 0.6);
}

.nexly-chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 440px;
}

.nexly-msg {
  display: flex;
  gap: 12px;
  max-width: 90%;
}

.nexly-msg-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.nexly-msg-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--nexly-electric-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.nexly-msg-user .nexly-msg-avatar {
  background: var(--nexly-violet);
}

.nexly-msg-bubble {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--nexly-border-glass);
  padding: 12px 16px;
  border-radius: var(--nexly-radius-md);
  color: var(--nexly-text-primary);
  font-size: 14px;
  line-height: 1.5;
}

.nexly-msg-user .nexly-msg-bubble {
  background: linear-gradient(135deg, var(--nexly-electric-blue) 0%, #1d4ed8 100%);
  color: #ffffff;
}

.nexly-chat-quick-suggestions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.nexly-chat-prompt {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--nexly-border-glass);
  color: var(--nexly-cyan-light);
  border-radius: var(--nexly-radius-sm);
  padding: 6px 12px;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
}

.nexly-chat-prompt:hover {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--nexly-cyan);
}

.nexly-chat-input-area {
  padding: 16px;
  display: flex;
  gap: 10px;
  background: rgba(17, 24, 39, 0.95);
  border-top: 1px solid var(--nexly-border-glass);
}

.nexly-chat-input {
  flex: 1;
  background: rgba(30, 41, 59, 0.8) !important;
  border: 1px solid var(--nexly-border-glass) !important;
  border-radius: var(--nexly-radius-md);
  color: #ffffff !important;
  padding: 10px 16px;
  font-size: 14px;
}

.nexly-chat-send-btn {
  background: linear-gradient(135deg, var(--nexly-electric-blue) 0%, var(--nexly-violet) 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--nexly-radius-md);
  padding: 10px 20px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Chat Products Right Pane */
.nexly-chat-products-pane {
  background: var(--nexly-bg-surface);
  padding: 20px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.nexly-chat-pane-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.nexly-chat-pane-header h4 {
  margin: 0;
  font-size: 15px;
  color: #ffffff;
}

.nexly-chat-retailer-tag {
  font-size: 11px;
  color: var(--nexly-cyan-light);
  background: rgba(6, 182, 212, 0.12);
  padding: 3px 8px;
  border-radius: var(--nexly-radius-full);
}

.nexly-chat-products-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nexly-chat-mini-card {
  display: flex;
  gap: 12px;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--nexly-border-glass);
  border-radius: var(--nexly-radius-sm);
  padding: 10px;
  align-items: center;
  transition: all 0.2s;
}

.nexly-chat-mini-card:hover {
  border-color: var(--nexly-electric-blue-light);
  background: rgba(30, 41, 59, 0.9);
}

.nexly-chat-mini-img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  background: #ffffff;
  border-radius: 6px;
  padding: 4px;
}

.nexly-chat-mini-info {
  flex: 1;
}

.nexly-chat-mini-title {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 4px;
}

.nexly-chat-mini-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--nexly-cyan-light);
}

/* ==========================================================================
   8. MODALS (Comparison, Analysis, Saved Products)
   ========================================================================== */

.nexly-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.nexly-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(10px);
}

.nexly-modal-dialog {
  position: relative;
  background: var(--nexly-bg-surface);
  border: 1px solid var(--nexly-border-glass);
  border-radius: var(--nexly-radius-lg);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8);
  color: var(--nexly-text-primary);
  font-family: var(--nexly-font);
  animation: nexlyModalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.nexly-modal-lg {
  max-width: 900px;
}

@keyframes nexlyModalPop {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.nexly-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--nexly-border-glass);
  background: rgba(15, 23, 42, 0.95);
}

.nexly-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nexly-modal-icon {
  font-size: 24px;
}

.nexly-modal-header h2 {
  font-size: 18px;
  font-weight: 800;
  margin: 0;
  color: #ffffff;
}

.nexly-modal-header p {
  font-size: 13px;
  color: var(--nexly-text-muted);
  margin: 2px 0 0;
}

.nexly-modal-close {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--nexly-text-secondary);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
}

.nexly-modal-close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.nexly-modal-body {
  padding: 24px;
}

/* Comparison Grid */
.nexly-compare-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
}

.nexly-compare-vs-pill {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--nexly-electric-blue);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  box-shadow: 0 0 14px rgba(37, 99, 235, 0.5);
}

.nexly-compare-col {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--nexly-border-glass);
  border-radius: var(--nexly-radius-md);
  padding: 16px;
}

.nexly-compare-empty-slot {
  text-align: center;
  padding: 30px 10px;
  color: var(--nexly-text-muted);
}

.nexly-compare-empty-slot .nexly-slot-icon {
  font-size: 32px;
  display: block;
  margin-bottom: 8px;
}

.nexly-compare-ai-verdict {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12) 0%, rgba(124, 58, 237, 0.12) 100%);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--nexly-radius-md);
  padding: 18px;
  margin-bottom: 24px;
}

.nexly-btn-compare-ai {
  background: linear-gradient(135deg, var(--nexly-electric-blue) 0%, var(--nexly-violet) 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--nexly-radius-md);
  padding: 12px 24px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 auto;
}

.nexly-btn-compare-ai:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ==========================================================================
   9. SAVED PRODUCTS DRAWER (Phase 23)
   ========================================================================== */

.nexly-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 999999;
}

.nexly-drawer-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 14, 23, 0.7);
  backdrop-filter: blur(6px);
}

.nexly-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 400px;
  height: 100%;
  background: var(--nexly-bg-surface);
  border-left: 1px solid var(--nexly-border-glass);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  animation: nexlyDrawerSlide 0.3s ease-out;
  color: #ffffff;
  font-family: var(--nexly-font);
}

@keyframes nexlyDrawerSlide {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.nexly-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--nexly-border-glass);
}

.nexly-drawer-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nexly-saved-count-badge {
  background: #ef4444;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--nexly-radius-full);
}

.nexly-drawer-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.nexly-drawer-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--nexly-border-glass);
}

.nexly-btn-clear-saved {
  width: 100%;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  padding: 10px;
  border-radius: var(--nexly-radius-sm);
  font-weight: 600;
  cursor: pointer;
}

/* Spinner */
.nexly-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(59, 130, 246, 0.2);
  border-top-color: var(--nexly-electric-blue-light);
  border-radius: 50%;
  animation: nexlySpin 0.8s linear infinite;
  margin: 12px auto;
}

@keyframes nexlySpin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   10. MOBILE OPTIMIZATIONS (Phase 16)
   ========================================================================== */

@media (max-width: 768px) {
  .nexly-hero-section {
    padding: 32px 14px 28px;
    margin: 10px auto 24px;
  }

  .nexly-search-input-wrap {
    padding: 6px 6px 6px 14px;
  }

  .nexly-search-input {
    font-size: 15px;
  }

  .nexly-btn-search span {
    display: none;
  }

  .nexly-btn-search {
    padding: 10px 14px;
  }

  .nexly-chat-layout {
    grid-template-columns: 1fr;
  }

  .nexly-chat-convo-pane {
    border-right: none;
    border-bottom: 1px solid var(--nexly-border-glass);
  }

  .nexly-compare-grid {
    grid-template-columns: 1fr;
  }

  .nexly-compare-vs-pill {
    margin: 8px auto;
  }

  .nexly-filters-bar {
    flex-direction: column;
    align-items: stretch;
  }
}
