/* ============================================================================
   PACKPRO — SHARED STYLES
   ============================================================================
   Design tokens and the components that appear on more than one page: buttons,
   header, footer, product cards, the sticky mobile bar.

   Every page links this file, so a colour or radius changed here changes the
   whole shop. Page-specific styling (the hero, the promo band, the checkout
   form) stays inline on its own page.

   Rules below were moved out of index.html unchanged — the look is identical.
   ========================================================================= */

/* ---------- Design tokens — change these to restyle the whole site ------- */
:root {
  --bg:         #FAFAFA;   /* clean near-white, matches PackPro product photos */
  --surface:    #FFFFFF;
  --ink:        #0E0E0E;   /* logo black */
  --ink-soft:   #5F6368;
  --line:       #E7E7E7;
  --line-soft:  #F2F2F2;
  --brand:      #FA6400;   /* PackPro orange, taken from the logo */
  --brand-soft: #FFF1E6;
  --sage:       #3F4A3C;
  --cta:        #FA6400;   /* CTAs use brand orange — two near-identical
                              oranges on one page reads as a mistake */
  --cta-dk:     #D95400;
  --ok:         #1F7A4D;
  --warn:       #A8700D;
  --crit:       #B23A2F;

  --radius:    14px;
  --radius-lg: 24px;
  --shadow:    0 1px 2px rgba(14,14,14,.04), 0 6px 20px rgba(14,14,14,.05);
  --shadow-lg: 0 2px 6px rgba(14,14,14,.06), 0 20px 48px rgba(14,14,14,.10);

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --maxw: 1160px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* `img { display:block }` and `.logo-mark { display:grid }` both beat the
   [hidden] attribute on specificity. Make hidden actually mean hidden. */
[hidden] { display: none !important; }

body {
  margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink);
  line-height: 1.6; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.022em; margin: 0; }
a { color: inherit; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.eyebrow {
  font-size: 11.5px; font-weight: 750; letter-spacing: .15em;
  text-transform: uppercase; color: var(--brand); margin: 0 0 14px;
}

/* Visible only to screen readers — used for form labels and live regions. */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 15px 28px; border-radius: 999px; border: 1.5px solid transparent;
  font-size: 15.5px; font-weight: 650; text-decoration: none; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  white-space: nowrap; font-family: inherit;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--cta); color: #fff; box-shadow: 0 4px 14px rgba(250,100,0,.28); }
.btn-primary:hover { background: var(--cta-dk); box-shadow: 0 8px 22px rgba(250,100,0,.36); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); background: rgba(14,14,14,.03); }
.btn-sm { padding: 11px 20px; font-size: 14px; }
.btn[disabled], .btn[aria-disabled="true"] {
  opacity: .45; cursor: not-allowed; transform: none; box-shadow: none;
}

/* ---------- Header ---------- */
header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250,250,250,.88);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, box-shadow .2s ease;
}
header.scrolled { border-bottom-color: var(--line); box-shadow: 0 1px 12px rgba(14,14,14,.04); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 24px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 18.5px; letter-spacing: -.02em; text-decoration: none; }
.logo-lockup { display: flex; align-items: center; gap: 10px; }
/* Tall, narrow mark — size it by height and let width follow. */
.logo-img { height: 30px; width: auto; flex: 0 0 auto; object-fit: contain; }
@media (max-width: 520px) { .logo-img { height: 26px; } }

.logo-mark {
  width: 32px; height: 32px; border-radius: 9px; flex: 0 0 auto;
  background: var(--ink);
  display: grid; place-items: center; color: #fff; font-size: 15px; font-weight: 800;
}
.nav-links { display: flex; gap: 28px; font-size: 14.5px; color: var(--ink-soft); font-weight: 550; }
.nav-links a { text-decoration: none; transition: color .15s ease; }
.nav-links a:hover { color: var(--ink); }
@media (max-width: 900px) { .nav-links { display: none; } }
/* Below 720px the sticky bottom bar carries the CTA, so the header copy of it
   is redundant — dropping it gives the logo room instead of two competing
   buttons on a 375px screen. */
@media (max-width: 720px) {
  .nav > .btn-primary { display: none; }
  .nav { height: 62px; }
}

/* ---------- Cart link in the header ----------
   Stays visible at every width — on a phone the basket is the one control a
   shopper must always be able to reach. */
.nav-cart {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none; font-size: 14.5px; font-weight: 620; color: var(--ink);
  padding: 9px 16px; border: 1.5px solid var(--line); border-radius: 999px;
  background: var(--surface); transition: border-color .15s ease;
  flex: 0 0 auto;
}
.nav-cart:hover { border-color: var(--ink); }
.nav-cart .cart-count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--cta); color: #fff; font-size: 11.5px; font-weight: 750;
  display: inline-grid; place-items: center; line-height: 1;
}
@media (max-width: 520px) { .nav-cart .cart-label { display: none; } }

/* ---------- Image placeholder ---------- */
.ph {
  text-align: center; color: #8A8F98; font-size: 12px; font-weight: 600;
  letter-spacing: .02em; padding: 18px; line-height: 1.55;
}
.ph span.ic { font-size: 26px; display: block; margin-bottom: 8px; opacity: .5; }
.ph code {
  display: inline-block; margin-top: 7px; font-size: 11px; background: rgba(14,14,14,.07);
  padding: 3px 7px; border-radius: 5px; color: #6B7280; word-break: break-all;
}

/* ---------- Sections ---------- */
section { padding: 80px 0; }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head h2 { font-size: clamp(27px, 3.5vw, 40px); font-weight: 750; }
.section-head p { color: var(--ink-soft); font-size: 16.5px; margin: 15px 0 0; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
@media (max-width: 720px) { section { padding: 56px 0; } }

/* ---------- Category filter ---------- */
.filters { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 32px; }
.filter {
  padding: 9px 17px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--surface); font-size: 14px; font-weight: 600; color: var(--ink-soft);
  cursor: pointer; font-family: inherit; transition: all .16s ease;
}
.filter:hover { border-color: var(--ink-soft); color: var(--ink); }
.filter[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.filter .count { opacity: .55; font-weight: 500; margin-left: 3px; }

/* ---------- Product grid ---------- */
.prod-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 1000px) { .prod-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px)  { .prod-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; } }
@media (max-width: 460px)  { .prod-grid { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; display: flex; flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  position: relative;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: transparent; }
.card[hidden] { display: none; }
.card-img { aspect-ratio: 1 / 1; position: relative; display: grid; place-items: center; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card:hover .card-img img { transform: scale(1.045); }

.badge {
  position: absolute; top: 11px; left: 11px; z-index: 2;
  background: var(--cta); color: #fff; font-size: 11px; font-weight: 700;
  padding: 5px 9px; border-radius: 6px; letter-spacing: .03em; text-transform: uppercase;
}
.badge.alt  { background: var(--sage); }
.badge.free { background: var(--brand); }

.card-body { padding: 15px 16px 17px; display: flex; flex-direction: column; flex: 1; }
.card-cat { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); opacity: .7; margin-bottom: 7px; }
.card-title { font-size: 14.5px; font-weight: 640; margin: 0 0 6px; line-height: 1.38; }
.card-desc { font-size: 13px; color: var(--ink-soft); margin: 0 0 13px; flex: 1; line-height: 1.5; }
.price-row { display: flex; align-items: baseline; gap: 8px; margin-bottom: 9px; min-height: 26px; }
.price { font-size: 20px; font-weight: 760; color: var(--cta); letter-spacing: -.02em; }
.price-was { font-size: 13.5px; color: var(--ink-soft); text-decoration: line-through; }
.price-tbd { font-size: 14px; font-weight: 620; color: var(--ink-soft); }
.meta-row {
  display: flex; align-items: center; gap: 6px; font-size: 12px;
  color: var(--ink-soft); padding-top: 11px; border-top: 1px solid var(--line-soft);
}
.stars { color: #F0A62B; letter-spacing: -1px; font-size: 12.5px; }
.dot { opacity: .4; }
.card-cta {
  margin-top: 11px; text-align: center; padding: 10px; border-radius: 9px;
  background: var(--brand-soft); color: var(--brand); font-weight: 650; font-size: 13.5px;
  transition: background .15s ease, color .15s ease;
}
.card:hover .card-cta { background: var(--cta); color: #fff; }
.empty-note { grid-column: 1/-1; text-align: center; color: var(--ink-soft); padding: 40px 0; }

/* ---------- Quantity stepper ----------
   Touch targets are 40px so a thumb hits them reliably on a phone. */
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line);
       border-radius: 999px; overflow: hidden; background: var(--surface); }
.qty button {
  width: 40px; height: 40px; border: 0; background: transparent; cursor: pointer;
  font-size: 19px; line-height: 1; color: var(--ink); font-family: inherit;
}
.qty button:hover:not([disabled]) { background: var(--line-soft); }
.qty button[disabled] { opacity: .35; cursor: not-allowed; }
.qty input {
  width: 46px; height: 40px; border: 0; text-align: center; font-size: 15px;
  font-weight: 640; font-family: inherit; background: transparent; color: var(--ink);
  -moz-appearance: textfield;
}
.qty input::-webkit-outer-spin-button,
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- Notes / status panels ---------- */
.note {
  border-radius: 11px; padding: 13px 15px; font-size: 14px; line-height: 1.55;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft);
}
.note b { color: var(--ink); }
.note.info  { background: var(--brand-soft); border-color: #F7D9BE; color: #7A3B04; }
.note.info b { color: #5C2C03; }
.note.warn  { background: #FFF8E6; border-color: #F0DCA8; color: #6B4E08; }
.note.setup { background: #FDEEEC; border-color: #F2C4BE; color: #7A2119; }
.note.setup b { color: #5E1912; }

/* ---------- Footer ---------- */
footer { padding: 42px 0; font-size: 14px; color: var(--ink-soft); }
.foot { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.foot-links { display: flex; gap: 22px; flex-wrap: wrap; }
.foot-links a { text-decoration: none; }
.foot-links a:hover { color: var(--ink); }

/* ---------- Mobile sticky CTA ---------- */
.mobile-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(250,250,250,.94);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line); display: none;
}
.mobile-cta .btn { width: 100%; }
@media (max-width: 720px) { .mobile-cta { display: block; } body { padding-bottom: 78px; } }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  .btn:hover, .card:hover { transform: none; }
  .card:hover .card-img img { transform: none; }
}
