:root {
  --primary-50: #f0fdf4;
  --primary-100: #dcfce7;
  --primary-500: #22c55e;
  --primary-600: #16a34a;
  --primary-700: #15803d;
  --primary-800: #166534;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-900: #0f172a;
  --shadow-lg: 0 10px 20px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--gray-900);
  background: #fff;
  overflow-x: hidden;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--gray-200);
  backdrop-filter: blur(12px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 20px;
}

.logo-badge {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-600);
  color: #fff;
  border-radius: 10px;
  font-weight: 700;
  line-height: 1;
}

.nav-links {
  display: flex;
  gap: 18px;
  align-items: center;
}

.nav-links a {
  color: var(--gray-700);
  font-weight: 600;
  font-size: 14px;
}

.nav-links a.active {
  color: var(--primary-600);
}

.nav-cta {
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--primary-600);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.mobile-menu-toggle span {
  width: 24px;
  height: 3px;
  background: var(--gray-700);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(7px, 7px);
}
.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

.hero {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 25%, #fff 100%);
  padding: 80px 0 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.05);
  pointer-events: none;
  animation: float 8s ease-in-out infinite;
}

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

.hero h1 {
  font-size: 48px;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
  animation: slideInDown 0.6s ease-out;
}

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

.hero p {
  font-size: 18px;
  color: var(--gray-600);
  max-width: 760px;
  margin: 0 auto 28px;
  position: relative;
  z-index: 1;
  animation: fadeIn 0.6s ease-out 0.2s both;
}

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

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
  animation: fadeIn 0.6s ease-out 0.3s both;
}

.hero-tags {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  color: var(--gray-600);
}

.hero-meta {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  color: var(--gray-600);
  font-size: 14px;
  margin-bottom: 18px;
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.hero-meta span:hover {
  transform: translateY(-1px);
  border-color: var(--primary-500);
  color: var(--primary-700);
}

.section {
  padding: 60px 0;
}

.section[id] {
  scroll-margin-top: 90px;
}

.section-title {
  text-align: center;
  margin-bottom: 32px;
}

.section-title h2 {
  font-size: 32px;
  margin: 0 0 10px;
}

.section-title p {
  color: var(--gray-600);
  margin: 0;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border: 2px solid var(--gray-200);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  background: #fff;
}

.search-box input {
  border: none;
  outline: none;
  width: 100%;
  font-size: 16px;
  transition: all 0.3s ease;
}

.search-box input:focus {
  box-shadow: inset 0 0 0 2px var(--primary-500);
  background: rgba(34, 197, 94, 0.02);
}

.recent-searches {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--gray-600);
  font-size: 13px;
}

.recent-searches button {
  border: none;
  background: var(--gray-100);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.popular-searches {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--gray-600);
  font-size: 13px;
}

.popular-searches button {
  border: 1px solid var(--gray-200);
  background: #fff;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.popular-searches button:hover {
  border-color: var(--primary-500);
  color: var(--primary-600);
  transform: translateY(-1px);
}

.results-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 24px 0 16px;
}

.results-grid,
.popular-grid,
.blog-grid,
.steps-grid,
.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.steps-grid .card {
  border: 2px solid var(--gray-200);
  border-left: 4px solid var(--primary-500);
}

.steps-grid .card:hover {
  border-color: var(--primary-600);
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--primary-100);
  color: var(--primary-600);
  font-weight: 700;
  margin-bottom: 10px;
}

.step-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--primary-50);
  color: var(--primary-700);
  font-size: 18px;
  margin-bottom: 8px;
}

.faq-item {
  border: 2px solid var(--gray-200);
  border-radius: 16px;
  padding: 12px 14px;
  background: #fff;
}

.faq-question {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: none;
  background: none;
  padding: 4px 2px;
  cursor: pointer;
  font-weight: 600;
  color: var(--gray-800);
  text-align: left;
  font-size: 15px;
}

.faq-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-size: 12px;
  transition: transform 0.2s ease;
}

.faq-answer {
  margin-top: 6px;
}

.faq-answer p {
  margin: 8px 0 0;
  color: var(--gray-600);
}

.faq-item.open .faq-answer {
  /* Handled by JavaScript inline styles */
}

.faq-item.open .faq-icon {
  transform: rotate(90deg);
}

.blog-carousel {
  position: relative;
  display: flex;
  align-items: center;
}

.blog-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 1fr);
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 6px 2px;
  width: 100%;
}

.blog-track .card {
  scroll-snap-align: start;
  cursor: pointer;
}

.blog-track::-webkit-scrollbar {
  display: none;
}

.carousel-btn {
  border: none;
  background: var(--primary-600);
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  box-shadow: var(--shadow-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}

.carousel-btn span {
  font-size: 22px;
  line-height: 1;
}

.carousel-btn.prev {
  left: -18px;
}

.carousel-btn.next {
  right: -18px;
}

.carousel-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.carousel-dots {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gray-300);
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.carousel-dot.active {
  background: var(--primary-600);
  transform: scale(1.25);
}

.card {
  border: 2px solid var(--gray-200);
  border-left: 4px solid var(--primary-500);
  border-radius: 16px;
  padding: 16px;
  background: #fff;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  animation: slideUp 0.5s ease-out backwards;
}

.card:hover {
  transform: scale(1.02) translateY(-4px);
  box-shadow: 0 15px 30px rgba(22, 101, 52, 0.15);
  border-color: var(--primary-400);
}

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

/* Category-based border colors */
.card[data-category="Vegetables"] {
  border-left-color: #22c55e;
}

.card[data-category="Meat"],
.card[data-category="Poultry"],
.card[data-category="Fish"] {
  border-left-color: #f43f5e;
}

.card[data-category="Nuts"],
.card[data-category="Seeds"] {
  border-left-color: #b45309;
}

.card[data-category="Dairy"],
.card[data-category="Cheese"] {
  border-left-color: #f59e0b;
}

.card[data-category="Fruits"],
.card[data-category="Berries"] {
  border-left-color: #ec4899;
}

.card[data-category="Oils"],
.card[data-category="Condiments"] {
  border-left-color: #8b5cf6;
}

.card h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.card .badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--gray-100);
  color: var(--gray-700);
  font-size: 12px;
  font-weight: 600;
}

.card .net-carbs {
  margin: 12px 0;
  padding: 12px;
  border-radius: 12px;
  border: 2px solid #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.card .net-carbs.medium {
  border-color: #fde68a;
  background: #fffbeb;
  color: #b45309;
}

.card .net-carbs.high {
  border-color: #fdba74;
  background: #fff7ed;
  color: #c2410c;
}

.card .grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.stat {
  background: var(--gray-100);
  padding: 10px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--gray-700);
}

.stat strong {
  display: block;
  font-size: 16px;
  color: var(--gray-900);
}

.serving-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.serving-row input {
  width: 70px;
  padding: 6px 8px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
}

.cta-banner {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-800));
  color: #fff;
  padding: 26px;
  border-radius: 18px;
  text-align: center;
}

.cta-banner .btn {
  padding: 12px 18px;
  font-size: 15px;
}

.footer {
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
  padding: 40px 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
}

.footer h4 {
  margin: 0 0 12px;
}

.footer a {
  display: block;
  color: var(--gray-600);
  margin-bottom: 8px;
  font-size: 14px;
}

.notice {
  padding: 10px 12px;
  border-radius: 10px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 13px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 40;
}

.modal-content {
  background: #fff;
  padding: 20px;
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
}

.modal-content h3 {
  margin-top: 0;
}

.modal-content input,
.modal-content textarea {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 10px;
  border-radius: 10px;
  border: 1px solid var(--gray-300);
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn-primary {
  background: var(--primary-600);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-700);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
}

.btn-secondary:hover {
  background: var(--gray-200);
  transform: translateY(-1px);
}

.btn:focus-visible {
  outline: 3px solid rgba(34, 197, 94, 0.35);
  outline-offset: 2px;
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.article-meta {
  margin-top: 6px;
  color: var(--gray-600);
  font-size: 13px;
}

.article-related {
  margin-top: 32px;
  padding: 16px;
  border: 2px solid var(--gray-200);
  border-radius: 16px;
  background: var(--gray-50);
}

.article-related h3 {
  margin: 0 0 12px;
  font-size: 18px;
}

.related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.related-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--gray-200);
  font-weight: 600;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.related-links a:hover {
  color: var(--primary-600);
  border-color: var(--primary-500);
  transform: translateY(-1px);
}

/* Modern form styles for request-feature page */
form input[type="text"],
form input[type="email"],
form select,
form textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--gray-200);
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  transition: all 0.2s ease;
  background: #fff;
  color: var(--gray-900);
}

form select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23475569' d='M4.427 6.427l3.396 3.396a.25.25 0 00.354 0l3.396-3.396A.25.25 0 0011.396 6H4.604a.25.25 0 00-.177.427z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
}

form input[type="text"]:focus,
form input[type="email"]:focus,
form select:focus,
form textarea:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

form input[type="text"]::placeholder,
form input[type="email"]::placeholder,
form textarea::placeholder {
  color: #94a3b8;
}

form textarea {
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
}

form label {
  display: block;
  margin-bottom: 6px;
  margin-top: 16px;
  font-weight: 600;
  font-size: 14px;
  color: var(--gray-700);
}

form label:first-of-type {
  margin-top: 0;
}

.tracker-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tracker-form input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  color: var(--gray-900);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tracker-form .form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.tracker-form .form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-start;
}

.tracker-form input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.tracker-form input::placeholder {
  color: #94a3b8;
}

.tracker-form .btn {
  padding: 8px 14px;
  font-size: 14px;
}

.page-hero {
  padding: 50px 0 30px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}

.page-hero h1 {
  margin: 0 0 10px;
}

.page-hero .small a {
  transition: color 0.2s ease;
}

.page-hero .small a:hover {
  color: var(--primary-600);
}

.article-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.article-card {
  border: 2px solid var(--gray-200);
  border-left: 4px solid var(--primary-500);
  border-radius: 16px;
  padding: 16px;
  background: #fff;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  animation: slideUp 0.5s ease-out backwards;
}

.article-card:hover {
  transform: scale(1.02) translateY(-4px);
  box-shadow: 0 15px 30px rgba(15, 23, 42, 0.12);
  border-color: var(--primary-400);
}

.article-card a,
.blog-track .card a,
.blog-grid .card a {
  transition: color 0.2s ease;
}

.article-card a:hover,
.blog-track .card a:hover,
.blog-grid .card a:hover {
  color: var(--primary-600);
}

.article-card h3 {
  margin: 6px 0 10px;
}

.small {
  font-size: 13px;
  color: var(--gray-600);
}

@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }
  
  .nav-links {
    display: flex;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--gray-200);
    flex-direction: column;
    gap: 0;
    padding: 12px 0;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-6px);
    pointer-events: none;
    transition: max-height 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
  }
  
  .nav-links.active {
    max-height: 420px;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  
  .nav-links a {
    padding: 14px 20px;
    width: 100%;
    border-bottom: 1px solid var(--gray-100);
  }
  
  .nav-links a:last-child {
    border-bottom: none;
  }
  
  .nav-cta {
    margin: 8px auto;
    text-align: center;
    width: calc(100% - 60px);
    max-width: 280px;
  }
  
  .hero h1 {
    font-size: 32px;
  }
  
  .hero p {
    font-size: 16px;
  }
  
  .hero-tags {
    font-size: 14px;
  }
  
  .section {
    padding: 40px 0;
  }
  
  .section-title h2 {
    font-size: 26px;
  }
  
  .results-grid,
  .popular-grid {
    grid-template-columns: 1fr;
  }
  
  .blog-grid {
    grid-template-columns: 1fr;
  }

  .blog-track {
    grid-auto-columns: calc(100% - 10px);
  }

  .carousel-btn {
    width: 32px;
    height: 32px;
  }

  .carousel-btn.prev {
    left: -6px;
  }

  .carousel-btn.next {
    right: -6px;
  }
  
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
  
  .card h3 {
    font-size: 18px;
  }
}

@media (max-width: 900px) {
  .hero h1 {
    font-size: 36px;
  }

  .blog-track {
    grid-auto-columns: calc(50% - 9px);
  }
}

/* Autocomplete styles */
.autocomplete-items {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 2px solid var(--gray-200);
  border-top: none;
  border-radius: 0 0 10px 10px;
  max-height: 320px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
  display: none;
}

.autocomplete-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--gray-100);
  transition: background 0.15s ease;
}

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

.autocomplete-item:hover {
  background: var(--primary-50);
}

/* Scroll to top button */
.scroll-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-500);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  z-index: 100;
}

.scroll-to-top:hover {
  background: var(--primary-600);
  transform: translateY(0) scale(1.05);
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

@media (max-width: 768px) {
  .scroll-to-top {
    bottom: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
  }
}
