:root {
  --sa-green: #007a33;
  --sa-gold: #ffb81c;
  --us-blue: #002868;
  --us-red: #bf0a30;
  --us-white: #ffffff;
  --light-bg: #f4f6f9;
  --text-color: #333333;
  --dark-color: #1a1a1a;
}

* { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--light-bg);
}

/* Header & Navigation (SA Green) */
header {
  background-color: var(--sa-green);
  color: white;
  padding: 1.5rem 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

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

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  text-decoration: none;
  color: white;
  display: flex;
  align-items: center;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 1rem;
  flex-wrap: wrap;
}

nav a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 0.8rem;
  border-radius: 4px;
  transition: background 0.3s;
}

nav a:hover, nav a.active {
  background-color: rgba(255,255,255,0.2);
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--sa-green) 0%, #004d20 100%);
  color: white;
  padding: 4rem 0;
  text-align: center;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.2rem;
  max-width: 800px;
  margin: 0 auto;
  opacity: 0.9;
}

/* Content Layout */
.main-content {
  padding: 3rem 0;
}

/* US Flag Themed Cards (Red, White, Blue) */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.card {
  background: var(--us-white);
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  border-top: 5px solid var(--us-red);
  border-bottom: 5px solid var(--us-blue);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card h2 {
  margin-bottom: 1rem;
  font-size: 1.4rem;
  color: var(--us-blue);
}

.card p {
  margin-bottom: 1.5rem;
  color: #555;
  font-size: 0.95rem;
}

/* Detailed Page Content Blocks (US Red, White, Blue) */
.content-block {
  background: var(--us-white);
  border-radius: 8px;
  padding: 2.5rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.06);
  margin-bottom: 2rem;
  border-left: 6px solid var(--us-blue);
  border-right: 6px solid var(--us-red);
}

.content-block h2 {
  margin-bottom: 1.2rem;
  color: var(--us-blue);
  font-size: 1.6rem;
}

.content-block h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--us-red);
}

.content-block p {
  margin-bottom: 1rem;
  color: #444;
}

ol, ul {
  margin-left: 1.5rem;
  margin-bottom: 1.5rem;
  color: #444;
}

li {
  margin-bottom: 0.5rem;
}

/* State Selection Menu Styling */
.selector-container {
  margin-top: 1.5rem;
  max-width: 400px;
}

.state-select {
  width: 100%;
  padding: 0.8rem 1.2rem;
  font-size: 1rem;
  font-family: inherit;
  border: 2px solid var(--us-blue);
  border-radius: 6px;
  background-color: var(--us-white);
  color: var(--us-blue);
  font-weight: bold;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.state-select:focus {
  border-color: var(--us-red);
  box-shadow: 0 0 0 3px rgba(191, 10, 48, 0.15);
}

/* Responsive Product Card Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

.product-card {
  background: var(--us-white);
  border: 1px solid #e1e8ed;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}

.product-image-container {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.product-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

.product-title {
  font-size: 1.15rem;
  font-weight: bold;
  color: var(--us-blue);
  margin-bottom: 0.5rem;
  min-height: 2.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-description {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 1.5rem;
  line-height: 1.4;
  flex-grow: 1;
}

/* US Theme CTA Buttons */
.btn {
  display: inline-block;
  background-color: var(--us-blue);
  color: white;
  text-decoration: none;
  padding: 0.6rem 1.2rem;
  border-radius: 4px;
  font-weight: bold;
  transition: background 0.3s, transform 0.2s;
  text-align: center;
  border: 1px solid var(--us-blue);
}

.btn:hover {
  background-color: var(--us-red);
  border-color: var(--us-red);
}

/* Affiliate Banners with US Colors */
.affiliate-banner {
  background-color: #f0f4f8;
  border: 2px dashed var(--us-blue);
  padding: 1.5rem;
  border-radius: 6px;
  margin-top: 1.5rem;
  position: relative;
}

.affiliate-banner::before {
  content: "RECOMMENDED SERVICE";
  position: absolute;
  top: -12px;
  left: 20px;
  background: var(--us-red);
  color: white;
  font-size: 0.75rem;
  font-weight: bold;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 1px;
}

.affiliate-banner strong {
  color: var(--us-blue);
  display: block;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.affiliate-link {
  display: inline-block;
  margin-top: 0.5rem;
  background-color: var(--us-red);
  color: white;
  text-decoration: none;
  padding: 0.6rem 1.2rem;
  font-weight: bold;
  border-radius: 4px;
  transition: background 0.2s;
}

.affiliate-link:hover {
  background-color: #900824;
}

/* Resource List Layout */
.resource-list {
  list-style: none;
  margin-left: 0;
}

.resource-list li {
  padding: 1.2rem;
  border: 1px solid #e1e8ed;
  background: #fafbfc;
  margin-bottom: 1rem;
  border-radius: 6px;
  border-left: 4px solid var(--us-blue);
}

.resource-title {
  font-weight: bold;
  color: var(--us-blue);
  text-decoration: none;
  font-size: 1.1rem;
  display: inline-block;
  margin-bottom: 0.3rem;
}

.resource-title:hover {
  color: var(--us-red);
  text-decoration: underline;
}

/* Partner Brand Logos & Containers */
.logo-wrapper {
  margin-bottom: 0.8rem;
  display: inline-block;
}

/* FoodFinder Specific Green Brand Background */
.logo-wrapper.foodfinder-bg {
  background-color: #10a142; /* FoodFinder Green */
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.logo-wrapper.foodfinder-bg:hover {
  background-color: #0d8435;
}

.partner-logo {
  height: 24px;
  max-width: 140px;
  width: auto;
  display: block;
  object-fit: contain;
}

/* General Page Titles */
.page-title {
  margin-bottom: 2rem;
  color: var(--us-blue);
  border-bottom: 3px solid var(--us-red);
  padding-bottom: 0.5rem;
  font-size: 2.2rem;
}

/* Footer Section */
footer {
  background-color: var(--dark-color);
  color: #ccc;
  text-align: center;
  padding: 2.5rem 0;
  margin-top: 4rem;
  font-size: 0.9rem;
  border-top: 4px solid var(--us-blue);
}

footer a {
  color: var(--sa-gold);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

.disclaimer {
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: #888;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

@media (max-width: 768px) {
  .header-content { 
    flex-direction: column; 
    text-align: center; 
  }
  nav ul { 
    justify-content: center; 
    margin-top: 1rem; 
  }
  .page-title { 
    font-size: 1.8rem; 
  }
}