/* ==========================================================================
   BIOCULTOR — Global Branding CSS, Unified Header Menu & Expandable Footer
   Single Global Brand Layer loaded on EVERY page via base.html.
   Unifies Landing (/), ERP Gaming (/juego/), ERP Pro (/erp/), Storefront,
   Marketplace, Rural Land Portal, Suppliers Club, Forum, and Onboarding.
   ========================================================================== */

:root {
  --bc-cacao-deep: #18110e;
  --bc-cacao-shell: #231b18;
  --bc-cacao-elevated: #2d221d;
  --bc-cream-card: #f8f6f0;
  --bc-lime-brand: #97bf04;
  --bc-lime-bright: #aee00a;
  --bc-lime-deep: #769603;
  --bc-cyan-water: #38bdf8;
  --bc-gold-hour: #ffd089;
  --bc-global-glass-dark: linear-gradient(135deg, rgba(26, 19, 15, 0.82) 0%, rgba(26, 19, 15, 0.58) 100%);
  --bc-global-glass-border: rgba(255, 238, 210, 0.22);
  --bc-global-glass-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 14px 36px rgba(0, 0, 0, 0.34);
}

/* ==========================================================================
   1. Global Brand Components (Shared across Landing, ERP Gaming & Portals)
   ========================================================================== */
.bc-brand-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.34rem 0.86rem;
  border-radius: 9999px;
  background: rgba(255, 252, 245, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  text-decoration: none;
  flex-shrink: 0;
}
.bc-brand-pill img {
  height: 23px;
  width: auto;
  display: block;
}

.bc-cta-lime {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 40px;
  padding: 0.48rem 1.25rem;
  border-radius: 9999px;
  border: 1px solid rgba(226, 255, 134, 0.56);
  background: linear-gradient(180deg, #a8d408 0%, #86a804 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 10px 26px rgba(24, 30, 4, 0.34);
  color: #19130e;
  font-family: var(--bc-font-ui);
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.18s ease, filter 0.18s ease;
}
.bc-cta-lime:hover {
  transform: translateY(-1px);
  filter: brightness(1.07);
}

.bc-cta-glass {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 40px;
  padding: 0.48rem 1.15rem;
  border-radius: 9999px;
  border: 1px solid var(--bc-global-glass-border);
  background: var(--bc-global-glass-dark);
  backdrop-filter: blur(18px) saturate(175%);
  -webkit-backdrop-filter: blur(18px) saturate(175%);
  box-shadow: var(--bc-global-glass-shadow);
  color: #fffbf2;
  font-family: var(--bc-font-ui);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.bc-cta-glass:hover {
  transform: translateY(-1px);
  border-color: var(--bc-lime-brand);
  color: #f4ffbf;
}

/* ==========================================================================
   2. Unified Global Header Menu (Standard / Overlay / Cockpit modes)
   ========================================================================== */
.bc-global-header {
  position: sticky;
  top: 0;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.72rem 1.6rem;
  background: linear-gradient(180deg, rgba(35, 27, 24, 0.94) 0%, rgba(28, 21, 18, 0.90) 100%);
  backdrop-filter: blur(20px) saturate(165%);
  -webkit-backdrop-filter: blur(20px) saturate(165%);
  border-bottom: 1px solid rgba(255, 232, 198, 0.14);
  color: #fffaf1;
}

.bc-global-header--overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, rgba(24, 17, 13, 0.56) 0%, rgba(24, 17, 13, 0.0) 100%);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: none;
  padding: 1.05rem 2.25rem;
}

.bc-global-header--cockpit {
  position: sticky;
  padding: 0.65rem 1.25rem;
  background: linear-gradient(180deg, #271d19 0%, #1f1714 100%);
}

.bc-global-nav-pill {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.28rem 0.42rem;
  border-radius: 9999px;
  background: rgba(24, 18, 15, 0.54);
  backdrop-filter: blur(18px) saturate(165%);
  -webkit-backdrop-filter: blur(18px) saturate(165%);
  border: 1px solid rgba(255, 238, 210, 0.18);
}

.bc-global-nav-pill a {
  color: rgba(255, 248, 236, 0.88);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.42rem 0.88rem;
  border-radius: 9999px;
  transition: background-color 0.18s ease, color 0.18s ease;
  white-space: nowrap;
}
.bc-global-nav-pill a:hover,
.bc-global-nav-pill a[aria-current="page"] {
  background: rgba(151, 191, 4, 0.22);
  color: #eefba8;
}

.bc-global-header-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.bc-global-menu-toggle {
  display: none;
  min-width: 42px;
  min-height: 42px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 238, 210, 0.24);
  background: rgba(24, 18, 15, 0.65);
  color: #fffaf1;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* Mobile Global Drawer */
.bc-global-mobile-drawer {
  display: none;
  position: fixed;
  top: 66px;
  left: 0.85rem;
  right: 0.85rem;
  z-index: 55;
  padding: 1rem;
  border-radius: 1.15rem;
  background: linear-gradient(145deg, rgba(28, 20, 16, 0.96) 0%, rgba(20, 14, 11, 0.94) 100%);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid rgba(255, 238, 210, 0.24);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  flex-direction: column;
  gap: 0.35rem;
}
.bc-global-mobile-drawer.is-open { display: flex; }
.bc-global-mobile-drawer a {
  color: #fff8ec;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.65rem 0.9rem;
  border-radius: 0.7rem;
}
.bc-global-mobile-drawer a:hover {
  background: rgba(151, 191, 4, 0.2);
  color: #eefba8;
}

/* ==========================================================================
   3. Unified Expandable Global Footer (Standard & Floating Full-Bleed Dock)
   ========================================================================== */
.bc-global-footer {
  background: linear-gradient(180deg, #241b17 0%, #19120f 100%);
  color: #efe6d8;
  border-top: 1px solid rgba(255, 232, 198, 0.14);
  margin-top: 2.5rem;
  position: relative;
  z-index: 35;
}

.bc-global-footer--floating {
  position: fixed;
  left: 50%;
  bottom: 0.85rem;
  transform: translateX(-50%);
  margin-top: 0;
  width: min(calc(100vw - 2rem), 980px);
  border-radius: 1.15rem;
  border: 1px solid rgba(255, 238, 210, 0.22);
  background: linear-gradient(135deg, rgba(26, 19, 15, 0.86) 0%, rgba(20, 14, 11, 0.78) 100%);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 18px 48px rgba(0, 0, 0, 0.46);
  pointer-events: auto;
}
.bc-global-footer--floating:not(.is-expanded) {
  width: auto;
  border-radius: 9999px;
}

.bc-footer-bar {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0.85rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  flex-wrap: wrap;
}
.bc-global-footer--floating:not(.is-expanded) .bc-footer-bar {
  padding: 0.38rem 0.9rem;
  gap: 0.65rem;
}
.bc-global-footer--floating:not(.is-expanded) .bc-footer-tagline {
  display: none;
}

.bc-footer-tagline {
  font-size: 0.78rem;
  color: #cfc2b0;
}
.bc-footer-tagline strong { color: #fffaf1; }

.bc-footer-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.bc-footer-expand-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  min-height: 34px;
  padding: 0.34rem 0.85rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 232, 198, 0.24);
  background: rgba(255, 245, 228, 0.08);
  color: #ffd48a;
  font-family: var(--bc-font-ui);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}
.bc-footer-expand-btn:hover {
  background: rgba(151, 191, 4, 0.2);
  border-color: #97bf04;
  color: #eefba8;
}
.bc-footer-chevron {
  display: inline-block;
  transition: transform 0.22s ease;
}
.bc-global-footer.is-expanded .bc-footer-chevron {
  transform: rotate(180deg);
}

/* Expandable 4-Column Sitemap Drawer */
.bc-footer-drawer {
  display: none;
  border-bottom: 1px solid rgba(255, 232, 198, 0.12);
}
.bc-global-footer.is-expanded .bc-footer-drawer {
  display: block;
}
.bc-footer-grid {
  max-width: 1240px;
  margin: 0 auto;
  padding: 1.5rem 1.4rem 1.25rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
}
.bc-footer-col h4 {
  font-family: var(--bc-font-brand);
  font-size: 0.95rem;
  color: #ffd48a;
  margin: 0 0 0.55rem;
}
.bc-footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.38rem;
}
.bc-footer-col a {
  color: #e4d8c8;
  text-decoration: none;
  font-size: 0.82rem;
}
.bc-footer-col a:hover { color: #a8d408; }
.bc-footer-col p {
  font-size: 0.78rem;
  line-height: 1.5;
  color: #c2b4a2;
  margin: 0;
}

/* ==========================================================================
   4. Global 9-Role Liquid-Glass Modal (Accessible from EVERY page)
   ========================================================================== */
.bc-role-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(14, 10, 8, 0.66);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}
.bc-role-modal-backdrop[open] {
  display: flex;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  color: #fffaf1;
}
.bc-role-modal-backdrop::backdrop { background: rgba(18, 13, 10, 0.56); }
.bc-role-modal {
  width: min(100%, 840px);
  max-height: 88dvh;
  overflow-y: auto;
  border-radius: 1.5rem;
  padding: 1.85rem 2rem;
  background: linear-gradient(135deg, rgba(28, 20, 16, 0.88) 0%, rgba(22, 16, 13, 0.72) 100%);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(255, 240, 214, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), 0 30px 80px rgba(0, 0, 0, 0.58);
}
.bc-role-lanes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 1.15rem;
}
.bc-role-lane-box {
  padding: 1rem 1.1rem;
  border-radius: 1rem;
  background: rgba(255, 250, 242, 0.07);
  border: 1px solid rgba(255, 236, 205, 0.2);
}
.bc-role-lane-box h3 { font-family: var(--bc-font-brand); color: #fffdf8; font-size: 1.12rem; margin: 0 0 0.25rem; }
.bc-role-lane-box p { font-size: 0.8rem; color: rgba(255, 245, 230, 0.78); margin: 0 0 0.7rem; }
.bc-role-chip-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.bc-role-chip {
  min-height: 44px;
  padding: 0.42rem 0.85rem;
  border-radius: 9999px;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fffbf2;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 238, 210, 0.26);
  display: inline-flex;
  align-items: center;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.bc-role-chip:hover { background: #97bf04; border-color: #97bf04; color: #16110d; }

/* ==========================================================================
   5. Responsive Rules (Desktop & Mobile 390 x 844)
   ========================================================================== */
@media (max-width: 960px) {
  .bc-global-nav-pill { display: none; }
  .bc-global-menu-toggle { display: inline-flex; }
  .bc-footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .bc-global-header { padding: 0.7rem 0.95rem; }
  .bc-global-header--overlay { padding: 0.78rem 1rem; }
  .bc-brand-pill { padding: 0.28rem 0.7rem; }
  .bc-brand-pill img { height: 20px; }
  .bc-cta-lime { padding: 0.42rem 0.9rem; font-size: 0.78rem; }
  .bc-footer-grid { grid-template-columns: 1fr; padding: 1.1rem; }
  .bc-role-lanes { grid-template-columns: 1fr; }
  .bc-role-modal { padding: 1.2rem; }

}

/* Shared optical surfaces. A low-alpha tile keeps the diffusion local to the glass. */
:root {
  --bc-glass-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.84' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' opacity='.045' filter='url(%23n)'/%3E%3C/svg%3E");
  --bc-glass-face: var(--bc-glass-grain), linear-gradient(155deg, rgb(62 46 35 / 95%), rgb(30 23 20 / 89%));
  --bc-edge: inset 0 1px 0 rgb(255 246 224 / 26%);
  --bc-float: var(--bc-edge), 0 10px 28px rgb(24 17 14 / 22%);
  --bc-display: clamp(3.6rem, 5.35vw, 6.75rem);
  --bc-reading: clamp(.94rem, 1.05vw, 1.12rem);
}
.bc-global-header {font-variant-numeric:tabular-nums}
.bc-global-header .bc-global-nav-pill {background:transparent;border:0;box-shadow:none;backdrop-filter:none;padding:0}
.bc-global-nav-pill a {border-radius:.32rem;display:inline-flex;align-items:center;min-height:44px}
.bc-global-header--overlay {background:linear-gradient(to bottom,rgb(29 22 19 / 75%),transparent);padding-inline:clamp(1rem,4vw,4.75rem)}
.bc-global-header--cockpit {border-bottom:1px solid #645040;background:var(--bc-cacao-shell)}
.bc-global-header .bc-cta-lime, .bc-global-menu-toggle, .bc-footer-expand-btn {min-height:44px}
.bc-global-mobile-drawer {max-height:calc(100dvh - 5rem);overflow-y:auto;overscroll-behavior:contain}
body .bc-role-modal, .bc-global-footer--floating, .bc-igloo-body .bc-liquid-console,
.bc-igloo-body .bc-glass-pin, .bc-cockpit-body .bc-3d-pin {
  background:var(--bc-glass-face);box-shadow:var(--bc-float);backdrop-filter:blur(14px) saturate(110%);
}
body .bc-role-modal {border-radius:1.15rem;overscroll-behavior:contain}
body .bc-role-lane-box {background:transparent;border:0;border-top:1px solid #796455;border-radius:0;padding:.9rem .25rem}
body .bc-role-lane-box h3 {font-size:1.4rem}
.bc-global-footer--floating {left:auto;right:1rem;bottom:max(.3rem,env(safe-area-inset-bottom));transform:none;max-height:calc(100dvh - 5rem);overflow:auto;overscroll-behavior:contain;z-index:40}
.bc-global-footer--floating:not(.is-expanded) .bc-footer-bar {padding:0}
.bc-global-footer--floating .bc-footer-expand-btn {border:0;background:transparent;color:#fff1d7}
.bc-global-footer.is-expanded .bc-footer-drawer {animation:bc-reveal .22s ease-out}
@keyframes bc-reveal {from{opacity:.4;transform:translateY(6px)}to{opacity:1;transform:none}}
:where(.bc-global-header,.bc-global-footer,.bc-role-modal,.bc-igloo-shell,.bc-cockpit-grid,dialog) :focus-visible {
  outline:3px solid #f8f6f0;outline-offset:2px;box-shadow:0 0 0 6px #30231b;
}
[data-theme="high-contrast"] :is(.bc-global-header,.bc-global-footer,.bc-role-modal,.bc-liquid-console,.bc-3d-pin,.bc-glass-pin) {background:#171311;color:white;border-color:white;backdrop-filter:none}
@media(max-width:767px){
  .bc-global-footer--floating {right:.65rem}
  .bc-igloo-body .bc-global-footer--floating:not(.is-expanded) {bottom:auto;top:4.5rem}
  .bc-igloo-body .bc-global-footer--floating.is-expanded {bottom:4.6rem;max-height:calc(100dvh - 9rem)}
  .bc-global-header--cockpit .bc-global-header-actions>.bc-cta-glass {display:none}
}
@media(prefers-reduced-motion:reduce){
  .bc-global-footer *, .bc-global-header *, .bc-role-modal *, .bc-igloo-shell * {animation:none!important;transition:none!important}
}
