/* ============================================================
   AGRIVANA — Base Styles (Premium Agricultural Export)
   Editorial Typography, Organic Hierarchy & Accessible Foundations
   ============================================================ */

/* ── Reset & Baseline ── */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--c-ivory);
  color: var(--c-text-primary);
}

body {
  font-family: var(--f-primary);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--c-text-primary);
  background-color: var(--c-ivory);
  overflow-x: hidden;
  min-height: 100vh;
}

/* ── Global Focus Accessibility ── */
:focus {
  outline: none;
}

:focus-visible {
  outline: var(--focus-outline);
  outline-offset: 3px;
  box-shadow: var(--focus-ring);
}

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

.container--sm {
  max-width: 960px;
}

.container--lg {
  max-width: 1380px;
}

/* ── Section Standard Spacing ── */
.section {
  padding-top: var(--section-py);
  padding-bottom: var(--section-py);
  position: relative;
}

.section--sm {
  padding-top: clamp(3rem, 5vw, 4.5rem);
  padding-bottom: clamp(3rem, 5vw, 4.5rem);
}

.section--lg {
  padding-top: clamp(5.5rem, 9vw, 8.5rem);
  padding-bottom: clamp(5.5rem, 9vw, 8.5rem);
}

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

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

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

.section--botanical {
  background-color: var(--c-botanical);
  color: var(--c-text-dark-primary);
}

/* ── Editorial Section Headings ── */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  font-family: var(--f-primary);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
  color: var(--c-forest);
  margin-bottom: var(--sp-1-5);
}

.eyebrow::before {
  content: '';
  display: inline-block;
  width: 1.5rem;
  height: 2px;
  background-color: var(--c-gold);
  border-radius: var(--r-full);
  flex-shrink: 0;
}

.eyebrow--light {
  color: var(--c-gold-harvest);
}

.eyebrow--light::before {
  background-color: var(--c-gold-harvest);
}

.section-heading {
  font-family: var(--f-primary);
  font-size: clamp(2rem, 4.2vw, 3.25rem);
  font-weight: var(--fw-extrabold);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  color: var(--c-text-primary);
  margin-bottom: var(--sp-2);
}

.section-heading em,
.editorial-em {
  font-family: var(--f-editorial);
  font-weight: 600;
  font-style: italic;
  letter-spacing: -0.01em;
  color: var(--c-forest);
}

.section-heading--light {
  color: var(--c-text-dark-primary);
}

.section-heading--light em {
  color: var(--c-gold-harvest);
}

.section-body {
  font-family: var(--f-secondary);
  font-size: var(--fs-md);
  line-height: var(--lh-relaxed);
  color: var(--c-text-secondary);
  max-width: 58ch;
}

.section-body--light {
  color: var(--c-text-dark-secondary);
}

/* ── Interactive Buttons (Touch Target >= 44px) ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-1);
  min-height: var(--min-touch-target);
  padding: 0.75rem 1.75rem;
  border-radius: var(--r-full);
  font-family: var(--f-primary);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-wide);
  transition:
    transform var(--t-fast) var(--ease-spring),
    box-shadow var(--t-fast) var(--ease-out),
    background var(--t-fast) var(--ease-out),
    border-color var(--t-fast) var(--ease-out),
    color var(--t-fast) var(--ease-out);
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  text-decoration: none;
}

/* Primary Button (Deep Botanical Green) */
.btn--primary {
  background: var(--gradient-botanical);
  color: var(--c-white);
  box-shadow: 0 4px 18px rgba(11, 66, 31, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(11, 66, 31, 0.40);
  color: var(--c-white);
}

/* Gold Button (Agrivana Gold Luxury Accent) */
.btn--gold,
.btn--lime {
  background: var(--gradient-gold);
  color: var(--c-botanical);
  box-shadow: 0 4px 18px var(--c-gold-glow);
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-weight: var(--fw-extrabold);
}

.btn--gold:hover,
.btn--lime:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(200, 154, 50, 0.42);
  color: #051d0d;
}

/* Secondary Button (Refined Outline on Ivory / White) */
.btn--secondary {
  background-color: transparent;
  color: var(--c-text-primary);
  border: 1.5px solid var(--c-border);
}

.btn--secondary:hover {
  border-color: var(--c-forest);
  color: var(--c-forest);
  background-color: rgba(11, 66, 31, 0.05);
  transform: translateY(-2px);
}

/* White Solid Button */
.btn--white {
  background-color: var(--c-white);
  color: var(--c-botanical);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(23, 53, 31, 0.08);
}

.btn--white:hover {
  background-color: var(--c-ivory);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: var(--c-botanical);
}

/* Ghost Light Button (for dark green sections) */
.btn--ghost-light {
  background: rgba(255, 255, 255, 0.08);
  color: var(--c-white);
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(8px);
}

.btn--ghost-light:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: var(--c-gold-harvest);
  color: var(--c-white);
  transform: translateY(-2px);
}

/* Gold Outline on Dark Backgrounds (Frozen Section etc.) */
.btn--outline-on-dark {
  background: transparent;
  color: var(--c-white);
  border: 1.5px solid #C89A32;
  font-weight: var(--fw-bold);
  letter-spacing: 0.06em;
  padding: 0.85rem 2.25rem;
  box-shadow: 0 0 0 0 rgba(200, 154, 50, 0);
  transition:
    transform var(--t-fast) var(--ease-spring),
    box-shadow var(--t-fast) var(--ease-out),
    background var(--t-fast) var(--ease-out),
    border-color var(--t-fast) var(--ease-out),
    color var(--t-fast) var(--ease-out);
}

.btn--outline-on-dark:hover {
  background: rgba(200, 154, 50, 0.12);
  border-color: #e3bc5a;
  color: #F5DFA0;
  transform: translateY(-2px);
  box-shadow: 0 0 24px rgba(200, 154, 50, 0.25);
}

.btn--outline-on-dark .btn__arrow {
  transition: transform var(--t-fast) var(--ease-out);
}

.btn--outline-on-dark:hover .btn__arrow {
  transform: translateX(4px);
}

/* Arrow Icon Transition */
.btn__arrow {
  width: 1rem;
  height: 1rem;
  transition: transform var(--t-fast) var(--ease-out);
  flex-shrink: 0;
}

.btn:hover .btn__arrow {
  transform: translateX(4px);
}

/* ── Thin Gold Separator ── */
.gold-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--c-gold) 35%, var(--c-gold-harvest) 65%, transparent 100%);
  opacity: 0.6;
  margin: var(--sp-4) 0;
}

/* ── Organic Panel & Cards ── */
.panel-organic {
  background: var(--c-white);
  border-radius: var(--r-xl);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-4);
}

.panel-organic--ivory {
  background: var(--c-ivory);
  border-color: var(--c-border);
}

.panel-organic--sage {
  background: var(--c-sage);
  border-color: rgba(23, 53, 31, 0.08);
}

/* ── Badge Indicators ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.85rem;
  border-radius: var(--r-full);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
}

.badge--gold {
  background-color: rgba(200, 154, 50, 0.14);
  color: #8c6717;
  border: 1px solid rgba(200, 154, 50, 0.28);
}

.badge--sage {
  background-color: var(--c-sage);
  color: var(--c-forest);
  border: 1px solid rgba(21, 92, 42, 0.18);
}

.badge--botanical {
  background-color: var(--c-botanical);
  color: var(--c-white);
}

/* ── Text Selection & Scrollbar ── */
::selection {
  background-color: var(--c-sage);
  color: var(--c-botanical);
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--c-ivory);
}

::-webkit-scrollbar-thumb {
  background: rgba(11, 66, 31, 0.25);
  border-radius: var(--r-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--c-forest);
}

/* ── GSAP Reveal Initial State ── */
.js-reveal {
  opacity: 0;
}

/* ══════════════════════════════════════════════════════════════
   RTL & ARABIC TYPOGRAPHY ENHANCEMENTS (Zero Duplication)
   ══════════════════════════════════════════════════════════════ */
[dir="rtl"] {
  --f-primary: 'IBM Plex Sans Arabic', 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  --f-secondary: 'IBM Plex Sans Arabic', 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --f-editorial: 'IBM Plex Sans Arabic', 'Manrope', sans-serif;
  text-align: right;
}

[dir="rtl"] body {
  font-family: var(--f-secondary);
  text-align: right;
}

[dir="rtl"] .section-heading,
[dir="rtl"] .hero__headline,
[dir="rtl"] .page-hero__headline,
[dir="rtl"] .eyebrow,
[dir="rtl"] .badge,
[dir="rtl"] .btn,
[dir="rtl"] .nav__list,
[dir="rtl"] .mobile-nav__link,
[dir="rtl"] .header__logo-text,
[dir="rtl"] .footer__logo-text,
[dir="rtl"] .product-tile__category,
[dir="rtl"] .footer__heading {
  letter-spacing: 0 !important;
}

[dir="rtl"] .section-heading em,
[dir="rtl"] .editorial-em,
[dir="rtl"] .hero__headline-serif {
  font-style: normal;
  font-weight: 800;
  font-family: var(--f-primary);
}

[dir="rtl"] .text-center {
  text-align: center;
}

/* Bi-directional text isolation for phone, emails, brand codes */
.ltr-text,
[dir="rtl"] .ltr-text,
[dir="rtl"] a[href^="tel:"]:not(.floating-whatsapp__btn),
[dir="rtl"] a[href^="mailto:"],
[dir="rtl"] a[href*="wa.me"]:not(.floating-whatsapp__btn) {
  direction: ltr !important;
  unicode-bidi: isolate !important;
  display: inline-block;
}

[dir="rtl"] .footer__contact-item {
  text-align: right;
  align-items: flex-start;
}

[dir="rtl"] .footer__contact-label {
  text-align: right;
}

[dir="rtl"] .footer__contact-value {
  text-align: right;
  direction: rtl;
  display: block;
}

[dir="rtl"] .footer__contact-value.ltr-text,
[dir="rtl"] a.footer__contact-value.ltr-text,
[dir="rtl"] .footer__contact-value a[href*="wa.me"],
[dir="rtl"] .footer__contact-value a[href^="tel:"],
[dir="rtl"] .footer__contact-value a[href^="mailto:"] {
  direction: ltr !important;
  unicode-bidi: isolate !important;
  text-align: right !important;
  display: inline-block;
}
