/* =========================================================================
   Aliska Trading — Commodities page
   Loaded ALONGSIDE the shared css/style.css (this page uses Aliska's
   standard topbar/header/footer). Only page-specific content is styled
   here — the trading hero, product grid, request log, about section, and
   quote-request modal. Classes that could collide with style.css (.hero,
   .btn-ghost) were renamed (.trading-hero, .btn-outline-gold) so the two
   stylesheets never fight over the same selector. Palette echoes the
   parent brand (navy + gold) with a warm, earthy paper tone for the
   product grid, appropriate to natural produce. Typeface (Montserrat) is
   imported once, by style.css, which this page always loads alongside
   this file — no need to fetch it a second time here.
   ========================================================================= */

/* Scoped to .pg (not :root) on purpose: this page loads Aliska's shared
   css/style.css for the topbar/header/footer, which defines its own
   --ink-600, --ink-400, --font-display and --font-body at :root with
   different values. Declaring these tokens on
   :root here would silently override the shared header/footer's fonts
   and text colors document-wide. Scoping to .pg keeps this page's
   Fraunces/Inter treatment confined to the trading content only.
   Font family itself now matches the main site (both use Montserrat, via
   style.css's import) — kept as separate tokens so display vs. body
   weight can still be tuned independently if needed. */
.pg {
  --navy-950: #0a1d30;
  --navy-900: #0f2a43;
  --navy-800: #1c3a5c;
  --gold-500: #c89b3c;
  --gold-400: #d9b559;
  --gold-100: #f3e6c4;
  --rust-500: #b3572c;
  --green-600: #2e7d4f;
  --cream: #f6f1e6;
  --paper: #fffdf9;
  --surface: #ffffff;
  --heading-ink: var(--navy-900);
  --ink-900: #1c2230;
  --ink-600: #55606f;
  --ink-400: #848c99;
  --line: #e7e0d0;
  --radius: 10px;
  --shadow: 0 16px 40px rgba(15, 42, 67, 0.14);
  --font-display: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Dark mode: js/main.js sets [data-theme="dark"] on <html> when the
   header's theme toggle is used. Re-pointing these same tokens (rather
   than writing separate dark rules for every component) means every
   surface, heading and body-text color on this page follows the toggle
   automatically. --heading-ink covers text that was previously hard-set
   to --navy-900 for readability (headings, prices, labels) without
   touching --navy-900 itself, which is still used as a fixed circle
   background (.tile, .m-tile) in both themes. */
[data-theme="dark"] .pg {
  --paper: #0b1420;
  --cream: #101c2c;
  --surface: #101c2c;
  --heading-ink: var(--gold-100);
  --ink-900: #f2efe6;
  --ink-600: #c6cbd6;
  --ink-400: #8b93a3;
  --line: #223349;
  --rust-500: #e0784b;
  --green-600: #5cd68a;
}

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

.pg {
  font-family: var(--font-body);
  color: var(--ink-900);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.pg img {
  max-width: 100%;
  display: block;
}

.pg a {
  color: inherit;
  text-decoration: none;
}

.pg ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.pg h1,
.pg h2,
.pg h3,
.pg h4 {
  font-family: var(--font-display);
  color: var(--heading-ink);
  line-height: 1.15;
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.pg p {
  margin: 0;
  color: var(--ink-600);
}

.pg button {
  font-family: inherit;
  cursor: pointer;
}

.pg :focus-visible {
  outline: 3px solid var(--gold-500);
  outline-offset: 2px;
}

.rule {
  max-width: 1180px;
  margin: 0 auto;
  height: 1px;
  background: var(--line);
}

/* ------------------------------------------------------------------ */
/* Trading hero (page content — not site chrome)                      */
/* ------------------------------------------------------------------ */
.trading-hero {
  max-width: 780px;
  margin: 0 auto;
  padding: 64px 24px 64px;
  text-align: center;
}

.trading-hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.trading-hero h1 span {
  color: var(--gold-500);
}

.trading-hero p {
  margin: 22px auto 0;
  max-width: 46ch;
  font-size: 1.1rem;
  color: var(--ink-600);
}

.hero-btns {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 32px;
  flex-wrap: wrap;
}

/* Note: named .btn-gold / .btn-outline-gold (not .btn-primary / .btn-ghost)
   so they never collide with the shared site button styles in style.css. */
.btn-gold,
.btn-outline-gold {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid transparent;
  transition: transform 200ms ease, background 200ms ease, border-color 200ms ease;
}

.btn-gold {
  background: var(--gold-500);
  color: var(--navy-950);
}

.btn-gold:hover {
  background: var(--gold-400);
  transform: translateY(-2px);
}

.btn-outline-gold {
  border-color: var(--line) !important;
  color: var(--heading-ink) !important;
}

.btn-outline-gold:hover {
  border-color: var(--heading-ink) !important;
  transform: translateY(-2px);
}

.trust {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin-top: 40px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--ink-400);
}

.trust span {
  position: relative;
  padding-left: 22px;
}

.trust span::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-500);
  transform: translateY(-50%);
}

/* ------------------------------------------------------------------ */
/* Section shell                                                      */
/* ------------------------------------------------------------------ */
#products,
.log,
.about {
  max-width: 1180px;
  margin: 0 auto;
  padding: 72px 24px;
}

.sec-h {
  max-width: 520px;
  margin: 0 auto 40px;
  text-align: center;
}

.sec-h h2 {
  font-size: 1.9rem;
  margin-bottom: 10px;
}

.sec-h p {
  font-size: 0.98rem;
}

.sec-h .count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  margin-left: 8px;
  background: var(--gold-100);
  color: var(--navy-900);
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  vertical-align: middle;
}

/* ------------------------------------------------------------------ */
/* Product grid                                                       */
/* ------------------------------------------------------------------ */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  cursor: pointer;
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.card:hover,
.card:focus-visible {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
  border-color: var(--gold-500);
}

.tile {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--navy-900);
  color: var(--gold-400);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.card-body h3 {
  font-size: 1.15rem;
  margin-bottom: 4px;
}

.card-origin {
  font-size: 0.85rem;
  color: var(--ink-400);
  margin-bottom: 14px;
}

.cert {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--navy-900);
  background: #fff;
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 16px;
}

[data-theme="dark"] .pg .cert {
  background: var(--gold-100);
  color: var(--navy-950);
  border-color: transparent;
}

.go {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--heading-ink);
  border-top: 1px solid var(--line);
  padding-top: 14px;
  transition: color 200ms ease;
}

.card:hover .go {
  color: var(--gold-500);
}

/* ------------------------------------------------------------------ */
/* Recent requests log                                                */
/* ------------------------------------------------------------------ */
.log {
  background: var(--navy-950);
  border-radius: var(--radius);
  color: #cfd6e0;
  max-width: 1180px;
}

.log .sec-h {
  color: #fff;
}

.log .sec-h h2 {
  color: #fff;
}

.log .sec-h p {
  color: #b7c0cf;
}

.empty {
  text-align: center;
  padding: 32px;
  border: 1px dashed #2b3d55;
  border-radius: var(--radius);
  color: #8b94a6;
  font-size: 0.92rem;
}

.log-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.log-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 16px;
  background: #101c2c;
  border: 1px solid #223349;
  border-radius: 8px;
  padding: 14px 18px;
  font-size: 0.88rem;
}

.log-item .ref {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--gold-400);
}

.log-item .what {
  color: #dfe4ec;
}

.log-item .meta {
  color: #8b94a6;
  font-size: 0.8rem;
}

.log-item .pill {
  background: rgba(46, 125, 79, 0.18);
  color: #5cd68a;
  font-weight: 600;
  font-size: 0.76rem;
  padding: 5px 12px;
  border-radius: 999px;
}

/* ------------------------------------------------------------------ */
/* About                                                               */
/* ------------------------------------------------------------------ */
.about h2 {
  text-align: center;
  font-size: 1.9rem;
  margin: 48px 0 36px;
}

.about-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.about-cols p {
  font-size: 1.02rem;
}

.about-cols ul li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 14px;
  font-size: 0.95rem;
  color: var(--ink-600);
}

.about-cols ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--gold-500);
}

/* ------------------------------------------------------------------ */
/* Modal / quote request                                               */
/* ------------------------------------------------------------------ */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 32, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--surface);
  width: 100%;
  max-width: 880px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 16px;
  position: relative;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  transform: translateY(16px);
  transition: transform 220ms ease;
}

.overlay.open .modal {
  transform: translateY(0);
}

.m-accent {
  height: 6px;
  background: linear-gradient(90deg, var(--gold-500), var(--navy-900));
  border-radius: 16px 16px 0 0;
}

.close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-600);
  font-size: 1rem;
  z-index: 2;
}

.close:hover {
  border-color: var(--heading-ink);
  color: var(--heading-ink);
}

.m-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.m-detail {
  padding: 44px 36px;
  border-right: 1px solid var(--line);
}

.m-tile {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--navy-900);
  color: var(--gold-400);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.m-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--heading-ink);
  margin-bottom: 4px;
}

.m-origin {
  font-size: 0.88rem;
  color: var(--ink-400);
  margin-bottom: 16px;
}

.m-certs {
  margin-bottom: 18px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.m-certs .cert {
  margin-bottom: 0;
}

.m-stock {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.m-stock.ok {
  color: var(--green-600);
}

.m-stock.low {
  color: var(--rust-500);
}

.m-desc {
  font-size: 0.95rem;
  padding-bottom: 20px;
}

.m-feats li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 10px;
  font-size: 0.88rem;
  color: var(--ink-600);
}

.m-feats li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--gold-500);
}

.m-form-wrap {
  padding: 44px 36px;
  background: var(--cream);
  border-radius: 0 0 16px 0;
}

.m-form-wrap h3 {
  font-size: 1.2rem;
  margin-bottom: 20px;
}

#reqForm label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--heading-ink);
  margin-bottom: 16px;
}

#reqForm label em,
#reqForm label i {
  font-weight: 400;
  color: var(--ink-400);
  font-style: normal;
  margin-left: 4px;
}

#reqForm input[type="text"],
#reqForm input[type="email"],
#reqForm input[type="number"],
#reqForm select,
#reqForm textarea {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--ink-900);
  background: var(--surface);
  transition: border-color 200ms ease;
}

#reqForm input:focus,
#reqForm select:focus,
#reqForm textarea:focus {
  border-color: var(--gold-500);
}

#reqForm textarea {
  resize: vertical;
}

.chk {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 400 !important;
  font-size: 0.85rem !important;
  color: var(--ink-600);
}

.chk input {
  width: 16px;
  height: 16px;
  margin-top: 3px;
  accent-color: var(--gold-500);
}

.err {
  display: block;
  color: var(--rust-500);
  font-size: 0.78rem;
  margin-top: 6px;
  font-weight: 500;
  min-height: 1.1em;
}

#reqForm button[type="submit"] {
  width: 100%;
  justify-content: center;
  margin-top: 6px;
}

#reqForm button[disabled] {
  opacity: 0.7;
  cursor: progress;
}

/* ------------------------------------------------------------------ */
/* Success view                                                        */
/* ------------------------------------------------------------------ */
.m-success {
  padding: 56px 44px;
  text-align: center;
}

.ok-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(46, 125, 79, 0.12);
  color: var(--green-600);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.m-success h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.ref {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--gold-500);
  background: var(--gold-100);
  padding: 8px 18px;
  border-radius: 999px;
  margin-bottom: 28px;
}

.s-summary {
  max-width: 420px;
  margin: 0 auto 22px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.s-summary div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--line);
}

.s-summary div:last-child {
  border-bottom: none;
}

.s-summary span {
  color: var(--ink-400);
}

.s-summary b {
  color: var(--heading-ink);
  font-weight: 600;
  text-align: right;
}

.s-note {
  max-width: 400px;
  margin: 0 auto 28px;
  font-size: 0.9rem;
}

.s-btns {
  display: flex;
  justify-content: center;
  gap: 14px;
}

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */
@media (max-width: 980px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .about-cols {
    grid-template-columns: 1fr;
  }

  .m-cols {
    grid-template-columns: 1fr;
  }

  .m-detail {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .m-form-wrap {
    border-radius: 0;
  }
}

@media (max-width: 640px) {
  .trading-hero {
    padding: 48px 20px 40px;
  }

  #products,
  .log,
  .about {
    padding: 56px 20px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .log-item {
    grid-template-columns: 1fr;
    align-items: flex-start;
    gap: 6px;
  }

  .m-detail,
  .m-form-wrap {
    padding: 32px 22px;
  }

  .modal {
    max-height: 94vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
  }
}

/* Product imagery ---------------------------------------------------- */
.tile--img {
  width: 100%;
  height: 230px;
  border-radius: 8px;
  background: var(--navy-900);
  overflow: hidden;
  margin-bottom: 18px;
}

.tile--img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms ease;
}

.card:hover .tile--img img {
  transform: scale(1.06);
}

/* Modal product image ----------------------------------------------- */
.m-tile {
  width: 100%;
  height: 300px;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 18px;
}

.m-tile__img img {
  width: 100%;
  height: 100px;
  object-fit: cover;
}