/* ============================================================
   Nutrasfit.com — Theme D: Soft Authority
   shared.css — loaded by every page
   ============================================================ */

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  color: #1f0a3c;
  background: #ffffff;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a { color: #7c3aed; text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Typography -------------------------------------------- */
h1 { font-size: clamp(26px, 4vw, 42px); font-weight: 900; letter-spacing: -0.03em; line-height: 1.1; color: #1f0a3c; }
h2 { font-size: clamp(20px, 3vw, 32px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; color: #1f0a3c; }
h3 { font-size: clamp(17px, 2.5vw, 22px); font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; color: #1f0a3c; }
h4 { font-size: 16px; font-weight: 700; color: #1f0a3c; }
p { color: #374151; line-height: 1.75; }

/* --- Layout Utilities ------------------------------------- */
.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.section { padding: 64px 0; }
.section-sm { padding: 40px 0; }
.section-purple { background: #f5f3ff; }
.section-dark { background: #1f0a3c; }
.text-center { text-align: center; }
.eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: #7c3aed; margin-bottom: 10px;
  display: block;
}
.section-title { margin-bottom: 8px; }
.section-subtitle { font-size: 17px; color: #6b7280; max-width: 600px; margin: 0 auto 40px; }

/* --- Buttons ---------------------------------------------- */
.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 30px;
  font-size: 14px; font-weight: 700;
  cursor: pointer; border: none;
  transition: opacity 0.15s, transform 0.1s;
  text-decoration: none;
  line-height: 1;
}
.btn:hover { opacity: 0.9; text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: #7c3aed; color: #fff; }
.btn-outline { background: transparent; color: #7c3aed; border: 2px solid #7c3aed; }
.btn-white { background: #fff; color: #7c3aed; }
.btn-lg { padding: 15px 36px; font-size: 16px; }
.btn-sm { padding: 8px 18px; font-size: 13px; }

/* --- Badges & Pills --------------------------------------- */
.badge {
  display: inline-block; font-size: 11px; font-weight: 700;
  padding: 4px 12px; border-radius: 20px;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.badge-purple { background: #f5f3ff; color: #7c3aed; }
.badge-green  { background: #d1fae5; color: #065f46; }
.badge-gold   { background: #fef3c7; color: #92400e; }
.badge-dark   { background: #1f0a3c; color: #e9d5ff; }

/* --- Navigation ------------------------------------------- */
#site-header {
  position: sticky; top: 0; z-index: 100;
  background: #fff;
  border-bottom: 2.5px solid #7c3aed;
}
.nav-inner {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  max-width: 1140px; margin: 0 auto;
}
.nav-logo {
  font-size: 22px; font-weight: 900; letter-spacing: -0.04em;
  color: #7c3aed; text-decoration: none;
}
.nav-logo span { color: #1f0a3c; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a {
  font-size: 14px; font-weight: 600; color: #374151;
  text-decoration: none; transition: color 0.15s;
}
.nav-links a:hover { color: #7c3aed; }
.nav-cta { margin-left: 12px; }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 4px; }
.nav-toggle span {
  display: block; width: 24px; height: 2px;
  background: #1f0a3c; margin: 5px 0; border-radius: 2px;
  transition: transform 0.2s;
}

/* --- Stats Bar -------------------------------------------- */
.stats-bar {
  background: #7c3aed;
  padding: 20px 0;
}
.stats-bar-inner {
  max-width: 1140px; margin: 0 auto; padding: 0 24px;
  display: flex; justify-content: space-around; flex-wrap: wrap; gap: 16px;
}
.stat-item { text-align: center; }
.stat-num { font-size: 28px; font-weight: 900; color: #fff; line-height: 1; }
.stat-lbl { font-size: 12px; color: #c4b5fd; margin-top: 4px; font-weight: 500; }

/* --- Trust Badges ----------------------------------------- */
.trust-row {
  display: flex; flex-wrap: wrap; gap: 16px;
  justify-content: center; margin-top: 40px;
}
.trust-item {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1.5px solid #ede9fe;
  border-radius: 10px; padding: 12px 18px;
}
.trust-item img { width: 36px; height: 36px; object-fit: contain; }
.trust-item-text { font-size: 13px; font-weight: 600; color: #1f0a3c; }
.trust-item-sub  { font-size: 11px; color: #6b7280; }

/* --- Category Grid ---------------------------------------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.cat-card {
  border: 1.5px solid #ede9fe;
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  transition: border-color 0.15s, transform 0.1s;
  background: #fff;
}
.cat-card:hover { border-color: #7c3aed; transform: translateY(-2px); text-decoration: none; }
.cat-card-img {
  width: 100%; aspect-ratio: 16/9;
  object-fit: cover;
  background: #f5f3ff;
}
.cat-card-body { padding: 12px 14px 14px; }
.cat-card-name { font-size: 14px; font-weight: 700; color: #1f0a3c; margin-bottom: 3px; }
.cat-card-count { font-size: 12px; color: #7c3aed; font-weight: 600; }

/* --- Product Cards ---------------------------------------- */
.prod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.prod-card {
  background: #fff;
  border: 1.5px solid #ede9fe;
  border-radius: 16px;
  overflow: hidden;
  transition: border-color 0.15s, transform 0.1s;
  display: flex; flex-direction: column;
}
.prod-card:hover { border-color: #7c3aed; transform: translateY(-2px); }
.prod-card.featured { border: 2.5px solid #7c3aed; }
.prod-card-top-badge {
  background: #7c3aed; color: #fff;
  font-size: 11px; font-weight: 700;
  padding: 6px 14px; text-align: center;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.prod-card-img {
  width: 100%; aspect-ratio: 4/3;
  object-fit: cover; background: #f5f3ff;
}
.prod-card-body {
  padding: 16px 18px 20px;
  flex: 1; display: flex; flex-direction: column;
}
.prod-score-row { display: flex; align-items: baseline; gap: 4px; margin-bottom: 6px; }
.prod-score { font-size: 28px; font-weight: 900; color: #7c3aed; line-height: 1; }
.prod-score-denom { font-size: 13px; color: #9ca3af; }
.prod-stars { color: #7c3aed; font-size: 13px; margin-bottom: 6px; }
.prod-name { font-size: 16px; font-weight: 800; color: #1f0a3c; margin-bottom: 4px; }
.prod-cat-pill {
  display: inline-block; background: #f5f3ff; color: #7c3aed;
  font-size: 11px; font-weight: 700; padding: 3px 10px;
  border-radius: 20px; margin-bottom: 10px;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.prod-desc { font-size: 14px; color: #6b7280; line-height: 1.6; flex: 1; margin-bottom: 14px; }
.prod-btn {
  display: block; width: 100%;
  background: #7c3aed; color: #fff;
  border: none; border-radius: 30px;
  padding: 11px; font-size: 14px; font-weight: 700;
  cursor: pointer; text-align: center;
  text-decoration: none; transition: opacity 0.15s;
}
.prod-btn:hover { opacity: 0.88; text-decoration: none; }

/* --- Breadcrumb ------------------------------------------- */
.breadcrumb {
  font-size: 13px; color: #6b7280;
  padding: 14px 0 0;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.breadcrumb a { color: #7c3aed; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: #d1d5db; }

/* --- Review Page Header ----------------------------------- */
.review-header {
  background: #fff;
  padding: 32px 0 40px;
  border-bottom: 1px solid #ede9fe;
}
.review-header-inner {
  display: flex; gap: 32px; align-items: flex-start;
}
.review-product-img {
  width: 200px; min-width: 200px;
  border: 1.5px solid #ede9fe; border-radius: 16px;
  overflow: hidden; background: #f5f3ff;
}
.review-product-img img { width: 100%; aspect-ratio: 3/4; object-fit: cover; }
.review-info { flex: 1; }
.review-badge-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.review-title { margin-bottom: 12px; }
.review-score-block { display: flex; align-items: center; gap: 20px; margin-bottom: 16px; }
.review-big-score { font-size: 52px; font-weight: 900; color: #7c3aed; line-height: 1; }
.review-score-meta { display: flex; flex-direction: column; gap: 4px; }
.review-stars { font-size: 20px; color: #7c3aed; }
.review-ratings-count { font-size: 13px; color: #6b7280; }
.review-score-label { font-size: 12px; font-weight: 700; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.06em; }
.review-summary { font-size: 15px; color: #4b5563; line-height: 1.7; margin-bottom: 20px; max-width: 580px; }
.review-cta-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.review-price { font-size: 13px; color: #6b7280; }

/* --- Score Breakdown -------------------------------------- */
.score-breakdown { margin: 32px 0; }
.score-row { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.score-label { font-size: 14px; font-weight: 600; color: #374151; width: 160px; flex-shrink: 0; }
.score-bar-wrap { flex: 1; height: 8px; background: #f5f3ff; border-radius: 4px; overflow: hidden; }
.score-bar { height: 100%; background: #7c3aed; border-radius: 4px; }
.score-val { font-size: 14px; font-weight: 800; color: #7c3aed; width: 36px; text-align: right; }

/* --- Pros Cons -------------------------------------------- */
.pros-cons-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 32px 0; }
.pros-box, .cons-box {
  border-radius: 14px; padding: 24px;
  border: 1.5px solid;
}
.pros-box { background: #f0fdf4; border-color: #86efac; }
.cons-box { background: #fff7f0; border-color: #fcd34d; }
.pros-box h4 { color: #166534; margin-bottom: 14px; }
.cons-box h4 { color: #92400e; margin-bottom: 14px; }
.check-list { list-style: none; }
.check-list li { font-size: 14px; padding: 5px 0; padding-left: 22px; position: relative; color: #374151; }
.pros-box .check-list li::before { content: "✓"; position: absolute; left: 0; color: #16a34a; font-weight: 700; }
.cons-box .check-list li::before { content: "✗"; position: absolute; left: 0; color: #d97706; font-weight: 700; }

/* --- FAQ Accordion ---------------------------------------- */
.faq-section { margin: 40px 0; }
.faq-item {
  border: 1.5px solid #ede9fe; border-radius: 12px;
  margin-bottom: 10px; overflow: hidden;
}
.faq-question {
  width: 100%; background: #fff; border: none;
  padding: 18px 20px; text-align: left;
  font-size: 15px; font-weight: 700; color: #1f0a3c;
  cursor: pointer; display: flex; justify-content: space-between; align-items: center;
  transition: background 0.15s;
}
.faq-question:hover { background: #faf5ff; }
.faq-question .faq-icon {
  font-size: 20px; color: #7c3aed; font-weight: 300;
  flex-shrink: 0; transition: transform 0.2s;
}
.faq-answer {
  display: none; padding: 0 20px 18px;
  font-size: 14px; color: #4b5563; line-height: 1.75;
  background: #fff;
}
.faq-item.open .faq-answer { display: block; }
.faq-item.open .faq-icon { transform: rotate(45deg); }

/* --- Review Cards (testimonials) -------------------------- */
.review-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.review-card {
  background: #fff; border: 1.5px solid #ede9fe;
  border-radius: 14px; padding: 20px;
}
.review-card-stars { color: #7c3aed; font-size: 15px; margin-bottom: 10px; }
.review-card-text { font-size: 14px; color: #374151; line-height: 1.65; margin-bottom: 12px; font-style: italic; }
.review-card-author { font-size: 13px; font-weight: 700; color: #1f0a3c; }
.review-card-meta  { font-size: 12px; color: #9ca3af; }

/* --- Ingredient Table ------------------------------------- */
.ingredient-table { width: 100%; border-collapse: collapse; margin: 24px 0; }
.ingredient-table th {
  background: #7c3aed; color: #fff;
  padding: 12px 16px; text-align: left;
  font-size: 13px; font-weight: 700; letter-spacing: 0.04em;
}
.ingredient-table td {
  padding: 12px 16px; font-size: 14px; color: #374151;
  border-bottom: 1px solid #f3e8ff;
}
.ingredient-table tr:nth-child(even) td { background: #faf5ff; }

/* --- Comparison Table ------------------------------------- */
.vs-table-wrap { overflow-x: auto; margin: 32px 0; }
.vs-table { width: 100%; border-collapse: collapse; }
.vs-table th {
  background: #1f0a3c; color: #e9d5ff;
  padding: 14px 18px; font-size: 14px; font-weight: 700;
}
.vs-table th:first-child { text-align: left; }
.vs-table td { padding: 13px 18px; font-size: 14px; border-bottom: 1px solid #ede9fe; color: #374151; text-align: center; }
.vs-table td:first-child { text-align: left; font-weight: 600; color: #1f0a3c; }
.vs-table tr:nth-child(even) td { background: #faf5ff; }
.vs-check { color: #16a34a; font-weight: 700; font-size: 16px; }
.vs-cross { color: #dc2626; font-weight: 700; }
.vs-winner { background: #f5f3ff !important; }

/* --- Buying Guide Box ------------------------------------- */
.guide-box {
  background: #f5f3ff; border: 1.5px solid #ede9fe;
  border-left: 4px solid #7c3aed;
  border-radius: 0 14px 14px 0;
  padding: 24px 28px; margin: 32px 0;
}
.guide-box h3 { color: #1f0a3c; margin-bottom: 12px; }
.guide-box p, .guide-box li { font-size: 15px; color: #4b5563; }
.guide-box ol, .guide-box ul { padding-left: 20px; margin-top: 8px; }
.guide-box li { margin-bottom: 6px; }

/* --- Alert / Warning Box ---------------------------------- */
.alert-box {
  background: #fef3c7; border: 1.5px solid #fcd34d;
  border-radius: 12px; padding: 16px 20px; margin: 24px 0;
  font-size: 14px; color: #78350f;
}

/* --- Related Products ------------------------------------- */
.related-section { background: #f5f3ff; padding: 48px 0; }

/* --- Category Page Hero ----------------------------------- */
.cat-hero {
  background: #f5f3ff;
  border-bottom: 1px solid #ede9fe;
  padding: 52px 0;
}
.cat-hero-inner { display: flex; align-items: center; gap: 40px; }
.cat-hero-text { flex: 1; }
.cat-hero-img { width: 340px; min-width: 340px; border-radius: 16px; overflow: hidden; }
.cat-hero-img img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }

/* --- Filter Chips ----------------------------------------- */
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 32px; }
.filter-chip {
  font-size: 13px; font-weight: 600; padding: 7px 18px;
  border-radius: 24px; border: 1.5px solid #ede9fe;
  color: #4b5563; background: #fff; cursor: pointer;
  transition: all 0.15s; text-decoration: none;
}
.filter-chip:hover, .filter-chip.active {
  background: #7c3aed; color: #fff; border-color: #7c3aed;
  text-decoration: none;
}

/* --- Related Categories ----------------------------------- */
.related-cats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.related-cat-link {
  background: #f5f3ff; border: 1.5px solid #ede9fe;
  border-radius: 10px; padding: 10px 16px;
  font-size: 13px; font-weight: 700; color: #7c3aed;
  text-decoration: none; transition: all 0.15s;
}
.related-cat-link:hover { background: #7c3aed; color: #fff; text-decoration: none; }

/* --- Footer ----------------------------------------------- */
#site-footer { background: #1f0a3c; padding: 56px 0 24px; }
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer-brand-logo {
  font-size: 24px; font-weight: 900; letter-spacing: -0.04em;
  color: #a78bfa; margin-bottom: 12px; display: block;
}
.footer-brand-logo span { color: #e9d5ff; }
.footer-tagline { font-size: 14px; color: #6d5a8a; line-height: 1.65; margin-bottom: 20px; }
.footer-disclaimer { font-size: 12px; color: #4a3760; line-height: 1.6; }
.footer-col h4 {
  font-size: 11px; font-weight: 700; color: #c4b5fd;
  text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 14px;
}
.footer-col a {
  display: block; font-size: 14px; color: #6d5a8a;
  text-decoration: none; margin-bottom: 8px;
  transition: color 0.15s;
}
.footer-col a:hover { color: #c4b5fd; }
.footer-bottom {
  border-top: 1px solid #3a1f5c;
  padding-top: 20px;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
}
.footer-bottom-text { font-size: 12px; color: #4a3760; }

/* --- Hidden Bingbot links --------------------------------- */

/* --- Article / Content ------------------------------------ */
.article-body h2 { margin: 36px 0 14px; }
.article-body h3 { margin: 28px 0 10px; }
.article-body p  { margin-bottom: 18px; font-size: 17px; }
.article-body ul, .article-body ol { padding-left: 22px; margin-bottom: 18px; }
.article-body li { margin-bottom: 6px; font-size: 17px; color: #374151; }
.article-body strong { color: #1f0a3c; }

/* --- Page Hero (about / contact / utility) ---------------- */
.page-hero { background: #f5f3ff; padding: 56px 0; border-bottom: 1px solid #ede9fe; }

/* --- Contact Form ----------------------------------------- */
.contact-form { max-width: 600px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 14px; font-weight: 700; color: #1f0a3c; margin-bottom: 6px; }
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%; padding: 12px 16px;
  border: 1.5px solid #ede9fe; border-radius: 10px;
  font-size: 15px; color: #1f0a3c; background: #fff;
  transition: border-color 0.15s; outline: none;
  font-family: inherit;
}
.form-group input:focus,
.form-group textarea:focus { border-color: #7c3aed; }
.form-group textarea { height: 140px; resize: vertical; }

/* --- 404 Page --------------------------------------------- */
.error-page { text-align: center; padding: 100px 0; }
.error-code { font-size: 120px; font-weight: 900; color: #ede9fe; line-height: 1; }

/* --- Responsive ------------------------------------------- */
@media (max-width: 900px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .review-header-inner { flex-direction: column; }
  .review-product-img { width: 100%; min-width: unset; max-width: 300px; }
  .cat-hero-inner { flex-direction: column; }
  .cat-hero-img { width: 100%; min-width: unset; }
  .pros-cons-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .nav-links.open {
    display: flex; flex-direction: column;
    position: absolute; top: 60px; left: 0; right: 0;
    background: #fff; border-bottom: 2px solid #7c3aed;
    padding: 16px 24px; gap: 16px; z-index: 99;
  }
  .stats-bar-inner { justify-content: space-between; }
  .stat-num { font-size: 22px; }
  .footer-inner { grid-template-columns: 1fr; gap: 28px; }
  .review-big-score { font-size: 42px; }
  .hero-h1 { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ============================================================
   Post Cards — used by loadLatestPosts & loadCategoryPosts
   ============================================================ */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.post-card {
  border: 1.5px solid #ede9fe;
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  background: #fff;
  transition: border-color 0.15s, transform 0.1s;
  display: flex;
  flex-direction: column;
}
.post-card:hover { border-color: #7c3aed; transform: translateY(-2px); text-decoration: none; }
.post-card-img {
  width: 100%; aspect-ratio: 5/3;
  object-fit: cover; display: block; background: #f5f3ff;
}
.post-card-body {
  padding: 16px 18px 20px;
  flex: 1; display: flex; flex-direction: column;
}
.post-card-type {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.07em;
  padding: 3px 10px; border-radius: 20px;
  margin-bottom: 10px; display: inline-block;
}
.post-card-type.review   { background: #f5f3ff; color: #7c3aed; }
.post-card-type.compare  { background: #fef3c7; color: #92400e; }
.post-card-type.guide    { background: #d1fae5; color: #065f46; }
.post-card-type.info     { background: #dbeafe; color: #1e40af; }
.post-card-title {
  font-size: 16px; font-weight: 700;
  color: #1f0a3c; line-height: 1.35;
  margin-bottom: 8px;
}
.post-card-desc {
  font-size: 14px; color: #6b7280;
  line-height: 1.6; margin-bottom: 10px; flex: 1;
}
.post-card-meta {
  font-size: 13px; color: #9ca3af;
  display: flex; align-items: center; gap: 6px;
  text-transform: capitalize; margin-bottom: 8px;
}
.post-card-score {
  font-size: 22px; font-weight: 900; color: #7c3aed;
  line-height: 1; margin-bottom: 8px;
}
.post-card-score span { font-size: 13px; color: #9ca3af; font-weight: 400; }
.post-card-arrow {
  font-size: 13px; color: #7c3aed;
  font-weight: 700; margin-top: 4px;
}
