/* Savvy Feaster - Main CSS Framework */
/* Mobile-first, accessible, performance-optimized */
/* Optimized for Core Web Vitals: LCP, FID, CLS */

:root {
  /* Brand Color System — matches app (Bootstrap 5.3) */
  --primary-green: #0d6efd;
  --primary-green-dark: #0b5ed7;
  --secondary-blue: #198754;
  --secondary-blue-dark: #157347;
  --accent-red: #dc3545;
  --accent-red-dark: #bb2d3b;

  /* Neutral Colors — matches app */
  --background-clean: #ffffff;
  --text-charcoal: #212529;
  --white: #ffffff;
  --gray-50: #f8f9fa;
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-600: #6c757d;
  --gray-800: #343a40;
  --gray-900: #212529;
  
  /* Fresh Status Colors */
  --success: var(--primary-green);
  --info: var(--secondary-blue);
  --error: var(--accent-red);
  
  /* Typography — matches app (Bootstrap 5.3 system font stack) */
  --font-primary: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', 'Noto Sans', 'Liberation Sans', Arial, sans-serif;
  --font-serif: Georgia, 'Times New Roman', serif;
  
  /* Performance optimizations */
  --will-change-transform: transform;
  --gpu-acceleration: translateZ(0);
  
  /* Spacing Scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  
  /* Border Radius — matches app (Bootstrap 5.3) */
  --radius-sm: 0.25rem;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 10px;
  --radius-full: 6px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  
  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-base: 200ms ease-in-out;
  --transition-slow: 300ms ease-in-out;
  
  /* Container Sizes */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
}

/* Reset & Base Styles */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

@supports (scroll-behavior: smooth) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  font-family: var(--font-primary);
  color: var(--text-charcoal);
  background-color: var(--background-clean);
  line-height: 1.6;
  font-display: swap;
  text-rendering: optimizeLegibility;
  -webkit-font-feature-settings: "liga", "kern";
  font-feature-settings: "liga", "kern";
}

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

/* Skip to main content */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--primary-green);
  color: var(--white);
  padding: 8px 16px;
  text-decoration: none;
  border-radius: var(--radius-md);
  z-index: 1000;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 6px;
}

/* Typography Scale - with high contrast defaults and improved inheritance */
.text-xs { font-size: 0.75rem; line-height: 1rem; color: inherit; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; color: inherit; }
.text-base { font-size: 1rem; line-height: 1.5rem; color: inherit; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; color: inherit; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; color: inherit; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; color: inherit; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; color: inherit; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; color: inherit; }
.text-5xl { font-size: 3rem; line-height: 1; color: inherit; }
.text-6xl { font-size: 3.75rem; line-height: 1; color: inherit; }

/* Font Weights */
.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* Layout */
.container {
  width: 100%;
  max-width: var(--container-xl);
  margin: 0 auto;
  padding-left: var(--space-lg);
  padding-right: var(--space-lg);
}

.container-sm { max-width: var(--container-sm); }
.container-md { max-width: var(--container-md); }
.container-lg { max-width: var(--container-lg); }

/* Grid System */
.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Flexbox Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }

/* Spacing */
.p-0 { padding: 0; }
.p-1 { padding: var(--space-xs); }
.p-2 { padding: var(--space-sm); }
.p-4 { padding: var(--space-md); }
.p-6 { padding: var(--space-lg); }
.p-8 { padding: var(--space-xl); }
.p-12 { padding: var(--space-2xl); }
.p-16 { padding: var(--space-3xl); }

.py-0 { padding-top: 0; padding-bottom: 0; }
.py-1 { padding-top: var(--space-xs); padding-bottom: var(--space-xs); }
.py-2 { padding-top: var(--space-sm); padding-bottom: var(--space-sm); }
.py-4 { padding-top: var(--space-md); padding-bottom: var(--space-md); }
.py-6 { padding-top: var(--space-lg); padding-bottom: var(--space-lg); }
.py-8 { padding-top: var(--space-xl); padding-bottom: var(--space-xl); }
.py-12 { padding-top: var(--space-2xl); padding-bottom: var(--space-2xl); }
.py-16 { padding-top: var(--space-3xl); padding-bottom: var(--space-3xl); }

.px-4 { padding-left: var(--space-md); padding-right: var(--space-md); }
.px-6 { padding-left: var(--space-lg); padding-right: var(--space-lg); }
.px-8 { padding-left: var(--space-xl); padding-right: var(--space-xl); }

.m-0 { margin: 0; }
.m-1 { margin: var(--space-xs); }
.m-2 { margin: var(--space-sm); }
.m-4 { margin: var(--space-md); }
.m-6 { margin: var(--space-lg); }
.m-8 { margin: var(--space-xl); }

.my-4 { margin-top: var(--space-md); margin-bottom: var(--space-md); }
.my-6 { margin-top: var(--space-lg); margin-bottom: var(--space-lg); }
.my-8 { margin-top: var(--space-xl); margin-bottom: var(--space-xl); }
.my-12 { margin-top: var(--space-2xl); margin-bottom: var(--space-2xl); }

.mx-auto { margin-left: auto; margin-right: auto; }

/* Header & Navigation */
.site-header {
  background: #ffffff;
  border-bottom: 2px solid #0d6efd;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  background-color: rgba(255, 255, 255, 0.98);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  max-width: var(--container-xl);
  margin: 0 auto;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-green);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.logo:hover,
.logo:focus {
  color: var(--primary-green-dark);
}

.nav-menu {
  display: none;
  list-style: none;
  gap: var(--space-lg);
}

.nav-menu a {
  color: var(--text-charcoal);  /* Dark text for good contrast on light header */
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
  position: relative;
}

.nav-menu a:hover,
.nav-menu a:focus {
  color: var(--primary-green);
}

.nav-menu a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-green);
  transition: width var(--transition-fast);
}

.nav-menu a:hover::after,
.nav-menu a:focus::after {
  width: 100%;
}

/* Mobile Menu */
.mobile-menu-button {
  display: block;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--gray-600);
  cursor: pointer;
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  transition: background-color var(--transition-fast);
}

.mobile-menu-button:hover,
.mobile-menu-button:focus {
  background-color: var(--gray-100);
  outline: none;
}

.mobile-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  box-shadow: var(--shadow-lg);
  padding: var(--space-lg);
}

.mobile-menu.active {
  display: block;
}

.mobile-menu ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.mobile-menu a {
  color: var(--text-charcoal);  /* Dark text for good contrast */
  text-decoration: none;
  font-weight: 500;
  padding: var(--space-md);
  border-radius: var(--radius-md);
  transition: background-color var(--transition-fast);
}

.mobile-menu a:hover,
.mobile-menu a:focus {
  background-color: var(--gray-50);
  color: var(--primary-green);
}

@media (min-width: 768px) {
  .nav-menu {
    display: flex;
  }
  
  .mobile-menu-button {
    display: none;
  }
}

/* Buttons - Optimized for interactions */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md) var(--space-xl);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  border: none;
  border-radius: var(--radius-full);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
  /* Performance optimizations */
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn:focus {
  outline: 2px solid var(--primary-green);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--primary-green);
  color: var(--white);
  font-weight: 400;
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--primary-green-dark);
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.btn-secondary {
  background: transparent;
  color: var(--primary-green);
  border: 2px solid var(--primary-green);
}

.btn-secondary:hover,
.btn-secondary:focus {
  background: var(--primary-green);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 2px solid var(--white);
}

.btn-outline:hover,
.btn-outline:focus {
  background: var(--white);
  color: var(--primary-green);
}

.btn-lg {
  padding: var(--space-lg) var(--space-2xl);
  font-size: 1.125rem;
}

.btn-sm {
  padding: var(--space-sm) var(--space-lg);
  font-size: 0.875rem;
}

/* Cards */
.card {
  background: #f0f4ff;
  border-radius: var(--radius-xl);
  border: 1px solid #dee2e6;
  box-shadow: none;
  padding: var(--space-xl);
  transition: all var(--transition-base);
  /* Prevent layout shifts */
  min-height: 200px;
  content-visibility: auto;
  contain-intrinsic-size: 0 200px;
}

.card .card-icon {
  color: #0d6efd;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}


.card-header {
  margin-bottom: var(--space-lg);
}

.card-icon {
  font-size: 3rem;
  margin-bottom: var(--space-lg);
  display: block;
}

.card-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-charcoal);  /* Dark text for better contrast on white cards */
  margin-bottom: var(--space-md);
}

.card-description {
  color: #1F2937 !important;  /* Force dark charcoal for maximum contrast */
  margin-bottom: var(--space-lg);
}

/* Ensure card text is always readable */
@media (prefers-color-scheme: dark) {
  .card-title {
    color: var(--white) !important;  /* White titles on dark cards */
  }
  
  .card-description {
    color: var(--gray-200) !important; /* Light text for maximum contrast on dark cards */
  }
}

/* Hero Section - Optimized for LCP */
.hero {
  background: linear-gradient(135deg, var(--primary-green) 0%, var(--secondary-blue) 100%);
  color: var(--white);  /* Pure white text on colored gradient for maximum contrast */
  padding: var(--space-3xl) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
  /* Critical for LCP optimization */
  content-visibility: auto;
  contain-intrinsic-size: 0 600px;
  /* Reduce paint times */
  transform: translateZ(0);
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="1" fill="white" opacity="0.1"/></svg>') repeat;
  background-size: 50px 50px;
  animation: float 20s ease-in-out infinite;
}

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

/* Reduce motion for accessibility and performance */
@media (prefers-reduced-motion: reduce) {
  .hero::before {
    animation: none !important;
  }
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--space-lg);
  color: var(--white) !important;  /* Force white text for maximum contrast */
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);  /* Add shadow for better readability */
}

.hero-subtitle {
  font-size: 1.25rem;
  color: #FFFFFF !important;  /* Pure white for maximum contrast */
  opacity: 1;  /* Remove opacity that reduces contrast */
  margin-bottom: var(--space-2xl);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5) !important;  /* Stronger shadow for better readability */
}

.hero-cta {
  display: flex;
  gap: var(--space-lg);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-xl);
}

/* Trust Indicators */
.trust-bar {
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
  flex-wrap: wrap;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.875rem;
  color: var(--white) !important;  /* White text for contrast */
  opacity: 1;  /* Remove opacity that reduces contrast */
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);  /* Add shadow for better readability */
}

/* Forms */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: var(--space-sm);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: var(--space-md);
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 1rem;
  transition: border-color var(--transition-fast);
  background: var(--white);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary-green);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.form-error {
  color: var(--error);
  font-size: 0.875rem;
  margin-top: var(--space-sm);
}

.form-success {
  color: var(--success);
  font-size: 0.875rem;
  margin-top: var(--space-sm);
}

/* Accordion */
.accordion-item {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  overflow: hidden;
}

.accordion-header {
  width: 100%;
  padding: var(--space-lg);
  background: var(--gray-50);
  border: none;
  text-align: left;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color var(--transition-fast);
}

.accordion-header:hover,
.accordion-header:focus {
  background: var(--gray-100);
  outline: none;
}

.accordion-icon {
  transition: transform var(--transition-fast);
}

.accordion-item.active .accordion-icon {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-base);
}

.accordion-item.active .accordion-content {
  max-height: 1000px;
}

.accordion-body {
  padding: var(--space-lg);
}

/* Footer */
.site-footer {
  background: #1e293b;  /* Dark background */
  color: #e2e8f0;  /* Light gray text */
  padding: var(--space-3xl) 0 var(--space-xl);
  margin-top: var(--space-3xl);
}

.footer-content {
  display: grid;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.footer-section h3 {
  color: #ffffff !important;  /* Pure white for headings */
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: var(--space-lg);
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.footer-section p {
  color: #cbd5e1 !important;  /* Light gray for paragraph text */
  line-height: 1.6;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.footer-links a {
  color: #cbd5e1 !important;  /* Light gray for links */
  text-decoration: none;
  transition: color var(--transition-fast);
  font-weight: 400;
}

.footer-links a:hover,
.footer-links a:focus {
  color: #ffffff !important;  /* White on hover */
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid var(--gray-800);
  padding-top: var(--space-lg);
  text-align: center;
  font-size: 0.875rem;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }

/* Reduced opacity classes - use sparingly to maintain contrast */
.opacity-90 { opacity: 0.9; }
/* Removed lower opacity classes to prevent contrast issues */

.bg-gray-50 { background-color: var(--gray-50); }
.bg-gray-100 { background-color: var(--gray-100); }
.bg-white { background-color: var(--white); }

.text-gray-600 { color: #1F2937; } /* Dark charcoal for maximum contrast - 10.7:1 ratio */
.text-dark-readable { color: var(--text-charcoal); } /* High contrast dark text */
.text-gray-800 { color: var(--text-charcoal); }
.text-light { color: var(--gray-100); }      /* Light text utility */
.text-lighter { color: var(--gray-200); }    /* Even lighter text utility */
.text-dark-readable { color: var(--text-charcoal); } /* Dark readable text */
.text-primary { color: var(--primary-green); }
.text-white { color: var(--white) !important; }

.border-none { border: none; }
.border { border: 1px solid var(--gray-300); }
.border-t { border-top: 1px solid var(--gray-300); }
.border-b { border-bottom: 1px solid var(--gray-300); }

.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

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

/* Responsive Design - Performance optimized */
@media (min-width: 768px) {
  .container {
    padding-left: var(--space-xl);
    padding-right: var(--space-xl);
  }
  
  .hero-title {
    font-size: 3.75rem;
    /* Prevent layout shift */
    line-height: 1.1;
  }
  
  .hero-subtitle {
    font-size: 1.5rem;
  }
  
  .footer-content {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .hero-cta {
    flex-wrap: nowrap;
  }
  
  /* Optimize for larger screens */
  .card:hover {
    transform: translate3d(0, -4px, 0);
  }
}

@media (min-width: 1024px) {
  .footer-content {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .grid-auto-fit {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
}

/* Print Styles - Performance optimized */
@media print {
  * {
    background: transparent !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
  
  .site-header,
  .site-footer,
  .btn,
  .mobile-menu-button {
    display: none !important;
  }
  
  .hero {
    background: none !important;
    color: var(--text-charcoal) !important;
  }
  
  .card {
    box-shadow: none !important;
    border: 1px solid var(--gray-300) !important;
    break-inside: avoid;
  }
  
  h2, h3 {
    page-break-after: avoid;
  }
  
  p {
    orphans: 3;
    widows: 3;
  }
}

/* Fresh Savings Theme Enhancements */
.deal-highlight {
  background: var(--accent-red);
  color: var(--white) !important;  /* Force white text for maximum contrast */
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.875rem;
}

.savings-badge {
  background: linear-gradient(45deg, var(--primary-green), var(--secondary-blue));
  color: var(--white) !important;  /* Force white text for maximum contrast */
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-full);
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);  /* Stronger shadow for better readability */
}

.price-highlight {
  color: var(--accent-red);
  font-weight: 700;
  font-size: 1.25rem;
}

.fresh-card {
  background: var(--white);
  border: 2px solid var(--primary-green);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: var(--space-xl);
  transition: all var(--transition-base);
}

.fresh-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--secondary-blue);
}

.grocery-icon {
  color: var(--primary-green);
  background: linear-gradient(135deg, var(--primary-green), var(--secondary-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.btn-deal {
  background: var(--accent-red);
  color: var(--white);
  font-weight: 700;
  border: none;
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-full);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-deal:hover,
.btn-deal:focus {
  background: var(--accent-red-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.fresh-gradient {
  background: linear-gradient(135deg, var(--primary-green) 0%, var(--secondary-blue) 50%, var(--accent-red) 100%);
}

.food-category {
  background: var(--white);
  border: 2px solid var(--primary-green);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
  transition: all var(--transition-base);
  color: var(--text-charcoal) !important; /* Force dark readable text */
}

@media (prefers-color-scheme: dark) {
  .food-category {
    background: var(--gray-800);
    color: var(--white) !important;  /* White text on dark background */
    border-color: var(--primary-green);
  }
}

.food-category:hover {
  background: var(--primary-green);
  color: var(--white) !important;  /* White text for maximum contrast on green background */
  transform: scale(1.02);
}

/* Performance-focused additions */
.lazy-load {
  content-visibility: auto;
  contain-intrinsic-size: 0 400px;
}

/* Critical Path Optimization */
.above-fold {
  content-visibility: visible;
}

.below-fold {
  content-visibility: auto;
  contain-intrinsic-size: 0 200px;
}

/* Improved button performance */
.btn:active {
  transform: scale(0.98);
}

/* Optimize images for mobile */
@media (max-width: 767px) {
  .phone-mockup {
    max-width: 280px;
    margin: 0 auto;
  }
}

/* Dark Mode Support - Updated for Fresh Savings with Proper Contrast */
@media (prefers-color-scheme: dark) {
  :root {
    --background-clean: #1e293b;
    --text-charcoal: #f8fafc;  /* Light text on dark background */
    --white: #ffffff;          /* Keep white as white for proper contrast */
    --gray-50: #334155;        /* Darker grays for dark mode */
    --gray-100: #475569;
    --gray-200: #64748b;
    --gray-300: #94a3b8;
    --gray-600: #cbd5e1;       /* Light gray for readable text */
    --gray-800: #e2e8f0;       /* Very light gray for headings */
    --gray-900: #f1f5f9;       /* Almost white for maximum contrast */
  }
  
  body {
    background-color: var(--background-clean);
    color: var(--text-charcoal);
  }
  
  .site-header {
    background-color: rgba(30, 41, 59, 0.95);
    border-bottom-color: var(--gray-600);
  }
  
  .fresh-card {
    background: var(--gray-50);  /* Dark card background */
    border-color: var(--primary-green);
    color: var(--text-charcoal); /* Light text */
  }
  
  .card {
    background: var(--gray-50);  /* Dark card background */
    color: var(--text-charcoal); /* Light text */
  }
  
  .accordion-header {
    background: var(--gray-100);
    color: var(--text-charcoal);
  }
  
  .accordion-header:hover,
  .accordion-header:focus {
    background: var(--gray-200);
  }
  
  .form-input,
  .form-textarea,
  .form-select {
    background: var(--gray-50);
    color: var(--text-charcoal);
    border-color: var(--gray-300);
  }
}

/* Critical performance CSS */
/* Prevent FOUC */
.no-js .lazy-load {
  content-visibility: visible;
}

/* GPU-accelerated scrolling */
@supports (transform: translate3d(0,0,0)) {
  .smooth-scroll {
    transform: translate3d(0,0,0);
  }
}

/* WCAG AA Contrast Compliance - Force readable text everywhere */
/* Override any low-contrast text on dark backgrounds */
@media (prefers-color-scheme: dark) {
  /* Ensure ALL paragraph text is readable */
  p, span, div, li, td, th {
    color: var(--gray-300) !important;
  }
  
  /* Headings should be even more prominent */
  h1, h2, h3, h4, h5, h6 {
    color: var(--gray-100) !important;
  }
  
  /* Small text needs higher contrast */
  .text-xs, .text-sm, small {
    color: var(--gray-200) !important;
  }
  
  /* Navigation links */
  .nav-menu a {
    color: var(--gray-300) !important;
  }
  
  .nav-menu a:hover,
  .nav-menu a:focus {
    color: var(--primary-green) !important;
  }
  
  /* Mobile menu */
  .mobile-menu a {
    color: var(--gray-300) !important;
  }
  
  /* Footer text */
  .site-footer {
    color: var(--gray-300) !important;
  }
  
  .footer-links a {
    color: var(--gray-300) !important;
  }
  
  .footer-links a:hover,
  .footer-links a:focus {
    color: var(--white) !important;
  }
}

/* Light mode - ensure dark text has enough contrast too */
body {
  color: var(--text-charcoal); /* Dark text on light background */
}

/* Force minimum contrast ratios for accessibility */
.min-contrast-text {
  color: #1F2937; /* Ensures 4.5:1 contrast on light backgrounds */
}

/* High contrast text utilities */
.text-high-contrast {
  color: #111827; /* Nearly black for maximum contrast */
}

.text-readable {
  color: #374151; /* Dark gray with 4.5:1+ contrast ratio */
}

@media (prefers-color-scheme: dark) {
  .min-contrast-text {
    color: var(--gray-200) !important; /* Ensures 4.5:1 contrast on dark backgrounds */
  }
  
  .text-high-contrast {
    color: #F9FAFB !important; /* Nearly white for maximum contrast */
  }
  
  .text-readable {
    color: #D1D5DB !important; /* Light gray with 4.5:1+ contrast ratio */
  }
}

/* Emergency override for any missed dark text on dark backgrounds */
@media (prefers-color-scheme: dark) {
  /* Catch any remaining dark text */
  [style*="color: #1e293b"],
  [style*="color: #334155"],
  [style*="color: #475569"] {
    color: var(--gray-200) !important;
  }
}

/* HIGH CONTRAST ENFORCEMENT - Override all low contrast text */
/* Force maximum contrast for all critical elements */

/* Hero section - WHITE TEXT on colored backgrounds */
.hero, .hero *:not(.carousel-btn):not(.carousel-btn *) {
  color: var(--white) !important;
}

.hero h1, .hero h2, .hero h3, .hero h4, .hero h5, .hero h6 {
  color: var(--white) !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero p, .hero span, .hero div {
  color: var(--white) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Buttons - Force white text on colored backgrounds */
.btn-primary, .btn-deal, .savings-badge, .deal-highlight {
  color: var(--white) !important;
  font-weight: 700 !important;
}

/* Cards - Dark text on light backgrounds, light text on dark backgrounds */
.card, .fresh-card {
  background: #f0f4ff !important;
}

.card *, .fresh-card * {
  color: #1F2937 !important; /* Use specific high-contrast color */
}

.card .card-icon,
.card .card-icon *,
.fresh-card .card-icon,
.fresh-card .card-icon * {
  color: #0d6efd !important;
}

.card ul li, .fresh-card ul li {
  color: #374151 !important; /* Slightly lighter for list items but still high contrast */
}

.card h1, .card h2, .card h3, .card h4, .card h5, .card h6,
.fresh-card h1, .fresh-card h2, .fresh-card h3, .fresh-card h4, .fresh-card h5, .fresh-card h6 {
  color: var(--text-charcoal) !important;
  font-weight: 700;
}

/* Navigation - Dark text on light header */
.site-header, .site-header * {
  color: var(--text-charcoal) !important;
}

.logo {
  color: var(--primary-green) !important;
}

/* Blog Post Styles */
.blog-post {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.post-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 2px solid #e5e7eb;
}

.post-header h1 {
  font-size: 2.5rem;
  line-height: 1.2;
  color: #1e293b;
  margin-bottom: 1rem;
  font-weight: 800;
}

.post-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  color: #64748b;
  font-size: 0.875rem;
}

.meta-separator {
  color: #cbd5e1;
}

.post-content {
  font-size: 1.125rem;
  line-height: 1.8;
  color: #334155;
}

.post-content p {
  margin-bottom: 1.5rem;
  color: #334155 !important;
}

.post-content h2 {
  font-size: 1.875rem;
  color: #1e293b;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  font-weight: 700;
  padding-top: 1rem;
}

.post-content h3 {
  font-size: 1.5rem;
  color: #1e293b;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.post-content ul,
.post-content ol {
  margin-bottom: 1.5rem;
  padding-left: 2rem;
  color: #334155;
}

.post-content li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
}

.post-content .lead {
  font-size: 1.25rem;
  line-height: 1.6;
  color: #475569;
  font-weight: 500;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.tip-box,
.savings-highlight {
  background: #f0fdf4;
  border-left: 4px solid #0d6efd;
  padding: 1.5rem;
  margin: 2rem 0;
  border-radius: 0.5rem;
}

.tip-box h3,
.savings-highlight h3 {
  color: #0b5ed7;
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.tip-box p,
.savings-highlight p {
  margin-bottom: 0;
  color: #1e293b !important;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  font-size: 0.875rem;
}

.breadcrumbs a {
  color: #0d6efd;
  text-decoration: none;
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

.breadcrumb-separator {
  color: #cbd5e1;
}

.breadcrumb-current {
  color: #64748b;
}

/* Footer - High contrast text on dark background */
.site-footer {
  background-color: #1e293b !important;
}

.site-footer h1, 
.site-footer h2, 
.site-footer h3, 
.site-footer h4, 
.site-footer h5, 
.site-footer h6 {
  color: #ffffff !important;
  font-weight: 700 !important;
}

.site-footer p,
.site-footer span,
.site-footer div:not(.footer-section) {
  color: #cbd5e1 !important;
}

.site-footer a {
  color: #cbd5e1 !important;
}

.site-footer a:hover {
  color: #ffffff !important;
}

/* Forms - Dark text on light inputs */
.form-input, .form-textarea, .form-select {
  background: var(--white) !important;
  color: var(--text-charcoal) !important;
  border: 2px solid var(--gray-300);
}

.form-label {
  color: var(--text-charcoal) !important;
  font-weight: 600;
}

/* Gradient backgrounds - ALWAYS white text */
.fresh-gradient, .fresh-gradient * {
  color: var(--white) !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Price highlights - High contrast red */
.price-highlight {
  color: var(--accent-red) !important;
  font-weight: 700 !important;
}

/* Dark mode overrides */
@media (prefers-color-scheme: dark) {
  /* Cards become dark with light text */
  .card, .fresh-card {
    background: var(--gray-800) !important;
  }
  
  .card *, .fresh-card * {
    color: var(--white) !important;
  }
  
  /* Header becomes dark */
  .site-header {
    background-color: rgba(30, 41, 59, 0.95) !important;
  }
  
  .site-header *, .nav-menu a, .mobile-menu a {
    color: var(--gray-200) !important;
  }
  
  .logo {
    color: var(--primary-green) !important;
  }
  
  /* Forms in dark mode */
  .form-input, .form-textarea, .form-select {
    background: var(--gray-700) !important;
    color: var(--white) !important;
    border-color: var(--gray-500);
  }
  
  .form-label {
    color: var(--gray-200) !important;
  }
  
  /* Food categories in dark mode */
  .food-category {
    background: var(--gray-700) !important;
    color: var(--white) !important;
  }
}

/* Accessibility - Minimum contrast ratios */
/* WCAG AA compliant (4.5:1 for normal text, 3:1 for large text) */
.min-contrast {
  color: var(--text-charcoal) !important;
}

@media (prefers-color-scheme: dark) {
  .min-contrast {
    color: var(--gray-200) !important;
  }
}

/* Remove any remaining opacity that reduces contrast */
.hero-subtitle, .trust-item {
  opacity: 1 !important;
}

/* Ensure hero section maintains perfect white text contrast */
.hero .trust-item {
  color: #FFFFFF !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  font-weight: 500;
}

.hero .trust-item span {
  color: #FFFFFF !important;
}

/* Ensure all text in colored sections is white */
.bg-primary, .bg-secondary, .bg-accent,
[style*="background: linear-gradient"],
[style*="background-color: #0d6efd"],
[style*="background-color: #198754"],
[style*="background-color: #dc3545"] {
  color: var(--white) !important;
}

.bg-primary *, .bg-secondary *, .bg-accent *,
[style*="background: linear-gradient"] *,
[style*="background-color: #0d6efd"] *,
[style*="background-color: #198754"] *,
[style*="background-color: #dc3545"] * {
  color: var(--white) !important;
}

/* COMPREHENSIVE CONTRAST FIXES */
/* Override all instances of common low-contrast colors */

/* Fix light gray text (#666, #999, etc.) on light backgrounds */
[style*="color: #666"],
[style*="color: #777"],
[style*="color: #888"],
[style*="color: #999"],
.text-gray-500,
.text-gray-400 {
  color: #374151 !important; /* High contrast dark gray */
}

/* Light backgrounds MUST have dark text */
.bg-white *, .bg-gray-50 *, .bg-gray-100 *,
[style*="background-color: white"] *,
[style*="background-color: #ffffff"] *,
[style*="background-color: #f8f9fa"] *,
[style*="background-color: #f0f0f0"] * {
  color: #1F2937 !important;
}

/* Colored backgrounds MUST have white text */
[style*="background: linear-gradient"],
[style*="background-color: #0d6efd"],
[style*="background-color: #198754"],
[style*="background-color: #dc3545"],
.bg-green-500, .bg-blue-500, .bg-red-500 {
  color: #FFFFFF !important;
}

/* Section-specific fixes */
.py-16.bg-gray-50 h2,
.py-16.bg-gray-50 h3,
.py-16.bg-gray-50 p {
  color: #1F2937 !important; /* Force dark text on light section backgrounds */
}

/* Card content must be readable */
.card p, .card span, .card div:not(.card-icon),
.fresh-card p, .fresh-card span, .fresh-card div:not(.feature-icon) {
  color: #374151 !important;
}

.card h1, .card h2, .card h3, .card h4, .card h5, .card h6,
.fresh-card h1, .fresh-card h2, .fresh-card h3, .fresh-card h4, .fresh-card h5, .fresh-card h6 {
  color: #1F2937 !important;
  font-weight: 700;
}

/* List items in cards */
.card ul li, .fresh-card ul li {
  color: #374151 !important;
}

/* Feature cards specific fixes */
.feature-card, .feature-card * {
  color: #1F2937 !important;
}

.feature-card .feature-icon,
.feature-card .feature-icon * {
  color: #0d6efd !important;
}

.feature-title {
  color: #0b5ed7 !important; /* Darker green for better contrast */
  font-weight: 700 !important;
}

.feature-description, .feature-benefits li {
  color: #374151 !important;
}

/* Stats and highlights */
.stat-label {
  color: #374151 !important;
  font-weight: 500 !important;
}

/* Phone mockup content */
.phone-mockup .screen * {
  color: #1F2937 !important;
}

/* Override any remaining light text on light backgrounds */
.text-light, .text-muted, .text-secondary {
  color: #374151 !important;
}

/* Ensure all paragraph text has sufficient contrast */
p {
  color: inherit;
}

/* Light sections must have dark text */
.bg-gray-50 p, .bg-gray-100 p, .bg-white p,
.py-16.bg-gray-50 *, .py-16.bg-white *:not(.btn):not(.hero *) {
  color: #1F2937 !important;
}

/* Trust indicators in hero - force white */
.trust-bar .trust-item,
.trust-bar .trust-item * {
  color: #FFFFFF !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5) !important;
}

/* Final safety net - if text is on a white/light background, make it dark */
.bg-white, .bg-gray-50, .bg-gray-100,
[style*="background: white"],
[style*="background: #ffffff"],
[style*="background: #f8f9fa"],
[style*="background: #f0f0f0"] {
  color: #1F2937 !important;
}

/* Emergency override for missed cases */
.card-description strong {
  color: #1F2937 !important;
  font-weight: 700;
}

/* Accessibility compliance - minimum 4.5:1 contrast ratio */
.wcag-compliant-text {
  color: #374151; /* 4.65:1 contrast ratio on white */
}

.wcag-compliant-heading {
  color: #1F2937; /* 10.73:1 contrast ratio on white */
}

/* Apply to common elements */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-charcoal);
}

p, span, div, li {
  color: inherit;
}