/* ==========================================================================
   NUTRIFLOW - GLOBAL CSS (Design System & Reset)
   ========================================================================== */

:root {
  /* Official NutriFlow Brand Colors */
  --primary-green: #00c46a;
  --dark-green: #00a859;
  --light-green: #e8f7f0;
  --accent-orange: #ff7e5f;
  --gold: #ffd166;

  /* Aliases for compatibility */
  --green: #00c46a;
  --green-dark: #00a859;
  --green-light: #e8f7f0;
  --green-subtle: rgba(0, 196, 106, 0.08);
  --lime: #00c46a;
  --lime-hover: #00a859;
  --lime-accent: #00a859;
  --lime-bright: #00c46a;
  --lime-bg: #e8f7f0;
  --lime-subtle: rgba(0, 196, 106, 0.08);
  --pale: #cff6e4;
  --ink: #1a1a1a;
  --ink-dark: #111815;
  --ink-light: #4a4a4a;
  --ink-muted: #6c757d;
  --dark: #0f1f17;
  --dark-accent: #172d22;
  --soft: #f8fbf9;
  --soft-border: #e8eee9;
  --line: #e5ece7;
  --line-dark: #22372c;
  --gray-light: #f4f6f5;
  --gray-bg: #f8f9fa;
  --gray-card: #ffffff;
  --white: #ffffff;
  --black: #000000;

  /* Signature Gradients */
  --gradient-emerald: linear-gradient(135deg, #00c46a 0%, #00a859 100%);
  --gradient-dark: linear-gradient(145deg, #152c21 0%, #0c1812 100%);
  --gradient-soft: linear-gradient(180deg, #f8fbf9 0%, #ffffff 100%);

  /* Overlays & Shadows */
  --overlay-header: rgba(255, 255, 255, 0.92);
  --overlay-nav-pill: rgba(255, 255, 255, 0.85);
  --overlay-brand-strip: rgba(255, 255, 255, 0.7);
  --overlay-card-dark: rgba(255, 255, 255, 0.06);
  --overlay-card-dark-hover: rgba(255, 255, 255, 0.12);
  --overlay-audience: rgba(15, 31, 23, 0.9);

  /* Layout & Spacing */
  --container: 1288px;
  --header-height: 96px;
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --radius-xl: 40px;
  --radius-full: 9999px;

  /* Transitions & Shadows */
  --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 4px 15px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 10px 25px rgba(0, 196, 106, 0.35);
  --shadow-green-sm: 0 4px 16px rgba(0, 196, 106, 0.22);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

html {
  overflow-x: clip;
}

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--white);
  font-family: var(--font-primary);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: clip;
  width: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 9px;
}
::-webkit-scrollbar-track {
  background: #f1f5f2;
}
::-webkit-scrollbar-thumb {
  background: var(--green);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--green-dark);
}

/* Skip Link for Accessibility */
.skip-link {
  position: fixed;
  left: 20px;
  top: -100px;
  z-index: 9999;
  background: var(--dark);
  color: var(--white);
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 20px;
}

/* Section Bases */
.section-light {
  background-color: var(--white);
}

.section-soft {
  background-color: var(--soft);
}

.dark-section {
  background-color: var(--dark);
  color: var(--white);
}

.section-pad {
  padding: 85px 0;
}

@media (max-width: 991.98px) {
  .section-pad {
    padding: 60px 0;
  }
}

@media (max-width: 575.98px) {
  .section-pad {
    padding: 48px 0;
  }
}

/* Container Customization */
.container {
  max-width: var(--container);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* Section Header Component */
.section-head {
  text-align: center;
  margin: 0 auto 55px;
}

@media (max-width: 575.98px) {
  .section-head {
    margin: 0 auto 40px;
  }
}

/* Common Section Badge (Polished Pill Capsule) */
.section-badge,
.section-head > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #00A859 !important;
  font-weight: 700;
  font-size: 0.78rem;
  line-height: 1;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 0;
  font-family: var(--font-primary);
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(0, 196, 106, 0.08);
  border: 1px solid rgba(0, 196, 106, 0.28);
  box-shadow: 0 2px 10px rgba(0, 196, 106, 0.08);
  transition: all 0.25s ease;
}

.section-head.light .section-badge,
.dark-section .section-badge {
  background: rgba(0, 196, 106, 0.15);
  border-color: rgba(0, 196, 106, 0.4);
  color: #79f7b4 !important;
  box-shadow: 0 2px 12px rgba(0, 196, 106, 0.18);
}

.section-badge:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 196, 106, 0.5);
  box-shadow: 0 4px 14px rgba(0, 196, 106, 0.16);
}

/* Section Head Heading */
.section-head h2 {
  margin: 0 auto 20px;
  max-width: 1150px;
}

/* Section Head Lead Paragraph */
.section-head p {
  max-width: 1180px;
  margin: 0 auto;
}

/* Buttons */
.btn-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  color: var(--white) !important;
  background: var(--gradient-emerald);
  border-radius: var(--radius-full);
  padding: 13px 28px;
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.2px;
  border: none;
  cursor: pointer;
  transition: var(--transition-normal);
  box-shadow: 0 6px 18px rgba(0, 196, 106, 0.32);
  white-space: nowrap !important;
}

.btn-brand:hover,
.btn-brand:focus {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(0, 196, 106, 0.45);
  color: var(--white) !important;
}

.btn-brand.btn-large {
  font-size: 1.15rem;
  padding: 16px 38px;
}

.btn-brand-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  color: var(--green) !important;
  background: transparent;
  border: 1.5px solid var(--green);
  border-radius: var(--radius-full);
  padding: 12px 26px;
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition-normal);
}

.btn-brand-outline:hover {
  background: var(--light-green);
  color: var(--green-dark) !important;
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  .btn-brand.btn-large {
    padding: 12px 24px;
    font-size: 0.95rem;
  }
}

/* Utilities */
.text-brand-green {
  color: var(--green) !important;
}

.bg-soft {
  background-color: var(--soft) !important;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--light-green);
  color: var(--green);
}

/* Gradient Text */
.text-gradient-emerald {
  background: var(--gradient-emerald);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Global Smooth Anchor Scroll Offset for Fixed Header */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 110px;
}

section[id],
div[id],
header[id] {
  scroll-margin-top: 110px;
}


/* ==========================================================================
   RTL GLOBAL RULES & LAYOUT ADAPTATIONS (English <-> Arabic)
   ========================================================================== */
[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .text-start {
  text-align: right !important;
}

[dir="rtl"] .text-end {
  text-align: left !important;
}

[dir="rtl"] .ms-auto {
  margin-left: 0 !important;
  margin-right: auto !important;
}

[dir="rtl"] .me-auto {
  margin-right: 0 !important;
  margin-left: auto !important;
}

[dir="rtl"] .me-1 { margin-right: 0 !important; margin-left: 0.25rem !important; }
[dir="rtl"] .me-2 { margin-right: 0 !important; margin-left: 0.5rem !important; }
[dir="rtl"] .me-3 { margin-right: 0 !important; margin-left: 1rem !important; }
[dir="rtl"] .ms-1 { margin-left: 0 !important; margin-right: 0.25rem !important; }
[dir="rtl"] .ms-2 { margin-left: 0 !important; margin-right: 0.5rem !important; }
[dir="rtl"] .ms-3 { margin-left: 0 !important; margin-right: 1rem !important; }

/* Flip directional icons in Arabic */
[dir="rtl"] .bi-arrow-right::before,
[dir="rtl"] .bi-chevron-right::before {
  display: inline-block;
  transform: scaleX(-1);
}

[dir="rtl"] .bi-arrow-left::before,
[dir="rtl"] .bi-chevron-left::before {
  display: inline-block;
  transform: scaleX(-1);
}

/* Dish switcher alignment in RTL */
[dir="rtl"] .dish-switch-btn {
  text-align: right;
}

[dir="rtl"] .dish-switch-info {
  margin-right: 10px;
  margin-left: 0;
  text-align: right;
}

[dir="rtl"] .dish-check-icon {
  margin-right: auto;
  margin-left: 0;
}

/* Footer links list in RTL */
[dir="rtl"] .footer-links-list {
  padding-right: 0;
}

[dir="rtl"] .footer-heading-dot {
  margin-left: 8px;
  margin-right: 0;
}

/* FAQ Accordion arrow in RTL */
[dir="rtl"] .faq-arrow-icon {
  margin-right: auto;
  margin-left: 0;
}

/* ==========================================================================
   PAGE SPEED & MOBILE RESPONSIVE PERFORMANCE ENHANCEMENTS
   ========================================================================== */
html,
body {
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

img,
svg,
picture {
  max-width: 100%;
}

/* Smooth Touch Scrolling on Tables */
.table-responsive {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

/* Touch Target Accessibility Optimization */
.btn-brand,
.btn-brand-outline,
.nav-link,
.lang-pill,
.header-lang-btn,
.ai-preset-btn,
.ingredient-filter-btn {
  touch-action: manipulation;
}

/* Off-screen Section Rendering Optimization (Reduces initial layout & memory consumption) */
@supports (content-visibility: auto) {
  #delivery,
  #admin-console,
  #installer,
  #offering-pricing,
  #value-breakdown,
  #pricing,
  #launch,
  #usp,
  #faqs,
  #cta,
  #footer {
    content-visibility: auto;
    contain-intrinsic-size: 1px 750px;
  }
}
