/* ==========================================================================
   AgriMart — "Harvest 2026" design system
   Editorial typography · soft glass surfaces · organic motion
   Bootstrap provides the grid + a few components; everything visual is here.
   ========================================================================== */

/* ---------- 1. Design tokens -------------------------------------------- */
:root {
  /* brand */
  --brand:        #1f5d3a;
  --brand-2:      #2f8f57;
  --brand-3:      #59c187;
  --brand-soft:   #e3f0e6;
  --accent:       #e2703a;   /* terracotta */
  --gold:         #d6a13f;   /* harvest */

  /* neutrals (light) */
  --bg:           #f6f4ec;
  --bg-2:         #efece1;
  --surface:      #ffffff;
  --surface-2:    #f3f0e7;
  --ink:          #12241a;
  --muted:        #5d6f61;
  --line:         rgba(18, 36, 26, .10);
  --line-strong:  rgba(18, 36, 26, .18);

  /* footer stays dark in both themes */
  --footer-bg:    #101d15;
  --footer-ink:   #f0f5f0;
  --footer-muted: rgba(240, 245, 240, .72);
  --footer-line:  rgba(255, 255, 255, .14);

  /* effects */
  --shadow-sm: 0 1px 2px rgba(18,36,26,.05), 0 2px 8px rgba(18,36,26,.05);
  --shadow-md: 0 10px 30px -12px rgba(18,36,26,.22), 0 2px 8px rgba(18,36,26,.06);
  --shadow-lg: 0 32px 70px -30px rgba(18,36,26,.45);
  --ring:      0 0 0 .25rem color-mix(in srgb, var(--brand-3) 35%, transparent);

  --radius-xs: 10px;
  --radius-sm: 14px;
  --radius:    22px;
  --radius-lg: 32px;
  --radius-pill: 999px;

  --glass:      rgba(255,255,255,.72);
  --glass-brd:  rgba(255,255,255,.55);

  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-body: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --ease: cubic-bezier(.22, 1, .36, 1);
  --container: 1240px;
}

[data-theme="dark"] {
  --brand:        #57cf90;
  --brand-2:      #7ee2ae;
  --brand-3:      #a4f0c8;
  --brand-soft:   rgba(87, 207, 144, .13);
  --accent:       #ff9364;
  --gold:         #f0c368;

  --bg:           #0b1410;
  --bg-2:         #0f1b15;
  --surface:      #121f18;
  --surface-2:    #17281f;
  --ink:          #ecf4ed;
  --muted:        #9cb2a3;
  --line:         rgba(255,255,255,.10);
  --line-strong:  rgba(255,255,255,.18);

  --footer-bg:    #070f0b;
  --footer-ink:   #eaf3ec;
  --footer-muted: rgba(234, 243, 236, .66);
  --footer-line:  rgba(255, 255, 255, .12);

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 14px 34px -14px rgba(0,0,0,.7);
  --shadow-lg: 0 40px 80px -40px rgba(0,0,0,.9);

  --glass:      rgba(18,31,24,.68);
  --glass-brd:  rgba(255,255,255,.08);
}

/* ---------- 2. Base ------------------------------------------------------ */
* { -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .4s var(--ease), color .4s var(--ease);
}

h1, h2, h3, h4, .display {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.08;
  color: var(--ink);
  font-variation-settings: "SOFT" 0, "WONK" 0;
}

.display-xl { font-size: clamp(2.6rem, 6.2vw, 5.1rem); font-weight: 560; }
.display-lg { font-size: clamp(2rem, 4.4vw, 3.3rem); }
.display-md { font-size: clamp(1.5rem, 3vw, 2.2rem); }

.italic-accent { font-style: italic; color: var(--brand-2); font-weight: 500; }

p { color: var(--muted); }
a { color: var(--brand-2); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--brand); }

.container { max-width: var(--container); padding-inline: clamp(1.1rem, 4vw, 2.4rem); }

::selection { background: var(--brand-3); color: #08150e; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--brand-2);
  font-weight: 500;
}

.section { padding-block: clamp(3.5rem, 8vw, 7rem); }

.section-head { margin-bottom: clamp(1.8rem, 3vw, 3rem); }

/* ---------- 3. Buttons --------------------------------------------------- */
.btn {
  font-family: var(--font-body);
  font-weight: 600;
  border-radius: var(--radius-pill);
  padding: .72rem 1.5rem;
  border: 1px solid transparent;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease),
              background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  letter-spacing: -.01em;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-sm { padding: .48rem 1rem; font-size: .87rem; }
.btn-lg { padding: .95rem 1.9rem; font-size: 1.03rem; }

.btn-solid, .btn-agri {
  background: var(--brand);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-solid:hover, .btn-agri:hover {
  background: var(--ink);
  color: var(--bg);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
[data-theme="dark"] .btn-solid:hover, [data-theme="dark"] .btn-agri:hover { background: var(--brand-3); color: #08150e; }

.btn-gold {
  background: var(--gold); color: #241703;
}
.btn-gold:hover { background: var(--accent); color: #fff; transform: translateY(-2px); }

.btn-ghost, .btn-outline-agri {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-ghost:hover, .btn-outline-agri:hover {
  background: var(--ink); color: var(--bg); border-color: var(--ink);
}
[data-theme="dark"] .btn-ghost:hover { background: var(--brand-3); color: #08150e; border-color: var(--brand-3); }

.btn-soft { background: var(--brand-soft); color: var(--brand); }
.btn-soft:hover { background: var(--brand); color: #fff; }

.btn-icon {
  width: 44px; height: 44px; padding: 0; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); position: relative;
}
.btn-icon:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.btn-link { color: var(--brand-2); }

/* ---------- 4. Pills, badges, chips ------------------------------------- */
.pill {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .34rem .8rem; border-radius: var(--radius-pill);
  font-size: .74rem; font-weight: 600; letter-spacing: .01em;
  background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--line);
}
.pill-brand { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.pill-gold  { background: color-mix(in srgb, var(--gold) 20%, transparent); color: var(--gold); border-color: transparent; }
.pill-accent{ background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); border-color: transparent; }
.pill-stock { background: var(--brand-soft); color: var(--brand-2); border-color: transparent; }
.pill-low   { background: color-mix(in srgb, var(--gold) 22%, transparent); color: #8a6512; border-color: transparent; }
[data-theme="dark"] .pill-low { color: var(--gold); }
.pill-out   { background: var(--surface-2); color: var(--muted); }

.badge-status {
  font-size: .68rem; letter-spacing: .12em; text-transform: uppercase;
  font-weight: 700; padding: .4rem .7rem; border-radius: var(--radius-pill);
}

/* ---------- 5. Cards ----------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: none;
  color: var(--ink);
}
.card-soft { box-shadow: var(--shadow-sm); }
.card-body { padding: 1.5rem; }

.surface {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--glass-brd);
}

/* ---------- 6. Header / navigation -------------------------------------- */
.announce {
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  overflow: hidden;
  white-space: nowrap;
}
.announce .track {
  display: inline-flex;
  gap: 3rem;
  padding-block: .55rem;
  animation: marquee 32s linear infinite;
}
.announce .track span { display: inline-flex; align-items: center; gap: .5rem; }
.announce .track i { color: var(--gold); }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.site-header { position: sticky; top: 0; z-index: 1030; }

.nav-shell {
  display: flex; align-items: center; gap: 1rem;
  padding-block: .8rem;
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .3s var(--ease), padding .3s var(--ease);
}
.site-header.is-stuck .nav-shell { box-shadow: var(--shadow-md); padding-block: .6rem; }

.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.45rem;
  color: var(--ink);
  display: inline-flex; align-items: center; gap: .55rem;
  letter-spacing: -.03em;
}
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-3));
  color: #fff; font-size: 1.15rem;
  box-shadow: var(--shadow-sm);
}

/* text wordmark logo (echoes the footer wordmark) */
.brand-wordmark {
  --wordmark-color: var(--ink);
  font-size: clamp(1.5rem, 1.1rem + 1.4vw, 1.85rem);
  font-weight: 600;
  letter-spacing: -.035em;
  line-height: 1;
}
.brand-wordmark .brand-text { color: var(--wordmark-color); }
@supports (-webkit-text-stroke: 1px black) {
  .brand-wordmark .brand-text {
    color: transparent;
    -webkit-text-stroke: .9px color-mix(in srgb, var(--wordmark-color) 52%, transparent);
    transition: color .25s var(--ease), -webkit-text-stroke-color .25s var(--ease);
  }
  .brand-wordmark:hover .brand-text,
  .brand-wordmark:focus-visible .brand-text {
    color: color-mix(in srgb, var(--wordmark-color) 82%, transparent);
    -webkit-text-stroke-color: transparent;
  }
}
/* light wordmark for dark surfaces (footer + auth aside) */
.footer .brand-wordmark {
  --wordmark-color: #fff;
  font-size: clamp(1.75rem, 1.15rem + 1.7vw, 2.3rem);
}
.brand-wordmark.on-dark { --wordmark-color: #fff; }

/* newsletter inline confirmation (replaces the JS alert) */
.newsletter-thanks {
  flex-basis: 100%;
  align-items: center; justify-content: center; gap: .45rem;
  margin: 0; color: #fff; font-weight: 600; font-size: .92rem;
}
.newsletter-thanks[hidden] { display: none !important; }
.newsletter-thanks:not([hidden]) { display: inline-flex; animation: flashPop .45s var(--ease) both; }

.nav-links { display: flex; align-items: center; gap: .25rem; margin-left: 1rem; }
.nav-link-x {
  padding: .5rem .9rem; border-radius: var(--radius-pill);
  color: var(--muted); font-weight: 600; font-size: .92rem;
}
.nav-link-x:hover, .nav-link-x.active { color: var(--ink); background: var(--surface-2); }

.nav-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }

.cart-dot {
  position: absolute; top: -4px; right: -4px;
  min-width: 20px; height: 20px; border-radius: 999px;
  background: var(--accent); color: #fff;
  font-size: .68rem; font-weight: 700; display: grid; place-items: center;
  padding: 0 5px; box-shadow: 0 0 0 3px var(--bg);
  font-family: var(--font-mono);
}

/* search */
.search-wrap { position: relative; }
.search-field {
  width: 44px; opacity: 0; pointer-events: none;
  transition: width .35s var(--ease), opacity .25s var(--ease);
}
.search-wrap.open .search-field { width: 240px; opacity: 1; pointer-events: auto; }
.search-input {
  border-radius: var(--radius-pill); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink);
  padding: .5rem 1rem .5rem 2.3rem; font-size: .9rem; width: 100%;
}
.search-input:focus { outline: none; box-shadow: var(--ring); border-color: var(--brand-3); }
.search-wrap .bi-search { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--muted); }

/* mobile menu */
.menu-toggle { display: none; }
.mobile-sheet {
  position: fixed; inset: 0; z-index: 1040;
  background: var(--bg);
  padding: 1.5rem;
  transform: translateY(-100%);
  transition: transform .45s var(--ease);
  overflow-y: auto;
}
.mobile-sheet.open { transform: translateY(0); }
.mobile-sheet a {
  display: block; padding: 1rem .25rem; font-size: 1.5rem;
  font-family: var(--font-display); color: var(--ink);
  border-bottom: 1px solid var(--line);
}

/* mobile / tablet bottom navigation bar (floating) */
.mobile-nav {
  display: none;
  position: fixed;
  left: .7rem; right: .7rem;
  bottom: calc(.7rem + env(safe-area-inset-bottom));
  z-index: 1025;
  align-items: stretch;
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--glass-brd);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 14px 34px -12px rgba(18, 36, 26, .35), 0 3px 10px -4px rgba(18, 36, 26, .18);
  padding: .4rem .45rem;
}
.mobile-nav-item {
  position: relative;
  flex: 1 1 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .18rem;
  padding: .35rem .2rem;
  border: 0; background: none; cursor: pointer;
  color: var(--muted); font-family: var(--font-body);
  font-size: .68rem; font-weight: 600; letter-spacing: .01em;
  border-radius: var(--radius-sm);
  transition: color .25s var(--ease), background .25s var(--ease);
}
.mobile-nav-item i { font-size: 1.25rem; line-height: 1; }
.mobile-nav-item:hover, .mobile-nav-item:focus-visible { color: var(--brand-2); }
.mobile-nav-item.active { color: var(--brand-2); background: var(--brand-soft); }
.mobile-nav-dot {
  position: absolute; top: .05rem; left: 50%;
  transform: translateX(calc(-50% + 12px));
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px;
  background: var(--accent); color: #fff;
  font-size: .6rem; font-weight: 700; line-height: 1;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  box-shadow: 0 0 0 2px var(--bg);
}

/* avatar */
.account-avatar {
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; flex: none;
  background: var(--brand-soft); color: var(--brand-2); font-size: 1.3rem;
}
.account-avatar.lg { width: 58px; height: 58px; font-size: 1.6rem; }

/* mobile account bottom sheet (enabled below 992px) */
.account-sheet,
.account-sheet-backdrop { display: none; }
.account-sheet {
  position: fixed;
  left: .7rem; right: .7rem;
  bottom: calc(.7rem + env(safe-area-inset-bottom));
  z-index: 1056;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1.1rem 1.1rem 1.25rem;
  transform: translateY(calc(100% + 2rem));
  opacity: 0; pointer-events: none;
  transition: transform .42s var(--ease), opacity .3s var(--ease);
}
.account-sheet.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
.account-sheet-grip {
  display: block; width: 42px; height: 4px; border-radius: 999px;
  background: var(--line-strong); margin: 0 auto 1rem;
}
.account-sheet-head { display: flex; align-items: center; gap: .9rem; }
.account-sheet-links { display: grid; gap: .25rem; margin-top: 1rem; }
.account-sheet-links a {
  display: flex; align-items: center; gap: .85rem;
  padding: .85rem .9rem; border-radius: var(--radius-sm);
  color: var(--ink); font-weight: 600;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.account-sheet-links a i { font-size: 1.15rem; color: var(--brand-2); width: 1.3rem; text-align: center; }
.account-sheet-links a:hover, .account-sheet-links a:focus-visible { background: var(--surface-2); }
.account-sheet-links a.danger, .account-sheet-links a.danger i { color: var(--accent); }
.account-sheet-backdrop {
  position: fixed; inset: 0; z-index: 1055;
  background: rgba(6, 14, 9, .5);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none;
  transition: opacity .3s var(--ease);
}
.account-sheet-backdrop.open { opacity: 1; pointer-events: auto; }

/* dropdown tweaks */
.dropdown-menu {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); background: var(--surface);
  padding: .5rem; min-width: 230px;
}
.dropdown-item {
  border-radius: var(--radius-xs); padding: .6rem .8rem;
  color: var(--ink); font-weight: 500; font-size: .92rem;
}
.dropdown-item:hover { background: var(--surface-2); color: var(--ink); }
.dropdown-divider { border-color: var(--line); }

/* ---------- 7. Hero ------------------------------------------------------ */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(4rem, 9vw, 8rem);
}
/* full-bleed rotating background for the entire hero section */
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1.05);
  transition: opacity 1.2s var(--ease), transform 8s linear;
}
.hero-slide.active { opacity: 1; transform: scale(1.14); }
/* theme-aware scrim keeps the copy legible over the photo */
.hero-scrim {
  position: absolute; inset: 0; z-index: 0;
  background:
    linear-gradient(90deg,
      var(--bg) 0%,
      color-mix(in srgb, var(--bg) 84%, transparent) 46%,
      color-mix(in srgb, var(--bg) 38%, transparent) 100%),
    linear-gradient(0deg,
      color-mix(in srgb, var(--bg) 58%, transparent),
      transparent 42%);
}
.hero .container { position: relative; z-index: 1; }

/* single, static image panel */
.hero-photo {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.hero-dots { display: flex; gap: .45rem; margin-top: 1.75rem; }
.hero-dot {
  width: 9px; height: 9px; border-radius: 50%; border: none; padding: 0;
  background: color-mix(in srgb, var(--ink) 30%, transparent); cursor: pointer;
  transition: width .3s var(--ease), background .3s var(--ease);
}
.hero-dot.active { width: 30px; border-radius: 999px; background: var(--brand); }

.stat-row { display: flex; gap: 2.5rem; flex-wrap: wrap; }
.stat-num { font-family: var(--font-display); font-size: 2rem; font-weight: 600; color: var(--ink); }
.stat-lbl { font-size: .8rem; color: var(--muted); }

/* ---------- 8. Category rail (one scrollable line) ---------------------- */
.cat-scroll {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: .75rem .25rem 1rem;
  scrollbar-width: none;        /* hide the scrollbar */
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}
.cat-scroll > * {
  flex: 0 0 clamp(230px, 24vw, 300px);
  scroll-snap-align: start;
}
.cat-scroll::-webkit-scrollbar { display: none; width: 0; height: 0; }

.rail-nav { display: inline-flex; gap: .5rem; }
.rail-btn {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  cursor: pointer; transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.rail-btn:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.rail-btn:disabled { opacity: .38; cursor: not-allowed; }
.rail-btn:disabled:hover { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }

.bento {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 1fr;
}
.bento-item {
  position: relative; overflow: hidden;
  border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface);
  padding: 1.5rem;
  display: flex; flex-direction: column; justify-content: space-between;
  min-height: 190px;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
  color: var(--ink);
}
.bento-item:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: var(--brand-3); color: var(--ink); }
.bento-item .ic {
  width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); font-size: 1.5rem;
  transition: transform .35s var(--ease);
}
.bento-item:hover .ic { transform: rotate(-6deg) scale(1.06); }
.bento-item.wide { grid-column: span 2; }
.bento-item.tall { grid-row: span 2; min-height: 100%; }

.arrow-link { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; color: var(--brand-2); font-size: .88rem; }
.bento-item:hover .arrow-link { gap: .7rem; }

/* farm-input category chips (raw materials for growers) */
.input-chips { display: flex; flex-wrap: wrap; gap: .6rem; }
.input-chip {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .55rem 1rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink); font-weight: 600; font-size: .9rem;
  transition: transform .3s var(--ease), border-color .3s var(--ease),
              background .3s var(--ease), color .3s var(--ease);
}
.input-chip i { color: var(--brand); font-size: 1.05rem; }
.input-chip:hover, .input-chip:focus-visible {
  transform: translateY(-2px); border-color: var(--brand-3);
  background: var(--brand-soft); color: var(--brand-2);
}
.input-chip:hover i, .input-chip:focus-visible i { color: var(--brand-2); }

/* ---------- 9. Product grid & cards ------------------------------------- */
.grid-products {
  display: grid; gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.pcard {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .4s var(--ease);
}
.pcard:hover { transform: translateY(-7px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }

.pcard-media {
  position: relative; aspect-ratio: 4 / 3; overflow: hidden;
  background: var(--surface-2);
}
.pcard-media-link { display: block; height: 100%; }
.pcard-media img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .7s var(--ease);
}
.pcard:hover .pcard-media img { transform: scale(1.07); }

.pcard-body { padding: 1.1rem 1.15rem 1.25rem; display: flex; flex-direction: column; flex: 1; }
.pcard-cat { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--brand-2); }
.pcard-title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; margin: .25rem 0; line-height: 1.2; }
.pcard-title a { color: var(--ink); }
.pcard-title a:hover { color: var(--brand-2); }
.pcard-farmer { font-size: .8rem; color: var(--muted); }
.pcard-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: .6rem; margin-top: auto; padding-top: .9rem; }
.pcard-meta { min-width: 0; }
.pcard-price { font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; color: var(--ink); line-height: 1; }
.pcard-price small { font-family: var(--font-body); font-size: .72rem; color: var(--muted); font-weight: 500; }

/* single, always-visible add-to-cart control */
.pcard-add-form { flex: 0 0 auto; margin: 0; }
.pcard-add {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  height: 44px; padding: 0 1.05rem 0 .95rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--brand); color: #fff;
  font-family: var(--font-body); font-size: .87rem; font-weight: 600;
  letter-spacing: -.01em; white-space: nowrap; cursor: pointer;
  box-shadow: 0 8px 20px -10px color-mix(in srgb, var(--brand) 75%, transparent);
  transition: background .25s var(--ease), color .25s var(--ease),
              transform .25s var(--ease), box-shadow .25s var(--ease);
}
.pcard-add-icon {
  display: grid; place-items: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  transition: background .25s var(--ease), transform .35s var(--ease);
}
.pcard-add-icon i { font-size: .95rem; line-height: 1; }
.pcard-add:hover {
  background: var(--ink); color: var(--bg);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.pcard-add:hover .pcard-add-icon { background: color-mix(in srgb, var(--bg) 18%, transparent); transform: rotate(90deg); }
.pcard-add:active { transform: translateY(0) scale(.97); }
.pcard-add:focus-visible { outline: none; box-shadow: var(--ring); }
.pcard-add:disabled {
  background: var(--surface-2); color: var(--muted);
  box-shadow: none; cursor: not-allowed;
}
.pcard-add:disabled .pcard-add-icon { background: color-mix(in srgb, var(--muted) 16%, transparent); }
[data-theme="dark"] .pcard-add { color: #08150e; box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .6); }
[data-theme="dark"] .pcard-add-icon { background: rgba(8, 21, 14, .16); }
[data-theme="dark"] .pcard-add:hover { background: var(--brand-3); color: #08150e; }
[data-theme="dark"] .pcard-add:hover .pcard-add-icon { background: rgba(8, 21, 14, .18); }
[data-theme="dark"] .pcard-add:disabled { background: var(--surface-2); color: var(--muted); }

.rating { display: inline-flex; align-items: center; gap: .25rem; font-size: .8rem; color: var(--gold); }
.rating .num { color: var(--muted); }

/* ---------- 9b. Reviews & rating input ---------------------------------- */
.review-score { display: flex; align-items: center; gap: 1rem; }
.review-score-num {
  font-family: var(--font-display); font-size: 3rem; font-weight: 600;
  line-height: 1; color: var(--ink); letter-spacing: -.03em;
}
.review-bars { display: flex; flex-direction: column; gap: .35rem; }
.review-bar { display: grid; grid-template-columns: 2.2rem 1fr 1.8rem; align-items: center; gap: .5rem; font-size: .74rem; }
.review-bar-label { color: var(--muted); display: inline-flex; align-items: center; gap: .2rem; }
.review-bar-label i { color: var(--gold); font-size: .7rem; }
.review-bar-track { height: 7px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.review-bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--gold); transition: width .4s var(--ease); }
.review-bar-count { text-align: right; color: var(--muted); }
.review-avatar {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-2);
  font-weight: 700; font-size: 1rem;
}

/* interactive star rating (reversed flex = correct fill direction) */
.star-input { display: inline-flex; flex-direction: row-reverse; gap: .15rem; }
.star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-input label { color: var(--line-strong); cursor: pointer; font-size: 1.7rem; line-height: 1; transition: color .15s var(--ease), transform .15s var(--ease); }
.star-input input:checked ~ label,
.star-input label:hover,
.star-input label:hover ~ label { color: var(--gold); }
.star-input label:hover { transform: scale(1.12); }
.star-input input:focus-visible + label { outline: 2px solid var(--brand-3); outline-offset: 3px; border-radius: 4px; }

/* ---------- 9c. Image upload dropzone ----------------------------------- */
.upload-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.upload-drop {
  position: relative; display: grid; place-items: center; gap: .4rem;
  min-height: 180px; padding: 1rem; text-align: center; cursor: pointer;
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius);
  background: var(--surface-2); overflow: hidden;
  transition: border-color .25s var(--ease), background .25s var(--ease);
}
.upload-drop:hover, .upload-zone.dragover .upload-drop {
  border-color: var(--brand); background: var(--brand-soft);
}
.upload-preview {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; border-radius: calc(var(--radius) - 2px);
}
.upload-prompt { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: .35rem; color: var(--muted); }
.upload-prompt i { font-size: 2rem; color: var(--brand-2); }
.upload-title { font-weight: 700; color: var(--ink); font-size: .95rem; }
.upload-sub { font-size: .74rem; }
.upload-zone.has-image .upload-prompt {
  position: absolute; bottom: .7rem; left: 50%; transform: translateX(-50%);
  flex-direction: row; align-items: center; gap: .4rem;
  padding: .35rem .85rem; border-radius: 999px;
  background: rgba(6, 14, 9, .72); color: #fff; white-space: nowrap;
}
.upload-zone.has-image .upload-prompt i { font-size: 1rem; color: #fff; }
.upload-zone.has-image .upload-title { color: #fff; font-size: .8rem; }
.upload-zone.has-image .upload-sub { display: none; }

/* ---------- 10. Forms ---------------------------------------------------- */
.form-label, .form-check-label { font-weight: 600; color: var(--ink); font-size: .86rem; }
.form-control, .form-select {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
  color: var(--ink);
  padding: .65rem .9rem;
  font-size: .93rem;
  transition: box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.form-control::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.form-control:focus, .form-select:focus {
  background: var(--surface); color: var(--ink);
  border-color: var(--brand-3); box-shadow: var(--ring);
}
.form-check-input { border-color: var(--line-strong); background-color: var(--surface); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { box-shadow: var(--ring); border-color: var(--brand-3); }
.form-text { color: var(--muted); }
.input-group-text { background: var(--surface-2); border-color: var(--line-strong); color: var(--muted); }

.pay-option {
  display: flex; align-items: center; gap: .75rem;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: .9rem 1rem; cursor: pointer;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.pay-option:hover { border-color: var(--brand-3); }
.pay-option input:checked ~ .pay-label { color: var(--brand); }
.pay-option:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }

/* filter rail */
.filter-rail { position: sticky; top: 100px; }
.filter-rail .card-body { padding: 1.3rem; }

/* shop toolbar + slide-in filter drawer (mobile / tablet) */
.shop-toolbar { display: flex; align-items: center; gap: .65rem; margin-bottom: 1.15rem; }
.shop-filter-btn { font-weight: 600; }
.shop-count { margin-left: auto; }
.shop-filter-dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block;
  background: var(--accent); margin-left: .35rem; vertical-align: middle;
}
.filter-close { width: 38px; height: 38px; }
.filter-backdrop { display: none; }

/* ---------- 11. Tables --------------------------------------------------- */
.table { color: var(--ink); --bs-table-bg: transparent; margin-bottom: 0; }
.table > :not(caption) > * > * { background: transparent; color: var(--ink); border-bottom-color: var(--line); }
.table thead th {
  font-family: var(--font-mono); font-size: .7rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); font-weight: 600;
  border-bottom: 1px solid var(--line-strong);
}
.table tbody tr { transition: background .2s var(--ease); }
.table tbody tr:hover { background: var(--surface-2); }
.table img { border: 1px solid var(--line); }

/* list group */
.list-group-item { background: transparent; color: var(--ink); border-color: var(--line); }

/* ---------- 12. Cart / summary ------------------------------------------ */
.qty {
  display: inline-flex; align-items: center;
  border: 1px solid var(--line-strong); border-radius: var(--radius-pill);
  overflow: hidden; background: var(--surface);
}
.qty button {
  width: 36px; height: 38px; border: none; background: transparent; color: var(--ink);
  font-size: 1.1rem; transition: background .2s var(--ease);
}
.qty button:hover { background: var(--surface-2); }
.qty input {
  width: 52px; height: 38px; border: none; text-align: center;
  background: transparent; color: var(--ink); font-weight: 600; -moz-appearance: textfield;
}
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.summary-line { display: flex; justify-content: space-between; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.summary-line.total { border-bottom: none; padding-top: 1rem; }
.summary-total { font-family: var(--font-display); font-size: 1.7rem; font-weight: 600; color: var(--brand-2); }

/* ---------- 13. Flash notifications (centered popup) -------------------- */
.flash-layer {
  position: fixed; inset: 0; z-index: 1085;
  display: grid; place-items: center;
  padding: 1.2rem;
  transition: opacity .3s var(--ease);
}
.flash-layer.leaving { opacity: 0; }

.flash-backdrop {
  position: absolute; inset: 0;
  background: color-mix(in srgb, #08150e 48%, transparent);
  -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px);
  animation: flashFade .3s var(--ease) both;
}

.flash-stack {
  position: relative;
  width: min(430px, 100%);
  max-height: 100%; overflow-y: auto;
  display: flex; flex-direction: column; gap: .8rem;
}

.flash {
  --flash: var(--brand-2);
  position: relative; overflow: hidden;
  display: flex; align-items: flex-start; gap: .95rem;
  padding: 1.15rem 1.2rem 1.25rem;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--flash) 32%, var(--line));
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  animation: flashPop .5s var(--ease) both;
}
.flash::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: color-mix(in srgb, var(--flash) 8%, transparent);
}
.flash > * { position: relative; }

.flash-success { --flash: var(--brand-2); }
.flash-danger  { --flash: #d64545; }
.flash-warning { --flash: var(--gold); }
.flash-info    { --flash: #2f7fd6; }
[data-theme="dark"] .flash-info { --flash: #5aa9ff; }

.flash-icon {
  flex: 0 0 auto;
  width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center; font-size: 1.3rem;
  background: var(--flash); color: #fff;
  box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--flash) 85%, transparent);
}
[data-theme="dark"] .flash-icon { color: #08150e; }

.flash-content { flex: 1; min-width: 0; padding-top: .15rem; }
.flash-title {
  font-family: var(--font-display); font-size: 1.08rem; font-weight: 600;
  line-height: 1.2; color: var(--ink); margin-bottom: .2rem;
}
.flash-msg { margin: 0; font-size: .93rem; color: var(--muted); }

.flash-close {
  flex: 0 0 auto;
  width: 32px; height: 32px; border-radius: 50%; border: none;
  display: grid; place-items: center; font-size: .85rem;
  background: transparent; color: var(--muted); cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.flash-close:hover { background: color-mix(in srgb, var(--flash) 16%, transparent); color: var(--flash); transform: rotate(90deg); }
.flash-close:focus-visible { outline: none; box-shadow: var(--ring); }

.flash-bar {
  position: absolute; left: 0; bottom: 0; height: 3px; width: 100%;
  background: var(--flash); transform-origin: left;
  animation: flashBar 5s linear forwards;
}

@keyframes flashPop {
  from { opacity: 0; transform: translateY(16px) scale(.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes flashFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes flashBar  { from { transform: scaleX(1); } to { transform: scaleX(0); } }

@media (prefers-reduced-motion: reduce) {
  .flash, .flash-backdrop { animation: none; }
  .flash-bar { animation: none; }
}

/* ---------- 14. Footer --------------------------------------------------- */
.footer {
  background: var(--footer-bg);
  color: var(--footer-ink);
  margin-top: auto;
  padding-block: clamp(3rem, 6vw, 5rem) 2rem;
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
}
.footer p { color: var(--footer-muted); }
.footer h6 { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); margin-bottom: 1rem; }
.footer a { color: var(--footer-muted); font-size: .9rem; }
.footer a:hover { color: var(--gold); }
.footer .wordmark {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 12vw, 9rem);
  font-weight: 600; line-height: .9; letter-spacing: -.04em;
  color: transparent;
  -webkit-text-stroke: 1px var(--footer-line);
  user-select: none;
}
.footer .brand { color: var(--footer-ink); }
.footer hr { background: var(--footer-line) !important; }

/* ---------- 15. Helpers -------------------------------------------------- */
.text-muted { color: var(--muted) !important; }
.text-agri, .text-brand { color: var(--brand-2) !important; }
.text-gold { color: var(--gold) !important; }
.text-earth { color: var(--accent) !important; }
.bg-agri-light, .bg-brand-soft { background: var(--brand-soft) !important; }
.price-tag { font-family: var(--font-display); }
.divider { height: 1px; background: var(--line); border: 0; }

/* reveal on scroll */
[data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
[data-reveal].is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; }
  * { animation: none !important; }
}

/* breadcrumbs */
.breadcrumb { --bs-breadcrumb-divider-color: var(--muted); font-size: .85rem; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand-2); }
.breadcrumb-item.active { color: var(--ink); }

/* nav pills (admin) */
.nav-pills .nav-link { border-radius: var(--radius-pill); color: var(--muted); font-weight: 600; }
.nav-pills .nav-link.active { background: var(--brand); color: #fff; }
.nav-pills .nav-link:not(.active):hover { background: var(--surface-2); color: var(--ink); }

/* ---------- 16. Responsive ---------------------------------------------- */
@media (max-width: 991.98px) {
  .nav-links, .search-wrap { display: none; }
  .menu-toggle { display: inline-flex; }
  .bento { grid-template-columns: repeat(2, 1fr); }
  .bento-item.wide { grid-column: span 2; }
  .bento-item.tall { grid-row: auto; }
  /* stacked hero: strengthen scrim so copy stays readable over the photo */
  .hero-scrim { background: color-mix(in srgb, var(--bg) 88%, transparent); }
  .hero-dots { justify-content: center; }

  /* ---- mobile / tablet header: tighter and better balanced ---- */
  .nav-shell { padding-block: .5rem; }
  .nav-shell > .container { gap: .4rem; }
  .nav-shell .brand-wordmark { font-size: 1.3rem; }
  .nav-actions { gap: .1rem; }
  .nav-shell .btn-icon { width: 38px; height: 38px; font-size: 1.05rem; }
  /* account + basket live in the bottom nav on small screens */
  .nav-shell .nav-account,
  .nav-shell .nav-cart { display: none; }

  /* ---- compact hero, no static photo ---- */
  .hero { padding-block: 2.4rem 2.6rem; }
  .hero-media { display: none; }
  .hero .display-xl { font-size: clamp(2.05rem, 8vw, 3rem); }
  .hero h1.mt-3 { margin-top: .55rem !important; }
  .hero .lead { font-size: .98rem; }
  .hero .hero-cta { margin-bottom: 1.6rem !important; }
  .hero .stat-row { gap: 1rem 1.75rem; }
  .hero .stat-num { font-size: 1.5rem; }
  .hero .hero-dots { margin-top: 1.1rem; }

  /* ---- shop: filter panel pops up centered on screen ---- */
  .filter-aside {
    position: fixed;
    top: 50%; left: 50%;
    z-index: 1050;
    width: min(92vw, 440px);
    max-width: 100%;
    margin: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    transform: translate(-50%, -46%) scale(.94);
    opacity: 0;
    pointer-events: none;
    transition: transform .35s var(--ease), opacity .25s var(--ease);
  }
  .filter-aside.open {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
  }
  .filter-aside .card-soft {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-height: 86vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .filter-rail { position: static; top: auto; }
  .filter-backdrop {
    display: block;
    position: fixed; inset: 0; z-index: 1045;
    background: rgba(6, 14, 9, .5);
    -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
    opacity: 0; pointer-events: none;
    transition: opacity .3s var(--ease);
  }
  .filter-backdrop.open { opacity: 1; pointer-events: auto; }
  body.filter-open { overflow: hidden; }

  /* ---- mobile account sheet ---- */
  .account-sheet,
  .account-sheet-backdrop { display: block; }
  body.account-open { overflow: hidden; }

  /* bottom navigation bar (floating, mobile + tablet) */
  .mobile-nav { display: flex; }
  body { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }

  /* homepage product sections: one-line horizontal scroll rails */
  .grid-products.rail {
    display: flex;
    flex-wrap: nowrap;
    grid-template-columns: none;
    gap: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: .25rem;
    padding-bottom: .6rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .grid-products.rail::-webkit-scrollbar { display: none; height: 0; }
  .grid-products.rail > * {
    flex: 0 0 auto;
    width: 78%;
    max-width: 320px;
    scroll-snap-align: start;
  }
}

/* tablet: fit a little more than two cards per view in the rails */
@media (min-width: 576px) and (max-width: 991.98px) {
  .grid-products.rail > * { width: 44%; max-width: 340px; }
}

/* phones: drop the footer — the bottom nav carries the links */
@media (max-width: 767.98px) {
  .footer { display: none; }
}
@media (max-width: 575.98px) {
  .grid-products { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .pcard-body { padding: .85rem; }
  .pcard-title { font-size: 1rem; }
  .pcard-price { font-size: 1.1rem; }
  .pcard-add { width: 44px; padding: 0; }
  .pcard-add-text { display: none; }
  .bento { grid-template-columns: 1fr; }
  .bento-item.wide { grid-column: auto; }
}

/* utility spacing/typography tweaks used in templates */
.rounded-pill { border-radius: var(--radius-pill) !important; }
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }
.lead { font-size: 1.06rem; color: var(--muted); }

/* ---------- 12. Auth (full-screen log in / register, no header/footer) -- */
.auth-body { background: var(--bg); }
.auth-shell {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.auth-aside {
  position: relative;
  overflow: hidden;
  flex-direction: column;
  justify-content: center;
  gap: 2rem;
  padding: clamp(2rem, 4vw, 3.5rem);
  color: #fff;
  background: #08150e;
}
/* farm photo layer */
.auth-aside::before {
  content: "";
  position: absolute; inset: 0;
  background-image: var(--auth-img);
  background-size: cover;
  background-position: center;
  opacity: .4;
}
/* green-to-black overlay so the copy stays bold and legible */
.auth-aside::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(155deg, rgba(31, 93, 58, .84) 0%, rgba(6, 14, 9, .93) 100%);
}
.auth-aside > * { position: relative; z-index: 1; }
.auth-aside .display-xl,
.auth-aside .display-lg { color: #fff; }

.auth-main {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: clamp(1rem, 2.6vw, 2rem);
  background: var(--bg);
}
.auth-topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex: 0 0 auto; }
.auth-formwrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  min-height: 0;
  max-width: 440px;
  margin-inline: auto;
  padding-block: clamp(.75rem, 2vh, 1.5rem);
}
/* compress the sign-in panel so the whole thing fits the viewport at once */
.auth-formwrap .display-lg { font-size: clamp(1.65rem, 3.6vh, 2.4rem); line-height: 1.06; }
.auth-formwrap .mb-3 { margin-bottom: .85rem !important; }
.auth-formwrap .mb-4 { margin-bottom: clamp(.85rem, 2.2vh, 1.4rem) !important; }
.auth-formwrap .mt-4 { margin-top: clamp(.85rem, 2.2vh, 1.4rem) !important; }
.auth-formwrap .surface { padding: .7rem .85rem !important; }
.auth-formwrap .form-control-lg { padding-block: .6rem; }

/* role picker (customer vs seller) on the register form */
.role-choice { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.role-option { position: relative; cursor: pointer; }
.role-option input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.role-option-body {
  display: flex; align-items: flex-start; gap: .6rem;
  height: 100%; padding: .7rem .75rem;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color .25s var(--ease), background .25s var(--ease), box-shadow .25s var(--ease);
}
.role-option-icon {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; font-size: 1.05rem;
  background: var(--surface-2); color: var(--brand-2);
  transition: background .25s var(--ease), color .25s var(--ease);
}
.role-option-text { display: flex; flex-direction: column; min-width: 0; }
.role-option-title { font-weight: 700; font-size: .9rem; color: var(--ink); line-height: 1.2; }
.role-option-desc { font-size: .74rem; color: var(--muted); line-height: 1.3; }
.role-option-check { margin-left: auto; color: var(--brand); opacity: 0; transition: opacity .2s var(--ease); }
.role-option:hover .role-option-body { border-color: var(--brand-3); }
.role-option:has(input:checked) .role-option-body {
  border-color: var(--brand); background: var(--brand-soft);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent);
}
.role-option:has(input:checked) .role-option-icon { background: var(--brand); color: #fff; }
.role-option:has(input:checked) .role-option-check { opacity: 1; }
.role-option:has(input:focus-visible) .role-option-body { outline: 2px solid var(--brand-3); outline-offset: 2px; }
[data-theme="dark"] .role-option:has(input:checked) .role-option-icon { color: #08150e; }
@media (max-width: 575.98px) {
  .role-choice { grid-template-columns: 1fr; }
}

@media (max-width: 991.98px) {
  .auth-shell { grid-template-columns: 1fr; }
}
/* never clip content on genuinely short viewports — allow scroll there only */
@media (max-height: 680px) {
  .auth-shell { height: auto; min-height: 100vh; overflow: visible; }
  .auth-main { height: auto; overflow: visible; }
}

/* ---------- 17. Admin dashboard shell ----------------------------------- */
.admin-shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  gap: clamp(1.25rem, 2.4vw, 2.25rem);
  align-items: start;
  padding-block: clamp(1.5rem, 3vw, 2.5rem);
}

.admin-sidebar {
  position: sticky;
  top: 92px;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  padding: 1.35rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.admin-sidebar-head { display: flex; flex-direction: column; gap: .6rem; }
.admin-brand {
  display: flex; align-items: center; gap: .6rem;
  font-family: var(--font-display); font-size: 1.3rem; font-weight: 600;
  color: var(--ink); letter-spacing: -.02em;
}

.admin-nav {
  display: flex; flex-direction: column; gap: .3rem;
  padding-bottom: 1.35rem;
  border-bottom: 1px solid var(--line);
}
.admin-nav-link {
  display: flex; align-items: center; gap: .75rem;
  padding: .7rem .85rem;
  border-radius: var(--radius-xs);
  color: var(--muted);
  font-weight: 600; font-size: .92rem; letter-spacing: -.01em;
  transition: background .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.admin-nav-link i { flex: 0 0 auto; width: 1.2rem; text-align: center; font-size: 1.05rem; }
.admin-nav-link:hover { background: var(--surface-2); color: var(--ink); }
.admin-nav-link.active { background: var(--brand-soft); color: var(--brand); }
.admin-nav-link.active i { color: var(--brand); }
[data-theme="dark"] .admin-nav-link.active { color: var(--brand-2); }

.admin-sidebar-foot { display: flex; flex-direction: column; gap: .75rem; }
.admin-user {
  display: flex; align-items: center; gap: .7rem;
  padding: .6rem .7rem;
  border-radius: var(--radius-xs);
  background: var(--surface-2);
}
.admin-user-avatar {
  flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand); color: #fff; font-size: .95rem;
}
[data-theme="dark"] .admin-user-avatar { color: #08150e; }
.admin-user-meta { min-width: 0; }
.admin-user-name { font-weight: 600; font-size: .88rem; color: var(--ink); line-height: 1.25; }
.admin-user-mail {
  font-size: .74rem; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.admin-role-tag {
  display: inline-flex; align-items: center; gap: .3rem;
  margin-top: .3rem; padding: .12rem .5rem; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-2);
  font-size: .64rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
}

.admin-main { min-width: 0; }

.admin-menu-btn { justify-content: center; }

/* control room popup (shown only below 992px) */
.admin-menu-backdrop,
.admin-menu { display: none; }
.admin-menu-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; margin-bottom: .9rem;
}
.admin-menu-links { display: flex; flex-direction: column; gap: .3rem; }

@media (max-width: 991.98px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; }
  /* the inline nav row is replaced by the Control room popup on small screens */
  .admin-nav { display: none; }
  .admin-sidebar-foot { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }

  .admin-menu-backdrop {
    display: block; position: fixed; inset: 0; z-index: 1055;
    background: rgba(6, 14, 9, .5);
    -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
    opacity: 0; pointer-events: none; transition: opacity .3s var(--ease);
  }
  .admin-menu-backdrop.open { opacity: 1; pointer-events: auto; }
  .admin-menu {
    display: block;
    position: fixed; top: 50%; left: 50%; z-index: 1056;
    width: min(92vw, 420px); max-height: 86vh; overflow-y: auto;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    padding: 1.15rem;
    transform: translate(-50%, -46%) scale(.94);
    opacity: 0; pointer-events: none;
    transition: transform .35s var(--ease), opacity .25s var(--ease);
  }
  .admin-menu.open { transform: translate(-50%, -50%) scale(1); opacity: 1; pointer-events: auto; }
  body.admin-menu-open { overflow: hidden; }
}
