/* Pakstoor :: pks-fees.css :: v1.0-000003 :: 2026-10-22 */
/*
  Copyright (c) 2026 Pakstoor (Pty) Ltd. All rights reserved.
  /how-it-works fee section (companion: js/pks-fees.js): the cost cards, the seller earnings calculator and the
  fee comparison grid. The section reuses the page's own grammar (.hiw-flow-section, .hiw-process-grid,
  .hiw-process-card); this file only adds the card columns, the calculator and the comparison table.
  Colours come from the shared tokens. Brand orange is used with restraint: #F47A20 in dark mode, #B5520F for
  orange text in light mode, #141414 for text on an orange fill.
*/

/* ---- Cost cards: three columns on desktop, two on tablets, one on phones ---- */
.hiw-flow-section.pks-fees .hiw-process-grid.pks-fees-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) {
  .hiw-flow-section.pks-fees .hiw-process-grid.pks-fees-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .hiw-flow-section.pks-fees .hiw-process-grid.pks-fees-cards { grid-template-columns: 1fr; }
}
.pks-fees-cards .hiw-process-card-body + .hiw-process-card-body { margin-top: 8px; }
.pks-fees-cards .pks-fees-rate { color: var(--ink); font-size: 14px; font-weight: 600; }
.pks-fees a { color: var(--pk-brand-text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.pks-fees a:hover { text-decoration-thickness: 2px; }
html[data-theme="light"] .pks-fees a { color: var(--pk-brand-text-light); }

/* ---- Panels (calculator, comparison): a solid card, pinned above the page's hex background like the page's cards ---- */
.pks-fees-panel {
  position: relative;
  z-index: 1;
  margin-top: 22px;
  padding: 22px 24px;
  background-color: var(--bg-1);
  border: 1px solid var(--line-2);
  border-radius: 14px;
}
html[data-theme="light"] .pks-fees-panel {
  background-color: var(--bg-2);
  border-color: var(--line);
  box-shadow: 0 1px 2px rgba(20, 18, 15, .04), 0 10px 28px -18px rgba(20, 18, 15, .20);
}
.pks-fees-subtitle {
  font-family: var(--font-sans);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 6px;
}
.pks-fees-lede {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-muted);
  max-width: 640px;
}

/* ---- Calculator form ---- */
.pks-fees-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 16px 28px;
  margin: 18px 0 0;
}
.pks-fees-field { flex: 1 1 220px; min-width: 0; max-width: 300px; }
.pks-fees-label {
  display: block;
  margin: 0 0 6px;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
/* The input itself is the box (light mode's global input border and focus ring then apply to it as on every form);
   the R sits inside it on the left. */
.pks-fees-input { position: relative; }
.pks-fees-input > span {
  position: absolute;
  top: 50%;
  left: 13px;
  transform: translateY(-50%);
  font-weight: 600;
  color: var(--ink-muted);
  pointer-events: none;
}
.pks-fees-input input {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 46px;
  margin: 0;
  padding: 0 12px 0 31px;
  background-color: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  outline: 0;
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.pks-fees-input input:focus { border-color: var(--pk-brand); box-shadow: 0 0 0 3px var(--pk-brand-wash-2); }
.pks-fees-input input#feesPrice[aria-invalid="true"] { border-color: var(--danger) !important; }
.pks-fees-hint { margin: 6px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--ink-dim); }
.pks-fees-error { margin: 6px 0 0; font-size: 13px; line-height: 1.5; color: var(--ink); }
.pks-fees-error:empty { margin: 0; }

/* Delivery toggle: two radios drawn as one pill group (same shape as the page's buyer / seller tabs). */
.pks-fees-toggle { flex: 1 1 260px; min-width: 0; margin: 0; padding: 0; border: 0; }
.pks-fees-seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  background-color: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: 999px;
}
html[data-theme="light"] .pks-fees-seg { background-color: var(--bg-1); }
.pks-fees-seg label { position: relative; display: inline-flex; margin: 0; }
.pks-fees-seg input { position: absolute; top: 0; left: 0; width: 1px; height: 1px; margin: 0; opacity: 0; }
.pks-fees-seg span {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 160ms ease, color 160ms ease;
}
.pks-fees-seg input:checked + span { background-color: var(--pk-brand); color: var(--pk-brand-ink); }
.pks-fees-seg input:focus-visible + span { outline: 2px solid var(--pk-brand); outline-offset: 2px; }
.pks-fees-seg input:not(:checked):not(:disabled) + span:hover { color: var(--ink); }
.pks-fees-seg input:disabled + span { opacity: .5; cursor: not-allowed; }

/* ---- Calculator results: label left, value in a locked right-hand column that never wraps ---- */
.pks-fees-rows { margin: 20px 0 0; padding: 0; border-top: 1px solid var(--line); }
.pks-fees-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 4px 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.pks-fees-row dt { margin: 0; font-size: 14px; line-height: 1.45; color: var(--ink-muted); }
.pks-fees-row dt small { display: block; margin-top: 2px; font-size: 12px; line-height: 1.4; color: var(--ink-dim); }
.pks-fees-row dd {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.pks-fees-row.is-total dt { color: var(--ink); font-weight: 600; }
.pks-fees-row.is-total dd { font-size: 17px; font-weight: 700; }

.pks-fees-buyer { margin: 14px 0 0; font-size: 13.5px; line-height: 1.6; color: var(--ink-muted); }
.pks-fees-buyer strong { color: var(--ink); font-weight: 600; }
.pks-fees-amt { white-space: nowrap; font-variant-numeric: tabular-nums; }
.pks-fees-buyer .pks-fees-amt { color: var(--ink); font-weight: 600; }

/* Status lines (aria-live): a yellow-amber dot for "could not load", a red dot for an input the server would refuse. */
.pks-fees-status { margin: 12px 0 0; font-size: 13px; line-height: 1.5; color: var(--ink-muted); }
.pks-fees-status:empty { margin: 0; }
.pks-fees-status.is-warn::before,
.pks-fees-error.is-error::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  vertical-align: 1px;
  background-color: var(--warning);
}
.pks-fees-error.is-error::before { background-color: var(--danger); }
.pks-fees-note { margin: 14px 0 0; font-size: 12.5px; line-height: 1.6; color: var(--ink-dim); }

/* Comparison grid removed 2026-10-18 (pricing v2, owner decision). */

@media (max-width: 600px) {
  .pks-fees-panel { padding: 18px 16px; }
  .pks-fees-field { max-width: none; }
}
/* ---- Boosts (owner 2026-10-22: current prices on /how-it-works). Prices are the server's boost tiers (lib/boost-tiers.ts):
   R50 / 8 days, R89 / 15 days, R159 / 30 days, R299 / 60 days. Tier colours follow the card badges: Basic blue,
   Premium purple, Pro orange. Amounts never wrap. ---- */
.pks-boosts .pks-boost-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 1100px) { .pks-boosts .pks-boost-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) { .pks-boosts .pks-boost-list { grid-template-columns: minmax(0, 1fr); } }
.pks-boost {
  --bt: #3B82F6;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--line-2);
  border-top: 3px solid var(--bt);
  border-radius: 12px;
  background-color: var(--bg-2);
}
html[data-theme="light"] .pks-boost { background-color: #FFFFFF; border-color: var(--line); border-top-color: var(--bt); }
.pks-boost.is-premium { --bt: #A855F7; }
.pks-boost.is-pro, .pks-boost.is-pro2 { --bt: #F47A20; }
.pks-boost-name {
  align-self: flex-start;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #FFFFFF;
  background-color: var(--bt);
}
.pks-boost.is-pro .pks-boost-name, .pks-boost.is-pro2 .pks-boost-name { color: #141414; }
.pks-boost-price {
  margin-top: 6px;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.01em;
  color: var(--ink);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.pks-boost-days { font-size: 13px; font-weight: 600; color: var(--ink); }
.pks-boost-perk { font-size: 13px; line-height: 1.5; color: var(--ink-muted); }
.pks-boosts .pks-fees-note { max-width: 760px; }

/* ---- Local Businesses section (owner 2026-10-22: R199 per storefront per year). Page grammar (.hiw-flow-section,
   .hiw-process-card) plus one price card that borrows the pricing drawing palette (.pks-pricing tokens + .pa paint). ---- */
.pks-localsec-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 360px);
  gap: 24px;
  align-items: center;
}
@media (max-width: 860px) { .pks-localsec-top { grid-template-columns: minmax(0, 1fr); } }
.pks-localsec-top .hiw-flow-section-head { margin-bottom: 0; }
.pks-localsec .pks-localsec-price {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 20px 22px;
  border-radius: 16px;
  background: var(--pp-card);
  border: 1px solid var(--pp-line);
  border-top: 4px solid var(--pp-or);
}
.pks-localsec .pks-localsec-price .pks-pricing-art { max-width: 240px; margin: 0 auto; }
.pks-localsec-amt { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; color: var(--pp-head); }
.pks-localsec-amt b { font-size: 40px; font-weight: 800; line-height: 1; letter-spacing: -.02em; white-space: nowrap; color: var(--pp-or-ink); }
.pks-localsec-amt span { font-size: 15px; font-weight: 600; }
.pks-localsec .hiw-process-grid.pks-localsec-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .pks-localsec .hiw-process-grid.pks-localsec-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .pks-localsec .hiw-process-grid.pks-localsec-cards { grid-template-columns: minmax(0, 1fr); } }
.pks-localsec-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 20px; position: relative; z-index: 1; }
.pks-localsec-cta .pks-localsec-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 22px;
  border-radius: 999px;
  background-color: var(--pk-brand);
  color: var(--pk-brand-ink);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
}
.pks-localsec-cta .pks-localsec-btn:hover { background-color: var(--pk-brand-hover); }
.pks-localsec-cta .pks-localsec-btn:focus-visible, .pks-localsec-cta .pks-localsec-link:focus-visible { outline: 2px solid var(--pk-brand); outline-offset: 2px; }
.pks-localsec-cta .pks-localsec-link {
  font-weight: 600;
  font-size: 14px;
  color: var(--pk-brand-text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
html[data-theme="light"] .pks-localsec-cta .pks-localsec-link { color: var(--pk-brand-text-light); }
@media (max-width: 600px) {
  .pks-localsec .pks-localsec-price { padding: 18px 16px; }
  .pks-localsec-amt b { font-size: 34px; }
  .pks-localsec-cta .pks-localsec-btn { width: 100%; }
}
