/* ============================================================
   Reyes Farms — Global Stylesheet
   Site-wide chrome (nav, drawer, footer), CSS variable defaults,
   and shared components. Loaded first by base.html; theme-overrides.css
   loads after and wins the cascade for editor-chosen values.
   ============================================================ */

@font-face {
  font-family: 'ChunkFive';
  src: url('https://343225263.fs1.hubspotusercontent-na3.net/hubfs/343225263/raw_assets/public/reyes-farms-hubspot-theme/images/fonts/ChunkFive-Regular.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@import url('https://fonts.googleapis.com/css2?family=Cabin:ital,wght@0,400;0,600;0,700;1,400&family=Bitter:ital,wght@0,400;0,600;0,700;1,400&family=Dancing+Script:wght@600&display=swap');

/* ── CSS Variables (BASE defaults; overridden by theme-overrides.css) ── */
:root {
  --rf-color-primary: #cc9b80;        /* terracotta — CTAs, eyebrows, active links */
  --rf-color-primary-dark: #b88468;   /* terracotta hover */
  --rf-color-accent: #e05a3a;         /* warm accent — subtle borders, featured cards */
  --rf-color-accent-soft: #f9e8e6;
  --rf-color-surface: #ffffff;
  --rf-color-surface-soft: #f5f0ea;   /* cream */
  --rf-color-surface-dark: #51473b;   /* brown — footer, sticky nav, dark sections */
  --rf-color-linen: #e3e3db;          /* linen — homepage fruit-grid backdrop */
  --rf-color-text: #52473b;
  --rf-color-text-muted: #5a5248;
  --rf-color-text-soft: #6b6055;

  /* Fonts */
  --rf-font-heading: 'ChunkFive', Georgia, serif;
  --rf-font-body:    'Bitter', Georgia, serif;
  --rf-font-ui:      'Cabin', sans-serif;
  --rf-font-accent:  'Dancing Script', cursive;

  /* Layout */
  --rf-layout-max-width: 1100px;
  --rf-layout-side-padding: 48px;
  --rf-layout-sticky-height: 80px;
  --rf-border: rgba(81,71,59,0.12);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--rf-font-ui);
  color: var(--rf-color-text);
  background: var(--rf-color-surface);
  -webkit-font-smoothing: antialiased;
}

h1 {
  font-family: var(--rf-font-heading);
  font-size: clamp(52px, 7.5vw, 82px);
  font-weight: normal;
  line-height: 1.05;
  text-transform: capitalize;
  letter-spacing: 0.01em;
}

h2, h3, h4, h5 {
  font-family: var(--rf-font-body);
  text-transform: capitalize;
}

/* ── STICKY NAV ── */
.rf-sticky-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--rf-layout-sticky-height);
  background: var(--rf-color-surface-dark);
  display: flex; align-items: center;
  padding: 0 var(--rf-layout-side-padding); gap: 40px;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
  box-shadow: 0 2px 16px rgba(0,0,0,0.3);
}
.rf-sticky-nav.is-visible { transform: translateY(0); }
.rf-sticky-logo { height: calc(var(--rf-layout-sticky-height) - 20px); width: auto; display: block; flex-shrink: 0; }
.rf-sticky-divider { width: 1px; height: 28px; background: rgba(255,255,255,0.18); flex-shrink: 0; }
.rf-sticky-links { display: flex; gap: 28px; list-style: none; align-items: center; flex: 1; }
.rf-sticky-links a {
  text-decoration: none; color: #ffffff;
  font-family: var(--rf-font-ui); font-size: 17px; font-weight: 700;
  letter-spacing: 0.02em; transition: color 0.2s; white-space: nowrap;
}
.rf-sticky-links a:hover { color: rgba(255,255,255,0.75); }
.rf-sticky-links a.active { color: var(--rf-color-primary); }
.rf-sticky-cta {
  background: var(--rf-color-primary); color: var(--rf-color-surface) !important;
  padding: 9px 18px; border-radius: 4px;
  font-weight: 700 !important; font-size: 13px !important;
  transition: background 0.2s !important; white-space: nowrap; margin-left: auto;
}
.rf-sticky-cta:hover { background: var(--rf-color-primary-dark) !important; }

/* ── HERO NAV ── */
.rf-hero-nav {
  position: absolute; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: flex-start; justify-content: center;
}
.rf-nav-left {
  display: flex; gap: 24px; list-style: none; align-items: center;
  padding-top: 72px; margin-right: 90px; justify-content: flex-end; flex: 1;
}
.rf-nav-right {
  display: flex; gap: 24px; list-style: none; align-items: center;
  padding-top: 72px; margin-left: 90px; justify-content: flex-start; flex: 1;
}
.rf-nav-left a, .rf-nav-right a {
  text-decoration: none; color: var(--rf-color-surface);
  font-family: var(--rf-font-ui); font-size: 18px; font-weight: 700;
  letter-spacing: 0.02em; transition: opacity 0.2s; white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.rf-nav-left a:hover, .rf-nav-right a:hover { opacity: 0.75; }
.rf-nav-left a.active, .rf-nav-right a.active { color: var(--rf-color-primary); }
.rf-nav-logo { width: 190px; height: 190px; flex-shrink: 0; position: relative; z-index: 101; }
.rf-nav-logo img { width: 100%; height: 100%; object-fit: contain; }
.rf-nav-cta {
  background: var(--rf-color-primary); color: var(--rf-color-surface) !important;
  padding: 10px 22px; border-radius: 4px;
  font-weight: 700 !important; font-size: 15px !important;
  transition: background 0.2s !important; white-space: nowrap; text-shadow: none !important;
}
.rf-nav-cta:hover { background: var(--rf-color-primary-dark) !important; opacity: 1 !important; }

/* ── MULTI-LEVEL DROPDOWNS (desktop hero + sticky navs) ── */
.rf-nav-item, .rf-sticky-links > li { position: relative; }

/* Caret on items that open a submenu (inherits nav text color) */
.rf-nav-caret {
  display: inline-block; width: 0; height: 0; margin-left: 7px;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid currentColor; vertical-align: middle;
  opacity: 0.85; transition: transform 0.2s ease;
}
.rf-has-dropdown:hover > a .rf-nav-caret,
.rf-has-dropdown:focus-within > a .rf-nav-caret { transform: rotate(180deg); }

/* Dropdown panel */
.rf-dropdown {
  list-style: none; position: absolute; top: 100%; left: 0;
  min-width: 216px; margin: 0; padding: 8px 0;
  background: var(--rf-color-surface);
  border: 1px solid var(--rf-border);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(46,40,32,0.20);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 300;
}
/* Transparent bridge so the pointer can cross the gap to the panel */
.rf-dropdown::before { content: ''; position: absolute; top: -14px; left: 0; right: 0; height: 14px; }

.rf-has-dropdown:hover > .rf-dropdown,
.rf-has-dropdown:focus-within > .rf-dropdown,
.rf-has-flyout:hover > .rf-dropdown,
.rf-has-flyout:focus-within > .rf-dropdown {
  opacity: 1; visibility: visible; transform: translateY(0);
}

.rf-dropdown li { position: relative; }
.rf-dropdown li a {
  display: block; padding: 10px 20px;
  font-family: var(--rf-font-ui); font-size: 15px; font-weight: 600;
  color: var(--rf-color-text); text-decoration: none; text-shadow: none;
  white-space: nowrap; transition: background 0.18s ease, color 0.18s ease;
}
.rf-dropdown li a:hover,
.rf-dropdown li a:focus { background: var(--rf-color-surface-soft); color: var(--rf-color-primary); opacity: 1; }
.rf-dropdown li a.active { color: var(--rf-color-primary); }

/* Third level and deeper open as a side flyout */
.rf-dropdown .rf-has-flyout > a { display: flex; align-items: center; }
.rf-nav-caret--right {
  margin-left: auto; width: 0; height: 0;
  border-left: 5px solid currentColor; border-top: 4px solid transparent;
  border-bottom: 4px solid transparent; border-right: 0;
  opacity: 0.7; transform: none;
}
.rf-dropdown .rf-dropdown {
  top: -9px; left: 100%; margin-left: 2px; transform: translateX(8px);
}
.rf-has-flyout:hover > .rf-dropdown,
.rf-has-flyout:focus-within > .rf-dropdown { transform: translateX(0); }
.rf-dropdown .rf-dropdown::before { top: 0; left: -14px; right: auto; width: 14px; height: 100%; }

/* Right-hand hero links (and their flyouts) open toward the viewport centre */
.rf-nav-right .rf-has-dropdown > .rf-dropdown { left: auto; right: 0; }
.rf-nav-right .rf-dropdown .rf-dropdown {
  left: auto; right: 100%; margin-left: 0; margin-right: 2px; transform: translateX(-8px);
}
.rf-nav-right .rf-has-flyout:hover > .rf-dropdown,
.rf-nav-right .rf-has-flyout:focus-within > .rf-dropdown { transform: translateX(0); }

/* ── MOBILE NAV ── */
.rf-hero-mobile-bar {
  display: none; position: absolute; top: 0; left: 0; right: 0; z-index: 102;
  align-items: center; justify-content: space-between;
  padding: 16px var(--rf-layout-side-padding);
}
.rf-hero-mobile-logo { height: 84px; width: auto; }
.rf-hero-mobile-logo img { height: 100%; width: auto; display: block; }

.rf-hamburger-btn {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.9); padding: 8px;
  display: none; align-items: center; justify-content: center;
  border-radius: 4px; transition: background 0.2s;
}
.rf-hamburger-btn:hover { background: rgba(255,255,255,0.1); color: var(--rf-color-surface); }
.rf-hamburger-btn svg { width: 26px; height: 26px; }

/* ── MOBILE DRAWER ── */
.rf-menu-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(46,40,32,0.5); opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.rf-menu-overlay.open { opacity: 1; pointer-events: all; }
.rf-mobile-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 600;
  width: min(320px, 85vw); background: var(--rf-color-surface-dark);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.4,0,0.2,1);
  box-shadow: -4px 0 24px rgba(0,0,0,0.3);
}
.rf-mobile-drawer.open { transform: translateX(0); }
.rf-drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid rgba(255,255,255,0.12);
}
.rf-drawer-logo { height: 48px; width: auto; }
.rf-drawer-close {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.8); padding: 8px;
  display: flex; align-items: center; border-radius: 4px;
}
.rf-drawer-close svg { width: 24px; height: 24px; }
.rf-drawer-links { list-style: none; padding: 16px 0; flex: 1; overflow-y: auto; }
.rf-drawer-sublinks { list-style: none; }

.rf-drawer-row {
  display: flex; align-items: stretch;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.rf-drawer-row > a {
  flex: 1; display: block; padding: 14px 24px;
  text-decoration: none; color: rgba(255,255,255,0.82);
  font-family: var(--rf-font-ui); font-size: 17px; font-weight: 600;
  transition: color 0.2s, background 0.2s;
}
.rf-drawer-row > a:hover { color: var(--rf-color-surface); background: rgba(255,255,255,0.06); }
.rf-drawer-row > a.active { color: var(--rf-color-primary); }

/* Nested levels indent and step down in weight */
.rf-drawer-item--depth-2 > .rf-drawer-row > a { padding-left: 40px; font-size: 15px; font-weight: 400; color: rgba(255,255,255,0.72); }
.rf-drawer-item--depth-3 > .rf-drawer-row > a { padding-left: 56px; font-size: 14px; }

/* Accordion toggle */
.rf-drawer-sub-toggle {
  flex-shrink: 0; width: 54px; background: none; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.55); transition: color 0.2s, background 0.2s;
}
.rf-drawer-sub-toggle:hover { color: var(--rf-color-surface); background: rgba(255,255,255,0.06); }
.rf-drawer-caret {
  width: 0; height: 0;
  border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-top: 6px solid currentColor;
  transition: transform 0.25s ease;
}
.rf-drawer-item--open > .rf-drawer-row .rf-drawer-caret { transform: rotate(180deg); }

/* Collapsible sub-list */
.rf-drawer-sublinks {
  max-height: 0; overflow: hidden;
  background: rgba(0,0,0,0.16);
  transition: max-height 0.3s ease;
}
.rf-drawer-item--open > .rf-drawer-sublinks { max-height: 720px; }
.rf-drawer-footer { padding: 20px 24px; border-top: 1px solid rgba(255,255,255,0.12); }
.rf-drawer-cta {
  display: block; width: 100%;
  background: var(--rf-color-primary); color: var(--rf-color-surface);
  text-decoration: none; text-align: center;
  padding: 14px 24px; border-radius: 4px;
  font-family: var(--rf-font-ui); font-size: 15px; font-weight: 700;
  transition: background 0.2s;
}
.rf-drawer-cta:hover { background: var(--rf-color-primary-dark); }

/* ── FOOTER ── */
.rf-footer { background: var(--rf-color-surface-dark); padding: 40px var(--rf-layout-side-padding); }
.rf-footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--rf-layout-max-width); margin: 0 auto;
}
.rf-footer-logo { width: 140px; }
.rf-footer-logo img { width: 100%; }
.rf-footer-nav { display: flex; gap: 28px; list-style: none; }
.rf-footer-nav a { color: rgba(255,255,255,0.75); text-decoration: none; font-size: 13px; transition: color 0.2s; }
.rf-footer-nav a:hover { color: var(--rf-color-surface); }
.rf-footer-divider { border: none; border-top: 1px solid rgba(255,255,255,0.12); max-width: var(--rf-layout-max-width); margin: 24px auto 16px; }
.rf-footer-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 14px 28px;
  flex-wrap: wrap; max-width: var(--rf-layout-max-width); margin: 0 auto;
}
.rf-footer-bottom > p { color: rgba(255,255,255,0.45); font-size: 12px; }
.rf-footer-credits { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; }
.rf-footer-credits a { color: rgba(255,255,255,0.7); text-decoration: none; font-size: 12px; transition: color 0.2s; }
.rf-footer-credits a:hover { color: var(--rf-color-surface); }
.rf-footer-social { display: inline-flex; align-items: center; gap: 7px; }
.rf-footer-social svg { width: 16px; height: 16px; display: block; }
.rf-footer-sep { color: rgba(255,255,255,0.28); font-size: 12px; }

/* ── SHARED COMPONENTS ── */
.rf-eyebrow {
  font-family: var(--rf-font-ui); font-size: 11px;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--rf-color-primary); font-weight: 700; margin-bottom: 16px;
  display: block;
}
.rf-btn-primary {
  background: var(--rf-color-primary); color: var(--rf-color-surface);
  padding: 14px 32px; border-radius: 4px;
  text-decoration: none; font-family: var(--rf-font-ui); font-size: 15px; font-weight: 700;
  display: inline-block; transition: background 0.2s;
}
.rf-btn-primary:hover { background: var(--rf-color-primary-dark); color: var(--rf-color-surface); }
.rf-btn-outline {
  border: 2px solid var(--rf-color-text); color: var(--rf-color-text);
  padding: 12px 32px; border-radius: 4px;
  text-decoration: none; font-family: var(--rf-font-ui); font-size: 15px; font-weight: 700;
  display: inline-block; transition: all 0.2s;
}
.rf-btn-outline:hover { background: var(--rf-color-text); color: var(--rf-color-surface); }
.rf-cta-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.rf-logo-link { display: text-decoration: none; flex-shrink: 0; }

/* ── GLOBAL RESPONSIVE ── */
@media (max-width: 900px) {
  :root { --rf-layout-side-padding: 24px; --rf-layout-sticky-height: 64px; }
  .rf-nav-left, .rf-nav-right, .rf-nav-logo { display: none; }
  .rf-hero-mobile-bar { display: flex; }
  .rf-sticky-links, .rf-sticky-divider { display: none; }
  .rf-sticky-nav { justify-content: space-between; }
  .rf-sticky-nav .rf-hamburger-btn { display: flex; margin-left: auto; }
  .rf-footer-inner { flex-direction: column; gap: 24px; text-align: center; }
  .rf-footer-nav { flex-wrap: wrap; justify-content: center; }
  .rf-footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
  .rf-footer { padding-top: 32px; padding-bottom: 32px; }
}