/* ==========================================================================
   RUACH FOODS — CLEAN DESIGN SYSTEM & RESPONSIVE FIXES (v2.0.0)
   Eliminates 367 KB / 4,931 !important bloat; restores mobile menu, archive
   prices, PDP quantity alignment, bundle wrapping, and WCAG contrast.
   ========================================================================== */

:root {
  --rf-green-deep: #154232;
  --rf-green-leaf: #2e5a36;
  --rf-cream-canvas: #faf7f2;
  --rf-cream-alt: #f5f0e6;
  --rf-gold: #c88a1e;
  --rf-ink: #1f2923;
  --rf-ink-muted: #525e57;
  --rf-border: #d8d0c3;
  --rf-surface: #ffffff;
  --rf-radius-card: 18px;
  --rf-radius-pill: 999px;
  --rf-font-display: 'Fraunces', Georgia, serif;
  --rf-font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  font-family: var(--rf-font-sans);
  color: var(--rf-ink);
  background-color: var(--rf-cream-canvas);
  --wc-form-border-color: #b7afa2;
  --wc-form-border-radius: 10px;
}

h1, h2, h3, .rf-hero-title, .woocommerce-loop-product__title {
  font-family: var(--rf-font-display);
  color: var(--rf-green-deep);
}

/* --------------------------------------------------------------------------
   1. FIX BROKEN MOBILE OFFCANVAS MENU DRAWER (#offcanvas)
   Replaces legacy height:0 / max-height:0 !important trap from v1.0.0
   -------------------------------------------------------------------------- */
#offcanvas.ct-panel {
  position: fixed !important;
  inset: 0 0 0 auto !important;
  width: min(340px, 88vw) !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  min-height: 100dvh !important;
  background: var(--rf-cream-canvas) !important;
  box-shadow: -12px 0 36px rgba(21, 66, 50, 0.18) !important;
  z-index: 100001 !important;
  transform: translateX(100%) !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  overflow-y: auto !important;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.28s ease, opacity 0.28s ease !important;
}

body[data-panel*="offcanvas"] #offcanvas.ct-panel,
#offcanvas.ct-panel.active,
#offcanvas.ct-panel[data-state="open"] {
  transform: translateX(0) !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

#offcanvas .ct-panel-content,
#offcanvas .ct-panel-content-inner {
  display: block;
  padding: 16px 20px 32px;
}

#offcanvas .mobile-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 4px;
  font-size: 16px;
  font-weight: 600;
  color: var(--rf-green-deep);
  border-bottom: 1px solid var(--rf-border);
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   2. HERO & BUNDLE CARD WRAPPING / BADGE OVERLAP FIXES
   -------------------------------------------------------------------------- */
.rf-hero-container {
  position: relative;
  background: radial-gradient(120% 120% at 50% 0%, #ffffff 0%, #f1fbf6 55%, #e6f4ec 100%);
  border: 1px solid var(--rf-border);
  border-radius: 24px;
  padding: clamp(20px, 4vw, 48px);
}

/* Remove floating particle dots that occluded hero text */
.rf-hero-particle,
.rf-floating-dot {
  display: none;
}

.rf-bundles-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

@media (max-width: 960px) {
  .rf-bundles-grid {
    grid-template-columns: 1fr;
  }
}

.rf-bundle-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--rf-surface);
  border: 1px solid var(--rf-border);
  border-radius: var(--rf-radius-card);
  padding: 36px 22px 24px;
  min-width: 0;
}

.rf-bundle-card h3,
.rf-bundle-card li,
.rf-bundle-card p {
  word-break: normal;
  overflow-wrap: break-word;
  hyphens: none;
}

.rf-bundle-badge {
  position: static;
  align-self: flex-start;
  margin-bottom: 10px;
  padding: 4px 12px;
  border-radius: var(--rf-radius-pill);
  font-size: 12px;
  font-weight: 700;
  background: #fef3c7;
  color: #7c2d12;
}

/* --------------------------------------------------------------------------
   3. PRODUCT ARCHIVE & CAROUSEL PRICE VISIBILITY + MOBILE TOOLBAR FIX
   -------------------------------------------------------------------------- */
.woocommerce ul.products li.product .price,
.woocommerce-page ul.products li.product .price {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  font-family: var(--rf-font-sans) !important;
  font-variant-numeric: tabular-nums;
  font-size: 16px !important;
  font-weight: 700 !important;
  color: var(--rf-green-deep) !important;
  margin: 6px 0 12px !important;
}

.woocommerce ul.products li.product .price del {
  color: #6b7280;
  font-weight: 500;
  margin-right: 6px;
}

.woocommerce ul.products li.product .price ins {
  background: transparent;
  text-decoration: none;
  color: var(--rf-green-deep);
}

.woocommerce-before-shop-loop {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.woocommerce .woocommerce-ordering {
  position: relative;
  margin: 0;
  z-index: 2;
}

@media (max-width: 767px) {
  .rf-carousel-side-arrow.rf-side-prev {
    left: 6px;
    top: 38%;
  }
  .rf-carousel-side-arrow.rf-side-next {
    right: 6px;
    top: 38%;
  }
  .rf-filter-tab {
    flex: 0 0 auto;
  }
}

/* --------------------------------------------------------------------------
   4. SINGLE PRODUCT PAGE: QUANTITY STEPPER, TRUST PANEL & STICKY MOBILE BAR
   -------------------------------------------------------------------------- */
.single-product .cart .quantity {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid #b7afa2;
  border-radius: var(--rf-radius-pill);
  background: var(--rf-surface);
  overflow: hidden;
  height: 46px;
}

.single-product .cart .quantity .ct-increase,
.single-product .cart .quantity .ct-decrease,
.single-product .cart .quantity button {
  position: static;
  width: 38px;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--rf-green-deep);
  font-weight: 700;
  cursor: pointer;
}

.single-product .cart .quantity input.qty {
  position: static;
  width: 44px;
  height: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--rf-ink);
  -moz-appearance: textfield;
}

.single-product .cart .quantity input.qty::-webkit-outer-spin-button,
.single-product .cart .quantity input.qty::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.rf-pdp-trust-box {
  margin: 18px 0;
  padding: 14px 16px;
  background: var(--rf-cream-alt);
  border: 1px solid var(--rf-border);
  border-radius: 14px;
  font-size: 13.5px;
}

.rf-pdp-trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--rf-green-deep);
  margin-bottom: 10px;
}

.rf-veg-mark {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 1.5px solid #15803d;
  border-radius: 2px;
  position: relative;
  flex-shrink: 0;
}

.rf-veg-mark::after {
  content: '';
  position: absolute;
  inset: 3px;
  background: #15803d;
  border-radius: 50%;
}

.rf-pdp-trust-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.rf-pdp-trust-grid p {
  margin: 4px 0 0;
  color: var(--rf-ink-muted);
  line-height: 1.45;
}

@media (max-width: 640px) {
  .rf-pdp-trust-grid {
    grid-template-columns: 1fr;
  }
}

/* Sticky Mobile Add-to-Cart */
.rf-sticky-atc {
  display: none;
}

@media (max-width: 767px) {
  .rf-sticky-atc.is-visible {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9990;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: var(--rf-surface);
    border-top: 1px solid var(--rf-border);
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.08);
  }
  .rf-sticky-atc__meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }
  .rf-sticky-atc__title {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .rf-sticky-atc__price {
    font-size: 13px;
    color: var(--rf-green-deep);
    font-weight: 700;
  }
  .rf-sticky-atc__btn {
    flex-shrink: 0;
    padding: 10px 18px;
    border: 0;
    border-radius: var(--rf-radius-pill);
    background: var(--rf-green-deep);
    color: #ffffff;
    font-weight: 700;
    font-size: 13px;
  }
}

/* --------------------------------------------------------------------------
   5. GLOBAL COMPLIANCE FOOTER BAR & ACCESSIBLE ACCOUNT FORMS
   -------------------------------------------------------------------------- */
.rf-footer-compliance {
  background: var(--rf-green-deep);
  color: #e6f2ec;
  font-size: 13px;
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.rf-footer-compliance__inner {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 10px;
  text-align: center;
}

.rf-footer-compliance a {
  color: #fde68a;
  text-decoration: underline;
}

.woocommerce-account input.input-text,
.woocommerce-checkout input.input-text,
.woocommerce-checkout select {
  background-color: var(--rf-surface) !important;
  border: 1.5px solid #9c9487 !important;
  border-radius: 10px !important;
  color: var(--rf-ink) !important;
  padding: 10px 14px !important;
}

.woocommerce-account input.input-text:focus,
.woocommerce-checkout input.input-text:focus {
  outline: 2px solid var(--rf-green-deep);
  outline-offset: 1px;
  border-color: var(--rf-green-deep);
}

/* Prevent WhatsApp floating button from covering footer text on mobile */
@media (max-width: 767px) {
  footer.ct-footer {
    padding-bottom: 84px;
  }
  .single-product footer.ct-footer {
    padding-bottom: 136px;
  }
}
