/* ============================================================
   CheckTheCarbs Brand Override — Full Homepage Redesign
   Hides React's built-in header, injects our custom hero.
   React search results still render below.
   ============================================================ */

/* ── 1. Hide the React app's blue/green hero section ─────── */
section[class*="0054A6"],
section[class*="003d7a"],
section[class*="bg-gradient-to-r"] {
  display: none !important;
}

/* ── 1b. Brand Net Carbs boxes green (cards + modal portal) ─ */
/* Covers arbitrary-value Tailwind (#0054A6), standard blue-600/700,
   and bg-primary in case the app uses a CSS variable. */
div[class*="0054A6"],
div[class*="003d7a"],
div[class*="bg-blue-6"],
div[class*="bg-blue-7"],
div[class*="bg-blue-8"],
div[class*="bg-primary"] {
  background: linear-gradient(135deg, #1a5c32 0%, #2d7d46 100%) !important;
}

/* "= Net Carbs" colored text in breakdown table */
[class*="text-\[#0054"],
[class*="text-\[#003d"],
[class*="text-blue-6"],
[class*="text-blue-7"],
[class*="text-primary"] {
  color: #2d7d46 !important;
}

/* Search/action buttons */
button[class*="0054A6"],
button[class*="003d7a"],
button[class*="bg-blue-"],
button[class*="bg-primary"] {
  background-color: #2d7d46 !important;
  background-image: none !important;
}

/* ── 2. Hide the static white SEO section above our hero ──── */
.seo-hero {
  display: none !important;
}

/* ── 3. Hide the React footer — replaced by static footer below grid ── */
#root footer,
footer.bg-muted,
footer[class*="bg-muted"] {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
}

/* ── 3b. Constrain the ad slot size ─────────────────────── */
.adsense-placeholder,
[class*="adsense"],
ins.adsbygoogle {
  max-height: 100px !important;
  overflow: hidden !important;
}

/* ── 4. Hide React app entirely — replaced by USDA custom search ── */
#root {
  display: none !important;
}


/* Search results area spacing */
section.container {
  padding-top: 16px !important;
  padding-bottom: 16px !important;
}

/* ── 5. NEW HERO SECTION ─────────────────────────────────── */
#ctc-hero {
  background: linear-gradient(135deg, #1a5c32 0%, #2d7d46 50%, #3a9658 100%);
  padding: 72px 20px 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* subtle pattern overlay */
#ctc-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 80%, rgba(255,255,255,0.06) 0%, transparent 50%),
                    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.06) 0%, transparent 50%);
  pointer-events: none;
}

#ctc-hero .hero-inner {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
}

#ctc-hero .badge {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 20px;
  border: 1px solid rgba(255,255,255,0.25);
}

#ctc-hero h1 {
  color: #fff;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 16px;
  letter-spacing: -0.02em;
}

#ctc-hero h1 span {
  color: #a8f0be;
}

#ctc-hero .subhead {
  color: rgba(255,255,255,0.88);
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  line-height: 1.6;
  margin: 0 auto 36px;
  max-width: 560px;
}

/* Search bar */
#ctc-hero .search-wrap {
  display: flex;
  gap: 0;
  max-width: 580px;
  margin: 0 auto 24px;
  border-radius: 50px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}

#ctc-hero .search-wrap input {
  flex: 1;
  padding: 18px 24px;
  font-size: 1.05rem;
  border: none;
  outline: none;
  color: #1a1a1a;
  background: #fff;
  font-family: inherit;
  min-width: 0;
}

#ctc-hero .search-wrap input::placeholder {
  color: #888;
}

#ctc-hero .search-wrap button {
  background: #f0a500;
  color: #fff;
  border: none;
  padding: 18px 32px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
  white-space: nowrap;
}

#ctc-hero .search-wrap button:hover {
  background: #d49000;
}

/* Popular pills */
#ctc-hero .popular {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

#ctc-hero .popular span {
  color: rgba(255,255,255,0.75);
  font-size: 0.85rem;
}

#ctc-hero .popular a {
  background: rgba(255,255,255,0.15);
  color: #fff;
  text-decoration: none;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  border: 1px solid rgba(255,255,255,0.25);
  transition: background 0.2s;
}

#ctc-hero .popular a:hover {
  background: rgba(255,255,255,0.28);
}

/* Stats bar */
#ctc-hero .stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255,255,255,0.2);
  padding-top: 32px;
  margin-top: 8px;
}

#ctc-hero .stat {
  color: rgba(255,255,255,0.9);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 7px;
}

#ctc-hero .stat strong {
  color: #fff;
  font-weight: 700;
}

/* ── 6. CATEGORY GRID ────────────────────────────────────── */
#ctc-categories {
  background: #f7fdf9;
  padding: 60px 20px 64px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

#ctc-categories h2 {
  text-align: center;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  color: #1a3d2b;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

#ctc-categories .subtitle {
  text-align: center;
  color: #556;
  font-size: 1rem;
  margin: 0 auto 40px;
  max-width: 480px;
}

#ctc-categories .grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  max-width: 1000px;
  margin: 0 auto;
}

#ctc-categories .card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1.5px solid #d4edda;
  border-radius: 16px;
  padding: 24px 12px 18px;
  text-decoration: none;
  color: #1a3d2b;
  font-weight: 600;
  font-size: 0.92rem;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  box-shadow: 0 2px 8px rgba(45,125,70,0.06);
}

#ctc-categories .card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(45,125,70,0.16);
  border-color: #2d7d46;
}

#ctc-categories .card .emoji {
  font-size: 2.6rem;
  line-height: 1;
}

#ctc-categories .card .count {
  font-size: 0.72rem;
  font-weight: 400;
  color: #888;
}

/* ── 7. FOOTER ───────────────────────────────────────────── */
#ctc-footer {
  background: #1a3d2b;
  color: rgba(255,255,255,0.7);
  text-align: center;
  padding: 32px 20px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.875rem;
  line-height: 1.8;
}

#ctc-footer a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  margin: 0 10px;
  transition: color 0.15s;
}

#ctc-footer a:hover {
  color: #fff;
}

#ctc-footer nav {
  margin: 8px 0;
}

#ctc-footer .copy {
  margin-top: 8px;
  font-size: 0.8rem;
  opacity: 0.6;
}

@media (max-width: 500px) {
  #ctc-categories .grid { grid-template-columns: repeat(2, 1fr); }
  #ctc-hero .stats { gap: 18px; }
}
