/**
 * Claude Product Advisor Widget Styles
 *
 * Modern CSS with fluid sizing, animated gradient border, and GPU-accelerated animations
 * Version: 2.1.0
 *
 * UI FIXES v2.1.0 (2025-12-10):
 * - Issue #12: Enhanced helper/example text styling (light gray, italic)
 * - Issue #15: Added login modal overlay styles (overlays panel, not below button)
 * - Issue #16: Updated launch button with white bg and purple-teal gradient border
 * - Issue #7: Added age range selection button styles with gradient on selection
 *
 * PHASE 1 ENHANCEMENTS v2.0.0:
 * - NEW: Skin type selection buttons with single-select styling
 * - NEW: Form section layout with step labels
 * - NEW: Helper text styling for textarea guidance
 * - NEW: Toast notification for max concerns warning
 * - NEW: Updated greeting section with title and subtitle
 * - NEW: Mobile responsive styles for new components
 * - UPDATED: Increased textarea height to accommodate 500 chars
 *
 * UI FIX v1.4.8:
 * - FIXED: Button background now always solid white (#FFFFFF), not affected by dark mode
 * - Implements single-product-template.md Stage 1 requirements
 * - Animated gradient border remains on ::before pseudo-element (border only)
 *
 * UI IMPROVEMENTS v1.4.7:
 * - Changed panel expansion from bottom-right to bottom-center (aligned with button)
 * - Panel now slides up from center on desktop for better visual continuity
 * - Fixed animation: Separated mobile/desktop transforms to prevent slide-over effect
 * - Increased desktop panel width from 400px to 40vw for better content display
 * - Maintains full-screen mobile behavior
 *
 * UI IMPROVEMENTS v1.4.6:
 * - Smoother button animations with improved cubic-bezier easing (0.5s transition)
 * - Optimized entrance/exit timing for more polished user experience
 *
 * Architecture:
 * - Animated gradient border using pseudo-elements
 * - MEDIUM-12: Fixed values + media queries (eliminated clamp() for paint optimization)
 * - GPU-accelerated animations (transform/opacity)
 * - Mobile-first responsive design
 * - Accessibility-focused with WCAG 2.1 AA compliance
 *
 * PERFORMANCE OPTIMIZATIONS v1.2.0:
 * - MEDIUM-5: Combined button animations to reduce GPU thrashing
 * - MEDIUM-6: Extended nth-child rules from 4 to 8 products
 * - MEDIUM-12: Replaced clamp() with fixed values + media queries for paint optimization
 *
 * BUG FIXES v1.2.2:
 * - CRITICAL: Fixed button positioning issue (line 184) - removed duplicate "position: relative"
 *   that was overriding "position: fixed", causing button to appear in bottom-left instead of bottom-right
 *
 * NEW FEATURES v1.3.0:
 * - NEW badge styling for featured products
 * - Product card highlighting for "is-new" class
 * - Gradient badge with purple-teal branding
 *
 * PERFORMANCE OPTIMIZATIONS v1.3.1 (Code Review Fixes):
 * - HIGH-1: Replaced `transition: all` with explicit property transitions (~5-10ms per interaction)
 *   - .claude-advisor-concern-pill: border-color, background-color, color, padding-inline
 *   - .claude-advisor-product-card: border-color, box-shadow, transform
 * - HIGH-2: Added `will-change: background-position` to animated button pseudo-element for smoother rendering
 *
 * REDESIGN v1.4.0 (UI/UX Improvements):
 * - Button: Changed from circular floating right to center bottom with rounded corners
 * - Button: Slide-in animation from bottom on scroll (appears after 300px)
 * - Button: Horizontal layout with larger text (better readability)
 * - AI Response: Subtle shadow box with rounded corners (12px radius)
 * - Product Cards: Enhanced shadow styling to match theme
 * - All elements: Consistent 12px border-radius and subtle shadows
 *
 * UI CLEANUP v1.4.1:
 * - Removed .claude-advisor-avatar styles (no longer used)
 * - Simplified .claude-advisor-greeting layout (removed flexbox, no longer needed)
 *
 * UI IMPROVEMENT v1.4.4 (Clean Design):
 * - Removed dark backdrop overlay (changed to transparent)
 * - Keeps backdrop element for click-to-close functionality
 * - Cleaner, less intrusive visual design
 *
 * BUG FIX v1.4.5 (Critical Hotfix):
 * - CRITICAL: Fixed backdrop blocking all page clicks after widget close
 * - Added pointer-events: none to backdrop when hidden (line 354)
 * - Added pointer-events: auto to backdrop.is-visible (line 365)
 * - Prevents invisible click-blocking layer from locking users out of page
 */

/* ===================================
   CSS Custom Properties (Design Tokens)
   =================================== */
:root {
  /* Brand Colors */
  --claude-purple: #9333EA;
  --claude-teal: #14B8A6;
  --claude-white: #FFFFFF;

  /* UI Colors */
  --claude-bg-primary: #FFFFFF;
  --claude-bg-secondary: #F3F4F6;
  --claude-border: #E5E7EB;
  --claude-text-primary: #111827;
  --claude-text-secondary: #6B7280;

  /* MEDIUM-12: Spacing (fixed values for mobile) */
  --claude-space-xs: 0.25rem;
  --claude-space-sm: 0.5rem;
  --claude-space-md: 0.75rem;
  --claude-space-lg: 1rem;
  --claude-space-xl: 1.5rem;

  /* Sizes */
  --claude-button-size-mobile: 56px;
  --claude-button-size-desktop: 60px;
  --claude-panel-width-mobile: 100vw;
  --claude-panel-width-desktop: 40vw; /* v1.4.7: Increased from 400px to 40vw */
  --claude-panel-height-max: min(600px, 90dvh);

  /* Animations */
  --claude-transition-fast: 200ms ease;
  --claude-transition-base: 300ms ease-out;
  --claude-transition-slow: 400ms ease-in-out;

  /* Shadows */
  --claude-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --claude-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
  --claude-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
  --claude-shadow-hover: 0 4px 12px rgba(147, 51, 234, 0.1);

  /* Z-index layers */
  --claude-z-backdrop: 9997;
  --claude-z-widget: 9998;
  --claude-z-panel: 9999;
}

/* MEDIUM-12: Tablet responsive spacing */
@media (min-width: 480px) {
  :root {
    --claude-space-xs: 0.375rem;
    --claude-space-sm: 0.625rem;
    --claude-space-md: 0.875rem;
    --claude-space-lg: 1.25rem;
    --claude-space-xl: 1.75rem;
  }
}

/* MEDIUM-12: Desktop responsive spacing */
@media (min-width: 768px) {
  :root {
    --claude-space-xs: 0.5rem;
    --claude-space-sm: 0.75rem;
    --claude-space-md: 1rem;
    --claude-space-lg: 1.5rem;
    --claude-space-xl: 2rem;
  }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
  :root {
    --claude-bg-primary: #1F2937;
    --claude-bg-secondary: #111827;
    --claude-border: #374151;
    --claude-text-primary: #F9FAFB;
    --claude-text-secondary: #D1D5DB;
  }
}

/* ===================================
   Keyframe Animations
   =================================== */

/* MEDIUM-5: Combined gradient + pulse animation to reduce GPU thrashing */
@keyframes claude-button-animate {
  0%, 100% {
    transform: scale(1);
    background-position: 0% 50%;
  }
  50% {
    transform: scale(1.05);
    background-position: 100% 50%;
  }
}

/* Loading Spinner Rotation */
@keyframes claude-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Slide Up Panel Animation */
@keyframes claude-slide-up {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Fade In Animation */
@keyframes claude-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Fade In Up (for product cards) */
@keyframes claude-fade-in-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===================================
   Floating Button with Animated Border
   =================================== */

.claude-advisor-button {
  position: fixed;
  /* REDESIGN v1.4.0: Center bottom button with slide-in animation */
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%); /* Hidden by default, slides in from bottom */
  z-index: var(--claude-z-widget);

  /* Size: Rounded rectangle instead of circle */
  padding: 0.875rem 2rem;
  min-width: 200px;
  height: auto;

  /* Layout */
  display: flex;
  flex-direction: row; /* Horizontal layout */
  align-items: center;
  justify-content: center;
  gap: var(--claude-space-sm);

  /* Background with gradient border effect */
  /* REQUIREMENT: Button must always be solid white (not affected by dark mode) */
  /* Issue #16: White bg with purple-teal border */
  background: #FFFFFF;
  color: var(--wp--preset--color--primary, #1a1a2e);
  border: 2px solid transparent;
  background-image: linear-gradient(#FFFFFF, #FFFFFF),
                    linear-gradient(135deg, #8B5CF6 0%, #06B6D4 100%);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  border-radius: 12px; /* Rounded corners instead of fully circular */

  /* Effects */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
  cursor: pointer;

  /* Smoother slide-in animation */
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.3s ease-out,
              opacity 0.4s ease-out;
  opacity: 0;

  /* MEDIUM-5: Optimized will-change */
  will-change: transform, opacity;
}

/* Show button on scroll */
.claude-advisor-button.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* REDESIGN v1.4.0: Responsive sizing for larger screens */
@media (min-width: 768px) {
  .claude-advisor-button {
    bottom: 2rem;
    padding: 1rem 2.5rem;
    min-width: 240px;
  }
}

/* Animated Gradient Border using Pseudo-element */
.claude-advisor-button::before {
  content: '';
  position: absolute;
  inset: -3px;
  z-index: -1;

  /* Animated gradient background */
  background: linear-gradient(
    135deg,
    var(--claude-purple),
    var(--claude-teal),
    var(--claude-white),
    var(--claude-purple)
  );
  background-size: 300% 300%;

  /* Border radius matching button */
  border-radius: inherit;

  /* HIGH-2 FIX: Hint browser about animated property for smoother rendering */
  will-change: background-position;

  /* MEDIUM-5: Combined with button pulse animation */
  animation: claude-button-animate 3.5s ease-in-out infinite;
}

/* Hover State - REDESIGN v1.4.0: Updated for center bottom button */
.claude-advisor-button:hover {
  transform: translateX(-50%) translateY(-4px); /* Subtle lift effect */
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2), 0 4px 8px rgba(0, 0, 0, 0.12);
}

/* Visible + Hover State */
.claude-advisor-button.is-visible:hover {
  transform: translateX(-50%) translateY(-4px);
}

/* MEDIUM-5: Pause animation on hover to reduce GPU load */
.claude-advisor-button:hover::before {
  animation-play-state: paused;
}

/* Focus State (Accessibility) */
.claude-advisor-button:focus-visible {
  outline: 2px solid var(--claude-purple);
  outline-offset: 2px;
}

/* Active State - REDESIGN v1.4.0 */
.claude-advisor-button:active {
  transform: translateX(-50%) translateY(0);
}

.claude-advisor-button.is-visible:active {
  transform: translateX(-50%) translateY(0);
}

/* Button Icon - REDESIGN v1.4.0: Larger icon for horizontal layout */
.claude-advisor-button svg {
  inline-size: 20px;
  block-size: 20px;
  color: var(--claude-purple);
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .claude-advisor-button svg {
    inline-size: 24px;
    block-size: 24px;
  }
}

/* Button Text - REDESIGN v1.4.0: Larger text for center button */
.claude-advisor-button span {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--claude-text-primary);
  white-space: nowrap;
  line-height: 1.2;
}

@media (min-width: 768px) {
  .claude-advisor-button span {
    font-size: 1rem;
  }
}

/* Hidden state (when panel is open) */
.claude-advisor-button.is-hidden {
  transform: scale(0);
  opacity: 0;
  pointer-events: none;
}

/* ===================================
   Backdrop Overlay
   =================================== */

.claude-advisor-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--claude-z-backdrop);
  background: transparent; /* REDESIGN v1.4.4: Removed dark overlay */
  pointer-events: none; /* BUG FIX v1.4.5: Don't block clicks when hidden */

  /* Animations */
  animation: claude-fade-in var(--claude-transition-fast);

  /* Hidden by default */
  display: none;
}

.claude-advisor-backdrop.is-visible {
  display: block;
  pointer-events: auto; /* BUG FIX v1.4.5: Enable clicks when panel is open */
}

/* ===================================
   Chat Panel Container
   =================================== */

.claude-advisor-panel {
  position: fixed;
  z-index: var(--claude-z-panel);

  /* Mobile: Full screen */
  inset: 0;
  inline-size: var(--claude-panel-width-mobile);
  block-size: 100dvh;

  /* Background */
  background: var(--claude-bg-primary);

  /* No border radius on mobile (full screen) */
  border-radius: 0;

  /* Shadow */
  box-shadow: var(--claude-shadow-lg);

  /* Layout */
  display: flex;
  flex-direction: column;

  /* Animations */
  animation: claude-slide-up var(--claude-transition-base);

  /* Hidden by default */
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
  transition: transform var(--claude-transition-base),
              opacity var(--claude-transition-base);
}

/* Desktop: Bottom-center positioned panel (v1.4.7) */
@media (min-width: 768px) {
  .claude-advisor-panel {
    inset-block-start: auto;
    /* MEDIUM-12: Fixed values */
    inset-block-end: 1.5rem;
    /* v1.4.7: Center horizontally (aligned with button) */
    inset-inline-start: 50%;
    inset-inline-end: auto;
    transform: translateX(-50%) translateY(100%);

    inline-size: var(--claude-panel-width-desktop);
    max-block-size: var(--claude-panel-height-max);
    block-size: auto;

    border-radius: 16px;
  }
}

/* Visible State */
.claude-advisor-panel.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* Mobile: Slide up from bottom */
@media (max-width: 767px) {
  .claude-advisor-panel.is-visible {
    transform: translateY(0);
  }
}

/* Desktop: Maintain center position when visible (v1.4.7) */
@media (min-width: 768px) {
  .claude-advisor-panel.is-visible {
    transform: translateX(-50%) translateY(0);
  }
}

/* ===================================
   Panel Header
   =================================== */

.claude-advisor-header {
  /* Size */
  min-block-size: 60px;
  padding-block: var(--claude-space-md);
  padding-inline: var(--claude-space-lg);

  /* Background gradient */
  background: linear-gradient(135deg, var(--claude-purple), var(--claude-teal));

  /* Layout */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--claude-space-md);

  /* Border radius only on desktop */
  border-radius: 0;

  /* Prevent shrinking */
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .claude-advisor-header {
    border-start-start-radius: 16px;
    border-start-end-radius: 16px;
  }
}

/* Header Title */
.claude-advisor-header h3,
#claude-advisor-title {
  /* MEDIUM-12: Fixed font size for mobile */
  font-size: 1rem;
  font-weight: 600;
  color: var(--claude-white);
  margin: 0;
  line-height: 1.2;
}

/* MEDIUM-12: Tablet font size */
@media (min-width: 480px) {
  .claude-advisor-header h3,
  #claude-advisor-title {
    font-size: 1.0625rem;
  }
}

/* MEDIUM-12: Desktop font size */
@media (min-width: 768px) {
  .claude-advisor-header h3,
  #claude-advisor-title {
    font-size: 1.125rem;
  }
}

/* Close Button */
.claude-advisor-close {
  /* Reset button styles */
  appearance: none;
  background: transparent;
  border: none;
  padding: var(--claude-space-xs);
  margin: calc(var(--claude-space-xs) * -1);

  /* Size (44x44 touch target) */
  inline-size: 44px;
  block-size: 44px;

  /* Layout */
  display: flex;
  align-items: center;
  justify-content: center;

  /* Styling */
  color: var(--claude-white);
  border-radius: 8px;
  cursor: pointer;

  /* Transition */
  transition: background-color var(--claude-transition-fast);
}

.claude-advisor-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.claude-advisor-close:focus-visible {
  outline: 2px solid var(--claude-white);
  outline-offset: 2px;
}

.claude-advisor-close svg {
  inline-size: 24px;
  block-size: 24px;
}

/* ===================================
   Panel Body (Scrollable Content)
   =================================== */

.claude-advisor-content {
  /* Fill available space */
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;

  /* Padding */
  padding-block: var(--claude-space-lg);
  padding-inline: var(--claude-space-lg);

  /* Custom scrollbar styling (WebKit) */
  scrollbar-width: thin;
  scrollbar-color: var(--claude-border) transparent;
}

.claude-advisor-content::-webkit-scrollbar {
  inline-size: 6px;
}

.claude-advisor-content::-webkit-scrollbar-track {
  background: transparent;
}

.claude-advisor-content::-webkit-scrollbar-thumb {
  background: var(--claude-border);
  border-radius: 3px;
}

.claude-advisor-content::-webkit-scrollbar-thumb:hover {
  background: var(--claude-text-secondary);
}

/* ===================================
   Greeting Section (UPDATED v2.0)
   =================================== */

.claude-advisor-greeting {
  margin-block-end: 1.5rem;
  padding-block-end: 1.25rem;
  border-block-end: 2px solid var(--claude-border);
}

.claude-advisor-greeting-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--claude-text-primary);
  margin: 0 0 0.5rem;
}

@media (min-width: 768px) {
  .claude-advisor-greeting-title {
    font-size: 1.25rem;
  }
}

.claude-advisor-greeting-subtitle {
  font-size: 0.875rem;
  color: var(--claude-text-secondary);
  line-height: 1.5;
  margin: 0;
}

@media (min-width: 768px) {
  .claude-advisor-greeting-subtitle {
    font-size: 0.9375rem;
  }
}

/* ===================================
   Form Section Layout (NEW v2.0)
   =================================== */

.claude-advisor-form-section {
  margin-block-end: 1.5rem;
}

.claude-advisor-form-label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--claude-text-primary);
  margin-block-end: 0.5rem;
}

@media (min-width: 768px) {
  .claude-advisor-form-label {
    font-size: 1rem;
  }
}

.claude-advisor-form-label .required {
  color: #dc3545;
  margin-inline-start: 0.125rem;
}

.claude-advisor-helper-text,
.claude-advisor-form-section .example-text {
  color: var(--wp--preset--color--grey-600, #6B7280);
  font-size: 0.8125rem;
  font-style: italic;
  margin-block: 0.25rem 0.5rem;
  line-height: 1.4;
}

/* ===================================
   Skin Type Selection (NEW v2.0 - Step 1)
   =================================== */

.claude-advisor-skin-types {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.625rem;
  margin-block-start: 0.75rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  padding-bottom: 4px; /* Space for touch scrolling */
}

.claude-advisor-skin-types::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.claude-advisor-skin-type {
  flex-shrink: 0; /* Prevent shrinking in horizontal slider */
  padding-block: 0.625rem;
  padding-inline: 1.25rem;
  background: var(--claude-bg-secondary);
  border: 2px solid var(--claude-border);
  border-radius: 1.5625rem; /* 25px */
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--claude-text-primary);
  cursor: pointer;
  transition: background-color var(--claude-transition-fast),
              border-color var(--claude-transition-fast),
              color var(--claude-transition-fast);
  flex: 0 1 auto;
}

.claude-advisor-skin-type:hover {
  background: var(--claude-border);
  border-color: var(--claude-purple);
}

.claude-advisor-skin-type.selected {
  background: linear-gradient(135deg, var(--claude-purple), var(--claude-teal));
  color: var(--claude-white);
  border-color: var(--claude-purple);
}

.claude-advisor-skin-type:focus-visible {
  outline: 2px solid var(--claude-purple);
  outline-offset: 2px;
}

/* ===================================
   Age Range Selection (NEW - Issue #7)
   =================================== */

.claude-advisor-age-ranges {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  padding-bottom: 4px; /* Space for touch scrolling */
}

.claude-advisor-age-ranges::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.claude-advisor-age-range {
  flex-shrink: 0; /* Prevent shrinking in horizontal slider */
  padding: 10px 20px;
  border: 1.5px solid var(--wp--preset--color--grey-300, #D1D5DB);
  border-radius: 20px;
  background: #FFFFFF;
  color: var(--wp--preset--color--grey-700, #374151);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.claude-advisor-age-range:hover {
  border-color: var(--wp--preset--color--purple, #8B5CF6);
  background: var(--wp--preset--color--grey-50, #F9FAFB);
}

.claude-advisor-age-range.selected {
  background: linear-gradient(135deg, #8B5CF6 0%, #06B6D4 100%);
  color: #FFFFFF;
  border-color: transparent;
}

@media (max-width: 480px) {
  .claude-advisor-age-ranges {
    gap: 6px;
  }

  .claude-advisor-age-range {
    padding: 8px 16px;
    font-size: 0.8125rem;
  }
}

/* ===================================
   Skin Concern Selection Section (UPDATED v2.0)
   =================================== */

.claude-advisor-concerns {
  margin-block-end: var(--claude-space-xl);
}

.claude-advisor-label {
  /* MEDIUM-12: Fixed font size for mobile */
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--claude-text-primary);
  margin-block-end: var(--claude-space-md);
  display: block;
}

/* MEDIUM-12: Desktop font size */
@media (min-width: 768px) {
  .claude-advisor-label {
    font-size: 1rem;
  }
}

/* Pill Container - Horizontal Slider */
.claude-advisor-concerns-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--claude-space-sm);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  padding-bottom: 4px; /* Space for touch scrolling */
}

.claude-advisor-concerns-grid::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

/* Individual Pill */
.claude-advisor-concern-pill {
  /* Reset button styles */
  appearance: none;
  flex-shrink: 0; /* Prevent shrinking in horizontal slider */
  white-space: nowrap; /* Keep text on one line */
  background: var(--claude-bg-primary);

  /* Border */
  border: 2px solid var(--claude-border);
  border-radius: 20px;

  /* Padding */
  padding-block: var(--claude-space-sm);
  padding-inline: var(--claude-space-md);

  /* Typography - MEDIUM-12: Fixed font size for mobile */
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--claude-text-primary);

  /* Cursor */
  cursor: pointer;

  /* HIGH-1 FIX: Explicit property transitions (avoid expensive 'all') */
  transition:
    border-color var(--claude-transition-fast),
    background-color var(--claude-transition-fast),
    color var(--claude-transition-fast),
    padding-inline var(--claude-transition-fast);

  /* Inline layout */
  display: inline-flex;
  align-items: center;
  gap: var(--claude-space-xs);
}

/* MEDIUM-12: Desktop font size */
@media (min-width: 768px) {
  .claude-advisor-concern-pill {
    font-size: 0.875rem;
  }
}

/* Hover State */
.claude-advisor-concern-pill:hover {
  border-color: var(--claude-purple);
  background: rgba(147, 51, 234, 0.05);
}

/* Selected State */
.claude-advisor-concern-pill.selected,
.claude-advisor-concern-pill.is-selected {
  background: linear-gradient(135deg, var(--claude-purple), var(--claude-teal));
  border: none;
  color: var(--claude-white);
  padding-inline: calc(var(--claude-space-md) + 2px); /* Compensate for removed border */
}

/* Focus State */
.claude-advisor-concern-pill:focus-visible {
  outline: 2px solid var(--claude-purple);
  outline-offset: 2px;
}

/* ===================================
   Message Textarea Section
   =================================== */

.claude-advisor-message {
  margin-block-end: var(--claude-space-xl);
}

.claude-advisor-textarea {
  inline-size: 100%;
  padding: var(--claude-space-md);
  border: 2px solid var(--claude-border);
  border-radius: 8px;
  /* MEDIUM-12: Fixed font size for mobile */
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--claude-text-primary);
  background: var(--claude-bg-primary);
  resize: vertical;
  transition: border-color var(--claude-transition-fast);
}

/* MEDIUM-12: Desktop font size */
@media (min-width: 768px) {
  .claude-advisor-textarea {
    font-size: 0.9375rem;
  }
}

.claude-advisor-textarea:focus {
  outline: none;
  border-color: var(--claude-purple);
}

.claude-advisor-char-count {
  /* MEDIUM-12: Fixed font size for mobile */
  font-size: 0.75rem;
  color: var(--claude-text-secondary);
  margin-block-start: var(--claude-space-xs);
  display: flex;
  align-items: center;
  gap: var(--claude-space-sm);
}

/* MEDIUM-12: Desktop font size */
@media (min-width: 768px) {
  .claude-advisor-char-count {
    font-size: 0.8125rem;
  }
}

/* MEDIUM-9: Character warning indicator */
.claude-advisor-char-warning {
  color: #F59E0B;
  font-weight: 600;
  animation: claude-fade-in var(--claude-transition-fast);
}

/* ===================================
   Submit Button
   =================================== */

.claude-advisor-submit {
  inline-size: 100%;
  padding-block: var(--claude-space-md);
  padding-inline: var(--claude-space-lg);
  background: linear-gradient(135deg, var(--claude-purple), var(--claude-teal));
  border: none;
  border-radius: 8px;
  color: var(--claude-white);
  /* MEDIUM-12: Fixed font size for mobile */
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--claude-transition-fast),
              box-shadow var(--claude-transition-fast);
  box-shadow: var(--claude-shadow-sm);
}

/* MEDIUM-12: Desktop font size */
@media (min-width: 768px) {
  .claude-advisor-submit {
    font-size: 1rem;
  }
}

.claude-advisor-submit:hover {
  transform: translateY(-2px);
  box-shadow: var(--claude-shadow-md);
}

.claude-advisor-submit:active {
  transform: translateY(0);
}

.claude-advisor-submit:focus-visible {
  outline: 2px solid var(--claude-purple);
  outline-offset: 2px;
}

/* ===================================
   AI Response Bubble
   =================================== */

.claude-advisor-response {
  margin-block: var(--claude-space-lg);
  /* REDESIGN v1.4.0: Subtle shadow box with rounded corners */
  background: var(--claude-bg-primary);
  border-radius: 12px;
  padding: var(--claude-space-lg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.claude-advisor-response-header {
  display: flex;
  gap: var(--claude-space-md);
  align-items: flex-start;
  margin-block-end: var(--claude-space-sm);
}

.claude-advisor-response-text {
  /* MEDIUM-12: Fixed font size for mobile */
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--claude-text-primary);
  flex: 1;
}

/* MEDIUM-12: Desktop font size */
@media (min-width: 768px) {
  .claude-advisor-response-text {
    font-size: 0.9375rem;
  }
}

.claude-advisor-response-text strong {
  font-weight: 600;
  color: var(--claude-purple);
}

/* Typing indicator */
.claude-response-bubble.is-typing .claude-response-text::after {
  content: '...';
  animation: claude-fade-in 1s ease-in-out infinite;
}

/* ===================================
   Product Recommendations Section
   =================================== */

.claude-advisor-products {
  margin-block-start: var(--claude-space-xl);
}

.claude-advisor-products-title {
  /* MEDIUM-12: Fixed font size for mobile */
  font-size: 1rem;
  font-weight: 600;
  color: var(--claude-text-primary);
  margin-block-end: var(--claude-space-md);
}

/* MEDIUM-12: Desktop font size */
@media (min-width: 768px) {
  .claude-advisor-products-title {
    font-size: 1.125rem;
  }
}

/* Product Grid */
.claude-advisor-products-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--claude-space-md);
}

/* Desktop: 1 column (panel too narrow for 2) */
@media (min-width: 768px) {
  .claude-advisor-products-grid {
    grid-template-columns: 1fr;
  }
}

/* ===================================
   Product Card
   =================================== */

.claude-advisor-product-card {
  background: var(--claude-bg-primary);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  padding: var(--claude-space-md);

  /* REDESIGN v1.4.0: Subtle shadow to match AI response */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);

  /* Layout */
  display: flex;
  gap: var(--claude-space-md);

  /* Link styling */
  text-decoration: none;
  color: inherit;

  /* HIGH-1 FIX: Explicit property transitions (avoid expensive 'all') */
  transition:
    border-color var(--claude-transition-fast),
    box-shadow var(--claude-transition-fast),
    transform var(--claude-transition-fast);

  /* Animation with sequential delay (applied via JS or nth-child) */
  animation: claude-fade-in-up var(--claude-transition-base);
  animation-fill-mode: both;
}

/* MEDIUM-6: Sequential animation delays extended to 8 products */
.claude-advisor-product-card:nth-child(1) { animation-delay: 0ms; }
.claude-advisor-product-card:nth-child(2) { animation-delay: 100ms; }
.claude-advisor-product-card:nth-child(3) { animation-delay: 200ms; }
.claude-advisor-product-card:nth-child(4) { animation-delay: 300ms; }
.claude-advisor-product-card:nth-child(5) { animation-delay: 400ms; }
.claude-advisor-product-card:nth-child(6) { animation-delay: 500ms; }
.claude-advisor-product-card:nth-child(7) { animation-delay: 600ms; }
.claude-advisor-product-card:nth-child(8) { animation-delay: 700ms; }
/* Note: Products beyond 8 will still animate but without stagger delay.
   For unlimited products, JavaScript applies delays dynamically. */

/* Hover State - REDESIGN v1.4.0: Enhanced shadow */
.claude-advisor-product-card:hover {
  border-color: var(--claude-purple);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

/* Focus State */
.claude-advisor-product-card:focus-visible {
  outline: 2px solid var(--claude-purple);
  outline-offset: 2px;
}

/* Product Image */
.claude-advisor-product-image {
  inline-size: 80px;
  block-size: 80px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--claude-bg-secondary);
  position: relative; /* For badge positioning */
}

.claude-advisor-product-image img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}

/* NEW Badge */
.claude-advisor-new-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: linear-gradient(135deg, var(--claude-purple), var(--claude-teal));
  color: white;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  z-index: 2;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Optional: Highlight "NEW" product card */
.claude-advisor-product-card.is-new {
  border-color: var(--claude-purple);
  background: linear-gradient(to bottom, rgba(147, 51, 234, 0.03), transparent);
}

.claude-advisor-product-card.is-new:hover {
  border-color: var(--claude-purple);
  box-shadow: 0 8px 24px rgba(147, 51, 234, 0.15);
}

/* Product Details */
.claude-advisor-product-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--claude-space-xs);
  min-inline-size: 0; /* Allow text truncation */
}

/* Product Name */
.claude-advisor-product-name {
  /* MEDIUM-12: Fixed font size for mobile */
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--claude-text-primary);
  margin: 0;

  /* Truncate long names */
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* MEDIUM-12: Desktop font size */
@media (min-width: 768px) {
  .claude-advisor-product-name {
    font-size: 0.9375rem;
  }
}

/* Product Price */
.claude-advisor-product-price {
  /* MEDIUM-12: Fixed font size for mobile */
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--claude-purple);
  margin: 0;
}

/* MEDIUM-12: Desktop font size */
@media (min-width: 768px) {
  .claude-advisor-product-price {
    font-size: 0.875rem;
  }
}

/* Product Link */
.claude-advisor-product-link {
  /* MEDIUM-12: Fixed font size for mobile */
  font-size: 0.75rem;
  color: var(--claude-text-secondary);
}

/* MEDIUM-12: Desktop font size */
@media (min-width: 768px) {
  .claude-advisor-product-link {
    font-size: 0.8125rem;
  }
}

/* Product Match Score (Optional) */
.claude-product-match {
  /* MEDIUM-12: Fixed font size for mobile */
  font-size: 0.75rem;
  color: var(--claude-text-secondary);
  margin: 0;
}

/* MEDIUM-12: Desktop font size */
@media (min-width: 768px) {
  .claude-product-match {
    font-size: 0.8125rem;
  }
}

/* ===================================
   Loading Spinner
   =================================== */

.claude-advisor-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--claude-space-md);
  padding-block: var(--claude-space-xl);
}

.claude-advisor-spinner {
  inline-size: 40px;
  block-size: 40px;
  border: 3px solid var(--claude-border);
  border-top-color: var(--claude-purple);
  border-radius: 50%;

  /* Spin animation */
  animation: claude-spin 1s linear infinite;
}

.claude-advisor-loading p {
  /* MEDIUM-12: Fixed font size for mobile */
  font-size: 0.875rem;
  color: var(--claude-text-secondary);
  margin: 0;
}

/* MEDIUM-12: Desktop font size */
@media (min-width: 768px) {
  .claude-advisor-loading p {
    font-size: 0.9375rem;
  }
}

/* ===================================
   Error State
   =================================== */

.claude-advisor-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--claude-space-md);
  padding-block: var(--claude-space-xl);
  text-align: center;
}

.claude-advisor-error svg {
  color: #EF4444;
}

.claude-advisor-error-message {
  background: #FEE2E2;
  border: 1px solid #EF4444;
  border-radius: 8px;
  padding-block: var(--claude-space-md);
  padding-inline: var(--claude-space-lg);
  color: #991B1B;
  /* MEDIUM-12: Fixed font size for mobile */
  font-size: 0.875rem;
}

/* MEDIUM-12: Desktop font size */
@media (min-width: 768px) {
  .claude-advisor-error-message {
    font-size: 0.9375rem;
  }
}

.claude-advisor-retry {
  padding-block: var(--claude-space-sm);
  padding-inline: var(--claude-space-lg);
  background: var(--claude-purple);
  border: none;
  border-radius: 6px;
  color: var(--claude-white);
  /* MEDIUM-12: Fixed font size for mobile */
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--claude-transition-fast);
}

/* MEDIUM-12: Desktop font size */
@media (min-width: 768px) {
  .claude-advisor-retry {
    font-size: 0.9375rem;
  }
}

.claude-advisor-retry:hover {
  background: #7C3AED;
}

/* ===================================
   Empty State
   =================================== */

.claude-empty-state {
  text-align: center;
  padding-block: var(--claude-space-xl);
  color: var(--claude-text-secondary);
}

.claude-empty-icon {
  inline-size: 48px;
  block-size: 48px;
  margin-inline: auto;
  margin-block-end: var(--claude-space-md);
  opacity: 0.5;
}

.claude-empty-text {
  /* MEDIUM-12: Fixed font size for mobile */
  font-size: 0.875rem;
  margin: 0;
}

/* MEDIUM-12: Desktop font size */
@media (min-width: 768px) {
  .claude-empty-text {
    font-size: 0.9375rem;
  }
}

/* ===================================
   Utility Classes
   =================================== */

/* Hidden elements (for screen readers) */
.claude-sr-only {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Text truncation */
.claude-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===================================
   Toast Message (NEW v2.0 - Max Concerns Warning)
   =================================== */

.claude-advisor-toast {
  position: absolute;
  inset-block-start: 3.75rem;
  inset-inline-start: 50%;
  transform: translateX(-50%) translateY(-0.625rem);
  background: #dc3545;
  color: white;
  padding-block: 0.625rem;
  padding-inline: 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 0.25rem 0.75rem rgba(220, 53, 69, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
  white-space: nowrap;
}

.claude-advisor-toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .claude-advisor-toast {
    font-size: 0.8125rem;
    padding-block: 0.5rem;
    padding-inline: 1rem;
    max-inline-size: 90%;
    white-space: normal;
    text-align: center;
  }

  .claude-advisor-skin-types {
    gap: 0.5rem;
  }

  .claude-advisor-skin-type {
    padding-block: 0.5rem;
    padding-inline: 1rem;
    font-size: 0.8125rem;
  }

  .claude-advisor-greeting-title {
    font-size: 1.125rem;
  }

  .claude-advisor-form-label {
    font-size: 0.875rem;
  }
}

/* ===================================
   Accessibility Enhancements
   =================================== */

/* High contrast mode support */
@media (prefers-contrast: high) {
  .claude-advisor-button::before {
    border: 3px solid currentColor;
  }

  .claude-advisor-concern-pill {
    border-width: 2px;
  }

  .claude-advisor-product-card {
    border-width: 2px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .claude-advisor-button::before {
    animation: none;
    background: linear-gradient(135deg, var(--claude-purple), var(--claude-teal));
  }
}

/* ===================================
   Login Modal Overlay (Issue #15)
   =================================== */

.claude-advisor-login-modal {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  border-radius: 16px;
}

.claude-advisor-login-modal-content {
  background: #FFFFFF;
  border-radius: 12px;
  padding: 24px;
  max-width: 90%;
  width: 340px;
  max-height: 80%;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.claude-advisor-login-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #6B7280;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.claude-advisor-login-close:hover {
  background: rgba(0, 0, 0, 0.1);
}

/* ===================================
   Meta OTP Form Integration (v1.4.5)
   =================================== */

/* Override Meta OTP form padding when displayed inside Claude Advisor widget */
.claude-advisor-panel .meta-otp-login-container {
  padding: 0 !important;
}

/* ===================================
   Print Styles (Hide Widget)
   =================================== */

@media print {
  .claude-advisor-button,
  .claude-advisor-panel,
  .claude-advisor-backdrop {
    display: none !important;
  }
}
