/* ============================================
   PERFUMER CUSTOMIZER PLUGIN CSS - ORGANIZED
   Easy to understand and modify structure
   ============================================ */

/* ============================================
   1. DESIGN TOKENS (Modify these for global changes)
   ============================================ */
:root {
  /* COLOR PALETTE - Grouped by purpose */
  --color-primary: #FADADD;        /* Main brand color for buttons, active states */
  --color-primary-hover: #f8c8cc;  /* Darker shade for hover states */
  --color-secondary: #FADADD;      /* Secondary color for accents, add to cart button */
  --color-secondary-hover: #FF9CA7C7; /* Lighter shade for secondary hover */
  --color-success: #4CAF50;        /* Success states (added to cart, etc.) */
  --color-error: #c53030;          /* Error messages and warnings */
  
  --color-background-light: #F5F5F5; /* Light background for sidebars */
  --color-background-white: #F5F5F5;  /* White background for cards */
  --color-background-cream: #fcf9f7;  /* Cream background for subtle areas */
  
  --color-border-light: #e8d5d7;   /* Light borders for inputs */
  --color-border-medium: #eee3d8;  /* Medium borders for containers */
  --color-border-thin: #f0eae4;    /* Very subtle borders */
  
  --color-text-dark: #000000;      /* Primary text color */
  --color-text-medium: #333333;    /* Secondary text */
  --color-text-light: #666666;     /* Tertiary/placeholder text */
  --color-text-white: #ffffff;     /* Text on dark backgrounds */

  /* SPACING SCALE - Consistent measurements */
  --space-xs: 0.25rem;  /* 4px - Tiny spacing */
  --space-sm: 0.7rem;   /* 8px - Small spacing */
  --space-md: 1rem;     /* 16px - Medium spacing */
  --space-lg: 1.5rem;   /* 24px - Large spacing */
  --space-xl: 2rem;     /* 32px - Extra large spacing */
  --space-xxl: 2.5rem;  /* 40px - Extra extra large */

  /* BORDER RADIUS */
  --radius-sm: 6px;     /* Small rounded corners */
  --radius-md: 8px;     /* Medium rounded corners */
  --radius-lg: 12px;    /* Large rounded corners (buttons, cards) */
  --radius-xl: 14px;    /* Extra large corners */
  --radius-pill: 999px; /* Perfect circles and pills */

  /* SHADOWS */
  --shadow-light: 0 2px 5px rgba(0, 0, 0, 0.03);    /* Subtle elevation */
  --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.1);   /* Medium elevation */
  --shadow-heavy: -6px 0 25px rgba(0, 0, 0, 0.15);  /* Sidebar shadow */
  --shadow-primary: 0 4px 12px rgba(250, 218, 221, 0.4); /* Primary color shadow */
  --shadow-secondary: 0 4px 12px rgba(253, 245, 230, 0.5); /* Secondary shadow */

  /* TYPOGRAPHY */
  --font-primary: 'Cormorant Garamond', 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-weight-normal: 400;   /* Regular weight */
  --font-weight-medium: 500;   /* Medium weight */
  --font-weight-bold: 600;     /* Bold weight */
  --font-weight-heavy: 700;    /* Extra bold */
  
  --text-xs: 0.7rem;   /* 11.2px - Extra small text */
  --text-sm: 0.8rem;   /* 12.8px - Small text (labels) */
  --text-base: 0.9rem; /* 14.4px - Base body text */
  --text-lg: 1rem;     /* 16px - Large text */
  --text-xl: 1.1rem;   /* 17.6px - Extra large */
  --text-xxl: 1.5rem;  /* 24px - Headings */

  /* TRANSITIONS */
  --transition-fast: 0.2s ease;   /* Quick interactions */
  --transition-normal: 0.3s ease; /* Standard transitions */
  --transition-slow: 0.4s ease;   /* Slow, deliberate animations */

  /* COMPONENT SIZES */
  --button-height: 50px;        /* Standard button height */
  --note-image-size: 90px;      /* Size of perfume note images */
  --sidebar-width: min(800px, 80%); /* Sidebar responsive width */
  --form-max-width: 550px;      /* Main form maximum width */
}

/* ============================================
   2. BASE STYLES & RESETS
   ============================================ */
* {
  box-sizing: border-box; /* Include padding/border in element dimensions */
}

body {
  font-family: var(--font-primary); /* Apply custom font stack */
  background-color: #fefcf9; /* Light cream background */
  color: var(--color-text-dark); /* Primary text color */
  margin: 0;
  padding: 0;
  letter-spacing: 2px; /* Luxury spaced typography */
}

/* Prevent scrolling when sidebar is open */
body.no-scroll {
  overflow: hidden;
}

/* Context class for pages with perfume form */
body.has-perfumer-form {
  position: relative;
}

/* Ensure consistent typography across all plugin elements */
.perfumer-form,
.perfumer-sidebar,
.perfumer-form *,
.perfumer-sidebar * {
  font-family: var(--font-primary);
  letter-spacing: 2px;
}

/* ============================================
   3. LAYOUT COMPONENTS
   ============================================ */

/* Main Form Container - Centered card with shadow */
.perfumer-form {
  max-width: var(--form-max-width);
  margin: var(--space-sm) auto; /* Center with small top/bottom margin */
  padding: var(--space-lg) var(--space-xl);
  background: var(--color-background-white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-medium);
  transition: var(--transition-normal);
  position: relative;
}

/* Individual form steps - minimal styling */
.perfumer-step {
  margin-bottom: var(--space-md);
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

/* Hide step headings (using visual design instead) */
.perfumer-step h3 {
  display: none;
}

/* Sidebar Container - Slides in from right */
.perfumer-sidebar {
  position: fixed;
  top: 0;
  right: -100%; /* Start off-screen */
  width: var(--sidebar-width);
  height: 100dvh; /* Dynamic viewport height */
  background: var(--color-background-light);
  box-shadow: var(--shadow-heavy);
  padding: var(--space-sm);
  transition: right var(--transition-slow);
  z-index: 10000; /* Very high z-index to overlay everything */
  overflow-y: auto;
  border-left: 1px solid var(--color-border-medium);
  scrollbar-width: thin; /* Firefox scrollbar styling */
}

/* Active sidebar state - slides into view */
.perfumer-sidebar.active {
  right: 0;
}

/* Custom scrollbar for webkit browsers */
.perfumer-sidebar::-webkit-scrollbar {
  width: 6px;
}

.perfumer-sidebar::-webkit-scrollbar-thumb {
  background: var(--color-border-medium);
  border-radius: var(--radius-pill);
}

.perfumer-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

/* Sidebar Header - Title and close button */
.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-md);
  font-size: var(--text-xl);
  padding: 0 var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--color-border-light);
  color: var(--color-text-dark);
}

/* Sidebar Content Area */
.sidebar-content {
  padding: 0 var(--space-md);
  min-height: min-content;
  max-width: 100%;
  overflow-x: hidden;
}

/* Overlay - Darkens background when sidebar is open */
.perfumer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999; /* Just below sidebar */
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-normal);
  backdrop-filter: blur(2px); /* Subtle background blur */
}

.perfumer-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ============================================
   4. BUTTON COMPONENTS
   ============================================ */

/* Step Buttons - Main navigation in form */
.perfumer-step .open-sidebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: var(--color-background-white);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  margin: 0;
  font-size: var(--text-lg);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-dark);
  text-decoration: none;
  transition: var(--transition-normal);
  text-align: left;
  cursor: pointer;
  position: relative;
  height: auto;
  min-height: var(--button-height);
  line-height: 1.4;
}

.perfumer-step .open-sidebar:hover {
  background: #faf8f5;
  border-color: var(--color-border-medium);
  transform: translateY(-1px); /* Lift effect */
  box-shadow: var(--shadow-light);
}

/* Arrow indicator for step buttons */
.perfumer-step .open-sidebar::after {
  content: "→";
  font-size: 1.2rem;
  font-weight: 300;
  color: var(--color-text-light);
  transition: var(--transition-normal);
  margin-left: var(--space-sm);
  line-height: 1;
}

.perfumer-step .open-sidebar:hover::after {
  color: var(--color-primary);
  transform: translateX(2px); /* Animate arrow on hover */
}

/* Close Sidebar Button - X icon */
.sidebar-header button.close-sidebar {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--color-text-dark);
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  transition: var(--transition-normal);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-header button.close-sidebar:hover {
  background: #f0f0f0;
  transform: scale(1.1);
}

/* Generic Button Groups - Flex container */
.perfumer-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

/* Base Button Style */
.perfumer-button {
  padding: var(--space-md) var(--space-lg);
  border: 2px solid #ccc;
  border-radius: var(--radius-md);
  cursor: pointer;
  background: #f9f9f9;
  font-size: var(--text-base);
  font-weight: var(--font-weight-medium);
  transition: var(--transition-normal);
  flex: 1;
  min-width: min-content;
  text-align: center;
}

.perfumer-button:hover {
  background: #f0e8e3;
  border-color: #bbaea4;
  color: #1f1f1f;
  transform: translateY(-1px);
}

.perfumer-button.active {
  background-color: var(--color-primary);
  color: var(--color-text-dark);
  border-color: var(--color-primary);
  font-weight: var(--font-weight-bold);
}

/* Size Selection Buttons - Grid layout */
.perfumer-size-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3 columns */
  gap: var(--space-md);
  margin: 0;
}

.perfumer-size-btn {
  padding: 0.8rem var(--space-sm);
  border: 2px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  background: var(--color-background-white);
  font-size: var(--text-base);
  font-weight: var(--font-weight-bold);
  text-align: center;
  cursor: pointer;
  transition: var(--transition-normal);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--button-height);
}

.perfumer-size-btn:hover {
  border-color: var(--color-primary);
  background: #faf8f5;
  transform: translateY(-1px);
}

.perfumer-size-btn.active {
  background: var(--color-primary);
  color: var(--color-text-dark);
  border-color: var(--color-primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-primary);
}

/* Primary Add to Cart Button */
#perfumer_add_to_cart {
  width: 100%;
  padding: 0.8rem var(--space-lg);
  font-size: var(--text-lg);
  background: var(--color-secondary);
  color: var(--color-text-dark);
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition-normal);
  margin-top: var(--space-md);
  font-weight: var(--font-weight-bold);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--button-height);
}

#perfumer_add_to_cart:hover:not(:disabled) {
  background: var(--color-secondary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-secondary);
}

#perfumer_add_to_cart:disabled {
  background: #cccccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

#perfumer_add_to_cart.success {
  background: var(--color-success);
  transform: scale(0.98);
}

/* ============================================
   5. FORM INPUTS & CONTROLS
   ============================================ */

/* Text Inputs - Consistent styling */
input[type="text"],
#perfume_name,
#about_you {
  width: 100%;
  padding: 0.8rem var(--space-md);
  margin: 0;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  background: var(--color-background-white);
  font-size: 0.95rem;
  color: var(--color-text-dark);
  box-shadow: var(--shadow-light);
  transition: var(--transition-normal);
}

/* About You textarea specific styles */
#about_you {
  min-height: 120px;
  line-height: 1.5;
  resize: vertical; /* Allow vertical resizing only */
}

/* Focus States - Accessibility enhancement */
input[type="text"]:focus,
#perfume_name:focus,
#about_you:focus,
.perfumer-button:focus,
.perfumer-note:focus,
.perfumer-quiz-btn:focus,
.open-sidebar:focus,
.close-sidebar:focus,
#perfumer_add_to_cart:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(250, 218, 221, 0.1);
}

/* ============================================
   6. NOTES & VIBES COMPONENTS
   ============================================ */

/* Notes Grid Layout - 4 columns desktop */
.perfumer-notes-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
  padding: var(--space-lg) 0;
  max-width: 100%;
  overflow: visible;
  margin: 0 calc(var(--space-sm) * -1); /* Negative margin for edge alignment */
}

/* Individual Note Item */
.perfumer-note {
  width: 100%;
  background: var(--color-background-white);
  border: 1px solid var(--color-border-thin);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-sm) var(--space-sm);
  text-align: center;
  cursor: pointer;
  transition: var(--transition-normal);
  box-shadow: var(--shadow-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: visible;
  min-height: 140px;
  justify-content: flex-start;
}

/* Note Media Container - Image wrapper */
.perfumer-note .note-media {
  width: var(--note-image-size);
  height: var(--note-image-size);
  background: var(--color-background-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-md);
  border: 1px solid var(--color-border-thin);
  transition: var(--transition-normal);
  position: relative;
  flex-shrink: 0;
}

/* Note Image - Perfume ingredient images */
.perfumer-note .note-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-normal);
  background-color: var(--color-background-white);
  border-radius: calc(var(--radius-md) - 1px);
}

/* Note Label Text */
.perfumer-note .note-label {
  font-size: var(--text-sm);
  color: var(--color-text-dark);
  font-weight: var(--font-weight-medium);
  line-height: 1.3;
  word-break: break-word;
  padding: 0 var(--space-xs);
  transition: var(--transition-normal);
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  max-height: none;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* Limit to 2 lines max */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Note Hover States */
.perfumer-note:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
  border-color: var(--color-border-medium);
}

.perfumer-note:hover .note-media {
  border-color: var(--color-border-medium);
  transform: scale(1.02);
}

/* Active/Selected Note State */
.perfumer-note.active {
  background-color: var(--color-primary);
  border: 1px solid var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary), var(--shadow-primary);
}

.perfumer-note.active .note-label {
  color: var(--color-text-dark);
  font-weight: var(--font-weight-bold);
}

.perfumer-note.active .note-media {
  border-color: var(--color-text-dark);
  transform: scale(1.05);
  box-shadow: var(--shadow-medium);
}

.perfumer-note.active .note-image {
  transform: scale(1.08);
}

/* Vibes Grid - Personality selection */
.perfumer-vibes-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  max-width: 100%;
  overflow: visible;
  margin: 0 calc(var(--space-sm) * -1); /* Negative margin for edge alignment */
}


/* Individual Vibe Button */
.perfumer-quiz-btn {
  width: 100%;
  height: 70px;
  background: var(--color-background-white);
  border: 1px solid var(--color-border-thin);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-dark);
  text-align: center;
  transition: var(--transition-normal);
  padding: var(--space-md);
  word-break: break-word;
  line-height: 1.3;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* Max 2 lines */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.perfumer-quiz-btn:hover {
  background: #f9f7f3;
  border-color: var(--color-border-medium);
  transform: translateY(-1px);
  box-shadow: var(--shadow-light);
}

.perfumer-quiz-btn.active {
  background: var(--color-primary);
  color: var(--color-text-dark);
  border: 1px solid var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary), var(--shadow-primary);
  font-weight: var(--font-weight-bold);
}

/* Selection Indicators - Small dot for selected items */
.perfumer-note::before,
.perfumer-quiz-btn::before {
  content: '';
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  width: 8px;
  height: 8px;
  background: var(--color-text-dark);
  border-radius: 50%;
  opacity: 0;
  transition: var(--transition-normal);
  z-index: 3;
  border: 1px solid var(--color-background-white);
}

.perfumer-note.active::before,
.perfumer-quiz-btn.active::before {
  opacity: 1;
  background: var(--color-text-dark);
}

/* Notes Counter Display - Shows selected/total */
.notes-counter-display {
  background: var(--color-background-white);
  padding: 0.3rem;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  text-align: center;
}

.notes-counter-text {
  font-weight: var(--font-weight-bold);
  color: var(--color-text-dark);
  font-size: var(--text-base);
}

/* Limit warning when max notes reached */
#current_notes_count.limit-reached {
  color: var(--color-error);
  font-weight: var(--font-weight-heavy);
}

.notes-counter-display small {
  display: none;
}

/* Note Placeholders - Fallback for missing images */
.note-media[data-placeholder="true"],
.note-media.placeholder-loaded {
  background: linear-gradient(135deg, #f0eae4 0%, #e8dfd6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.note-placeholder {
  color: var(--color-text-light);
  font-size: 1.5rem;
}

.note-placeholder i {
  opacity: 0.9;
}


/* ============================================
   7. SUMMARY & DISPLAY COMPONENTS
   ============================================ */

.perfumer-summary {
  padding: var(--space-sm);
  background: var(--color-background-white);
  border-radius: var(--radius-lg);
  margin-top: var(--space-lg);
  text-align: center;
  border: 0.5px solid var(--color-border-light);
}

.summary-total {
  margin-bottom: var(--space-md);
}

.summary-total #perfumer_price {
  font-size: var(--text-xxl);
  font-weight: var(--font-weight-heavy);
  color: var(--color-text-dark);
  display: block;
}

/* Error Display - HIDDEN since we're using visual indicators instead */
.perfumer-errors {
  display: none !important; /* Completely hide the error message box */
}

/* Selection Display */
#selected_size,
#selected_notes_count {
  font-weight: var(--font-weight-bold);
  color: var(--color-text-dark);
}


/* ============================================
   8. VISUAL ERROR INDICATORS (Red circle highlights)
   ============================================ */

/* Error highlight for form steps */
.perfumer-step.error-highlight {
    position: relative;
    animation: pulseError 2s infinite;
}

/* Red circle pulse animation */
@keyframes pulseError {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(197, 48, 48, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(197, 48, 48, 0);
    }
}

/* Error state for size selection */
.perfumer-step.size-step.error-highlight {
    border: 2px solid var(--color-error);
    border-radius: var(--radius-lg);
    padding: var(--space-sm);
    margin: calc(var(--space-sm) * -1);
}

.perfumer-size-list.error-highlight {
    position: relative;
}

.perfumer-size-list.error-highlight::before {
    content: "•";
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--color-error);
    font-size: 24px;
    font-weight: bold;
    animation: bounceError 0.5s ease-in-out;
}

/* Error state for notes button */
.open-sidebar.field-error {
    border: 2px solid var(--color-error) !important;
    color: var(--color-error) !important;
    position: relative;
    animation: shakeError 0.5s ease-in-out;
}

.open-sidebar.field-error::after {
    content: "•";
    position: absolute;
    top: -8px;
    right: -8px;
    color: var(--color-error);
    font-size: 24px;
    font-weight: bold;
    background: var(--color-background-white);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: bounceError 0.5s ease-in-out;
}

/* Error state for perfume name input */
#perfume_name.field-error {
    border: 2px solid var(--color-error) !important;
    position: relative;
    animation: shakeError 0.5s ease-in-out;
}

#perfume_name.field-error::before {
    content: "•";
    position: absolute;
    top: -8px;
    right: -8px;
    color: var(--color-error);
    font-size: 24px;
    font-weight: bold;
    background: var(--color-background-white);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    animation: bounceError 0.5s ease-in-out;
}

/* Error animations */
@keyframes shakeError {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes bounceError {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}


/* ============================================
   9. CART COMPONENTS
   ============================================ */

/* Inline Cart Styles - Detailed cart view */
.perfumer-cart-inline {
  border: 1px solid var(--color-border-light);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  background: var(--color-background-white);
  margin: var(--space-md) 0;
}

.perfumer-cart-inline h3 {
  font-family: var(--font-primary);
  font-size: var(--text-xl);
  color: var(--color-text-dark);
  margin-top: 0;
  margin-bottom: var(--space-md);
  font-weight: var(--font-weight-bold);
}

.perfumer-cart-items {
  margin-bottom: var(--space-md);
}

.perfumer-cart-item {
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-border-thin);
}

.perfumer-cart-item:last-child {
  border-bottom: none;
}

.perfumer-cart-item-details h4 {
  margin: 0 0 var(--space-sm) 0;
  font-size: var(--text-lg);
  color: var(--color-text-dark);
  font-weight: var(--font-weight-bold);
}

/* Perfume customization details in cart */
.perfume-customization {
  font-size: var(--text-sm);
  color: var(--color-text-medium);
  margin-bottom: var(--space-sm);
}

.perfume-customization p {
  margin: 0.2rem 0;
}

.perfumer-cart-item-price {
  font-weight: var(--font-weight-bold);
  color: var(--color-text-dark);
  margin: 0;
}

.perfumer-cart-empty {
  text-align: center;
  color: var(--color-text-light);
  font-style: italic;
  padding: var(--space-xl) var(--space-md);
  margin: 0;
}

/* Cart Action Buttons */
.perfumer-cart-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
}

.perfumer-cart-actions .button {
  background: var(--color-secondary);
  color: var(--color-text-dark);
  padding: 0.7rem var(--space-lg);
  text-decoration: none;
  border-radius: var(--radius-md);
  border: none;
  font-size: var(--text-base);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: var(--transition-normal);
}

.perfumer-cart-actions .button:hover {
  background: var(--color-secondary-hover);
  transform: translateY(-1px);
}

.perfumer-cart-actions .checkout-button {
  background: var(--color-primary);
}

.perfumer-cart-actions .checkout-button:hover {
  background: var(--color-primary-hover);
}

/* Simple Cart Icon - Minimal cart display */
.perfumer-cart-simple {
  display: inline-block;
  margin: var(--space-md) 0;
}

.perfumer-cart-simple-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  position: relative;
  padding: 6px;
  border-radius: var(--radius-md);
  transition: var(--transition-normal);
  background: transparent;
}

/* Shopping bag icon - BLACK */
.perfumer-cart-simple-link i {
  font-size: 30px;
  color: var(--color-text-dark); /* BLACK */
  transition: var(--transition-normal);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  position: relative;
}

/* Cart item count badge - WHITE */
.perfumer-cart-simple-count {
  position: absolute;
  top: 60%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--color-text-white); /* WHITE */
  font-size: 14px;
  font-weight: var(--font-weight-heavy);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-normal);
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  width: 16px;
  height: 11px;
}

/* Hide count badge when empty or has empty class */
.perfumer-cart-simple-count.empty,
.perfumer-cart-simple-count:empty {
  display: none;
}

.perfumer-cart-simple-link:hover {
  background: rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.perfumer-cart-simple-link:hover i {
  color: var(--color-text-dark); /* BLACK */
  transform: scale(1.05);
}

.perfumer-cart-simple-link:hover .perfumer-cart-simple-count {
  transform: translate(-50%, -50%) scale(1.1);
}

/* Cart animations */
.cart-bounce {
  animation: cartBounce 0.5s ease;
}

.cart-pulse {
  animation: cartPulse 0.5s ease;
}

@keyframes cartBounce {
  0%, 20%, 53%, 80%, 100% {
    transform: translate3d(0, 0, 0);
  }
  40%, 43% {
    transform: translate3d(0, -8px, 0);
  }
  70% {
    transform: translate3d(0, -4px, 0);
  }
  90% {
    transform: translate3d(0, -2px, 0);
  }
}

@keyframes cartPulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.3);
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
  }
}



/* ============================================
   10. ANIMATIONS & TRANSITIONS
   ============================================ */

/* Loading Animations - For image loading states */
.perfumer-note .note-media.loading {
  background: linear-gradient(90deg, #f0eae4 25%, #e8dfd6 50%, #f0eae4 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  display: flex;
  align-items: center;
  justify-content: center;
}

.perfumer-note .note-media.loading::after {
  content: "⋯";
  color: var(--color-text-light);
  font-size: 1.2rem;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Cart Animations - Visual feedback for cart interactions */
@keyframes floatIcon {
  0%, 100% { 
    transform: translateY(0px); 
  }
  50% { 
    transform: translateY(-5px); 
  }
}

.cart-bounce {
  animation: iconBounce 0.6s ease;
}

@keyframes iconBounce {
  0%, 20%, 60%, 100% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.15);
  }
  80% {
    transform: scale(1.05);
  }
}

.cart-pulse {
  animation: numberPulse 1s ease-out;
}

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

/* Success Animations - Add to cart confirmation */
#perfumer_add_to_cart.success {
  animation: successGlow 2s ease;
}

@keyframes successGlow {
  0%, 100% {
    background: var(--color-success);
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4);
  }
  50% {
    background: #45a049;
    box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
  }
}

/* ============================================
   11. UTILITY CLASSES (Reusable helpers)
   ============================================ */

/* Flex Utilities - Quick layout helpers */
.flex { display: flex; }
.flex-center { 
  display: flex; 
  align-items: center; 
  justify-content: center; 
}
.flex-between { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
}
.flex-column {
  display: flex;
  flex-direction: column;
}

/* Spacing Utilities - Margin and padding helpers */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-sm); }
.mt-2 { margin-top: var(--space-md); }
.mt-3 { margin-top: var(--space-lg); }
.mt-4 { margin-top: var(--space-xl); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-sm); }
.mb-2 { margin-bottom: var(--space-md); }
.mb-3 { margin-bottom: var(--space-lg); }

.p-1 { padding: var(--space-sm); }
.p-2 { padding: var(--space-md); }
.p-3 { padding: var(--space-lg); }
.p-4 { padding: var(--space-xl); }

/* Text Utilities - Text alignment and styling */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-bold { font-weight: var(--font-weight-bold); }
.text-medium { font-weight: var(--font-weight-medium); }
.text-normal { font-weight: var(--font-weight-normal); }

.text-primary { color: var(--color-primary); }
.text-secondary { color: var(--color-secondary); }
.text-dark { color: var(--color-text-dark); }
.text-light { color: var(--color-text-light); }
.text-white { color: var(--color-text-white); }

.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }

/* State Utilities - Common state classes */
.is-hidden { display: none; }
.is-visible { display: block; }
.is-active { 
  background: var(--color-primary);
  color: var(--color-text-dark);
}
.is-disabled { 
  opacity: 0.6; 
  pointer-events: none; 
  cursor: not-allowed;
}
.is-success { background: var(--color-success); }
.is-error { background: var(--color-error); }



/* ============================================
   12. RESPONSIVE BREAKPOINTS
   ============================================ */

/* Large Desktop (1201px and above) - Default styles apply */

/* Desktop Narrow (1025px - 1200px) */
@media (max-width: 1200px) {
  :root {
    --sidebar-width: min(750px, 85%);
    --note-image-size: 85px;
    --form-max-width: 500px;
  }
  
  .sidebar-content { padding: 0 var(--space-lg); }
  .sidebar-header { padding: 0 var(--space-lg) var(--space-md); }
  
  /* Notes Section */
  .perfumer-notes-list {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-sm);
    padding: var(--space-lg) 0;
    margin: 0;
  }
  
  /* Vibes Section */
  .perfumer-vibes-list {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
    padding: var(--space-lg) 0;
    margin: 0;
  }
  
  .perfumer-quiz-btn { 
    height: 65px; 
    font-size: var(--text-sm); 
  }
  
  .perfumer-form {
    padding: var(--space-lg) var(--space-lg);
  }
}

/* Tablet Landscape (769px - 1024px) */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: min(700px, 90%);
    --note-image-size: 80px;
    --button-height: 48px;
    --form-max-width: 450px;
  }
  
  .sidebar-content { padding: 0 var(--space-md); }
  .sidebar-header { 
    padding: 0 var(--space-md) var(--space-md);
    font-size: var(--text-lg);
  }
  
  /* Notes Section */
  .perfumer-notes-list {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
    padding: var(--space-lg) 0;
    margin: 0;
  }
  
  /* Vibes Section */
  .perfumer-vibes-list {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
    padding: var(--space-lg) 0;
    margin: 0;
  }
  
  .perfumer-note .note-label { 
    font-size: var(--text-xs); 
    line-height: 1.2; 
  }
  
  .perfumer-step .open-sidebar { 
    padding: var(--space-md) var(--space-md); 
    font-size: var(--text-base); 
  }
  
  .perfumer-size-btn { 
    padding: var(--space-sm) var(--space-xs); 
    font-size: var(--text-sm); 
  }
  
  .perfumer-note { 
    min-height: 135px; 
  }
  
  .perfumer-form {
    margin: var(--space-xs) auto;
    padding: var(--space-md) var(--space-lg);
  }
}

/* Tablet Portrait (601px - 768px) */
@media (max-width: 768px) {
  :root {
    --sidebar-width: 95%;
    --note-image-size: 75px;
    --button-height: 46px;
    --form-max-width: 400px;
  }
  
  .sidebar-content { padding: 0 var(--space-md); }
  .sidebar-header { 
    padding: 0 var(--space-md) var(--space-md);
    font-size: var(--text-lg);
    margin-bottom: var(--space-lg);
  }
  
  /* Notes Section */
  .perfumer-notes-list {
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-sm);
    padding: var(--space-md) 0;
    margin: 0;
  }
  
  /* Vibes Section */
  .perfumer-vibes-list {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
    padding: var(--space-md) 0;
    margin: 0;
  }
  
  .perfumer-note .note-media { 
    margin-bottom: var(--space-sm); 
  }
  
  .perfumer-note { 
    padding: var(--space-sm) var(--space-xs) var(--space-xs); 
    min-height: 125px; 
  }
  
  .perfumer-note .note-label { 
    font-size: var(--text-xs); 
    line-height: 1.2; 
  }
  
  .perfumer-quiz-btn { 
    height: 60px; 
    font-size: var(--text-xs); 
    padding: var(--space-sm);
    line-height: 1.2; 
  }
  
  .perfumer-form { 
    margin: var(--space-xs) auto; 
    padding: var(--space-md) var(--space-md); 
  }
  
  .perfumer-step .open-sidebar { 
    padding: var(--space-md) var(--space-md); 
    font-size: var(--text-base); 
  }
  
  .perfumer-size-list { 
    gap: var(--space-sm); 
  }
  
  .perfumer-size-btn { 
    padding: var(--space-sm) var(--space-xs); 
    font-size: var(--text-sm); 
  }
  
  .summary-total #perfumer_price { 
    font-size: var(--text-xl); 
  }
  
  .perfumer-sidebar {
    padding: var(--space-md);
  }
}

/* Mobile Landscape (481px - 600px) */
@media (max-width: 600px) {
  :root {
    --sidebar-width: 98%;
    --note-image-size: 70px;
    --button-height: 44px;
    --form-max-width: 100%;
    --space-xl: 1.5rem;
  }
  
  .sidebar-content { padding: 0 var(--space-sm); }
  .sidebar-header { 
    padding: 0 var(--space-sm) var(--space-md);
    font-size: var(--text-base);
  }
  
  /* Notes Section */
  .perfumer-notes-list {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-sm);
    padding: var(--space-md) 0;
    margin: 0;
  }
  
  /* Vibes Section */
  .perfumer-vibes-list {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
    padding: var(--space-md) 0;
    margin: 0;
  }
  
  .perfumer-quiz-btn { 
    height: 55px; 
    font-size: var(--text-xs); 
    padding: var(--space-xs);
    line-height: 1.2; 
  }
  
  .perfumer-sidebar { 
    padding: var(--space-md) var(--space-sm); 
  }
  
  .perfumer-size-list { 
    grid-template-columns: repeat(2, 1fr); 
    gap: var(--space-sm); 
  }
  
  .perfumer-size-btn { 
    padding: var(--space-sm); 
    font-size: var(--text-xs); 
  }
  
  .perfumer-step .open-sidebar { 
    padding: var(--space-sm) var(--space-md); 
    font-size: var(--text-sm); 
  }
  
  #about_you { 
    min-height: 100px; 
    padding: var(--space-sm) var(--space-md); 
  }
  
  #perfume_name { 
    padding: var(--space-sm) var(--space-md); 
  }
  
  .perfumer-note { 
    min-height: 115px; 
  }
  
  .perfumer-form {
    margin: var(--space-xs);
    padding: var(--space-md) var(--space-md);
    border-radius: var(--radius-lg);
  }
}

/* Mobile Portrait (376px - 480px) */
@media (max-width: 480px) {
  :root {
    --sidebar-width: 100%;
    --note-image-size: 65px;
    --button-height: 42px;
    --form-max-width: 100%;
  }
  
  .sidebar-content { padding: 0 var(--space-sm); }
  .sidebar-header { 
    padding: 0 var(--space-sm) var(--space-md);
    font-size: var(--text-base);
    margin-bottom: var(--space-md);
  }
  
  /* Notes Section */
  .perfumer-notes-list {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
    padding: var(--space-sm) 0;
    margin: 0;
  }
  
  /* Vibes Section */
  .perfumer-vibes-list {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
    padding: var(--space-sm) 0;
    margin: 0;
  }
  
  .perfumer-note .note-media { 
    margin-bottom: var(--space-xs); 
  }
  
  .perfumer-note .note-label { 
    font-size: var(--text-xs); 
    line-height: 1.2; 
  }
  
  .perfumer-quiz-btn { 
    height: 50px; 
    font-size: var(--text-xs); 
    padding: var(--space-xs);
    line-height: 1.2; 
  }
  
  .perfumer-sidebar { 
    width: 100vw; 
    padding: var(--space-sm); 
  }
  
  .perfumer-form { 
    padding: var(--space-md) var(--space-sm); 
    margin: var(--space-xs); 
  }
  
  .perfumer-step { 
    margin-bottom: var(--space-sm); 
  }
  
  .perfumer-step .open-sidebar { 
    padding: var(--space-sm) var(--space-sm); 
    font-size: var(--text-xs); 
  }
  
  .perfumer-summary { 
    padding: var(--space-sm); 
    margin-top: var(--space-md); 
  }
  
  .summary-total #perfumer_price { 
    font-size: var(--text-lg); 
  }
  
  .perfumer-note { 
    min-height: 110px; 
    padding: var(--space-xs) var(--space-xs) var(--space-xs); 
  }
  
  .perfumer-size-list {
    grid-template-columns: 1fr;
  }
}

/* Tiny Mobile (320px - 375px) */
@media (max-width: 375px) {
  :root {
    --note-image-size: 60px;
    --button-height: 40px;
    --space-lg: 1.25rem;
    --space-md: 0.875rem;
  }
  
  .sidebar-content { padding: 0 var(--space-xs); }
  .sidebar-header { 
    padding: 0 var(--space-xs) var(--space-sm);
    font-size: var(--text-sm);
  }
  
  /* Notes Section */
  .perfumer-notes-list {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
    padding: var(--space-sm) 0;
    margin: 0;
  }
  
  /* Vibes Section */
  .perfumer-vibes-list {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
    padding: var(--space-sm) 0;
    margin: 0;
  }
  
  .perfumer-quiz-btn { 
    height: 45px; 
    font-size: var(--text-xs); 
    padding: var(--space-xs);
    line-height: 1.2; 
  }
  
  .perfumer-sidebar { 
    padding: var(--space-sm) var(--space-xs); 
  }
  
  .perfumer-form { 
    padding: var(--space-sm); 
    margin: var(--space-xs); 
  }
  
  .perfumer-size-list { 
    grid-template-columns: 1fr; 
    gap: var(--space-xs); 
  }
  
  .perfumer-size-btn { 
    padding: var(--space-sm); 
  }
  
  .perfumer-step .open-sidebar { 
    padding: var(--space-sm); 
    font-size: var(--text-xs); 
  }
  
  .perfumer-note { 
    min-height: 105px; 
  }
  
  .sidebar-header button.close-sidebar {
    width: 35px;
    height: 35px;
    font-size: 1.25rem;
  }
}




/* ============================================
   13. ACCESSIBILITY & SPECIAL MODES
   ============================================ */

/* Reduced Motion Support - For users with motion sensitivity */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .perfumer-sidebar,
  .perfumer-overlay {
    transition: none;
  }
  
  .perfumer-cart-simple-link,
  .cart-bounce,
  .cart-pulse {
    animation: none;
  }
  
  .perfumer-cart-simple-link:hover,
  .perfumer-button:hover,
  .perfumer-note:hover,
  .perfumer-quiz-btn:hover {
    transform: none;
  }
}

/* High Contrast Mode - For visually impaired users */
@media (prefers-contrast: high) {
  :root {
    --color-primary: #000000;
    --color-border-light: #000000;
    --color-text-dark: #000000;
    --color-background-light: #ffffff;
    --color-background-white: #ffffff;
  }
  
  .perfumer-button.active,
  .perfumer-note.active,
  .perfumer-quiz-btn.active {
    border-width: 3px;
    background: #000000 !important;
    color: #ffffff !important;
  }
  
  .perfumer-cart-simple-link i {
    filter: none;
  }
  
  .perfumer-cart-simple-count {
    text-shadow: 0 0 3px #000, 0 0 3px #000;
    font-weight: var(--font-weight-heavy);
    background: #000000;
  }
  
  .perfumer-errors {
    border-width: 2px;
    background: #fff0f0;
  }
}

/* Dark Mode Support - Automatic dark theme */
@media (prefers-color-scheme: dark) {
  .perfumer-form,
  .perfumer-sidebar {
    background: #1a1a1a;
    color: var(--color-text-dark);
    border-color: #333;
  }
  
  .perfumer-step h3 {
    color: #e0e0e0;
  }
  
  .perfumer-note,
  .perfumer-quiz-btn {
    background: #2d2d2d;
    border-color: #404040;
    color: var(--color-text-dark);
  }
  
  .perfumer-note .note-label,
  .perfumer-quiz-btn {
    color: #e0e0e0;
  }
  
  .perfumer-note.active,
  .perfumer-quiz-btn.active {
    background: var(--color-primary);
    color: var(--color-text-dark);
  }
  
  input[type="text"],
  #perfume_name,
  #about_you {
    background: #2d2d2d;
    border-color: #404040;
    color: var(--color-text-dark);
  }
  
  .perfumer-summary {
    background: #2d2d2d;
    border-color: #404040;
    color: var(--color-text-dark);
  }
  
  .open-sidebar {
    background: #2d2d2d;
    border-color: #404040;
    color: #e0e0e0;
  }
  
  .perfumer-cart-simple-link i {
    color: #e8e6e3;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  }
  
  .perfumer-cart-simple-link {
    background: rgba(45, 45, 45, 0.9);
    border-color: #404040;
  }
  
  .perfumer-cart-simple-link:hover {
    background: rgba(60, 60, 60, 0.95);
  }
}

/* High DPI Screen Support - Crisp images on retina displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .perfumer-note .note-image {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Print Styles - Hide interactive elements when printing */
@media print {
  .perfumer-cart-simple {
    display: none !important;
  }
  
  .perfumer-overlay,
  .perfumer-sidebar {
    display: none !important;
  }
  
  .perfumer-note,
  .perfumer-quiz-btn {
    border: 1px solid #000 !important;
    box-shadow: none !important;
    break-inside: avoid;
  }
  
  .perfumer-note.active,
  .perfumer-quiz-btn.active {
    background: #333 !important;
    color: #fff !important;
  }
}