/* =========================================================
   MecCannabis — design tokens
   Palette:  anthracite base, neon-green + mustard/gold accents
   Type:     Fraunces (display) / Inter (body) / JetBrains Mono (data)
   Signature: il "Lot Passport" — la card prodotto che si apre come
              un documento di tracciabilita (batch, THC/CBD, terpeni, QR->COA)
   ========================================================= */

:root {
  --bg-0: #101311;
  --bg-1: #171b18;
  --bg-2: #1f241f;
  --line: #2b322a;
  --text-0: #f2f4ee;
  --text-1: #b9c2b5;
  --text-2: #7c8878;
  --green: #46f29b;
  --green-dim: #1f5c43;
  --gold: #d3a24a;
  --gold-dim: #6b5527;
  --danger: #e2665a;

  --radius: 14px;
  --radius-sm: 8px;
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg-0);
  color: var(--text-0);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; margin: 0 0 .5rem; letter-spacing: -0.01em; }
p { margin: 0 0 1rem; color: var(--text-1); }
.mono { font-family: var(--font-mono); letter-spacing: 0.02em; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* Focus visibility */
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- Top notice bar ---------- */
.notice-bar {
  background: var(--bg-1);
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
  font-size: 0.78rem;
  text-align: center;
  padding: 7px 12px;
}
.notice-bar strong { color: var(--gold); }

/* ---------- Header ---------- */
header.site {
  position: sticky; top: 0; z-index: 40;
  background: rgba(16,19,17,0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
}
.logo {
  font-family: var(--font-display);
  font-size: 2.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 12px;
  text-decoration: none;
}
.logo .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }
.logo .brand-leaf { width: 38px; height: 38px; color: var(--green); flex-shrink: 0; filter: drop-shadow(0 0 10px rgba(70,242,155,0.55)); }
.nav-links { display: flex; gap: 26px; list-style: none; margin: 0; padding: 0; }
.nav-links a { text-decoration: none; color: var(--text-1); font-size: 0.92rem; font-weight: 500; transition: color .15s; }
.nav-links a:hover { color: var(--green); }
.nav-actions { display: flex; gap: 12px; align-items: center; }

/* ---------- Hamburger menu + dropdown overlay ---------- */
.menu-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; border-radius: 999px; flex-shrink: 0;
  border: 1px solid var(--green-dim); background: rgba(70,242,155,0.08); color: var(--green);
  cursor: pointer; transition: border-color .15s, background .15s, transform .15s;
}
.menu-toggle:hover { border-color: var(--green); background: rgba(70,242,155,0.16); transform: scale(1.04); }
.menu-toggle svg { width: 36px; height: 36px; }

.nav-overlay {
  position: absolute; top: calc(100% + 10px); right: 24px; z-index: 100;
  width: min(300px, 90vw);
  background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
  padding: 12px;
  display: flex; flex-direction: column; gap: 2px;
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
.nav-overlay.open { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-overlay-row {
  display: flex; align-items: center; gap: 12px; text-decoration: none;
  color: var(--text-0); font-weight: 600; font-size: 0.92rem;
  padding: 10px 10px; border-radius: var(--radius-sm);
  transition: background .15s, color .15s;
}
.nav-overlay-row:hover, .nav-overlay-row.active { background: rgba(70,242,155,0.09); color: var(--green); }
.nav-overlay-row svg { width: 19px; height: 19px; flex-shrink: 0; }
.nav-overlay-row .badge-count {
  margin-left: auto; font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-2);
}
.nav-overlay-divider { height: 1px; background: var(--line); margin: 6px 4px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 0.88rem; text-decoration: none; cursor: pointer;
  transition: transform .12s ease, background .15s ease, border-color .15s;
  font-family: var(--font-body);
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--green); color: #06140d; }
.btn-primary:hover { background: #63f6ae; }
.btn-outline { border-color: var(--line); color: var(--text-0); background: transparent; }
.btn-outline:hover { border-color: var(--green); color: var(--green); }
.btn-gold { background: var(--gold); color: #241a05; }
.btn-gold:hover { background: #e3b869; }
.btn-sm { padding: 7px 14px; font-size: 0.8rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 90px 24px 60px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; max-width: 1180px; margin: 0 auto; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--green); border: 1px solid var(--green-dim); background: rgba(70,242,155,0.06);
  padding: 6px 12px; border-radius: 999px; margin-bottom: 18px;
}
.hero h1 { font-size: clamp(2.2rem, 4.4vw, 3.4rem); line-height: 1.05; margin-bottom: 18px; }
.hero h1 em { font-style: normal; color: var(--green); }
.hero p.lead { font-size: 1.05rem; max-width: 46ch; }
.hero-actions { display: flex; gap: 14px; margin-top: 26px; flex-wrap: wrap; }

.hero-visual {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; position: relative; min-height: 320px; overflow: hidden;
}
.hero-visual img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.hero-visual::after {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(155deg, rgba(16,19,17,0.35), rgba(16,19,17,0.75));
}
.hero-visual .passport-demo { position: relative; z-index: 2; }

/* ---------- Full-bleed photo strip ---------- */
.photo-strip { display: grid; grid-template-columns: repeat(4, 1fr); }
.photo-strip img { width: 100%; height: 340px; object-fit: cover; display: block; }

/* ---------- Trust strip ---------- */
.trust-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.trust-item { background: var(--bg-0); padding: 22px 20px; }
.trust-item .k { font-family: var(--font-mono); font-size: 0.7rem; color: var(--green); text-transform: uppercase; letter-spacing: 0.08em; }
.trust-item p { margin: 6px 0 0; font-size: 0.88rem; color: var(--text-1); }

/* ---------- Bento section ---------- */
.section { padding: 72px 24px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 32px; gap: 20px; flex-wrap: wrap; }
.section-head h2 { font-size: 1.9rem; }
.section-head p { max-width: 50ch; }

.bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 150px;
  gap: 14px;
}
.bento-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-1); padding: 22px; position: relative; overflow: hidden;
  text-decoration: none; display: flex; flex-direction: column; justify-content: flex-end;
  transition: border-color .15s, transform .15s;
}
.bento-card:hover { border-color: var(--green-dim); transform: translateY(-2px); }
.bento-card h3 { font-size: 1.05rem; margin-bottom: 4px; color: var(--text-0); }
.bento-card p { font-size: 0.82rem; margin: 0; color: var(--text-2); }
.bento-card .method { position: absolute; top: 18px; right: 18px; font-family: var(--font-mono); font-size: 0.68rem; color: var(--gold); text-transform: uppercase; }
.bento-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; opacity: 0.5; transition: opacity .2s, transform .3s; }
.bento-card:hover .bento-bg { opacity: 0.65; transform: scale(1.05); }
.bento-card.has-photo::after {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(16,19,17,0.1), rgba(16,19,17,0.92));
}
.bento-card.has-photo .method,
.bento-card.has-photo h3,
.bento-card.has-photo p { position: relative; z-index: 2; }
.bento-1x2 { grid-column: span 2; }
.bento-2x2 { grid-column: span 2; grid-row: span 2; }
.bento-1x1 { grid-column: span 1; }

/* ---------- Product grid & Lot Passport card ---------- */
.filters-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 28px; }
.chip {
  font-family: var(--font-mono); font-size: 0.76rem; padding: 7px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-1); color: var(--text-1); cursor: pointer;
}
.chip.active { border-color: var(--green); color: var(--green); background: rgba(70,242,155,0.07); }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }

.passport {
  perspective: 1200px;
  height: 380px;
}
.passport-inner {
  position: relative; width: 100%; height: 100%;
  transition: transform 0.55s cubic-bezier(.2,.8,.2,1);
  transform-style: preserve-3d;
}
.passport:hover .passport-inner,
.passport.flipped .passport-inner { transform: rotateY(180deg); }

.passport-face {
  position: absolute; inset: 0; backface-visibility: hidden;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-1);
  display: flex; flex-direction: column; overflow: hidden;
}
.passport-face.front { }
.passport-face.back { transform: rotateY(180deg); padding: 20px; }

.passport-face.front .thumb {
  height: 170px; background: var(--bg-2); overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.passport-face.front .thumb img { width: 100%; height: 100%; object-fit: cover; }
.passport-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.passport-body .cat { font-family: var(--font-mono); font-size: 0.68rem; color: var(--green); text-transform: uppercase; letter-spacing: .06em; }
.passport-body h4 { font-size: 1.02rem; margin: 2px 0; }
.passport-body .price { font-family: var(--font-mono); font-weight: 600; color: var(--gold); margin-top: auto; font-size: 1.05rem; }
.passport-hint { font-family: var(--font-mono); font-size: 0.66rem; color: var(--text-2); padding: 0 18px 14px; }

.back h5 { font-family: var(--font-mono); font-size: 0.68rem; color: var(--gold); text-transform: uppercase; margin: 0 0 10px; letter-spacing: .08em; }
.stat-row { display: flex; justify-content: space-between; font-size: 0.82rem; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.stat-row span:last-child { font-family: var(--font-mono); color: var(--text-0); }
.terp-bar-row { margin: 10px 0 4px; }
.terp-bar-row .label { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--text-2); margin-bottom: 3px; font-family: var(--font-mono); }
.terp-bar { height: 4px; border-radius: 3px; background: var(--bg-2); overflow: hidden; }
.terp-bar span { display: block; height: 100%; background: var(--green); }
.qr-note { margin-top: auto; display: flex; align-items: center; gap: 10px; font-size: 0.72rem; color: var(--text-2); font-family: var(--font-mono); }
.qr-box { width: 34px; height: 34px; border: 1px solid var(--green-dim); border-radius: 4px; background: repeating-conic-gradient(var(--green-dim) 0% 25%, transparent 0% 50%) 0 0/8px 8px; }

/* ---------- Pharmacy / B2B section ---------- */
.pharma-band {
  background: var(--bg-1); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 72px 24px;
}
.pharma-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: start; }
.tier-list { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.tier { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; }
.tier .name { font-family: var(--font-mono); font-size: 0.8rem; color: var(--gold); }
.tier.gold { border-color: var(--gold-dim); }

/* ---------- Forms ---------- */
.form-card { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; max-width: 460px; margin: 0 auto; }
.form-card.wide { max-width: 640px; }
label { display: block; font-size: 0.8rem; color: var(--text-1); margin-bottom: 6px; font-family: var(--font-mono); }
input, select, textarea {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line); color: var(--text-0);
  border-radius: var(--radius-sm); padding: 10px 12px; font-family: var(--font-body); font-size: 0.92rem;
  margin-bottom: 16px;
}
input:focus, select:focus, textarea:focus { border-color: var(--green); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
.checkbox-row input { width: auto; margin: 3px 0 0; }
.checkbox-row label { margin: 0; color: var(--text-1); font-family: var(--font-body); font-size: 0.85rem; }
.form-error { background: rgba(226,102,90,0.1); border: 1px solid var(--danger); color: #ffb3ac; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 0.85rem; margin-bottom: 16px; display: none; }
.form-success { background: rgba(70,242,155,0.1); border: 1px solid var(--green-dim); color: var(--green); padding: 10px 14px; border-radius: var(--radius-sm); font-size: 0.85rem; margin-bottom: 16px; display: none; }

/* ---------- Cart / checkout ---------- */
.cart-line { display: grid; grid-template-columns: 60px 1fr auto auto auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-line img { width: 52px; height: 52px; object-fit: contain; background: var(--bg-2); border-radius: 6px; padding: 6px; }
.qty-input { width: 70px; margin: 0; padding: 6px 8px; text-align: center; }
.qty-control { display: inline-flex; align-items: center; gap: 6px; }
.qty-btn {
  width: 28px; height: 28px; flex-shrink: 0; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-1); color: var(--text-0);
  font-family: var(--font-mono); font-size: 1rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .15s, color .15s;
}
.qty-btn:hover { border-color: var(--green); color: var(--green); }
.cart-summary { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.summary-row { display: flex; justify-content: space-between; font-size: 0.9rem; padding: 6px 0; color: var(--text-1); }
.summary-row.total { color: var(--text-0); font-weight: 700; font-size: 1.05rem; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 14px; }

/* ---------- Age gate modal ---------- */
.age-gate-overlay {
  position: fixed; inset: 0; background: rgba(8,10,8,0.92); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.age-gate-box { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--radius); padding: 36px; max-width: 420px; text-align: center; }
.age-gate-box .dot-big { width: 44px; height: 44px; border-radius: 50%; background: var(--green); margin: 0 auto 18px; box-shadow: 0 0 24px var(--green); }

/* ---------- Table (admin) ---------- */
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { color: var(--text-2); font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: .06em; }
.badge { font-family: var(--font-mono); font-size: 0.68rem; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); }
.badge.pending { color: var(--gold); border-color: var(--gold-dim); }
.badge.approved { color: var(--green); border-color: var(--green-dim); }
.badge.rejected, .badge.cancelled { color: var(--danger); border-color: var(--danger); }
.admin-shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.admin-nav { background: var(--bg-1); border-right: 1px solid var(--line); padding: 24px 16px; }
.admin-nav a { display: block; padding: 9px 12px; border-radius: 8px; text-decoration: none; color: var(--text-1); font-size: 0.88rem; margin-bottom: 4px; }
.admin-nav a.active, .admin-nav a:hover { background: var(--bg-2); color: var(--green); }
.admin-main { padding: 32px; }
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 28px; }
.stat-card { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 18px; }
.stat-card .num { font-family: var(--font-mono); font-size: 1.6rem; color: var(--green); }
.stat-card .lbl { font-size: 0.78rem; color: var(--text-2); }

/* ---------- Strain Finder ---------- */
.sf-progress { display: flex; gap: 6px; margin-bottom: 32px; }
.sf-progress-dot { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.sf-progress-dot.done { background: var(--green); }
.sf-step { display: none; }
.sf-step.active { display: block; }
.sf-question { font-size: 1.3rem; margin-bottom: 20px; }
.sf-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.sf-option { position: relative; }
.sf-option input { position: absolute; opacity: 0; }
.sf-option label {
  display: flex; align-items: center; justify-content: center; text-align: center;
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 18px 14px;
  cursor: pointer; font-weight: 600; font-size: 0.92rem; color: var(--text-1);
  transition: border-color .15s, background .15s, color .15s; min-height: 64px;
}
.sf-option label:hover { border-color: var(--green-dim); }
.sf-option input:checked + label { border-color: var(--green); background: rgba(70,242,155,0.09); color: var(--green); }
.sf-actions { display: flex; justify-content: space-between; margin-top: 32px; }
.sf-result-hero { text-align: center; margin-bottom: 28px; }
.sf-match-badge { font-family: var(--font-mono); font-size: 0.72rem; color: var(--green); text-transform: uppercase; letter-spacing: .08em; }

/* ---------- Footer ---------- */
footer.site { border-top: 1px solid var(--line); padding: 40px 24px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; max-width: 1180px; margin: 0 auto; }
.footer-grid h5 { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; color: var(--text-2); margin-bottom: 12px; }
.footer-grid a { display: block; text-decoration: none; color: var(--text-1); font-size: 0.86rem; margin-bottom: 8px; }
.footer-grid a:hover { color: var(--green); }
.legal-note { max-width: 1180px; margin: 24px auto 0; font-size: 0.72rem; color: var(--text-2); border-top: 1px solid var(--line); padding-top: 18px; }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .hero-grid, .pharma-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .bento { grid-template-columns: repeat(2, 1fr); }
  .bento-2x2, .bento-1x2 { grid-column: span 2; }
  .photo-strip { grid-template-columns: repeat(2, 1fr); }
  .photo-strip img { height: 220px; }
  .trust-strip { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-nav { display: flex; overflow-x: auto; gap: 8px; border-right: none; border-bottom: 1px solid var(--line); }
}
