/* ── PriceBasket Module Styles ───────────────────────────────────────────────
   Restored to PriceBasket's own original visual identity. Source of truth:
   the ported React/Tailwind build this module was completed from
   (PriceBasket-FULL-PROJECT-WITH-DEPENDENCIES-v16/client/src, see
   client/src/index.css), whose top comment names the design contract
   "PRICEBASKET / «Тихая кладовая»" (Quiet Pantry) — editorial utility: a
   warm paper background, dark pine-green "conifer" ink for navigation and
   emphasis, a "сбереги-абрикос" (save-apricot) accent reserved for savings
   callouts, high-readability tabular numerals for prices, and DM Sans body
   text with Manrope for display/headings.

   An earlier build pass deliberately stripped all of this out and made the
   module fall back to bimbly.eu's generic site-wide purple
   (--brand:#7657ff / --brand2:#9a7dff). That is reverted here — PriceBasket
   gets its own palette back.

   How it's scoped: the palette lives in its own --pb-* custom properties
   (below) so nothing here ever redefines bimbly's shared --brand/--text/
   --muted/etc. at :root — that would leak into the shared site-wide
   header/nav/footer. Instead, the shared token *names* are re-pointed to
   PriceBasket's palette only inside <main> (which on every price-basket
   page contains just this module's own content plus the shared breadcrumbs
   / ad slot, which use their own styling and are unaffected by this — the
   shared header, module-nav and footer all render outside <main>).

   Class names for this module's own components stay pb-*, unchanged from
   before — only their declarations changed, so no PHP templates needed
   markup changes for this beyond the stale "no accent" comment in
   templates/header.php.
   ─────────────────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap');

main {
  /* Module's own palette tokens ("Quiet Pantry") */
  --pb-paper: #FAF7EE;         /* warm paper background */
  --pb-surface: #FFFEFA;       /* card / receipt surface */
  --pb-surface-2: #F1E9D8;     /* secondary section fill (honesty band) */
  --pb-surface-soft: #F5EFDD;  /* selected-choice / pill fill */
  --pb-ink: #1E2A25;           /* deep pine-tinted near-black text */
  --pb-muted: #6C7B72;         /* muted sage-grey */
  --pb-pine: #21473B;          /* primary brand ink — "conifer navigation" */
  --pb-pine-dark: #163027;     /* pine hover/active */
  --pb-pine-light: #3A6656;    /* pine tint for softer emphasis */
  --pb-line: #DED2B8;          /* warm tan hairline border */
  --pb-apricot: #D98A52;       /* "save-apricot" — savings-only accent */
  --pb-apricot-dark: #B96F3C;  /* apricot hover */
  --pb-apricot-soft: #F3DEC7;  /* light apricot tint */
  --pb-radius: 20px;
  --pb-shadow: 0 18px 45px rgba(30, 42, 37, .10), 0 2px 5px rgba(30, 42, 37, .05);
  --pb-font-sans: "DM Sans", ui-sans-serif, system-ui, sans-serif;
  --pb-font-display: "Manrope", ui-sans-serif, system-ui, sans-serif;

  /* Re-point the shared bimbly tokens to PriceBasket's own palette, scoped
     to <main> only — the shared site-header/nav/footer live outside <main>
     on every price-basket page and are completely unaffected by this. */
  --brand: var(--pb-pine);
  --brand2: var(--pb-pine-dark);
  --bg: var(--pb-paper);
  --surface: var(--pb-surface);
  --surface2: var(--pb-surface-2);
  --surface-soft: var(--pb-surface-soft);
  --text: var(--pb-ink);
  --muted: var(--pb-muted);
  --line: var(--pb-line);
  --radius: var(--pb-radius);
  --shadow: var(--pb-shadow);

  display: block;
  background: var(--pb-paper);
  background-image: radial-gradient(rgba(33, 71, 59, .05) 0.7px, transparent 0.7px);
  background-size: 8px 8px;
  color: var(--pb-ink);
  font-family: var(--pb-font-sans);
  font-feature-settings: "tnum" 1;
}
main h1, main h2, main h3 { font-family: var(--pb-font-display); letter-spacing: -.02em; }

.pb-hero {
  padding: clamp(40px, 6vw, 72px) 0 clamp(48px, 7vw, 80px);
  border-bottom: 1px solid var(--pb-line, #ded2b8);
}
.pb-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, .95fr);
  align-items: center;
  gap: clamp(28px, 5vw, 60px);
}
.pb-hero-grid h1 {
  margin: 12px 0 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.06;
  letter-spacing: -.02em;
  color: var(--pb-ink, #1e2a25);
}
.pb-hero-lead {
  font-size: 1.08rem;
  color: var(--pb-muted, #6c7b72);
  margin: 18px 0 0;
  line-height: 1.6;
  max-width: 520px;
}
.pb-hero-links { display: flex; gap: 20px; margin-top: 20px; flex-wrap: wrap; }
.pb-hero-links a { font-weight: 600; color: var(--pb-pine, #21473b); text-decoration: none; }
.pb-hero-links a:hover { text-decoration: underline; }

/* Receipt-style summary card */
.pb-receipt-card {
  position: relative;
  background: var(--pb-surface, #fffefa);
  border: 1px solid var(--pb-line, #ded2b8);
  border-radius: var(--pb-radius, 20px);
  box-shadow: var(--pb-shadow, 0 18px 45px rgba(30,42,37,.10));
  padding: 24px;
}
.pb-receipt-card::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 4.2rem;
  bottom: 1.3rem;
  width: 3px;
  background: repeating-linear-gradient(to bottom, var(--pb-pine-light, #3a6656) 0 4px, transparent 4px 10px);
  border-radius: 3px;
}
.pb-receipt-top { display: flex; justify-content: space-between; font-size: .72rem; letter-spacing: .08em; color: var(--pb-muted, #6c7b72); text-transform: uppercase; }
.pb-receipt-rule { border-top: 1px dashed var(--pb-line, #ded2b8); margin: 14px 0; }
.pb-receipt-rule.dark { border-top-style: solid; opacity: .5; }
.pb-receipt-empty { color: var(--pb-muted, #6c7b72); font-size: .92rem; }
.pb-receipt-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.pb-receipt-stats-standalone { max-width: 560px; margin: 0 auto 40px; padding: 24px; background: var(--pb-surface, #fffefa); border: 1px solid var(--pb-line, #ded2b8); border-radius: var(--pb-radius, 20px); }
.pb-receipt-stats div { display: flex; flex-direction: column; }
.pb-receipt-stats b { font-size: 1.6rem; color: var(--pb-pine, #21473b); font-variant-numeric: tabular-nums; }
.pb-receipt-stats small { color: var(--pb-muted, #6c7b72); font-size: .78rem; }

/* Basket / product picker */
.pb-basket-section { padding: 48px 0; }
.pb-section-head h2 { margin: 4px 0 24px; font-size: clamp(1.5rem, 3vw, 2.1rem); }
.pb-category-group { border: 1px solid var(--pb-line, #ded2b8); border-radius: 16px; padding: 20px; margin-bottom: 20px; }
.pb-category-group legend { padding: 0 8px; font-weight: 700; color: var(--pb-pine, #21473b); font-family: var(--pb-font-display); }
.pb-product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.pb-product-choice {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--pb-line, #ded2b8); border-radius: 14px; padding: 12px 14px;
  cursor: pointer; background: var(--pb-surface, #fffefa);
  transition: border-color .15s ease, background .15s ease;
}
.pb-product-choice:has(input:checked) { border-color: var(--pb-pine, #21473b); background: var(--pb-surface-soft, #f5efdd); }
.pb-product-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pb-checkmark {
  flex: 0 0 auto;
  width: 18px; height: 18px;
  border: 1.5px solid var(--pb-line, #ded2b8);
  border-radius: 5px;
  background: var(--pb-surface, #fffefa);
  position: relative;
  transition: background .15s ease, border-color .15s ease;
}
.pb-product-choice input:checked ~ .pb-checkmark {
  background: var(--pb-pine, #21473b);
  border-color: var(--pb-pine, #21473b);
}
.pb-product-choice input:checked ~ .pb-checkmark::after {
  content: "";
  position: absolute;
  left: 5px; top: 1px;
  width: 5px; height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.pb-product-choice input:focus-visible ~ .pb-checkmark { outline: 2px solid var(--pb-pine-light, #3a6656); outline-offset: 2px; }
.pb-product-choice small { display: block; color: var(--pb-muted, #6c7b72); font-size: .76rem; }

.pb-btn {
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 999px; padding: 12px 22px; font-weight: 700;
  border: 1px solid transparent; cursor: pointer; text-decoration: none; font-size: .95rem;
  font-family: var(--pb-font-display);
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.pb-btn-primary { background: var(--pb-pine, #21473b); color: #fff; margin-top: 18px; }
.pb-btn-primary:hover { background: var(--pb-pine-dark, #163027); }
.pb-btn-ghost { border-color: var(--pb-line, #ded2b8); color: var(--pb-ink, #1e2a25); background: var(--pb-surface, #fffefa); }
.pb-btn-ghost:hover { border-color: var(--pb-pine, #21473b); color: var(--pb-pine, #21473b); }

.pb-empty-state {
  text-align: center; padding: 48px 24px; border: 1px dashed var(--pb-line, #ded2b8);
  border-radius: var(--pb-radius, 20px); color: var(--pb-muted, #6c7b72);
}
.pb-empty-state .pb-btn { margin-top: 16px; }

.pb-honesty { background: var(--pb-surface-2, #f1e9d8); padding: 32px 0; }
.pb-honesty p.eyebrow { letter-spacing: .1em; font-size: .72rem; color: var(--pb-muted, #6c7b72); text-transform: uppercase; margin-bottom: 8px; }
.pb-honesty p:last-child { max-width: 720px; color: var(--pb-ink, #1e2a25); }

/* Ecosystem crosslinks */
.pb-ecosystem { padding: 40px 0; }
.pb-card { background: var(--pb-surface, #fffefa); border: 1px solid var(--pb-line, #ded2b8); border-radius: var(--pb-radius, 20px); padding: 20px; }
.pb-card-title { font-weight: 700; margin-bottom: 12px; font-family: var(--pb-font-display); }
.pb-ecosystem-links { display: flex; flex-direction: column; gap: 4px; }
.pb-ecosystem-link { display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-radius: 12px; text-decoration: none; color: var(--pb-ink, #1e2a25); }
.pb-ecosystem-link:hover { background: var(--pb-surface-soft, #f5efdd); }
.pb-ecosystem-link span:last-child { margin-left: auto; color: var(--pb-muted, #6c7b72); }

/* Info pages (how / data) */
.pb-info-hero { padding: clamp(40px, 6vw, 64px) 0 24px; border-bottom: 1px solid var(--pb-line, #ded2b8); }
.pb-info-hero .container.narrow { max-width: 720px; }
.pb-ledger { padding: 40px 0; }
.pb-ledger-row { display: grid; grid-template-columns: 48px 1fr; gap: 8px 16px; padding: 20px 0; border-bottom: 1px solid var(--pb-line, #ded2b8); }
.pb-ledger-row span { font-weight: 700; color: var(--pb-pine, #21473b); font-size: 1.2rem; font-family: var(--pb-font-display); }
.pb-ledger-row h2 { grid-column: 2; margin: 0; font-size: 1.15rem; }
.pb-ledger-row p { grid-column: 2; margin: 0; color: var(--pb-muted, #6c7b72); }

/* Compare results */
.pb-results { padding: 40px 0 64px; }
.pb-selected-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.pb-selected-strip span { background: var(--pb-surface-soft, #f5efdd); border-radius: 999px; padding: 6px 14px; font-size: .82rem; }
.pb-result-sheet {
  background: var(--pb-surface, #fffefa); border: 1px solid var(--pb-line, #ded2b8); border-radius: var(--pb-radius, 20px);
  padding: 24px; margin-bottom: 20px;
}
.pb-result-sheet.is-complete { border-color: var(--pb-pine, #21473b); }
.pb-result-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.pb-result-head h2 { margin: 4px 0 0; }
.pb-result-total { text-align: right; }
.pb-result-total b { font-size: 1.4rem; display: block; font-variant-numeric: tabular-nums; }
.pb-line-items { display: grid; gap: 8px; font-variant-numeric: tabular-nums; }
.pb-line-items > div { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--pb-line, #ded2b8); }
.pb-result-foot { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 14px; font-size: .82rem; color: var(--pb-muted, #6c7b72); }
.pb-result-foot strong { color: var(--pb-apricot-dark, #b96f3c); }

/* Request form */
.pb-request-wrap { max-width: 640px; margin: 0 auto; padding: 40px 16px 64px; }
.pb-request-form fieldset { border: 1px solid var(--pb-line, #ded2b8); border-radius: 18px; padding: 18px; margin-bottom: 18px; }
.pb-request-form legend { padding: 0 8px; font-weight: 700; font-family: var(--pb-font-display); }
.pb-request-form label { display: block; margin-bottom: 12px; }
.pb-request-form label span { display: block; font-size: .82rem; color: var(--pb-muted, #6c7b72); margin-bottom: 4px; }
.pb-request-form input[type=text], .pb-request-form input[type=email], .pb-request-form input:not([type=radio]):not([type=checkbox]), .pb-request-form textarea {
  width: 100%; border: 1px solid var(--pb-line, #ded2b8); border-radius: 10px; padding: 10px 12px; font: inherit;
  background: var(--pb-surface, #fffefa); color: var(--pb-ink, #1e2a25);
}
.pb-request-form input:focus, .pb-request-form textarea:focus { outline: none; border-color: var(--pb-pine, #21473b); }
.pb-topic-options { display: grid; gap: 8px; }
.pb-topic-options label { display: flex; align-items: center; gap: 8px; margin-bottom: 0; }
.pb-contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.pb-honeypot { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.pb-flash { border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; font-size: .9rem; }
.pb-flash-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.pb-success-state { text-align: center; padding: 48px 24px; }
.pb-success-state .pb-btn { margin-top: 16px; }

@media (max-width: 720px) {
  .pb-hero-grid { grid-template-columns: 1fr; }
  .pb-result-head { flex-direction: column; }
  .pb-result-total { text-align: left; }
}
