/* /shop/ storefront. Its own design, independent of the site header.
   Markup is generated by tools/shop/build.py. */

:root {
  --bg: #F6F2EB;
  --surface: #FFFFFF;
  --sunk: #EFE9DF;
  --ink: #16130F;
  --ink-2: #4F4840;
  --ink-3: #7A7167;
  --line: #E5DED2;
  --line-2: #D4CBBC;
  --buy: #E5482A;
  --buy-hover: #C93A1F;
  --buy-ink: #FFFFFF;
  --free: #1E7A47;
  --free-soft: #E3F1E8;
  --soon: #8A6A14;
  --head: #16130F;
  --head-ink: #FFF4E8;
  --head-dim: #BDB1A2;
  --shadow: 0 1px 2px rgba(22, 19, 15, .06), 0 10px 30px -12px rgba(22, 19, 15, .18);
  --r: 16px;
  --sans: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12100D;
    --surface: #1C1915;
    --sunk: #24201B;
    --ink: #F4EDE3;
    --ink-2: #CEC4B6;
    --ink-3: #9D9284;
    --line: #2E2923;
    --line-2: #40392F;
    --buy: #FF6A3D;
    --buy-hover: #FF8560;
    --buy-ink: #1A0E08;
    --free: #5BD08F;
    --free-soft: #173324;
    --soon: #E5C26A;
    --head: #0B0A08;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-padding-top: 16px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; padding: 8px 14px; background: var(--buy); color: var(--buy-ink); border-radius: 8px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--buy); outline-offset: 2px; }

/* Announcement strip */
.strip { background: var(--buy); color: #fff; font-size: 13px; font-weight: 600; }
.strip .wrap { display: flex; justify-content: center; gap: 8px 28px; flex-wrap: wrap; padding-top: 7px; padding-bottom: 7px; text-align: center; }
.strip a { color: #fff; }
@media (prefers-color-scheme: dark) { .strip, .strip a { color: #1A0E08; } }
@media (max-width: 720px) { .strip span:not(:first-child) { display: none; } }

/* Header */
.top { background: var(--head); color: var(--head-ink); position: sticky; top: 0; z-index: 30; }
.top > .wrap { display: flex; align-items: center; gap: 20px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; flex: 0 0 auto; }
.brand svg { width: 30px; height: 30px; color: var(--buy); }
.brand span { display: flex; flex-direction: column; line-height: 1.05; }
.brand b { font-size: 19px; letter-spacing: -.01em; }
.brand small { font-size: 12px; color: var(--head-dim); font-weight: 500; }
.hsearch { flex: 1; max-width: 620px; position: relative; display: block; }
.hsearch svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: #7A7167; pointer-events: none; }
.hsearch input { width: 100%; height: 44px; padding: 0 16px 0 42px; border: 0; border-radius: 999px; background: #FFF9F1; color: #16130F; font-size: 15px; }
.hsearch input::placeholder { color: #8F857A; }
.tlinks { display: flex; gap: 18px; margin-left: auto; font-size: 14px; font-weight: 600; }
.tlinks a { color: var(--head-ink); text-decoration: none; opacity: .85; }
.tlinks a:hover { opacity: 1; text-decoration: underline; }
.catnav { border-top: 1px solid rgba(255, 244, 232, .1); }
.catnav .wrap { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.catnav .wrap::-webkit-scrollbar { display: none; }
.catnav a { flex: 0 0 auto; padding: 10px 12px; font-size: 14px; font-weight: 600; color: var(--head-dim); text-decoration: none; border-bottom: 2px solid transparent; }
.catnav a:hover, .catnav a[aria-current="true"] { color: var(--head-ink); border-bottom-color: var(--buy); }
@media (max-width: 760px) {
  .top { position: static; }
  .top > .wrap { flex-wrap: wrap; height: auto; padding-top: 12px; padding-bottom: 12px; gap: 12px; }
  .hsearch { order: 3; flex-basis: 100%; max-width: none; }
}

/* Hero */
.hero { padding: 44px 0 36px; background: linear-gradient(180deg, var(--sunk), var(--bg)); border-bottom: 1px solid var(--line); }
.eyebrow { margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--buy); }
.hero h1 { margin: 0; max-width: 820px; font-size: clamp(30px, 4.6vw, 52px); line-height: 1.06; letter-spacing: -.025em; }
.lede { max-width: 760px; margin: 14px 0 28px; font-size: 18px; color: var(--ink-2); }
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; }
.cat { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 16px; min-height: 150px; border-radius: var(--r); color: #fff; text-decoration: none; overflow: hidden; transition: transform .15s; }
.cat:hover { transform: translateY(-2px); }
.cat .glyph { width: 30px; height: 30px; margin-bottom: 6px; opacity: .95; }
.cat b { font-size: 16px; line-height: 1.2; }
.cat span { font-size: 13px; line-height: 1.35; opacity: .82; }
.cat em { margin-top: auto; padding-top: 8px; font-style: normal; font-size: 12px; font-weight: 700; opacity: .9; }
.cat-robots, .media-robots { background: radial-gradient(120% 90% at 20% 0%, #24406A, #0E1B30); }
.cat-indicators, .media-indicators { background: radial-gradient(120% 90% at 20% 0%, #2B2E57, #12142A); }
.cat-risk, .media-risk { background: radial-gradient(120% 90% at 20% 0%, #1F4A48, #0D2120); }
.cat-tradingview, .media-tradingview { background: radial-gradient(120% 90% at 20% 0%, #2A3142, #131722); }
.cat-woocommerce, .media-woocommerce { background: radial-gradient(120% 90% at 20% 0%, #573B85, #22163A); }
.cat-themes, .media-themes { background: radial-gradient(120% 90% at 20% 0%, #8A4B2A, #3A1E10); }
.cat-spreadsheets { background: radial-gradient(120% 90% at 20% 0%, #2F7A4F, #123A24); }
.cat-free { background: radial-gradient(120% 90% at 20% 0%, #C2562F, #5E2412); }
.media-spreadsheets, .media-free { background: var(--sunk); }

/* Shop layout */
.shop { padding: 28px 0 24px; }
.shop-grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px; align-items: start; }
.side { position: sticky; top: 124px; }
.filters summary { list-style: none; display: none; }
.filters summary::-webkit-details-marker { display: none; }
.filters fieldset { margin: 0 0 18px; padding: 0 0 16px; border: 0; border-bottom: 1px solid var(--line); }
.filters legend { padding: 0; margin-bottom: 8px; font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.filters label { display: flex; align-items: center; gap: 9px; padding: 5px 0; font-size: 15px; cursor: pointer; }
.filters label span { margin-left: auto; font-size: 13px; color: var(--ink-3); }
.filters input { width: 17px; height: 17px; margin: 0; accent-color: var(--buy); flex: 0 0 auto; }
.reset { padding: 0; border: 0; background: none; color: var(--buy); font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: underline; }
@media (max-width: 900px) {
  .shop-grid { grid-template-columns: 1fr; gap: 12px; }
  .side { position: static; }
  .filters { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
  .filters summary { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; font-weight: 700; cursor: pointer; }
  .filters summary::after { content: "+"; font-size: 20px; line-height: 1; color: var(--ink-3); }
  .filters[open] summary::after { content: "–"; }
  .filters form { padding: 4px 16px 16px; }
  .filters fieldset { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); column-gap: 16px; }
  .filters legend { grid-column: 1 / -1; }
}
#nfilt { margin-left: 8px; margin-right: auto; font-size: 13px; color: var(--buy); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
#count { margin: 0; font-weight: 700; }
.sort { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-3); }
.sort select { padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px; }

/* Product tiles */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 18px; }
.tile { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; transition: transform .15s; }
.tile:hover { transform: translateY(-2px); }
.tile[hidden] { display: none; }
.tile:target { outline: 3px solid var(--buy); outline-offset: 2px; }
.media { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 11; overflow: hidden; color: #fff; }
.media .logo { width: 104px; height: 104px; object-fit: contain; border-radius: 22px; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .35)); transition: transform .2s; }
.tile:hover .media .logo { transform: scale(1.05); }
.media .cover { width: 100%; height: 100%; object-fit: cover; }
.media .glyph-xl { width: 72px; height: 72px; color: var(--buy); }
.flags { position: absolute; left: 10px; top: 10px; right: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.flag { padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, .92); color: #16130F; font-size: 12px; font-weight: 700; }
.flag-free { background: #1E7A47; color: #fff; }
.tbody { display: flex; flex-direction: column; flex: 1; padding: 14px 16px 16px; }
.kind { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-3); }
.tile h3 { margin: 4px 0 6px; font-size: 18px; line-height: 1.25; letter-spacing: -.01em; }
.tile h3 a { text-decoration: none; }
.tile h3 a:hover { text-decoration: underline; }
.desc { margin: 0 0 12px; font-size: 14px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; margin-top: auto; margin-bottom: 12px; }
.price b { font-size: 24px; letter-spacing: -.02em; }
.price span { font-size: 13px; font-weight: 600; color: var(--free); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 16px; border: 0; border-radius: 10px; font-size: 15px; font-weight: 700; text-decoration: none; cursor: pointer; transition: background .15s; }
.btn-wide { width: 100%; }
.btn-buy { background: var(--buy); color: var(--buy-ink); }
.btn-buy:hover { background: var(--buy-hover); }
.btn-free { background: var(--free-soft); color: var(--free); box-shadow: inset 0 0 0 1.5px currentColor; }
.btn-free:hover { background: var(--free); color: var(--surface); }
.btn-off { background: var(--sunk); color: var(--ink-3); cursor: default; font-weight: 600; }
.n { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: rgba(255, 255, 255, .25); font-size: 12px; }

.opts summary { list-style: none; }
.opts summary::-webkit-details-marker { display: none; }
.opts[open] summary { border-radius: 10px 10px 0 0; }
.opts .eds { border: 1px solid var(--line); border-top: 0; border-radius: 0 0 10px 10px; padding: 0 12px; }

.eds { list-style: none; margin: 0; padding: 0; }
.eds li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.eds li:last-child { border-bottom: 0; }
.ed { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.pr { font-weight: 800; }
.pr-free { color: var(--free); }
.pr-soon { color: var(--soon); font-weight: 700; font-size: 14px; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; }
.btns .btn { flex: 1 1 120px; min-height: 40px; font-size: 14px; }

.meta { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 10px; margin: 12px 0 0; font-size: 13px; }
.where { color: var(--ink-3); }
.links { display: flex; gap: 12px; }
.links a { font-weight: 700; color: var(--ink); }

.empty { padding: 56px 16px; text-align: center; background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--r); }
.empty[hidden] { display: none; }
.empty b { font-size: 20px; }
.empty button { padding: 0; border: 0; background: none; color: var(--buy); font-weight: 700; text-decoration: underline; cursor: pointer; }

/* Quick view */
.quick { width: min(880px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: 20px; background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.quick::backdrop { background: rgba(22, 19, 15, .55); backdrop-filter: blur(3px); }
.quick-in { position: relative; display: grid; grid-template-columns: 1fr 1.15fr; }
.quick-media { display: grid; place-items: center; min-height: 100%; }
.quick-media.media { aspect-ratio: auto; }
.quick-media .logo { width: 150px; height: 150px; }
.quick-body { padding: 28px; overflow: auto; max-height: calc(100vh - 32px); }
.quick h2 { margin: 4px 0 8px; font-size: 26px; line-height: 1.15; letter-spacing: -.02em; }
.quick .desc { display: block; -webkit-line-clamp: unset; font-size: 15px; }
.quick .eds { border-top: 1px solid var(--line); }
.x { position: absolute; right: 12px; top: 12px; z-index: 2; width: 38px; height: 38px; border: 0; border-radius: 999px; background: var(--sunk); color: var(--ink); font-size: 24px; line-height: 1; cursor: pointer; }
@media (max-width: 700px) {
  .quick-in { grid-template-columns: 1fr; }
  .quick-media { aspect-ratio: 16 / 9; min-height: 0; }
  .quick-media .logo { width: 96px; height: 96px; }
  .quick-body { padding: 20px; max-height: none; }
}

/* Help */
.help { padding: 48px 0; background: var(--sunk); border-top: 1px solid var(--line); }
.help h2 { margin: 0 0 20px; font-size: 28px; letter-spacing: -.02em; }
.help-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.help-grid > div { padding: 20px; background: var(--surface); border-radius: var(--r); border: 1px solid var(--line); }
.help h3 { margin: 0 0 6px; font-size: 17px; }
.help p { margin: 0; font-size: 15px; color: var(--ink-2); }
.help a { color: var(--buy); font-weight: 600; }

/* Footer */
.foot { background: var(--head); color: var(--head-dim); padding: 40px 0 48px; font-size: 14px; }
.foot-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 28px; }
.foot .brand { color: var(--head-ink); margin-bottom: 10px; }
.foot h3 { margin: 0 0 10px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--head-ink); }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin: 6px 0; }
.foot a { color: var(--head-dim); text-decoration: none; }
.foot a:hover { color: var(--head-ink); text-decoration: underline; }
.foot p { max-width: 380px; }
@media (max-width: 800px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-grid > div:first-child { grid-column: 1 / -1; } }

@media (prefers-reduced-motion: reduce) { .tile, .cat, .media .logo, .btn { transition: none; } .tile:hover, .cat:hover { transform: none; } }

@media (max-width: 600px) {
  .hero { padding: 28px 0 24px; }
  .lede { font-size: 16px; margin-bottom: 20px; }
  .cats { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 4px; }
  .cats::-webkit-scrollbar { display: none; }
  .cat { flex: 0 0 62%; min-height: 132px; scroll-snap-align: start; }
  .media { aspect-ratio: 16 / 8; }
  .media .logo { width: 88px; height: 88px; }
}
