/* 
 * Main CSS Entry Point
 * Imports all CSS modules in the correct order
 */

/* Theme variables - must be loaded first */

/* 
 * Theme Variables and Custom Properties
 * Central location for all theme-related CSS variables
 */

:root {
  /* Brand Colors */
  --color-primary: #7aa299;
  --color-primary-dark: #2d5a4f;
  --color-secondary: #a7c7e7;
  --color-accent: #e0f7fa;
  
  /* Gradient Definitions */
  --gradient-primary: linear-gradient(135deg, #7aa299 0%, #a7c7e7 100%);
  --gradient-bg: linear-gradient(135deg, #e0e7ef 0%, #f7fafc 100%);
  --gradient-subtle: linear-gradient(135deg, rgba(45, 90, 79, 0.08) 0%, rgba(45, 90, 79, 0.05) 50%, rgba(45, 90, 79, 0.03) 100%);
  
  /* Text Colors */
  --text-primary: #1f2937;
  --text-secondary: #374151;
  --text-muted: #9ca3af;
  --text-white: #ffffff;
  
  /* Background Colors */
  --bg-white: #ffffff;
  --bg-gray-50: #f7fafc;
  --bg-gray-100: #e0e7ef;
  --bg-dark: rgba(17, 24, 39, 0.7);
  
  /* Border Colors */
  --border-gray: #d1d5db;
  --border-light: #e5e7eb;
  --border-primary: var(--color-primary);
  --border-glass: rgba(255,255,255,0.12);
  
  /* Shadows */
  --shadow-sm: 0 2px 8px 0 rgba(122,162,153,0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 32px rgba(122, 162, 153, 0.2);
  --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  
  /* Border Radius */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 0.2s ease-in-out;
  --transition-base: 0.3s ease;
  --transition-slow: 0.6s ease-out;
  --transition-bounce: cubic-bezier(0.23, 1, 0.32, 1);
  
  /* Z-Index Scale */
  --z-base: 1;
  --z-dropdown: 10;
  --z-sticky: 20;
  --z-fixed: 30;
  --z-modal-backdrop: 40;
  --z-modal: 50;
  --z-popover: 60;
  --z-tooltip: 70;
  --z-notification: 80;
  
  /* Animation Durations */
  --duration-fast: 200ms;
  --duration-base: 300ms;
  --duration-slow: 600ms;
  --duration-slower: 1000ms;
  
  /* Responsive Breakpoints */
  --breakpoint-sm: 640px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1024px;
  --breakpoint-xl: 1280px;
  --breakpoint-2xl: 1536px;
}

/* Dark Mode Theme Variables (future enhancement) */

@media (prefers-color-scheme: dark) {
  :root {
    /* Dark mode color overrides can be added here */
  }
}

/* Apply theme variables to common elements */

body {
  color: var(--text-primary);
  background: var(--gradient-bg);
}

a {
  color: var(--color-primary);
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-dark);
}

/* Utility classes using CSS variables */

.bg-primary {
  background-color: var(--color-primary);
}

.bg-gradient {
  background: var(--gradient-primary);
}

.text-primary {
  color: var(--color-primary);
}

.border-primary {
  border-color: var(--border-primary);
}

.shadow-sm {
  box-shadow: var(--shadow-sm);
}

.shadow-md {
  box-shadow: var(--shadow-md);
}

.shadow-lg {
  box-shadow: var(--shadow-lg);
}

/* Base styles - foundational styles, resets, typography */

/* 
 * Base Styles - Foundational CSS
 * Global styles, resets, typography, and base element styling
 */

/* Smooth scrolling for navigation */

html {
  scroll-behavior: smooth;
}

/* Base body styling */

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #e0e7ef 0%, #f7fafc 100%);
  min-height: 100vh;
  padding-top: 84px;
  /* iPhone 14 Pro safe area support - KISS approach */
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* Mobile responsive padding */

@media (max-width: 640px) { 
  body { 
    padding-top: 72px; 
  } 
}

/* Brand gradient text */

.text-gradient {
  background: linear-gradient(135deg, #7aa299 0%, #a7c7e7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

/* Offset for fixed header when scrolling to sections */

#shop-protein, #features, #reviews {
  padding-top: 100px;
  margin-top: -100px;
}

@media (max-width: 640px) {
  #shop-protein, #features, #reviews {
    padding-top: 80px;
    margin-top: -80px;
  }
}

/* Layout styles - grid systems, containers, spacing */

/* 
 * Layout Styles
 * Grid systems, flexbox layouts, and structural styles
 */

/* Product card enhancements */

.product-card {
  position: relative;
  background: white;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Payment form styling moved to forms.css to avoid duplication */

/* Mobile responsiveness */

@media (max-width: 768px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .grid {
    gap: 1rem;
  }
  
  .product-card {
    margin-bottom: 1rem;
  }
}

@media (max-width: 640px) {
  .hero-content {
    text-align: center;
    padding: 2rem 1rem;
  }
  
  .section-padding {
    padding: 3rem 1rem;
  }
}

/* Main content layout */

.main-content {
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Desktop layout adjustments */

@media (min-width: 1024px) {
  .main-content { 
    padding-right: 22rem; /* Accommodate fixed sidebar */
    padding-left: 2rem;
  }
}

/* Authenticated Pages Layout Utilities */

.auth-page-layout {
  min-height: 100vh;
  /* Fixed header spacing: h-16 (64px) mobile, lg:h-20 (80px) desktop */
  padding-top: 4rem; /* 64px */
}

@media (min-width: 1024px) {
  .auth-page-layout {
    padding-top: 5rem; /* 80px */
  }
}

/* Authenticated page container pattern */

.auth-container {
  max-width: 112rem; /* max-w-7xl */
  margin: 0 auto;
  padding: 2rem 1rem;
}

@media (min-width: 640px) {
  .auth-container {
    padding: 2rem 1.5rem;
  }
}

@media (min-width: 1024px) {
  .auth-container {
    padding: 2rem 2rem;
  }
}

/* Shared authenticated page background */

.auth-bg {
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
}

.auth-bg-blue {
  background: linear-gradient(135deg, #f9fafb 0%, #eff6ff 100%);
}

/* Grid layouts */

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 1rem;
}

@media (min-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    padding: 2rem;
  }
}

@media (min-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
  }
}

/* Flexbox utilities */

.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 */

.section-padding {
  padding: 4rem 2rem;
}

.container-max {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 768px) {
  .container-max {
    padding: 0 2rem;
  }
}

@media (min-width: 1024px) {
  .section-padding {
    padding: 6rem 2rem;
  }
}

/* Utility classes - single-purpose helpers */

/* 
 * Utility Classes
 * Single-purpose utility classes and helper styles
 */

/* Hero section background */

.hero-bg {
  background: url('/assets/images/bg3.png') center/cover no-repeat;
}

/* Product grid minimum height */

.product-grid-min-height {
  min-height: 300px;
}

/* Hide Stripe Link section completely */

.p-LinkAuthenticationElement,
.p-LinkAuthenticationElement-container,
[data-testid="Link-authentication-element"],
.LinkAuthenticationElement,
.Link,
.p-Link,
[class*="Link"],
[class*="link-authentication"],
[data-testid*="link"],
.ElementsForm .CheckboxInput,
.p-CheckboxInput {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
}

/* Hide any save info checkboxes or Link-related UI */

.p-Element--complete .p-CheckboxInput,
.p-Element .p-CheckboxInput,
[role="checkbox"],
input[type="checkbox"][name*="link"],
input[type="checkbox"][name*="save"] {
  display: none !important;
}

/* Mobile box preview styles moved to components/box-preview.css to avoid duplication */

/* Scroll to top button */

#scrollToTopBtn {
  display: none;
  position: fixed;
  bottom: 32px;
  left: 32px;
  z-index: 100;
  background: linear-gradient(135deg, #7aa299, #a7c7e7);
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  justify-content: center;
  align-items: center;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  opacity: 0.85;
}

#scrollToTopBtn:hover {
  opacity: 1;
  transform: scale(1.08);
}

/* Content layout classes */

.content-card {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid #f3f4f6;
  transition: box-shadow 0.3s ease;
}

.content-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #f3f4f6;
}

/* Button styles */

.btn-primary {
  background: linear-gradient(135deg, #7aa299 0%, #a7c7e7 100%);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  border: none;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(122, 162, 153, 0.2);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(122, 162, 153, 0.3);
  background: linear-gradient(135deg, #6a9289 0%, #97b7d7 100%);
}

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

/* Info box component */

.info-box {
  background: #f0f9ff;
  border: 1px solid #7aa299;
  border-radius: 0.5rem;
  padding: 1rem;
  color: #1e3a8a;
}

.info-box-text {
  margin-bottom: 0.5rem;
  color: #1e3a8a;
  line-height: 1.6;
}

.info-box-text:last-child {
  margin-bottom: 0;
}

/* CTA Section styles */

.cta-section {
  background: linear-gradient(135deg, #7aa299 0%, #a7c7e7 100%);
  color: white;
  padding: 3rem 2rem;
  border-radius: 1rem;
  text-align: center;
  margin-top: 3rem;
  margin-bottom: 2rem;
}

.cta-blue {
  background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
}

.cta-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.cta-text {
  font-size: 1.125rem;
  margin-bottom: 2rem;
  opacity: 0.9;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Responsive adjustments */

@media (max-width: 768px) {
  .content-card {
    padding: 1.5rem;
    border-radius: 0.75rem;
  }
  
  .section-title {
    font-size: 1.25rem;
  }
  
  .cta-section {
    padding: 2rem 1.5rem;
    border-radius: 0.75rem;
  }
  
  .cta-title {
    font-size: 1.5rem;
  }
  
  .cta-text {
    font-size: 1rem;
  }
}

/* Component styles */

/* 
 * Button Components
 * All button styles and variations
 */

/* Enhanced button touch-friendly styling */

.increase-btn, .decrease-btn {
  min-width: 2.5rem;
  min-height: 2.5rem;
  font-size: 1.2rem;
  position: relative;
  z-index: 1;
  -moz-user-select: none;
       user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Make buttons even larger on touch devices */

@media (pointer: coarse) {
  .increase-btn, .decrease-btn {
    min-width: 3rem;
    min-height: 3rem;
    font-size: 1.4rem;
  }
}

/* Improve touch targets on mobile */

@media (max-width: 768px) {
  button,
  .btn,
  [role="button"] {
    min-height: 44px;
    min-width: 44px;
    padding: 8px 16px;
    touch-action: manipulation;
    /* Better mobile spacing and feedback */
    -webkit-tap-highlight-color: rgba(122, 162, 153, 0.2);
  }
  
  .increase-btn, .decrease-btn {
    min-width: 48px;
    min-height: 48px;
    font-size: 1.5rem;
  }
  
  /* Larger checkout and cart buttons */
  #checkout-button,
  #cart-button,
  .checkout-btn,
  .cart-btn,
  #mobile-checkout-box-btn,
  #checkout-box-btn {
    min-height: 52px;
    font-size: 1.1rem;
    /* KISS: Ensure consistent padding and spacing */
    padding: 12px 20px;
    touch-action: manipulation;
    /* Better visual hierarchy on mobile */
    font-weight: 600;
    letter-spacing: 0.025em;
    /* Enhanced mobile feedback */
    -webkit-tap-highlight-color: rgba(122, 162, 153, 0.3);
  }
  
  /* Mobile checkout button specific improvements */
  #mobile-checkout-box-btn {
    /* Better visual hierarchy */
    font-weight: 600;
    letter-spacing: 0.025em;
    /* Improved button design */
    border: 2px solid transparent;
    background-clip: padding-box;
  }
  
  #mobile-checkout-box-btn:not(:disabled):hover,
  #mobile-checkout-box-btn:not(:disabled):active {
    transform: translateY(-1px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 25px rgba(122, 162, 153, 0.25);
  }
  
  #mobile-checkout-box-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
  }
}

/* Modern button hover effect */

.modern-btn {
  transition: background 0.3s, box-shadow 0.3s, transform 0.2s;
  box-shadow: 0 2px 8px 0 rgba(122,162,153,0.08);
}

.modern-btn:hover, 
.modern-btn:focus {
  background: linear-gradient(90deg, #7aa299 0%, #a7c7e7 100%);
  box-shadow: 0 8px 24px 0 rgba(122,162,153,0.18);
  transform: translateY(-2px) scale(1.03);
}

/* Scroll to top button */

#scroll-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #7aa299, #a7c7e7);
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

#scroll-to-top.show {
  opacity: 1;
  visibility: visible;
}

#scroll-to-top:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

/* Mobile box toggle button - iPhone 14 Pro safe area support */

@media (max-width: 1023px) {
  #mobile-box-toggle {
    /* KISS approach: use CSS env() for iPhone 14 Pro safe areas */
    bottom: max(1rem, calc(1rem + env(safe-area-inset-bottom)));
    right: max(1rem, calc(1rem + env(safe-area-inset-right)));
    /* Ensure minimum 44px touch target */
    min-width: 64px;
    min-height: 64px;
    /* Improve visual hierarchy */
    box-shadow: 0 8px 32px rgba(122, 162, 153, 0.3), 0 2px 8px rgba(0, 0, 0, 0.15);
    /* Prevent layout shift */
    transform-origin: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  #mobile-box-toggle:hover,
  #mobile-box-toggle:active {
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(122, 162, 153, 0.4), 0 4px 12px rgba(0, 0, 0, 0.2);
  }
  
  /* Ensure proper spacing when mobile box preview is shown */
  #mobile-box-toggle.hidden-for-preview {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
  }

  /* Persistent mobile checkout button */
  #mobile-persistent-checkout-btn {
    /* KISS approach: use CSS env() for iPhone 14 Pro safe areas */
    bottom: max(1rem, calc(1rem + env(safe-area-inset-bottom)));
    left: max(1rem, calc(1rem + env(safe-area-inset-left)));
    /* Ensure minimum 44px touch target */
    min-height: 52px;
    /* Smooth transitions */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* Better visual hierarchy */
    box-shadow: 0 8px 32px rgba(34, 197, 94, 0.25), 0 2px 8px rgba(0, 0, 0, 0.15);
    /* Prevent layout shift */
    transform-origin: center;
  }

  #mobile-persistent-checkout-btn:hover:not(:disabled),
  #mobile-persistent-checkout-btn:active:not(:disabled) {
    box-shadow: 0 12px 40px rgba(34, 197, 94, 0.35), 0 4px 12px rgba(0, 0, 0, 0.2);
  }

  #mobile-persistent-checkout-btn:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    transform: none !important;
  }

  /* Ensure buttons don't overlap on very small screens */
  @media (max-width: 380px) {
    #mobile-box-toggle {
      right: 0.75rem;
      bottom: max(0.75rem, calc(0.75rem + env(safe-area-inset-bottom)));
    }
    
    #mobile-persistent-checkout-btn {
      left: 0.75rem;
      bottom: max(0.75rem, calc(0.75rem + env(safe-area-inset-bottom)));
      padding: 0.5rem 0.75rem;
    }
    
    #mobile-persistent-checkout-btn .text-xs {
      font-size: 0.6rem;
    }
    
    #mobile-persistent-checkout-btn .text-sm {
      font-size: 0.75rem;
    }
  }
}

/* Cart button improvements - Enhanced with proper z-index */

#cart-toggle-btn {
  transition: all 0.2s ease;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 30;
  pointer-events: auto;
  cursor: pointer;
  touch-action: manipulation;
}

#cart-toggle-btn:hover {
  background-color: #f3f4f6;
  transform: scale(1.05);
}

#cart-toggle-btn:active {
  transform: scale(0.95);
}

/* Cart count badge styling */

#cart-count-badge {
  font-size: 0.75rem;
  line-height: 1;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 31;
  position: relative;
}

/* Mobile specific improvements */

@media (max-width: 640px) {
  #cart-toggle-btn {
    min-width: 48px;
    min-height: 48px;
    touch-action: manipulation;
  }
  
  #cart-count-badge {
    font-size: 0.7rem;
    width: 20px;
    height: 20px;
    top: 0.5;
    right: 0.5;
  }
}

/* Ensure all small interactive elements meet WCAG touch target requirements */

@media (max-width: 768px) {
  /* Close buttons and small action buttons */
  button[class*="close"],
  .close-btn,
  .modal-close,
  [aria-label*="close"],
  [aria-label*="Close"] {
    min-width: 44px !important;
    min-height: 44px !important;
    padding: 8px !important;
    touch-action: manipulation;
  }
  
  /* Small text links and buttons */
  .text-xs button,
  .text-sm button,
  button.text-xs,
  button.text-sm {
    min-height: 44px !important;
    min-width: 44px !important;
    padding: 8px 12px !important;
  }
  
  /* Badge and count elements that are interactive */
  .badge[onclick],
  .count[onclick],
  [class*="badge"]:hover,
  [role="button"] {
    min-height: 44px !important;
    min-width: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  
  /* Links with small text */
  a.text-xs,
  a.text-sm {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
  }
  
  /* Mobile checkout modal specific improvements */
  .js-checkout-nav {
    padding: 20px 16px !important;
    gap: 16px;
  }
  
  .js-checkout-nav .flex {
    gap: 16px !important;
  }
  
  /* Input field additions and controls */
  .w-5,
  .h-5,
  .w-6,
  .h-6 {
    min-width: 44px !important;
    min-height: 44px !important;
  }
  
  /* Ensure SVG icons in buttons are properly sized */
  button svg,
  [role="button"] svg {
    width: 24px !important;
    height: 24px !important;
  }
}

/* 
 * Modal Components
 * Cart modal, checkout modal, and other modal styles
 */

/* Cart modal styles */

.cart-modal {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  width: 200px;
  height: 100%;
  background: rgba(17, 24, 39, 0.7);
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  overflow-y: auto;
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-left: 1.5px solid rgba(255,255,255,0.12);
}

#cart-modal {
  right: -100%;
  transition: right 0.3s ease;
}

#cart-modal.open,
.cart-modal.open {
  display: block;
  right: 0;
}

/* Cart backdrop */

.cart-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 40;
}

.cart-backdrop.show {
  display: block;
}

/* Checkout modal styling */

#checkout-modal-backdrop {
  transition: opacity 0.3s ease-in-out;
}

#checkout-modal-backdrop.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  z-index: -1;
}

#checkout-modal-backdrop:not(.hidden) {
  opacity: 1;
}

#checkout-modal {
  transition: opacity 0.3s ease-in-out;
}

#checkout-modal.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  z-index: -1;
}

#checkout-modal:not(.hidden) {
  opacity: 1;
}

#checkout-modal .modal-content {
  background: #ffffff;
  border-radius: 1.5rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  max-width: 600px;
  width: 90%;
  transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
  transform: scale(0.95) translateY(20px);
  opacity: 0;
}

#checkout-modal:not(.hidden) .modal-content {
  transform: scale(1) translateY(0);
  opacity: 1;
}

#checkout-modal h2 {
  color: #1f2937;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

/* Checkout modal form styling */

#checkout-modal label {
  color: #374151;
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: block;
  font-size: 0.875rem;
}

#checkout-modal input,
#checkout-modal select {
  background: #ffffff;
  border: 2px solid #d1d5db;
  border-radius: 0.5rem;
  padding: 0.75rem;
  color: #374151;
  width: 100%;
  margin-bottom: 1rem;
  font-size: 1rem;
  transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

#checkout-modal input:focus,
#checkout-modal select:focus {
  outline: none;
  border-color: #7aa299;
  box-shadow: 0 0 0 3px rgba(122, 162, 153, 0.1);
}

#checkout-modal input::-moz-placeholder {
  color: #9ca3af;
}

#checkout-modal input::placeholder {
  color: #9ca3af;
}

/* Enhanced checkout form styling */

#checkout-modal .modal-content {
  max-height: 90vh;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Ensure proper flexbox layout for desktop */

@media (min-width: 769px) {
  #checkout-modal .modal-content {
    display: flex;
    flex-direction: column;
    max-height: 90vh;
  }
  
  /* Make content area scrollable on desktop too */
  #checkout-modal .modal-content > div:not(.border-b):not(.flex):not(.flex-shrink-0) {
    flex: 1;
    overflow-y: auto;
  }
}

#checkout-modal input:invalid {
  border-color: #ef4444;
}

#checkout-modal input:valid {
  border-color: #10b981;
}

#checkout-modal label {
  color: #374151;
  font-weight: 500;
  margin-bottom: 0.5rem;
  display: block;
}

#checkout-modal input,
#checkout-modal select {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #e5e7eb;
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background: #ffffff;
  color: #1f2937;
}

#checkout-modal input:focus,
#checkout-modal select:focus {
  outline: none;
  border-color: #7aa299;
  box-shadow: 0 0 0 3px rgba(122, 162, 153, 0.1);
}

#checkout-modal input::-moz-placeholder {
  color: #9ca3af;
}

#checkout-modal input::placeholder {
  color: #9ca3af;
}

#checkout-modal .bg-white {
  background-color: #ffffff !important;
}

#checkout-modal input:invalid {
  border-color: #ef4444;
}

#checkout-modal input:valid {
  border-color: #10b981;
}

/* Checkout Stage Transitions */

.checkout-stage {
  transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.checkout-stage.hidden {
  opacity: 0;
  transform: translateX(20px);
  pointer-events: none;
}

.checkout-stage:not(.hidden) {
  opacity: 1;
  transform: translateX(0);
}

/* Progress indicator styles */

.progress-indicator {
  transition: all 0.3s ease-in-out;
}

/* Mobile responsive modal styles */

@media (max-width: 768px) {
  /* MOBILE CRITICAL: Force checkout modal visibility on mobile */
  #checkout-modal-backdrop {
    z-index: 60 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.6) !important;
  }
  
  #checkout-modal {
    z-index: 70 !important;
    /* Force higher stacking than mobile box preview (z-index: 45) */
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    display: flex !important;
  }
  
  /* MOBILE CRITICAL: Force visibility when not hidden */
  #checkout-modal:not(.hidden) {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }
  
  #checkout-modal-backdrop:not(.hidden) {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }
  
  /* Ensure mobile box preview stays below checkout when both are present */
  .mobile-box-preview {
    /* Lower z-index when checkout is open - handled by JS but CSS backup */
    z-index: 45 !important;
  }
  
  /* When body has modal-open class, further ensure proper stacking */
  body.modal-open .mobile-box-preview {
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
  }
  
  /* Mobile cart modal improvements */
  #cart-modal {
    width: 100% !important;
    max-width: 100% !important;
  }
  
  /* Mobile checkout modal - enhanced full screen approach */
  #checkout-modal {
    padding: 0 !important;
    align-items: flex-start !important;
  }
  
  #checkout-modal .modal-content {
    /* Use dynamic viewport height that accounts for mobile browser UI */
    max-height: 100dvh !important;
    height: 100dvh !important;
    /* Fallback for older browsers */
    max-height: 100vh !important;
    height: 100vh !important;
    width: 100vw !important;
    max-width: 100vw !important;
    margin: 0 !important;
    border-radius: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
    /* Add iOS safe area handling */
    padding-bottom: env(safe-area-inset-bottom) !important;
  }
  
  /* Enhanced mobile header styling */
  #checkout-modal .border-b {
    flex-shrink: 0 !important;
    position: sticky !important;
    top: 0 !important;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
    z-index: 10 !important;
    padding: 1rem 1.25rem !important;
    border-bottom: 2px solid #e2e8f0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
  }
  
  /* Mobile-optimized title */
  #checkout-modal h2 {
    font-size: 1.5rem !important; /* Smaller than desktop */
    font-weight: 700 !important;
    color: #1e293b !important;
    margin-bottom: 0.75rem !important;
  }
  
  /* Compact mobile progress indicator */
  #checkout-modal .mt-4 {
    margin-top: 0.5rem !important;
  }
  
  /* Progress indicator improvements */
  #checkout-modal .space-x-2 {
    gap: 0.25rem !important;
  }
  
  #checkout-modal .w-8.h-8 {
    width: 1.75rem !important;
    height: 1.75rem !important;
    font-size: 0.75rem !important;
  }
  
  #checkout-modal .w-8.h-0\\.5,
  #checkout-modal .h-0\\.5 {
    width: 1rem !important;
    height: 2px !important;
  }
  
  #checkout-modal .text-sm.text-gray-600 {
    font-size: 0.75rem !important;
    display: none !important; /* Hide stage labels on very small screens */
  }
  
  /* Enhanced close button */
  #close-checkout-modal {
    width: 2.5rem !important;
    height: 2.5rem !important;
    border-radius: 50% !important;
    background: #f1f5f9 !important;
    color: #64748b !important;
    font-size: 1.25rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    touch-action: manipulation !important;
  }
  
  #close-checkout-modal:hover {
    background: #e2e8f0 !important;
    color: #475569 !important;
    transform: scale(1.05) !important;
  }
  
  /* Enhanced scrollable content area */
  #checkout-modal .modal-content > div:not(.border-b):not(.flex):not(.flex-shrink-0) {
    flex: 1 !important;
    overflow-y: auto !important;
    padding: 1.5rem 1.25rem 2rem 1.25rem !important;
    /* Add bottom padding to account for fixed navigation */
    padding-bottom: calc(6rem + env(safe-area-inset-bottom, 0px)) !important;
    background: white !important;
    margin: 0.5rem !important;
    border-radius: 1rem !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
  }
  
  /* Ensure order summary sections display correctly on mobile */
  #checkout-modal .bg-gray-50 {
    margin-bottom: 1rem !important;
  }
  
  /* Fix spacing issues with pricing breakdown sections */
  #checkout-modal .space-y-6 > div {
    margin-bottom: 1.5rem !important;
  }
  
  /* KISS Principle: Use semantic classes instead of complex selectors */
  
  /* Fixed navigation bar for mobile */
  #checkout-modal .js-checkout-nav {
    flex-shrink: 0 !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
    z-index: 80 !important;
    padding: 1.25rem !important;
    padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px)) !important;
    border-top: 1px solid #e5e7eb !important;
    padding-top: 1rem !important;
    margin-top: 0 !important;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08) !important;
    pointer-events: auto !important;
    isolation: isolate !important;
    transform: translate3d(0, 0, 0) !important;
    min-height: calc(4rem + env(safe-area-inset-bottom, 0px)) !important;
  }
  
  /* Static pricing summary */
  #checkout-modal .js-pricing-summary {
    position: static !important;
    padding: 1rem 0 0 0 !important;
    margin-top: 1rem !important;
    border-top: 1px solid #e5e7eb !important;
    background: transparent !important;
    box-shadow: none !important;
    z-index: auto !important;
    min-height: auto !important;
    transform: none !important;
  }
  
  /* Default border styling for other elements */
  #checkout-modal .js-content-border {
    position: static !important;
    padding: 1rem 0 0 0 !important;
    margin-top: 1rem !important;
    border-top: 1px solid #e5e7eb !important;
    background: transparent !important;
    box-shadow: none !important;
    z-index: auto !important;
    min-height: auto !important;
    transform: none !important;
  }
  
  /* Mobile-optimized buttons */
  #checkout-modal .border-t button,
  #checkout-modal .js-checkout-nav button {
    font-weight: 600 !important;
    letter-spacing: 0.025em !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    /* Force button interactivity with higher z-index */
    pointer-events: auto !important;
    cursor: pointer !important;
    position: relative !important;
    z-index: 81 !important;
    /* Touch optimizations */
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-user-select: none !important;
       -moz-user-select: none !important;
            user-select: none !important;
    /* Ensure minimum touch target size */
    min-height: 48px !important;
    min-width: 48px !important;
    /* Hardware acceleration for better performance */
    transform: translate3d(0, 0, 0) !important;
  }
  
  #checkout-modal .border-t .bg-gradient-to-r,
  #checkout-modal .js-checkout-nav .bg-gradient-to-r {
    background: linear-gradient(135deg, #7aa299 0%, #a7c7e7 100%) !important;
    box-shadow: 0 4px 12px rgba(122, 162, 153, 0.3) !important;
  }
  
  #checkout-modal .border-t .bg-gradient-to-r:hover,
  #checkout-modal .js-checkout-nav .bg-gradient-to-r:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 16px rgba(122, 162, 153, 0.4) !important;
  }
}

/* Critical fix: Ensure navigation container is properly layered */

#checkout-modal .js-checkout-nav {
  position: relative !important;
  z-index: 80 !important;
  isolation: isolate !important;
  pointer-events: auto !important;
  background: #ffffff !important;
}

/* Additional desktop-specific navigation fixes */

@media (min-width: 769px) {
  #checkout-modal .js-checkout-nav {
    position: sticky !important;
    bottom: 0 !important;
    z-index: 85 !important;
  }
}

/* CRITICAL: Force clickability - override any conflicting styles */

#checkout-next-btn,
#cancel-checkout-modal,
#checkout-modal-submit,
#checkout-back-btn {
  pointer-events: auto !important;
  z-index: 90 !important;
  position: relative !important;
  cursor: pointer !important;
  -webkit-user-select: none !important;
     -moz-user-select: none !important;
          user-select: none !important;
  touch-action: manipulation !important;
  /* Ensure minimum touch target */
  min-height: 44px !important;
  min-width: 44px !important;
  /* Force hardware acceleration for better responsiveness */
  will-change: transform !important;
  transform: translateZ(0) !important;
}

@media (max-width: 640px) {
  /* Ensure full-screen modal on small devices */
  #checkout-modal {
    padding: 0 !important;
  }
  
  /* Add specific mobile browser viewport handling */
  #checkout-modal .modal-content {
    /* Support for newer browsers with dynamic viewport */
    height: 100dvh !important;
    max-height: 100dvh !important;
    /* iOS-specific small viewport height for better keyboard handling */
    height: 100svh !important;
    max-height: 100svh !important;
    /* Legacy fallback */
    height: 100vh !important;
    max-height: 100vh !important;
  }
  
  /* Additional mobile-specific fixes for border-t styling */
  #checkout-modal .bg-gray-50 .border-t.border-gray-200 {
    /* Ensure the pricing breakdown sections have proper spacing on small screens */
    padding-top: 1rem !important;
    margin-top: 1rem !important;
    border-top: 1px solid #e5e7eb !important;
  }
  
  /* Fix for navigation area border on very small screens */
  #checkout-modal .border-t.border-gray-200:not(.bg-gray-50 .border-t) {
    /* Ensure navigation border is visible */
    border-top: 1px solid #e5e7eb !important;
    padding-top: 1rem !important;
  }
  
  /* Force single column layout */
  #checkout-modal .grid[class*="grid-cols-2"] {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }
  
  /* Enhanced form styling for mobile */
  #checkout-modal input,
  #checkout-modal select {
    padding: 1rem !important;
    font-size: 16px !important; /* Prevent iOS zoom */
    margin-bottom: 1.25rem !important;
    border-radius: 0.75rem !important;
    border-width: 2px !important;
    transition: all 0.2s ease !important;
    background: #fafafa !important;
  }
  
  #checkout-modal input:focus,
  #checkout-modal select:focus {
    background: white !important;
    border-color: #7aa299 !important;
    box-shadow: 0 0 0 3px rgba(122, 162, 153, 0.1) !important;
    transform: translateY(-1px) !important;
  }
  
  /* Enhanced labels */
  #checkout-modal label {
    font-weight: 600 !important;
    color: #374151 !important;
    margin-bottom: 0.5rem !important;
    font-size: 0.875rem !important;
  }
  
  /* Beautiful form sections */
  #checkout-modal .space-y-6 > div {
    background: white !important;
    padding: 1.25rem !important;
    border-radius: 1rem !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
    border: 1px solid #f1f5f9 !important;
  }
  
  /* Order summary enhancement */
  #checkout-modal .bg-gray-50 {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 1rem !important;
    padding: 1.5rem !important;
  }
  
  /* Payment type cards enhancement */
  #checkout-modal input[type="radio"] + label {
    border-radius: 1rem !important;
    border-width: 2px !important;
    padding: 1.25rem !important;
    transition: all 0.2s ease !important;
  }
  
  #checkout-modal input[type="radio"]:checked + label {
    border-color: #7aa299 !important;
    background: linear-gradient(135deg, #f0fdfa 0%, #ecfdf5 100%) !important;
    box-shadow: 0 4px 12px rgba(122, 162, 153, 0.15) !important;
  }
  
  /* Larger touch targets for buttons */
  #checkout-modal button {
    min-height: 52px !important;
    padding: 1rem 1.5rem !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    border-radius: 0.75rem !important;
    touch-action: manipulation !important;
    transition: all 0.2s ease !important;
  }
  
  /* Navigation buttons enhancement */
  #checkout-modal .border-t .flex {
    gap: 0.75rem !important;
  }
  
  #checkout-modal .border-t button:not(.bg-gradient-to-r) {
    background: #f8fafc !important;
    border: 2px solid #e2e8f0 !important;
    color: #475569 !important;
  }
  
  #checkout-modal .border-t button:not(.bg-gradient-to-r):hover {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    transform: translateY(-1px) !important;
  }
  
  /* Stage headings */
  #checkout-modal h3 {
    color: #1e293b !important;
    font-weight: 700 !important;
    font-size: 1.125rem !important;
    margin-bottom: 1rem !important;
  }
  
  /* Progress indicator - hide text, show only dots */
  #checkout-modal .space-x-2 span {
    display: none !important;
  }
  
  #checkout-modal .space-x-2 {
    justify-content: center !important;
    gap: 0.5rem !important;
  }
  
  /* Prevent any potential scrolling issues */
  body.modal-open {
    overflow: hidden !important;
    /* Use dynamic viewport height for better mobile experience */
    height: 100dvh !important;
    height: 100vh !important; /* Fallback */
    /* Prevent iOS bounce scrolling when modal is open */
    position: fixed !important;
    width: 100% !important;
  }
  
  /* Ensure modal doesn't cause horizontal scroll */
  #checkout-modal-backdrop {
    width: 100vw !important;
    height: 100vh !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
  }
}

/* Enhanced mobile checkout modal micro-interactions */

@media (max-width: 640px) {
  /* Smooth modal entrance animation */
  #checkout-modal:not(.hidden) {
    animation: mobileModalSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }
  
  /* Mobile-first checkout layout improvements */
  .checkout-stage {
    padding-bottom: 140px; /* Space for sticky summary and navigation */
  }
  
  /* Sticky total summary bar for mobile */
  .mobile-total-summary {
    position: fixed;
    bottom: 80px; /* Above navigation buttons */
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e5e7eb;
    padding: 12px 16px;
    z-index: 100;
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
  }
  
  /* Enhanced mobile navigation area */
  .mobile-checkout-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e5e7eb;
    padding: 16px;
    z-index: 101;
    box-shadow: 0 -8px 10px -3px rgba(0, 0, 0, 0.1);
  }
  
  /* Improve button accessibility on mobile */
  .mobile-checkout-nav .checkout-btn {
    min-height: 48px;
    font-size: 16px; /* Prevent iOS zoom */
    touch-action: manipulation;
  }
  
  /* Simplified mobile progress indicator */
  .mobile-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #f3f4f6;
    z-index: 1000;
  }
  
  .mobile-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #7aa299 0%, #a7c7e7 100%);
    transition: width 0.3s ease-in-out;
    width: 25%; /* Default to stage 1 */
  }
  
  /* Hide desktop progress on mobile */
  #checkout-modal .mt-4.flex.items-center.space-x-2 {
    display: none;
  }
  
  /* Compact mobile header */
  #checkout-modal .p-4.sm\\:p-6.border-b {
    padding: 12px 16px;
  }
  
  #checkout-modal .p-4.sm\\:p-6.border-b h2 {
    font-size: 1.25rem;
    margin-bottom: 0;
  }
}

/* Form field focus animations */

#checkout-modal input:focus,
  #checkout-modal select:focus,
  #checkout-modal textarea:focus {
    animation: fieldFocusGlow 0.3s ease-out;
  }

/* Button press feedback */

#checkout-modal button:active {
    transform: scale(0.98) !important;
    transition: transform 0.1s ease !important;
  }

/* Progress indicator active state */

#checkout-modal [style*="background-color: rgb(122, 162, 153)"],
  #checkout-modal .bg-emerald-600,
  #checkout-modal .bg-green-600 {
    animation: progressPulse 2s infinite;
  }

/* Error message slide in */

#checkout-modal-error:not(.hidden) {
    animation: errorSlideIn 0.3s ease-out;
  }

/* Loading spinner enhancement */

#checkout-modal-spinner {
    animation: spinEnhanced 1s linear infinite;
  }

/* Keyframe animations for mobile */

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

@keyframes fieldFocusGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(122, 162, 153, 0.4);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(122, 162, 153, 0.1);
  }
  100% {
    box-shadow: 0 0 0 3px rgba(122, 162, 153, 0.1);
  }
}

@keyframes progressPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(122, 162, 153, 0.7);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 4px rgba(122, 162, 153, 0);
  }
}

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

/* Enhanced error message states */

#checkout-modal-error {
  transition: all 0.3s ease;
  border-left: 4px solid #ef4444;
  position: relative;
}

/* Error updating state */

#checkout-modal-error.updating {
  border-left-color: #3b82f6;
  background-color: #eff6ff;
  color: #1d4ed8;
}

/* Error fade-out state */

#checkout-modal-error.fading {
  opacity: 0.5;
  transform: translateX(-10px);
}

/* Error dim state (on focus) */

#checkout-modal-error.dimmed {
  opacity: 0.3;
  transform: scale(0.98);
}

/* Success transition when error is being resolved */

@keyframes errorResolving {
  0% {
    background-color: #fef2f2;
    border-left-color: #ef4444;
  }
  50% {
    background-color: #eff6ff;
    border-left-color: #3b82f6;
  }
  100% {
    background-color: #f0fdf4;
    border-left-color: #10b981;
    opacity: 0;
    transform: translateX(100%);
  }
}

/* Apply resolving animation */

#checkout-modal-error.resolving {
  animation: errorResolving 1.2s ease-out forwards;
}

@keyframes spinEnhanced {
  from {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(180deg) scale(1.1);
  }
  to {
    transform: rotate(360deg) scale(1);
  }
}

/* Payment Plan Selection Styling */

#checkout-modal input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Reduced motion support */

@media (prefers-reduced-motion: reduce) {
  #checkout-modal input[type="radio"] + label > div,
  #checkout-modal input[type="radio"] + label .w-6.h-6,
  #checkout-modal input[type="radio"] + label .w-6.h-6 svg {
    transition: none !important;
    animation: none !important;
  }
}

/* Default radio button styling - Fixed selector for nested input */

#checkout-modal label .w-6.h-6 {
  border: 2px solid #d1d5db;
  background: #ffffff;
  transition: all 0.2s ease;
}

/* Default checkmark styling - hidden and scaled down */

#checkout-modal label .w-6.h-6 svg {
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Selected radio button styling - Fixed selector for nested input */

#checkout-modal input[type="radio"]:checked ~ div .w-6.h-6,
#checkout-modal label:has(input[type="radio"]:checked) .w-6.h-6,
#checkout-modal input.peer:checked ~ div .w-6.h-6 {
  border-color: #7aa299 !important;
  background: #7aa299 !important;
  box-shadow: 0 0 0 3px rgba(122, 162, 153, 0.1);
}

/* Show checkmark when selected - Fixed selector for nested input */

#checkout-modal input[type="radio"]:checked ~ div .w-6.h-6 svg,
#checkout-modal label:has(input[type="radio"]:checked) .w-6.h-6 svg,
#checkout-modal input.peer:checked ~ div .w-6.h-6 svg {
  opacity: 1 !important;
  color: white !important;
  transform: scale(1) !important;
  transition: opacity 0.2s ease, transform 0.2s ease !important;
}

/* Selected plan card styling - Fixed selector for nested input */

#checkout-modal input[type="radio"]:checked ~ div,
#checkout-modal label:has(input[type="radio"]:checked) > div,
#checkout-modal input.peer:checked ~ div {
  border-color: #7aa299 !important;
  background: linear-gradient(135deg, #f0fdfa 0%, #ecfdf5 100%) !important;
  box-shadow: 0 4px 12px rgba(122, 162, 153, 0.15) !important;
  transform: scale(1.02);
}

/* Hover states for payment plans */

#checkout-modal label:hover > div {
  border-color: #7aa299 !important;
  box-shadow: 0 2px 8px rgba(122, 162, 153, 0.1) !important;
}

/* Focus states for keyboard navigation - Fixed selector for nested input */

#checkout-modal input[type="radio"]:focus ~ div,
#checkout-modal label:has(input[type="radio"]:focus) > div {
  border-color: #7aa299 !important;
  box-shadow: 0 0 0 3px rgba(122, 162, 153, 0.2) !important;
  outline: 2px solid transparent;
  outline-offset: 2px;
}

/* Focus visible for better accessibility - Fixed selector for nested input */

#checkout-modal input[type="radio"]:focus-visible ~ div,
#checkout-modal label:has(input[type="radio"]:focus-visible) > div {
  border-color: #7aa299 !important;
  box-shadow: 0 0 0 3px rgba(122, 162, 153, 0.3) !important;
}

/* Enhanced mobile modal shadow */

#checkout-modal .modal-content {
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

@media (max-width: 768px) {
  /* Enhanced mobile modal shadow */
  #checkout-modal .modal-content {
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05),
                0 10px 25px -5px rgba(0, 0, 0, 0.1),
                0 20px 40px -10px rgba(0, 0, 0, 0.15) !important;
  }
  
  /* Mobile payment plan enhancements */
  #checkout-modal input[type="radio"] + label > div {
    padding: 1.25rem !important;
    margin-bottom: 0.75rem !important;
    min-height: 4rem !important; /* Ensure 64px touch target */
  }
  
  /* Larger mobile touch targets */
  #checkout-modal input[type="radio"] + label {
    min-height: 4rem !important;
    display: flex !important;
    align-items: stretch !important;
  }
  
  /* Mobile selected state - Fixed selector for nested input */
  #checkout-modal input[type="radio"]:checked ~ div,
  #checkout-modal label:has(input[type="radio"]:checked) > div {
    transform: scale(1.01) !important;
    box-shadow: 0 6px 20px rgba(122, 162, 153, 0.2) !important;
  }
}

/* Cart button improvements */

#cart-toggle-btn {
  transition: all 0.2s ease;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#cart-toggle-btn:hover {
  background-color: #f3f4f6;
  transform: scale(1.05);
}

#cart-toggle-btn:active {
  transform: scale(0.95);
}

/* Cart count badge styling */

#cart-count-badge {
  font-size: 0.75rem;
  line-height: 1;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Mobile specific improvements */

@media (max-width: 640px) {
  #cart-toggle-btn {
    min-width: 48px;
    min-height: 48px;
    touch-action: manipulation;
  }
  
  #cart-count-badge {
    font-size: 0.7rem;
    width: 20px;
    height: 20px;
    top: 0.5;
    right: 0.5;
  }
}

/* Box Editor Modal Styles */

#box-editor-modal {
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  transition: opacity 0.3s ease-in-out;
}

#box-editor-modal.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

#box-editor-modal:not(.hidden) {
  opacity: 1;
}

/* Box editor modal container slide animation */

#box-editor-modal .fixed.inset-x-0.bottom-0 {
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

#box-editor-modal:not(.hidden) .fixed.inset-x-0.bottom-0 {
  transform: translateY(0);
}

/* Edit button hover effect in checkout review */

#edit-box-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(122, 162, 153, 0.2);
}

/* Progress bar animation */

#editor-progress-bar {
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Smooth servings count updates */

#editor-servings-count {
  transition: color 0.3s ease;
}

/* Mobile touch feedback for quantity controls */

.editor-increase-btn:active,
.editor-decrease-btn:active,
.editor-remove-btn:active {
  transform: scale(0.9);
}

/* Success state for save button */

#save-box-changes:not(:disabled):active {
  transform: scale(0.98);
}

/* Mobile-specific touch feedback */

@media (max-width: 768px) {
  .editor-increase-btn:active,
  .editor-decrease-btn:active {
    background-color: rgba(122, 162, 153, 0.1);
  }
  
  .editor-remove-btn:active {
    background-color: rgba(239, 68, 68, 0.2);
  }
}

/* 
 * Form Components
 * Form inputs, validation, and payment form styles
 */

/* Payment form styling */

#payment-form {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Form inputs - consistent with index.html styling */

input, select, textarea {
  border-radius: 0.375rem; /* rounded-md */
  border: 1px solid #d1d5db; /* border-gray-300 */
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  padding: 0.5rem 0.75rem; /* px-3 py-2 */
  background-color: white;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #7aa299;
  box-shadow: 0 0 0 2px rgba(122, 162, 153, 0.2);
}

/* Form validation states */

input:invalid {
  border-color: #ef4444;
}

input:valid {
  border-color: #10b981;
}

/* Placeholder styling */

input::-moz-placeholder, textarea::-moz-placeholder {
  color: #9ca3af;
}

input::placeholder, textarea::placeholder {
  color: #9ca3af;
}

/* Form component classes */

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #374151;
  font-size: 0.875rem;
}

.form-input {
  width: 100%;
  padding: 0.5rem 0.75rem; /* px-3 py-2 equivalent */
  border: 1px solid #d1d5db; /* border-gray-300 equivalent */
  border-radius: 0.375rem; /* rounded-md equivalent */
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background-color: white;
}

.form-input:focus {
  outline: none;
  border-color: #7aa299;
  box-shadow: 0 0 0 2px rgba(122, 162, 153, 0.2);
}

.form-textarea {
  width: 100%;
  padding: 0.5rem 0.75rem; /* px-3 py-2 equivalent */
  border: 1px solid #d1d5db; /* border-gray-300 equivalent */
  border-radius: 0.375rem; /* rounded-md equivalent */
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background-color: white;
  resize: vertical;
  min-height: 120px;
}

.form-textarea:focus {
  outline: none;
  border-color: #7aa299;
  box-shadow: 0 0 0 2px rgba(122, 162, 153, 0.2);
}

/* Real-time validation feedback messages */

.field-validation-error {
  color: #dc2626; /* text-red-600 */
  font-size: 0.875rem; /* text-sm */
  margin-top: 0.25rem; /* mt-1 */
  display: flex;
  align-items: flex-start;
  gap: 0.25rem;
}

.field-validation-error::before {
  content: "⚠";
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.field-validation-hint {
  color: #d97706; /* text-yellow-600 */
  font-size: 0.875rem; /* text-sm */
  margin-top: 0.25rem; /* mt-1 */
  display: flex;
  align-items: flex-start;
  gap: 0.25rem;
}

.field-validation-hint::before {
  content: "💡";
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.field-validation-success {
  color: #059669; /* text-green-600 */
  font-size: 0.875rem; /* text-sm */
  margin-top: 0.25rem; /* mt-1 */
  display: flex;
  align-items: flex-start;
  gap: 0.25rem;
}

/* Legacy validation message support (phone/email specific) */

.phone-error, .email-error {
  color: #dc2626; /* text-red-600 */
  font-size: 0.875rem; /* text-sm */
  margin-top: 0.25rem; /* mt-1 */
  display: flex;
  align-items: flex-start;
  gap: 0.25rem;
}

.phone-error::before, .email-error::before {
  content: "⚠";
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.phone-hint, .email-hint {
  color: #d97706; /* text-yellow-600 */
  font-size: 0.875rem; /* text-sm */
  margin-top: 0.25rem; /* mt-1 */
  display: flex;
  align-items: flex-start;
  gap: 0.25rem;
}

.phone-hint::before, .email-hint::before {
  content: "💡";
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.phone-success, .email-success {
  color: #059669; /* text-green-600 */
  font-size: 0.875rem; /* text-sm */
  margin-top: 0.25rem; /* mt-1 */
  display: flex;
  align-items: flex-start;
  gap: 0.25rem;
}

/* Enhanced field states with smooth transitions */

input.border-gray-300 {
  border-color: #d1d5db !important;
  background-color: white !important;
  transition: all 0.2s ease;
}

input.border-blue-200 {
  border-color: #bfdbfe !important;
  background-color: #eff6ff !important;
  transition: all 0.2s ease;
}

input.border-yellow-300 {
  border-color: #fcd34d !important;
  background-color: #fefce8 !important;
  transition: all 0.2s ease;
}

input.border-green-300 {
  border-color: #86efac !important;
  background-color: #f0fdf4 !important;
  transition: all 0.2s ease;
}

input.border-red-300 {
  border-color: #fca5a5 !important;
  background-color: #fef2f2 !important;
  transition: all 0.2s ease;
}

/* Mobile form improvements */

@media (max-width: 768px) {
  input, select, textarea, .form-input, .form-textarea {
    font-size: 16px; /* Prevent zoom on iOS */
    padding: 0.75rem; /* Slightly larger padding on mobile */
    min-height: 44px; /* Touch-friendly minimum height */
  }
  
  .form-textarea {
    min-height: 120px;
  }
  
  .btn-primary {
    min-height: 48px;
    padding: 0.875rem 1.5rem;
    font-size: 1.125rem;
    touch-action: manipulation;
  }
  
  #payment-form {
    padding: 1.5rem;
    border-radius: 0.75rem;
  }
  
  /* Improve spacing on mobile */
  .form-group {
    margin-bottom: 1.25rem;
  }
  
  /* Keep consistent focus styles on mobile */
  .form-input:focus, .form-textarea:focus {
    border-color: #7aa299;
    box-shadow: 0 0 0 2px rgba(122, 162, 153, 0.2);
  }
}

/* 
 * Product Component Styles
 * Product cards, grid layouts, and product-specific UI
 */

/* Product card base styles */

.product-card {
  background: white;
  border-radius: 1rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border: 2px solid transparent;
  overflow: hidden;
  position: relative;
}

/* Product card hover effects */

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(122, 162, 153, 0.2);
  border-color: #7aa299;
}

/* Product card mobile optimizations */

@media (max-width: 768px) {
  .product-card {
    padding: 1.5rem;
  }
  
  .product-card .flex.items-center.space-x-3 {
    gap: 1rem;
  }
}

/* Product image styling */

.product-card img {
  transition: transform 0.3s ease;
}

.product-card:hover img {
  transform: scale(1.05);
}

/* Product quantity controls */

.product-quantity-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

/* Product servings indicator */

.servings-badge {
  background: linear-gradient(135deg, #7aa299, #a7c7e7);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
}

/* 
 * Cart Component Styles
 * Shopping cart modal and related UI
 */

/* Cart modal base styles */

.cart-modal {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  width: 200px;
  height: 100%;
  background: rgba(17, 24, 39, 0.7);
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  overflow-y: auto;
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-left: 1.5px solid rgba(255,255,255,0.12);
}

/* Cart modal open state */

.cart-modal.open {
  display: block;
  animation: slideInFromRight 0.3s ease-out;
}

/* Cart modal responsive */

@media (max-width: 768px) {
  #cart-modal {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* Cart animations */

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

/* 
 * Box Preview Component
 * Styles for the box preview UI and mobile preview
 */

/* Box preview wrap styling */

.box-preview-wrap {
  min-height: 90px;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

/* Empty state styling */

.box-preview-wrap:empty::before,
.box-preview-wrap > p:only-child {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 90px;
}

/* Desktop: vertical stacked list */

@media (min-width: 1024px) {
  .box-preview-wrap {
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: stretch;
  }
  
  .box-preview-wrap:empty::before,
  .box-preview-wrap > p:only-child {
    min-height: 120px;
  }
}

/* Mobile: horizontal icon grid */

@media (max-width: 1023px) {
  .box-preview-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.875rem;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 0.5rem;
    /* Better mobile visual hierarchy */
    background: rgba(247, 250, 252, 0.5);
    border-radius: 12px;
    border: 1px solid #f1f5f9;
  }
  
  .box-preview-wrap:empty::before,
  .box-preview-wrap > p:only-child {
    min-height: 100px;
  }
}

/* Box preview section styling */

.box-preview-section {
  background: linear-gradient(135deg, #f7fafc 60%, #e0f7fa 100%);
  border-radius: 1.5rem;
  box-shadow: 0 4px 24px 0 rgba(122,162,153,0.10);
  border: 1.5px solid #a7c7e7;
}

/* Mobile box preview - only shown on mobile devices */

@media (max-width: 1023px) {
  .mobile-box-preview {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 45;
    background: white;
    border-top: 2px solid #e5e7eb;
    padding: 20px 16px;
    /* iPhone 14 Pro safe area support - KISS approach */
    padding-bottom: max(28px, env(safe-area-inset-bottom));
    transform: translateY(100%);
    transition: transform 0.3s ease;
    /* Ensure it's visible when shown */
    visibility: visible;
    opacity: 1;
    /* Better mobile visual hierarchy */
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
    /* Responsive max height to prevent content overflow */
    max-height: 85vh;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .mobile-box-preview.show {
    transform: translateY(0);
  }

  /* Mobile box toggle visibility */
  #mobile-box-toggle.hidden-for-preview {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }
  
  /* Ensure close button is always accessible */
  #close-mobile-box {
    position: relative;
    z-index: 50;
    touch-action: manipulation;
    min-width: 48px;
    min-height: 48px;
  }
}

/* Mobile box preview responsive padding adjustments */

@media (max-width: 359px) {
  .mobile-box-preview {
    padding: 16px 12px;
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }
}

@media (min-width: 360px) and (max-width: 374px) {
  .mobile-box-preview {
    padding: 18px 14px;
    padding-bottom: max(26px, env(safe-area-inset-bottom));
  }
}

@media (min-width: 414px) and (max-width: 1023px) {
  .mobile-box-preview {
    padding: 24px 20px;
    padding-bottom: max(32px, env(safe-area-inset-bottom));
  }
}

/* Landscape orientation adjustments */

@media (max-width: 1023px) and (orientation: landscape) {
  .mobile-box-preview {
    max-height: 95vh;
    padding: 12px 16px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }
  
  .mobile-box-preview h3 {
    font-size: 1.125rem;
  }
  
  .mobile-box-preview p {
    font-size: 0.875rem;
  }
}

/* Desktop box preview item styling */

@media (min-width: 1024px) {
  #box-preview .box-preview-item,
  #mobile-box-preview-content .box-preview-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin-bottom: 4px;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.3);
    overflow: hidden;
    transition: all 0.2s ease;
    -webkit-backdrop-filter: blur(8px);
            backdrop-filter: blur(8px);
  }
  
  #box-preview .box-preview-item:hover,
  #mobile-box-preview-content .box-preview-item:hover {
    border-color: #7aa299;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  }
  
  /* Background image with rotation */
  #box-preview .box-preview-item::after,
  #mobile-box-preview-content .box-preview-item::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    right: -50%;
    bottom: -50%;
    background-size: 180px 180px;
    background-repeat: no-repeat;
    background-position: right center;
    opacity: 0.5;
    z-index: -1;
    transform: rotate(75deg) scale(1.2);
    transition: all 0.4s ease;
    pointer-events: none;
  }
  
  #box-preview .box-preview-item:hover::after,
  #mobile-box-preview-content .box-preview-item:hover::after {
    opacity: 0.7;
    transform: rotate(90deg) scale(1.6);
  }
  
  /* Semi-transparent overlay for text readability */
  #box-preview .box-preview-item::before,
  #mobile-box-preview-content .box-preview-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.15);
    z-index: -1;
  }
  
  #box-preview .box-preview-item:hover::before,
  #mobile-box-preview-content .box-preview-item:hover::before {
    background: rgba(248, 250, 252, 0.4);
  }
  
  #box-preview .box-preview-img,
  #mobile-box-preview-content .box-preview-img {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    -o-object-fit: cover;
       object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
  }
  
  #box-preview .box-preview-label,
  #mobile-box-preview-content .box-preview-label {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    flex-grow: 1;
    line-height: 1.3;
    position: relative;
    z-index: 1;
  }
  
  #box-preview .box-preview-quantity,
  #mobile-box-preview-content .box-preview-quantity {
    font-size: 14px;
    font-weight: 700;
    color: #059669;
    background: #d1fae5;
    padding: 4px 8px;
    border-radius: 6px;
    position: relative;
    z-index: 1;
  }
}

/* Mobile box preview item styling - responsive grid system */

@media (max-width: 1023px) {
  .box-preview-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 5.5rem;
    position: relative;
    padding: 0.75rem 0.5rem;
    background: white;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    transition: all 0.2s ease;
    /* Better touch experience */
    touch-action: manipulation;
  }
  
  .box-preview-item:hover {
    border-color: #7aa299;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(122, 162, 153, 0.15);
  }
  
  .box-preview-img {
    width: 3rem;
    height: 3rem;
    -o-object-fit: cover;
       object-fit: cover;
    border-radius: 8px;
    margin-bottom: 4px;
  }
  
  .box-preview-label {
    font-size: 11px;
    font-weight: 600;
    color: #374151;
    text-align: center;
    line-height: 1.2;
    margin-bottom: 4px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  
  .box-preview-quantity {
    font-size: 10px;
    font-weight: 700;
    color: #059669;
    background: #d1fae5;
    padding: 2px 6px;
    border-radius: 6px;
  }
}

/* Mobile-specific responsive design for mobile-box-preview-content */

@media (max-width: 1023px) {
  /* Enhanced mobile flavor items with responsive grid system */
  .mobile-flavor-item {
    /* Base responsive setup - mobile first */
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    padding: 8px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.2s ease;
    touch-action: manipulation;
  }
  
  .mobile-flavor-item:active {
    transform: scale(0.98);
  }
  
  /* Image responsiveness */
  .mobile-flavor-item img {
    width: 100%;
    height: 60px;
    -o-object-fit: cover;
       object-fit: cover;
    border-radius: 6px;
    margin-bottom: 6px;
  }
  
  /* Text scaling for different screen sizes */
  .mobile-flavor-item p {
    font-size: 10px;
    line-height: 1.2;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-align: center;
  }
  
  /* Responsive control buttons */
  .mobile-flavor-item .quantity-btn {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    border-width: 1px;
    font-size: 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
  }
  
  /* Quantity display responsiveness */
  .mobile-flavor-item .quantity-display {
    min-width: 32px;
  }
  
  .mobile-flavor-item .quantity-value {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 12px;
  }
  
  /* Quick add buttons responsiveness */
  .mobile-flavor-item .quick-add-btn {
    font-size: 9px;
    padding: 2px 4px;
    border-radius: 4px;
    min-height: 20px;
    min-width: 20px;
  }
  
  /* Remove button positioning */
  .mobile-flavor-item .remove-flavor-btn {
    width: 20px;
    height: 20px;
    font-size: 10px;
    border-radius: 50%;
    top: 4px;
    right: 4px;
  }
}

/* Extra small phones (320px - 359px) - iPhone SE, older phones */

@media (max-width: 359px) {
  /* Responsive grid: single column on very small screens */
  .responsive-mobile-grid {
    grid-template-columns: 1fr !important;
    gap: 8px;
  }
  
  .mobile-flavor-item {
    min-height: 120px;
    padding: 6px;
  }
  
  .mobile-flavor-item img {
    height: 50px;
  }
  
  .mobile-flavor-item p {
    font-size: 9px;
    -webkit-line-clamp: 1;
  }
  
  .mobile-flavor-item .quantity-btn {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    font-size: 10px;
  }
  
  .mobile-flavor-item .quantity-value {
    font-size: 10px;
    padding: 2px 6px;
  }
  
  .mobile-flavor-item .quick-add-btn {
    font-size: 8px;
    padding: 1px 3px;
    min-height: 18px;
    min-width: 18px;
  }
}

/* Small phones (360px - 374px) - Galaxy S series, standard Android */

@media (min-width: 360px) and (max-width: 374px) {
  /* Two column grid with tighter spacing */
  .responsive-mobile-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 6px;
  }
  
  .mobile-flavor-item {
    min-height: 130px;
    padding: 7px;
  }
  
  .mobile-flavor-item img {
    height: 55px;
  }
}

/* Standard phones (375px - 413px) - iPhone 12/13/14, most modern phones */

@media (min-width: 375px) and (max-width: 413px) {
  /* Optimal two column grid */
  .responsive-mobile-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px;
  }
  
  .mobile-flavor-item {
    min-height: 140px;
    padding: 8px;
  }
  
  .mobile-flavor-item img {
    height: 60px;
  }
  
  .mobile-flavor-item p {
    font-size: 10px;
  }
  
  .mobile-flavor-item .quantity-btn {
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
  }
}

/* Large phones (414px+) - iPhone Pro Max, Galaxy Note series */

@media (min-width: 414px) and (max-width: 1023px) {
  /* Three column grid for larger phones in portrait */
  .responsive-mobile-grid {
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 10px;
  }
  
  .mobile-flavor-item {
    min-height: 145px;
    padding: 10px;
  }
  
  .mobile-flavor-item img {
    height: 65px;
  }
  
  .mobile-flavor-item p {
    font-size: 11px;
    -webkit-line-clamp: 2;
  }
  
  .mobile-flavor-item .quantity-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    font-size: 14px;
  }
  
  .mobile-flavor-item .quantity-value {
    font-size: 12px;
    padding: 5px 10px;
  }
  
  .mobile-flavor-item .quick-add-btn {
    font-size: 10px;
    padding: 3px 5px;
    min-height: 22px;
    min-width: 22px;
  }
  
  .mobile-flavor-item .remove-flavor-btn {
    width: 22px;
    height: 22px;
    font-size: 12px;
  }
}

/* Landscape orientation optimizations */

@media (max-width: 1023px) and (orientation: landscape) {
  /* Use more horizontal space in landscape */
  .responsive-mobile-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 8px;
  }
  
  .mobile-flavor-item {
    min-height: 120px;
    padding: 6px;
  }
  
  .mobile-flavor-item img {
    height: 45px;
  }
  
  .mobile-flavor-item p {
    font-size: 9px;
    -webkit-line-clamp: 1;
    margin-bottom: 4px;
  }
  
  .mobile-flavor-item .quantity-btn {
    width: 26px;
    height: 26px;
    min-width: 26px;
    min-height: 26px;
    font-size: 11px;
  }
  
  .mobile-flavor-item .quantity-value {
    font-size: 10px;
    padding: 3px 6px;
  }
  
  .mobile-flavor-item .quick-add-btn {
    font-size: 8px;
    padding: 2px 3px;
    min-height: 18px;
    min-width: 18px;
  }
}

/* Ultra-wide phones and foldables in landscape */

@media (min-width: 600px) and (max-width: 1023px) and (orientation: landscape) {
  .responsive-mobile-grid {
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 12px;
  }
}

/* Additional mobile box styles */

@media (max-width: 1023px) {
  /* Hide the mobile toggle button when preview is open */
  #mobile-box-toggle.hidden-for-preview {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }
  
  /* Ensure close button is always accessible with proper touch target */
  #close-mobile-box {
    position: relative;
    z-index: 50;
    touch-action: manipulation;
    min-width: 48px;
    min-height: 48px;
  }
}

/* ========================================
   ENHANCED MOBILE UX - Selection States & Animations
   ======================================== */

/* Keyframe animations for enhanced feedback */

@keyframes selectionPulse {
  0% { transform: scale(1); }
  30% { transform: scale(1.02); }
  60% { transform: scale(0.98); }
  100% { transform: scale(1); }
}

@keyframes quantityBounce {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

@keyframes progressFill {
  0% { width: 0; }
  100% { width: 100%; }
}

@keyframes slideInUp {
  0% { 
    opacity: 0; 
    transform: translateY(10px); 
  }
  100% { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

/* Enhanced mobile flavor selection states */

@media (max-width: 1023px) {
  
  /* Base mobile-flavor-item enhancements */
  .mobile-flavor-item {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Enhanced shadow and border system */
    box-shadow: 
      0 1px 3px rgba(0, 0, 0, 0.1),
      0 0 0 1px rgba(229, 231, 235, 0.5);
  }
  
  /* Selection states with visual hierarchy */
  .mobile-flavor-item.selected {
    border-color: #7aa299 !important;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%) !important;
    box-shadow: 
      0 4px 12px rgba(122, 162, 153, 0.15),
      0 0 0 2px rgba(122, 162, 153, 0.2) !important;
    transform: translateY(-1px);
  }
  
  /* High quantity visual emphasis */
  .mobile-flavor-item.high-quantity {
    background: linear-gradient(135deg, #fef3c7 0%, #fef7e5 100%) !important;
    border-color: #f59e0b !important;
    box-shadow: 
      0 4px 12px rgba(245, 158, 11, 0.15),
      0 0 0 2px rgba(245, 158, 11, 0.2) !important;
  }
  
  /* Interactive feedback on touch */
  .mobile-flavor-item:active {
    transform: translateY(0) scale(0.98);
    transition: all 0.1s ease;
  }
  
  /* Selection progress bar */
  .mobile-flavor-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #7aa299 0%, #a7c7e7 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0;
    z-index: 1;
  }
  
  .mobile-flavor-item.selected::before {
    transform: scaleX(1);
  }
  
  /* Enhanced quantity display */
  .mobile-flavor-item .quantity-value {
    transition: all 0.2s ease;
    font-weight: 700 !important;
    position: relative;
    z-index: 2;
  }
  
  .mobile-flavor-item .quantity-value.updated {
    animation: quantityBounce 0.4s ease-out;
  }
  
  /* Improved button states */
  .mobile-flavor-item .quantity-btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 2;
    font-weight: 700;
  }
  
  .mobile-flavor-item .quantity-btn:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
  }
  
  .mobile-flavor-item .quantity-btn:disabled {
    opacity: 0.4;
    transform: none !important;
  }
  
  /* Enhanced hover states for devices that support hover */
  @media (hover: hover) {
    .mobile-flavor-item:hover {
      transform: translateY(-2px);
      box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(122, 162, 153, 0.1);
      border-color: #7aa299;
    }
    
    .mobile-flavor-item .quantity-btn:hover:not(:disabled) {
      transform: scale(1.05);
    }
  }
  
  /* Quick selection buttons enhancement */
  .mobile-flavor-item .quick-add-btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 2;
    font-weight: 600;
  }
  
  .mobile-flavor-item .quick-add-btn:active {
    transform: scale(0.95);
  }
  
  .mobile-flavor-item .quick-add-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
  }
  
  /* Remove button enhancements */
  .mobile-flavor-item .remove-flavor-btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-backdrop-filter: blur(4px);
            backdrop-filter: blur(4px);
    z-index: 10;
  }
  
  .mobile-flavor-item .remove-flavor-btn:active {
    transform: scale(0.9);
  }
  
  /* Selection pulse animation class */
  .mobile-flavor-item.selection-pulse {
    animation: selectionPulse 0.6s ease-out;
  }
  
  /* Slide-in animation for new items */
  .mobile-flavor-item.slide-in {
    animation: slideInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }
}

/* ========================================
   SMART SELECTION FEATURES
   ======================================== */

/* Progress indicator enhancements */

@media (max-width: 1023px) {
  .selection-progress {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
  }
  
  .selection-progress::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(135deg, rgba(122, 162, 153, 0.1) 0%, rgba(167, 199, 231, 0.1) 100%);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
  }
  
  .selection-progress .content {
    position: relative;
    z-index: 1;
  }
  
  .progress-bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 8px;
  }
  
  .progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #7aa299 0%, #a7c7e7 100%);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 3px;
  }
  
  /* Smart suggestions */
  .smart-suggestions {
    background: linear-gradient(135deg, #fefce8 0%, #fef3c7 100%);
    border: 1px solid #fbbf24;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 16px;
    animation: slideInUp 0.4s ease-out;
  }
  
  .smart-suggestions h4 {
    font-size: 14px;
    font-weight: 600;
    color: #92400e;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  
  .smart-suggestions .suggestion-btn {
    background: white;
    border: 1px solid #fbbf24;
    color: #92400e;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 8px;
    margin-bottom: 6px;
    transition: all 0.2s ease;
    display: inline-block;
  }
  
  .smart-suggestions .suggestion-btn:active {
    transform: scale(0.95);
    background: #fbbf24;
    color: white;
  }
}

/* ========================================
   ACCESSIBILITY & KEYBOARD NAVIGATION
   ======================================== */

/* Screen reader only content */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Enhanced focus states for keyboard navigation */

@media (max-width: 1023px) {
  .mobile-flavor-item:focus,
  .mobile-flavor-item.keyboard-focused,
  .mobile-flavor-item button:focus {
    outline: 2px solid #7aa299;
    outline-offset: 2px;
    box-shadow: 
      0 0 0 4px rgba(122, 162, 153, 0.1),
      0 4px 12px rgba(122, 162, 153, 0.15);
  }
  
  .mobile-flavor-item button:focus {
    outline-color: #7aa299;
    z-index: 10;
  }
  
  /* High contrast mode support */
  @media (prefers-contrast: high) {
    .mobile-flavor-item.selected {
      border-color: #000 !important;
      background: #fff !important;
    }
    
    .mobile-flavor-item.high-quantity {
      border-color: #000 !important;
      background: #ffff00 !important;
    }
  }
  
  /* Reduced motion support */
  @media (prefers-reduced-motion: reduce) {
    .mobile-flavor-item,
    .mobile-flavor-item *,
    .smart-suggestions,
    .selection-progress * {
      animation: none !important;
      transition: none !important;
    }
  }
  
  /* High contrast focus indicators */
  @media (prefers-contrast: high) {
    .mobile-flavor-item:focus,
    .mobile-flavor-item button:focus {
      outline: 3px solid #000;
      outline-offset: 2px;
    }
  }
}

/* Touch-friendly enhancements */

@media (pointer: coarse) {
  .mobile-flavor-item .quantity-btn {
    min-width: 44px;
    min-height: 44px;
  }
  
  .mobile-flavor-item .quick-add-btn {
    min-height: 36px;
    padding: 8px 12px;
  }
  
  .mobile-flavor-item .remove-flavor-btn {
    min-width: 32px;
    min-height: 32px;
  }
}

/* 
 * Payment Component Styles
 * Payment form, payment options, and Stripe elements
 */

/* Payment form base styling */

#payment-element {
  min-height: 400px;
}

#stripe-payment-element {
  min-height: 300px;
}

/* Payment option styling - default unselected state */

label div {
  opacity: 0.92;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity, transform, border-color;
}

label div h4,
label div .font-bold,
label div .text-2xl,
label div .text-sm,
label div .text-xs {
  opacity: 0.92;
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover state for unselected payment options */

label:not(:has(input:checked)):hover div {
  opacity: 0.96;
  transform: translateY(-1px);
  border-color: #2d5a4f !important;
  transition: all 0.12s cubic-bezier(0.4, 0, 0.2, 1);
}

label:not(:has(input:checked)):hover div h4,
label:not(:has(input:checked)):hover div .font-bold,
label:not(:has(input:checked)):hover div .text-2xl,
label:not(:has(input:checked)):hover div .text-sm,
label:not(:has(input:checked)):hover div .text-xs {
  opacity: 0.96;
  transition: opacity 0.12s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Selected payment option state */

input[name="checkout-payment-type"]:checked ~ div {
  opacity: 1 !important;
  background: linear-gradient(135deg, rgba(45, 90, 79, 0.08) 0%, rgba(45, 90, 79, 0.05) 50%, rgba(45, 90, 79, 0.03) 100%) !important;
  border-color: #2d5a4f !important;
  border-width: 3px !important;
  transform: translateY(-2px);
  transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.1s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

/* Selected state text */

input[name="checkout-payment-type"]:checked ~ div h4,
input[name="checkout-payment-type"]:checked ~ div .font-bold,
input[name="checkout-payment-type"]:checked ~ div .text-2xl,
input[name="checkout-payment-type"]:checked ~ div .text-sm,
input[name="checkout-payment-type"]:checked ~ div .text-xs {
  opacity: 1 !important;
  transition: none !important;
}

/* Ensure selected state overrides hover */

input[name="checkout-payment-type"]:checked ~ div:hover {
  opacity: 1 !important;
  transform: translateY(-2px) !important;
  border-color: #2d5a4f !important;
  border-width: 3px !important;
  transition: none !important;
}

/* Performance optimization for selected state */

input[name="checkout-payment-type"]:checked ~ div,
input[name="checkout-payment-type"]:checked ~ div:hover,
input[name="checkout-payment-type"]:checked ~ div:focus {
  opacity: 1 !important;
  backface-visibility: hidden;
  transform: translateZ(0);
}

input[name="checkout-payment-type"]:checked ~ div h4,
input[name="checkout-payment-type"]:checked ~ div .font-bold,
input[name="checkout-payment-type"]:checked ~ div .text-2xl,
input[name="checkout-payment-type"]:checked ~ div .text-sm,
input[name="checkout-payment-type"]:checked ~ div .text-xs {
  opacity: 1 !important;
  transition: none !important;
  backface-visibility: hidden;
}

/* Selected option text emphasis */

input[name="checkout-payment-type"]:checked ~ div h4 {
  color: inherit !important;
  font-weight: 900 !important;
}

input[name="checkout-payment-type"]:checked ~ div .font-bold {
  color: inherit !important;
  font-weight: 900 !important;
}

/* 
 * Stripe Integration Styles
 * Hides Stripe Link authentication and related UI elements
 */

/* Hide Stripe Link section completely */

.p-LinkAuthenticationElement,
.p-LinkAuthenticationElement-container,
[data-testid="Link-authentication-element"],
.LinkAuthenticationElement,
.Link,
.p-Link,
[class*="Link"],
[class*="link-authentication"],
[data-testid*="link"],
.ElementsForm .CheckboxInput,
.p-CheckboxInput {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
}

/* Hide any save info checkboxes or Link-related UI */

.p-Element--complete .p-CheckboxInput,
.p-Element .p-CheckboxInput,
[role="checkbox"],
input[type="checkbox"][name*="link"],
input[type="checkbox"][name*="save"] {
  display: none !important;
}

/* 
 * Scroll to Top Button Component
 * Fixed position button for quick navigation to top
 */

/* Scroll to top button */

#scrollToTopBtn {
  display: none;
  position: fixed;
  bottom: 32px;
  left: 32px;
  z-index: 100;
  background: linear-gradient(135deg, #7aa299, #a7c7e7);
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(122, 162, 153, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s, transform 0.2s;
  opacity: 0.85;
}

/* Hover state */

#scrollToTopBtn:hover {
  opacity: 1;
  transform: scale(1.08);
}

/* Active/pressed state */

#scrollToTopBtn:active {
  transform: scale(0.95);
}

/* Show when scrolled */

#scrollToTopBtn.show {
  display: flex;
  animation: fadeInUp 0.3s ease-out;
}

/* Mobile adjustments */

@media (max-width: 768px) {
  #scrollToTopBtn {
    bottom: 100px; /* Position above mobile mini cart */
    left: 24px;
    width: 44px;
    height: 44px;
    font-size: 18px;
    box-shadow: 0 4px 20px rgba(122, 162, 153, 0.4);
  }
}

/* Animation for button appearance */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 0.85;
    transform: translateY(0);
  }
}

/* 
 * Subscription Dashboard Component Styles
 * Extracted from inline styles for better maintainability
 */

/* Custom CSS Variables for Design System */

:root {
  --color-primary: #7aa299;
  --color-primary-light: #9bc4bb;
  --color-primary-dark: #5a7d73;
  --color-secondary: #a7c7e7;
  --color-success: #22c55e;
  --color-warning: #f59e0b;
  --color-error: #ef4444;
  --color-info: #3b82f6;
  --space-unit: 0.25rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --shadow-elevated: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Enhanced animations */

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes progressFill {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

.animate-slide-up {
  animation: slideInUp 0.4s ease-out;
}

.animate-fade-in {
  animation: fadeIn 0.3s ease-out;
}

.animate-fade-in-up {
  animation: fadeInUp 0.4s ease-out forwards;
  opacity: 0;
}

.animate-pulse-dot {
  animation: pulse 2s infinite;
}

.animate-progress {
  animation: progressFill 0.8s ease-out forwards;
  transform-origin: left;
}

.animate-shimmer {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  background-size: 200px 100%;
  animation: shimmer 1.5s infinite;
}

/* Delivery Calendar Component Styles */

.delivery-calendar {
  background: white;
  border-radius: var(--radius-xl);
  border: 1px solid #e5e7eb;
  overflow: hidden;
  box-shadow: var(--shadow-elevated);
}

/* Calendar Header */

.calendar-header {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-bottom: 1px solid #e5e7eb;
  padding: 1.5rem;
}

.calendar-navigation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.nav-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-button:hover {
  background: #f9fafb;
  border-color: #9ca3af;
  color: #374151;
}

.nav-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.current-month-year {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
  min-width: 200px;
  text-align: center;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #6b7280;
}

.legend-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-dot.delivery-scheduled {
  background: var(--color-success);
}

.legend-dot.delivery-overdue {
  background: var(--color-error);
}

.legend-dot.delivery-soon {
  background: var(--color-warning);
}

.legend-dot.delivery-multiple {
  background: var(--color-info);
}

.calendar-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.action-button {
  padding: 0.5rem 1rem;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-button:hover {
  background: var(--color-primary-dark);
  transform: translateY(-1px);
}

/* Calendar Grid */

.calendar-grid {
  padding: 0;
}

.weekday-headers {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
}

.weekday-header {
  padding: 1rem 0.5rem;
  text-align: center;
  font-weight: 600;
  color: #374151;
  font-size: 0.875rem;
}

.weekday-short {
  display: block;
}

.weekday-full {
  display: none;
}

.calendar-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid #f3f4f6;
}

.calendar-week:last-child {
  border-bottom: none;
}

/* Calendar Days */

.calendar-day {
  position: relative;
  min-height: 4rem;
  padding: 0.5rem;
  border-right: 1px solid #f3f4f6;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.calendar-day:last-child {
  border-right: none;
}

.calendar-day:hover {
  background: #f8fafc;
}

.calendar-day:focus {
  background: #eff6ff;
  box-shadow: inset 0 0 0 2px var(--color-info);
  z-index: 10;
}

.calendar-day.selected {
  background: #dbeafe;
  box-shadow: inset 0 0 0 2px var(--color-info);
}

.calendar-day.other-month {
  background: #f9fafb;
  color: #9ca3af;
}

.calendar-day.other-month .day-number {
  opacity: 0.5;
}

.calendar-day.today {
  background: #fef3c7;
  font-weight: 600;
}

.calendar-day.today .day-number {
  color: #92400e;
}

.calendar-day.weekend {
  background: #fafafa;
}

.calendar-day.has-deliveries {
  background: #f0fdf4;
}

.calendar-day.has-overdue {
  background: #fef2f2;
}

.calendar-day.has-soon {
  background: #fefce8;
}

.calendar-day.has-multiple {
  background: #eff6ff;
}

.calendar-day.highlighted {
  animation: pulse 2s infinite;
  background: #ddd6fe !important;
}

.day-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  height: 100%;
  position: relative;
}

.day-number {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
}

/* Delivery Indicators */

.delivery-indicators {
  display: flex;
  gap: 0.125rem;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  margin-top: auto;
}

.delivery-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.delivery-count {
  font-size: 0.625rem;
  color: #6b7280;
  font-weight: 600;
  margin-left: 0.125rem;
}

/* Delivery Tooltip */

.delivery-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 0.5rem;
  background: #1f2937;
  color: white;
  border-radius: 0.5rem;
  padding: 0.75rem;
  font-size: 0.75rem;
  white-space: nowrap;
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.delivery-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: #1f2937;
}

.calendar-day:hover .delivery-tooltip {
  opacity: 1;
}

.delivery-info {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.delivery-info + .delivery-info {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #4b5563;
}

.delivery-name {
  font-weight: 600;
}

.delivery-frequency {
  opacity: 0.8;
}

.delivery-status {
  font-size: 0.625rem;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
}

.delivery-status.high {
  background: rgba(239, 68, 68, 0.2);
  color: #dc2626;
}

.delivery-status.medium {
  background: rgba(245, 158, 11, 0.2);
  color: #d97706;
}

.delivery-status.low {
  background: rgba(34, 197, 94, 0.2);
  color: #16a34a;
}

/* Upcoming Deliveries */

.upcoming-deliveries {
  background: #f8fafc;
  border-top: 1px solid #e5e7eb;
  padding: 1.5rem;
}

.upcoming-deliveries h4 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 1rem 0;
}

.upcoming-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.no-upcoming {
  text-align: center;
  padding: 2rem;
  color: #6b7280;
}

.upcoming-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1rem;
  transition: all 0.2s ease;
}

.upcoming-item:hover {
  border-color: #d1d5db;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.upcoming-item.high {
  border-left: 4px solid var(--color-error);
}

.upcoming-item.medium {
  border-left: 4px solid var(--color-warning);
}

.upcoming-item.low {
  border-left: 4px solid var(--color-success);
}

.upcoming-content {
  flex: 1;
}

.upcoming-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.subscription-name {
  font-weight: 600;
  color: #1f2937;
}

.delivery-date {
  font-size: 0.875rem;
  color: #6b7280;
  font-weight: 500;
}

.upcoming-details {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: #6b7280;
}

.frequency {
  background: #f3f4f6;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
}

.status {
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-weight: 500;
}

.upcoming-actions {
  display: flex;
  gap: 0.5rem;
  margin-left: 1rem;
}

.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: #f3f4f6;
  border: none;
  border-radius: 0.375rem;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-btn:hover {
  background: #e5e7eb;
  color: #374151;
}

.view-btn:hover {
  background: #dbeafe;
  color: var(--color-info);
}

.calendar-btn:hover {
  background: #dcfce7;
  color: var(--color-success);
}

/* Error State */

.calendar-error {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 20rem;
  padding: 2rem;
}

.error-content {
  text-align: center;
  color: #6b7280;
}

.error-icon {
  width: 4rem;
  height: 4rem;
  color: #ef4444;
  margin-bottom: 1rem;
}

.error-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.5rem;
}

.error-content p {
  margin-bottom: 1rem;
}

.retry-btn {
  padding: 0.5rem 1rem;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.retry-btn:hover {
  background: var(--color-primary-dark);
}

/* Mobile Responsive */

@media (max-width: 768px) {
  .calendar-header {
    padding: 1rem;
  }
  
  .calendar-navigation {
    margin-bottom: 0.75rem;
  }
  
  .current-month-year {
    font-size: 1.125rem;
    min-width: 150px;
  }
  
  .calendar-legend {
    gap: 0.75rem;
    margin-bottom: 0.75rem;
  }
  
  .legend-item {
    font-size: 0.75rem;
  }
  
  .weekday-header {
    padding: 0.75rem 0.25rem;
    font-size: 0.75rem;
  }
  
  .weekday-full {
    display: none;
  }
  
  .weekday-short {
    display: block;
  }
  
  .calendar-day {
    min-height: 3rem;
    padding: 0.25rem;
  }
  
  .day-number {
    font-size: 0.75rem;
  }
  
  .delivery-dot {
    width: 0.375rem;
    height: 0.375rem;
  }
  
  .upcoming-deliveries {
    padding: 1rem;
  }
  
  .upcoming-item {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  
  .upcoming-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  
  .upcoming-actions {
    margin-left: 0;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .calendar-header {
    padding: 0.75rem;
  }
  
  .calendar-legend {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }
  
  .calendar-actions {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .action-button {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
  }
  
  .weekday-header {
    padding: 0.5rem 0.125rem;
    font-size: 0.625rem;
  }
  
  .calendar-day {
    min-height: 2.5rem;
    padding: 0.125rem;
  }
  
  .day-number {
    font-size: 0.625rem;
  }
  
  .delivery-indicators {
    gap: 0.0625rem;
  }
  
  .delivery-dot {
    width: 0.25rem;
    height: 0.25rem;
  }
  
  .delivery-count {
    font-size: 0.5rem;
  }
  
  .upcoming-deliveries h4 {
    font-size: 1rem;
  }
}

/* Modern card hover effects with transform scale */

.subscription-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.subscription-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-elevated);
}

/* Status indicators */

.status-active { background: linear-gradient(135deg, #22c55e, #16a34a); }

.status-paused { background: linear-gradient(135deg, #f59e0b, #d97706); }

.status-cancelled { background: linear-gradient(135deg, #ef4444, #dc2626); }

.status-pending { background: linear-gradient(135deg, #3b82f6, #2563eb); }

/* Loading skeleton */

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

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

/* Custom scrollbar */

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

.custom-scrollbar::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border-radius: 3px;
}

/* Tab Navigation Styles */

.tab-button {
  position: relative;
  transition: all 0.3s ease;
}

.tab-button.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary) !important;
}

.tab-button.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-dark));
  border-radius: 2px 2px 0 0;
}

.tab-button:hover:not(.active) {
  background: rgba(122, 162, 153, 0.05);
}

/* Tab Content Transitions */

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

.tab-content-exit {
  animation: fadeOut 0.2s ease-out;
}

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

/* Scrollbar hide for tab navigation */

.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Tab navigation container enhancements */

.tab-navigation-container {
  position: relative;
}

/* Scroll indicator for mobile tabs */

@media (max-width: 768px) {
  .tab-navigation-container::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 1rem;
    background: linear-gradient(to left, rgba(255, 255, 255, 0.9), transparent);
    pointer-events: none;
    z-index: 1;
  }
  
  /* Ensure tab text doesn't wrap */
  .tab-button {
    white-space: nowrap;
    text-overflow: ellipsis;
  }
}

/* Payment method card styles */

.payment-method-card {
  transition: all 0.3s ease;
  cursor: pointer;
}

.payment-method-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* Schedule slot styles */

.time-slot {
  transition: all 0.2s ease;
}

.time-slot:hover:not(.selected) {
  background-color: var(--color-primary-light);
  transform: scale(1.02);
}

.time-slot.selected {
  background-color: var(--color-primary);
  color: white;
  font-weight: 600;
}

/* Quick Action Button Styles with hover transform scale */

.quick-action-btn {
  @apply inline-flex items-center px-4 py-2 bg-white hover:bg-gray-50 text-gray-700 hover:text-gray-900 border border-gray-300 hover:border-gray-400 rounded-lg font-medium text-sm transition-all duration-200 shadow-sm hover:shadow-md transform hover:scale-105;
}

/* Modal Mobile Responsiveness - Critical Fix */

[role="dialog"] {
  /* Ensure modals don't exceed viewport */
  max-height: 100vh !important;
  overflow-y: auto !important;
}

[role="dialog"] > div {
  /* Modal content responsive breakpoints */
  max-height: 90vh !important;
  overflow-y: auto !important;
  /* Smooth scrolling on iOS */
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 640px) {
  [role="dialog"] {
    padding: 1rem !important;
    align-items: flex-start !important;
    padding-top: 2rem !important;
  }
  
  [role="dialog"] > div {
    max-height: calc(100vh - 4rem) !important;
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 1rem !important;
  }
  
  /* Ensure modal content is scrollable */
  .space-y-6, .space-y-4 {
    padding-bottom: 1rem;
  }
}

/* Mobile optimizations */

@media (max-width: 768px) {
  .subscription-card {
    margin-bottom: 1rem;
    padding: 1rem;
  }
  
  .quick-actions {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  /* Mobile subscription card improvements */
  .subscription-card .grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    text-align: center;
  }
  
  .subscription-card .flex.flex-wrap {
    justify-content: center;
  }
  
  .quick-action-btn {
    min-width: 120px;
    justify-content: center;
  }

  /* Enhanced mobile tab styling */
  .tab-button {
    padding: 0.875rem 0.75rem; /* Reduced horizontal padding for mobile */
    font-size: 0.8125rem; /* 13px - slightly smaller but readable */
    min-height: 48px; /* Increased touch target size */
    gap: 0.375rem; /* Reduced gap between icon and text */
    flex-shrink: 0; /* Prevent shrinking */
    min-width: -moz-fit-content;
    min-width: fit-content; /* Allow natural width */
  }

  .tab-button svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0; /* Prevent icon shrinking */
  }

  /* Ensure scrollable tab container has proper spacing */
  nav .flex.overflow-x-auto {
    padding: 0 0.5rem; /* Add horizontal padding to container */
    gap: 0.25rem; /* Small gap between tabs */
  }
  
  /* Improve scrolling on mobile */
  nav .flex.overflow-x-auto {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scroll-padding: 0.5rem;
  }
  
  /* Mobile-specific card enhancements */
  .mobile-card-stack {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .mobile-action-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    transition: all 0.2s ease;
    min-height: 60px;
    touch-action: manipulation;
  }
  
  .mobile-action-button:hover,
  .mobile-action-button:active {
    transform: scale(0.98);
    border-color: var(--color-primary);
    background: rgba(122, 162, 153, 0.05);
  }
  
  .mobile-action-content {
    display: flex;
    align-items: center;
    flex: 1;
  }
  
  .mobile-action-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
  }
  
  .mobile-action-text {
    flex: 1;
  }
  
  .mobile-action-arrow {
    color: #9ca3af;
  }
  
  /* Mobile frequency cards */
  .frequency-card {
    padding: 0.75rem !important;
    text-align: center;
  }
  
  /* Mobile spacing improvements */
  .space-y-6 > * + * {
    margin-top: 1rem !important;
  }
  
  /* Mobile grid responsiveness */
  .grid.grid-cols-1.md\\:grid-cols-2.lg\\:grid-cols-4 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
  }
}

/* Extra small mobile devices */

@media (max-width: 480px) {
  .quick-actions {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  
  .subscription-card {
    padding: 1rem;
  }
  
  .mobile-action-button {
    padding: 0.75rem;
    min-height: 56px;
  }
  
  .mobile-action-icon {
    width: 2rem;
    height: 2rem;
    margin-right: 0.5rem;
  }
  
  /* Further optimize tabs for very small screens */
  .tab-button {
    padding: 0.75rem 0.5rem; /* Even more compact for small screens */
    font-size: 0.75rem; /* 12px for very small screens */
    min-height: 44px;
  }
  
  .tab-button svg {
    width: 0.875rem; /* 14px */
    height: 0.875rem;
  }
  
  /* Reduce text sizes for very small screens */
  .text-2xl {
    font-size: 1.5rem !important;
  }
  
  .text-lg {
    font-size: 1rem !important;
  }
  
  /* Extra small mobile frequency grid */
  .grid.grid-cols-1.md\\:grid-cols-2.lg\\:grid-cols-4 {
    grid-template-columns: 1fr !important;
    gap: 0.5rem !important;
  }
  
  /* Improve button spacing on tiny screens */
  .quick-action-btn {
    min-width: 100px;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
  }
}

/* Reduced motion preferences */

@media (prefers-reduced-motion: reduce) {
  .animate-fade-in,
  .animate-fade-in-up,
  .animate-slide-up,
  .animate-progress,
  .subscription-card,
  .mobile-action-button {
    animation: none !important;
    transition: none !important;
  }
  
  .progress-fill::after {
    animation: none !important;
  }
  
  .subscription-card:hover {
    transform: none !important;
  }
}

/* 
 * Mobile Loading States - KISS Mobile Performance Enhancement
 * Simple skeleton screens and loading indicators for mobile users
 */

/* Skeleton Loading Animation */

@keyframes skeleton-pulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: 0.5rem;
}

/* Mobile-First Product Card Skeleton */

.product-skeleton {
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.product-skeleton .skeleton-image {
  width: 100%;
  height: 200px;
  border-radius: 0.75rem;
  margin-bottom: 1rem;
}

.product-skeleton .skeleton-title {
  height: 1.5rem;
  width: 70%;
  margin-bottom: 0.5rem;
}

.product-skeleton .skeleton-text {
  height: 1rem;
  width: 90%;
  margin-bottom: 0.75rem;
}

.product-skeleton .skeleton-button {
  height: 2.5rem;
  width: 60%;
  margin-top: 1rem;
  border-radius: 0.5rem;
}

/* Mobile Loading Overlay - Simple and Clean */

.mobile-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  -webkit-backdrop-filter: blur(2px);
          backdrop-filter: blur(2px);
}

.mobile-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #f0f0f0;
  border-top: 3px solid #7aa299;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

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

.mobile-loading-text {
  font-size: 1rem;
  color: #666;
  font-weight: 500;
}

/* Progressive Loading States */

.loading-state-1 .product-skeleton:nth-child(n+3) { display: none; }

.loading-state-2 .product-skeleton:nth-child(n+6) { display: none; }

/* Hide skeletons when content loads */

.content-loaded .product-skeleton { display: none; }

/* Mobile Specific Loading Improvements */

@media (max-width: 768px) {
  /* Faster animations on mobile for better perceived performance */
  .skeleton {
    animation-duration: 1.2s;
  }
  
  /* Smaller, mobile-optimized skeletons */
  .product-skeleton {
    padding: 1rem;
    margin-bottom: 1rem;
  }
  
  .product-skeleton .skeleton-image {
    height: 150px;
  }
  
  /* Mobile loading overlay optimization */
  .mobile-loading-overlay {
    background: rgba(255, 255, 255, 0.98);
  }
  
  .mobile-loading-spinner {
    width: 35px;
    height: 35px;
  }
  
  .mobile-loading-text {
    font-size: 0.9rem;
  }
}

/* Touch-friendly loading button states */

@media (pointer: coarse) {
  .skeleton-button {
    height: 3rem; /* Larger touch targets */
  }
}

/* Quick fade-in animation for loaded content */

.fade-in-loaded {
  animation: fadeInLoaded 0.3s ease-out;
}

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

/* Loading state for mobile box preview */

.mobile-box-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  min-height: 100px;
}

.mobile-box-loading .mobile-loading-spinner {
  width: 30px;
  height: 30px;
  margin-bottom: 0;
}

/* Visual effects */

/* 
 * Visual Effects and Decorative Elements
 * Animated blobs, particles, and other visual enhancements
 */

/* Animated gradient floating blob */

.animated-blob {
  position: fixed;
  top: 10%;
  left: 60%;
  width: 300px;
  height: 300px;
  background: linear-gradient(45deg, rgba(122, 162, 153, 0.3), rgba(167, 199, 231, 0.3), rgba(122, 162, 153, 0.2));
  border-radius: 50% 40% 30% 70%;
  animation: blobMove 20s infinite linear;
  z-index: 1;
  pointer-events: none;
  filter: blur(40px);
}

/* Dynamic particles effect */

.particle {
  position: absolute;
  background: linear-gradient(45deg, #7aa299, #a7c7e7);
  border-radius: 50%;
  opacity: 0.6;
  animation: float 3s ease-in-out infinite;
  pointer-events: none;
}

/* Blob movement animation */

@keyframes blobMove {
  0% { 
    transform: rotate(0deg) translate(50px) rotate(0deg); 
  }
  100% { 
    transform: rotate(360deg) translate(50px) rotate(-360deg); 
  }
}

/* Particle float animation */

@keyframes float {
  0%, 100% { 
    transform: translateY(0px) rotate(0deg); 
    opacity: 0.6; 
  }
  50% { 
    transform: translateY(-20px) rotate(180deg); 
    opacity: 0.8; 
  }
}

/* Glow effect for interactive elements */

.glow-effect {
  position: relative;
}

.glow-effect::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, #7aa299, #a7c7e7, #7aa299);
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
  filter: blur(8px);
}

.glow-effect:hover::before {
  opacity: 0.7;
}

/* Animations last - to avoid conflicts with component transitions */

/* 
 * Animation Classes and Keyframes
 * All animations, transitions, and motion effects
 */

/* Animation classes */

.animate-fadeInUp {
  animation: fadeInUp 1s ease-out;
}

.animate-slideInRight {
  animation: slideInRight 0.5s ease-out;
}

.animate-scaleBounce {
  animation: scaleBounce 0.8s ease-in-out;
}

.scale-bounce {
  animation: scale-bounce 0.3s ease-in-out;
}

/* Custom animation durations */

.animate-spin-slow {
  animation-duration: 8s;
}

.animate-bounce-slow {
  animation-duration: 2s;
}

.animate-bounce-medium {
  animation-duration: 2.5s;
}

.animate-bounce-fast {
  animation-duration: 3s;
}

/* Keyframe definitions */

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(40px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes scaleBounce {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes scale-bounce {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
    opacity: 0.6;
  }
  50% {
    transform: translateY(-20px) rotate(180deg);
    opacity: 0.8;
  }
}

@keyframes blobMove {
  0% {
    transform: rotate(0deg) translate(50px) rotate(0deg);
  }
  100% {
    transform: rotate(360deg) translate(50px) rotate(-360deg);
  }
}

/* Box preview animations */

.checkout-stage.hidden {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.checkout-stage:not(.hidden) {
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Animation for box completion */

.box-complete-animation {
  animation: boxCompleteEntry 0.5s ease-out;
}

@keyframes boxCompleteEntry {
  0% {
    transform: translateY(20px);
    opacity: 0.7;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Animated gradient floating blob */

.animated-blob {
  position: fixed;
  top: 10%;
  left: 15%;
  width: 300px;
  height: 300px;
  background: linear-gradient(45deg, rgba(122, 162, 153, 0.3), rgba(167, 199, 231, 0.3), rgba(122, 162, 153, 0.2));
  border-radius: 50% 40% 30% 70%;
  animation: blobMove 20s infinite linear;
  z-index: 1;
  pointer-events: none;
  filter: blur(40px);
}

/* Dynamic particles effect */

.particle {
  position: absolute;
  background: linear-gradient(45deg, #7aa299, #a7c7e7);
  border-radius: 50%;
  opacity: 0.6;
  animation: float 3s ease-in-out infinite;
  pointer-events: none;
}

/* Fly to box animation for cart interactions */

@keyframes flyToBox {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--fly-x, 200px), var(--fly-y, -100px)) scale(0.5);
  }
}

/* Box pulse animation */

@keyframes boxPulse {
  0%, 100% { 
    transform: scale(1); 
  }
  50% { 
    transform: scale(1.05); 
  }
}

/* Additional animation classes */

.fly-to-box {
  animation: flyToBox 0.8s ease-out forwards;
}

.box-pulse {
  animation: boxPulse 0.6s ease-in-out;
}

/* Box Editor Animations */

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

#box-editor-empty .w-20 {
  animation: float 3s ease-in-out infinite;
}