/* VertexOps shop — storefront, cart, checkout and downloads.

   A second stylesheet, not a second design system. Every colour, radius, shadow and
   font here comes from the custom properties site.css already defines, so the shop
   re-themes with the rest of the site and a palette change stays a one-file edit.
   It is separate only so that the pages which do not sell anything — the coverage
   page, the contact page — do not pay for markup they never render.

   Loaded by the shop pages and by the home page, which carries the shop teaser. */

/* ── shared bits the home page also uses ──────────────────────────────────── */
.section-foot {
  margin-top: clamp(24px, 3vw, 34px);
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  color: var(--text-muted); font-size: .95rem;
}

/* A run-down list: a name, then the one line that says what it does.

   Exactly two columns, not auto-fit. Two reasons: a one-line blurb reads better in a
   wide column than a narrow one, and the row rules below assume a known column count —
   with auto-fit choosing three, the third item of row one got a rule the first two did
   not. A column gap keeps the two columns from running into each other. */
.rundown { list-style: none; padding: 0; margin: 0;
           display: grid; gap: 0 clamp(26px, 3.5vw, 52px); grid-template-columns: 1fr; }
@media (min-width: 780px) { .rundown { grid-template-columns: 1fr 1fr; } }
.rundown li { padding: 15px 0; border-top: 1px solid var(--border); }
.rundown li:first-child { border-top: 0; }
@media (min-width: 780px) { .rundown li:nth-child(2) { border-top: 0; } }
.rundown b { display: block; color: var(--text); font-size: 1rem; margin-bottom: 3px; }
.rundown span { color: var(--text-muted); font-size: .93rem; }
.rundown .rundown-domain {
  display: inline-block; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin-bottom: 4px;
}

/* ── nav cart pill ────────────────────────────────────────────────────────── */
.cart-link { position: relative; display: inline-flex; align-items: center; gap: 7px; }
.cart-link svg { width: 17px; height: 17px; }
.cart-count {
  min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
  background: var(--accent); color: var(--accent-ink);
  font-size: .72rem; font-weight: 700; line-height: 19px; text-align: center;
}
/* Hidden rather than zero: an empty cart should not advertise itself. */
.cart-link[data-count="0"] .cart-count { display: none; }

/* ── shop hero ────────────────────────────────────────────────────────────── */
.shop-hero { padding-block: clamp(40px, 6vw, 76px) clamp(28px, 4vw, 44px); }
.shop-hero h1 { max-width: 16em; }
.shop-hero .hero-lede { max-width: 44em; }
.shop-assurance {
  display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 22px;
  color: var(--text-muted); font-size: .92rem;
}
.shop-assurance li { display: flex; align-items: center; gap: 8px; }
.shop-assurance svg { width: 16px; height: 16px; color: var(--accent); flex: none; }

/* ── toolbar: search and filters ─────────────────────────────────────────── */
.shop-toolbar {
  display: grid; gap: 14px; margin-bottom: clamp(22px, 3vw, 32px);
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: center;
}
@media (max-width: 700px) { .shop-toolbar { grid-template-columns: 1fr; } }

.shop-search { position: relative; }
.shop-search svg {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; color: var(--text-faint); pointer-events: none;
}
.shop-search input {
  width: 100%; padding: 12px 14px 12px 40px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  font: inherit; font-size: .95rem;
}
.shop-search input::placeholder { color: var(--text-faint); }
.shop-search input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.shop-sort select {
  padding: 12px 14px; background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  font: inherit; font-size: .92rem; cursor: pointer;
}

/* Filter chips. A row of toggles rather than a sidebar of checkboxes: there are
   eleven categories and four file types, which is not enough to justify a panel. */
.shop-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.chip {
  padding: 7px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text-muted); font-size: .86rem; font-weight: 500; font-family: inherit;
  white-space: nowrap;
}
.chip:hover { color: var(--text); background: var(--surface-hover); }
.chip[aria-pressed="true"] {
  background: var(--accent-dim); border-color: var(--accent-line); color: var(--accent);
}
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip-count { opacity: .6; margin-left: 5px; font-variant-numeric: tabular-nums; }

.shop-resultline {
  color: var(--text-faint); font-size: .88rem; margin-bottom: 16px;
  font-variant-numeric: tabular-nums;
}

/* ── product grid ─────────────────────────────────────────────────────────── */
.product-grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
}
@media (max-width: 359px) { .product-grid { grid-template-columns: 1fr; } }

.product-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.product-card:hover {
  border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow-lift);
}
.product-card:focus-within { border-color: var(--accent-line); }

.product-shot {
  position: relative; display: block; aspect-ratio: 3 / 2;
  background: var(--bg-sunken); border-bottom: 1px solid var(--border); overflow: hidden;
}
.product-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-badges {
  position: absolute; top: 10px; left: 10px; display: flex; flex-wrap: wrap; gap: 6px;
}
.badge {
  padding: 4px 9px; border-radius: 6px; font-size: .7rem; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase;
}
.badge-featured { background: var(--accent); color: var(--accent-ink); }
.badge-best     { background: var(--leaf); color: #08150f; }
.badge-sale     { background: #d9534f; color: #fff; }
.badge-bundle   { background: var(--brand-blue, var(--accent)); color: #fff; }

/* The file-type stamp sits on the image because it is the single fact a buyer of a
   template pack checks first: can I actually open this. */
.product-format {
  position: absolute; right: 10px; bottom: 10px;
  padding: 4px 9px; border-radius: 6px;
  background: rgba(4, 12, 11, .78); color: #eafaf5;
  font-family: var(--mono); font-size: .7rem; letter-spacing: .04em;
  backdrop-filter: blur(3px);
}

.product-body { padding: 18px 19px 19px; display: flex; flex-direction: column; flex: 1; gap: 9px; }
.product-cat {
  font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); font-weight: 600;
}
.product-body h3 { font-size: 1.04rem; margin: 0; line-height: 1.3; }
.product-body h3 a { color: var(--text); }
.product-body h3 a:hover { color: var(--accent); text-decoration: none; }
.product-body > p { color: var(--text-muted); font-size: .91rem; margin: 0; flex: 1; }

.price { display: flex; align-items: baseline; gap: 9px; font-variant-numeric: tabular-nums; }
.price-now { font-size: 1.3rem; font-weight: 700; letter-spacing: -.02em; color: var(--text); }
.price-was { font-size: .95rem; color: var(--text-faint); text-decoration: line-through; }
.price-save { font-size: .8rem; font-weight: 600; color: var(--good); }

.product-actions { display: flex; gap: 8px; margin-top: 3px; }
.product-actions .btn { flex: 1; justify-content: center; text-align: center; }

/* ── shop teaser on the home page ─────────────────────────────────────────── */
.shop-teaser { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr) minmax(0, 320px); }
@media (max-width: 900px) { .shop-teaser { grid-template-columns: 1fr; } }
.shop-teaser .product-grid { grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 16px; }

.shop-categories {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px 21px;
}
.shop-categories h3 { font-size: .95rem; margin-bottom: 12px; }
.shop-categories ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.shop-categories a {
  display: flex; justify-content: space-between; gap: 12px; align-items: baseline;
  padding: 7px 9px; border-radius: 7px; color: var(--text-muted); font-size: .91rem;
}
.shop-categories a:hover { background: var(--surface-hover); color: var(--text); text-decoration: none; }
.shop-categories .count { color: var(--text-faint); font-size: .82rem; font-variant-numeric: tabular-nums; }

/* ── product page ─────────────────────────────────────────────────────────── */
.product-layout {
  display: grid; gap: clamp(26px, 4vw, 46px);
  grid-template-columns: minmax(0, 1fr) minmax(0, 380px);
  align-items: start;
}
@media (max-width: 940px) { .product-layout { grid-template-columns: 1fr; } }

.gallery-main {
  aspect-ratio: 3 / 2; background: var(--bg-sunken);
  border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-thumbs { display: flex; gap: 9px; margin-top: 11px; flex-wrap: wrap; }
.gallery-thumbs button {
  width: 78px; aspect-ratio: 3 / 2; padding: 0; cursor: pointer; overflow: hidden;
  background: var(--bg-sunken); border: 1px solid var(--border); border-radius: 8px;
}
.gallery-thumbs button[aria-current="true"] { border-color: var(--accent); }
.gallery-thumbs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }

.product-prose { margin-top: clamp(28px, 4vw, 40px); }
.product-prose h2 { font-size: 1.25rem; margin: 34px 0 12px; }
.product-prose h2:first-child { margin-top: 0; }
.product-prose p { color: var(--text-muted); }

/* "What's included" — a checked list, because the buyer is scanning for whether the
   thing they need is in the box. */
.includes { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.includes li {
  display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start;
  color: var(--text-muted); font-size: .96rem;
}
.includes li::before {
  content: ""; margin-top: 6px; width: 12px; height: 7px;
  border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}

.bullets { color: var(--text-muted); padding-left: 1.15em; }
.bullets li { margin-bottom: 7px; }

/* Spec table: version, licence, formats, file count, updated. Definition list rather
   than a table because it is pairs, not a grid, and it collapses cleanly on a phone. */
.specs {
  display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px;
  margin: 0; padding: 20px 22px;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg);
  font-size: .93rem;
}
.specs dt { color: var(--text-faint); }
.specs dd { margin: 0; color: var(--text); }
@media (max-width: 460px) { .specs { grid-template-columns: 1fr; gap: 3px 0; }
                            .specs dd { margin-bottom: 10px; } }

/* ── buy box ──────────────────────────────────────────────────────────────── */
.buybox {
  position: sticky; top: 84px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow);
  display: grid; gap: 15px;
}
@media (max-width: 940px) { .buybox { position: static; } }
.buybox .price-now { font-size: 2rem; }
.buybox .btn { width: 100%; justify-content: center; }
.buybox-note { color: var(--text-faint); font-size: .84rem; margin: 0; }
.buybox-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px;
               font-size: .88rem; color: var(--text-muted); }
.buybox-list li { display: flex; gap: 9px; align-items: center; }
.buybox-list svg { width: 15px; height: 15px; color: var(--accent); flex: none; }
.buybox hr { border: 0; border-top: 1px solid var(--border); margin: 0; }

/* Bundle savings callout. The number is the argument, so it is the biggest thing. */
.savings {
  background: var(--leaf-dim); border: 1px solid var(--accent-line);
  border-radius: var(--radius); padding: 12px 14px; font-size: .9rem; color: var(--text);
}
.savings b { color: var(--good); }

/* ── cart ─────────────────────────────────────────────────────────────────── */
.cart-layout {
  display: grid; gap: clamp(22px, 3vw, 36px);
  grid-template-columns: minmax(0, 1fr) minmax(0, 340px); align-items: start;
}
@media (max-width: 880px) { .cart-layout { grid-template-columns: 1fr; } }

.cart-lines { display: grid; gap: 0; }
.cart-line {
  display: grid; gap: 16px; align-items: center; padding: 18px 0;
  border-top: 1px solid var(--border);
  grid-template-columns: 96px minmax(0, 1fr) auto auto;
}
.cart-line:first-child { border-top: 0; }
@media (max-width: 620px) {
  .cart-line { grid-template-columns: 72px minmax(0, 1fr); gap: 12px 14px; }
  .cart-line .cart-qty, .cart-line .cart-line-total { grid-column: 2; justify-self: start; }
}
.cart-line img {
  width: 100%; aspect-ratio: 3 / 2; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--border); background: var(--bg-sunken);
}
.cart-line h3 { font-size: 1rem; margin: 0 0 4px; }
.cart-line h3 a { color: var(--text); }
.cart-meta { color: var(--text-faint); font-size: .84rem; }
.cart-line-total { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

.cart-qty { display: flex; align-items: center; gap: 2px; }
.cart-qty button {
  width: 32px; height: 32px; display: grid; place-items: center; cursor: pointer;
  background: var(--surface); color: var(--text); border: 1px solid var(--border-strong);
  font-size: 1rem; line-height: 1;
}
.cart-qty button:first-of-type { border-radius: 7px 0 0 7px; }
.cart-qty button:last-of-type { border-radius: 0 7px 7px 0; }
.cart-qty button:disabled { opacity: .38; cursor: not-allowed; }
.cart-qty output {
  min-width: 36px; height: 32px; display: grid; place-items: center;
  border-block: 1px solid var(--border-strong); background: var(--bg-elevated);
  font-variant-numeric: tabular-nums; font-size: .92rem;
}
.link-btn {
  background: none; border: 0; padding: 0; cursor: pointer; font: inherit;
  color: var(--text-faint); font-size: .84rem; text-decoration: underline;
}
.link-btn:hover { color: #d9534f; }

/* ── order summary ────────────────────────────────────────────────────────── */
.summary {
  position: sticky; top: 84px;
  background: var(--bg-elevated); border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg); padding: 22px; display: grid; gap: 14px;
}
@media (max-width: 880px) { .summary { position: static; } }
.summary h2 { font-size: 1.05rem; margin: 0; }
.summary-rows { display: grid; gap: 9px; font-size: .94rem; }
.summary-row { display: flex; justify-content: space-between; gap: 16px;
               color: var(--text-muted); font-variant-numeric: tabular-nums; }
.summary-row.discount { color: var(--good); }
.summary-total {
  display: flex; justify-content: space-between; gap: 16px; align-items: baseline;
  padding-top: 13px; border-top: 1px solid var(--border);
  font-size: 1.15rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums;
}

.coupon-row { display: flex; gap: 8px; }
.coupon-row input {
  flex: 1; min-width: 0; padding: 10px 12px; font: inherit; font-size: .9rem;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  text-transform: uppercase;
}
.coupon-row input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ── checkout ─────────────────────────────────────────────────────────────── */
.checkout-form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field label { font-size: .88rem; color: var(--text-muted); font-weight: 500; }
.field input {
  padding: 11px 13px; font: inherit; font-size: .95rem;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
}
.field input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.field input[aria-invalid="true"] { border-color: #d9534f; }
.field-error { color: #e8837f; font-size: .84rem; }
/* The honeypot. Off-screen rather than display:none, because some bots skip hidden
   fields; a screen reader is told to ignore it and it is out of the tab order. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.paypal-slot { min-height: 52px; margin-top: 4px; }
.paypal-note {
  display: flex; gap: 9px; align-items: flex-start;
  color: var(--text-faint); font-size: .84rem; margin: 0;
}
.paypal-note svg { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--accent); }

/* ── messages ─────────────────────────────────────────────────────────────── */
.notice {
  padding: 13px 16px; border-radius: var(--radius); font-size: .92rem;
  border: 1px solid var(--border-strong); background: var(--bg-elevated); color: var(--text-muted);
}
.notice-error   { border-color: #d9534f; background: rgba(217, 83, 79, .1); color: #f0a5a2; }
.notice-success { border-color: var(--accent-line); background: var(--accent-dim); color: var(--text); }
.notice-warn    { border-color: #d9a441; background: rgba(217, 164, 65, .1); color: #e8c98a; }
:root[data-theme="light"] .notice-error { color: #96231f; }
:root[data-theme="light"] .notice-warn  { color: #7a5610; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .notice-error { color: #96231f; }
  :root:not([data-theme="dark"]) .notice-warn  { color: #7a5610; }
}

.empty-state {
  text-align: center; padding: clamp(40px, 8vw, 72px) 20px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius-lg);
  color: var(--text-muted);
}
.empty-state h2 { font-size: 1.15rem; margin-bottom: 8px; color: var(--text); }

/* ── downloads ────────────────────────────────────────────────────────────── */
.download-list { display: grid; gap: 0; }
.download-row {
  display: grid; gap: 12px 16px; align-items: center; padding: 15px 0;
  border-top: 1px solid var(--border);
  grid-template-columns: 1fr auto;
}
.download-row:first-child { border-top: 0; }
.download-row h3 { font-size: .98rem; margin: 0 0 3px; }
.download-meta { color: var(--text-faint); font-size: .83rem; font-family: var(--mono); }

.order-head {
  display: flex; flex-wrap: wrap; gap: 10px 28px; align-items: baseline;
  padding: 18px 20px; margin-bottom: 24px;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.order-head dt { color: var(--text-faint); font-size: .8rem; text-transform: uppercase;
                 letter-spacing: .08em; margin-bottom: 3px; }
.order-head dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ── FAQ ──────────────────────────────────────────────────────────────────── */
.faq { display: grid; gap: 0; }
.faq details { border-top: 1px solid var(--border); }
.faq details:last-child { border-bottom: 1px solid var(--border); }
.faq summary {
  padding: 16px 34px 16px 0; cursor: pointer; position: relative;
  font-weight: 600; color: var(--text); list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 9px; height: 9px;
  border-right: 2px solid var(--text-faint); border-bottom: 2px solid var(--text-faint);
  transform: translateY(-70%) rotate(45deg); transition: transform .15s ease;
}
.faq details[open] summary::after { transform: translateY(-25%) rotate(-135deg); }
.faq summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.faq p { color: var(--text-muted); padding: 0 0 16px; margin: 0; max-width: 62em; }

/* ── breadcrumb ───────────────────────────────────────────────────────────── */
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
          font-size: .86rem; color: var(--text-faint); margin-bottom: 18px; padding: 0; list-style: none; }
.crumbs li { display: flex; gap: 8px; align-items: center; }
.crumbs li + li::before { content: "/"; color: var(--border-strong); }
.crumbs a { color: var(--text-muted); }

/* ── related products ─────────────────────────────────────────────────────── */
.related { margin-top: clamp(40px, 6vw, 64px); }
.related h2 { font-size: 1.25rem; margin-bottom: 6px; }
.related > p { color: var(--text-muted); margin-bottom: 22px; }

/* ── toast ────────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(120%);
  z-index: 60; max-width: min(92vw, 420px);
  display: flex; align-items: center; gap: 12px;
  padding: 13px 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lift); color: var(--text); font-size: .93rem;
  transition: transform .22s cubic-bezier(.2, .8, .3, 1);
}
.toast.is-visible { transform: translateX(-50%) translateY(0); }
.toast a { white-space: nowrap; }

/* ── busy state ───────────────────────────────────────────────────────────── */
[data-busy="true"] { opacity: .55; pointer-events: none; }
.spinner {
  width: 15px; height: 15px; border-radius: 50%; display: inline-block;
  border: 2px solid var(--border-strong); border-top-color: var(--accent);
  animation: shop-spin .7s linear infinite; vertical-align: -2px;
}
@keyframes shop-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2s; }
  .toast { transition: none; }
}

/* Nothing on a shop page may push the document sideways on a 320px screen. */
.shop-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* A heading that exists for the document outline and for screen readers, without
   adding a second visual title to a page that already has one. Not display:none —
   that would take it out of the accessibility tree along with the outline. */
.sr-heading {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
