/* /shop only: category sidebar, product grid, search and sort. Loaded from the shop page body, so no other page changes. */
.shop-page { width: min(1080px, calc(100% - 2rem)); margin: 0 auto; padding: 1.6rem 0 1rem; }
.shop-head h1 { margin-bottom: 0.4rem; }
.shop-head .intro { margin: 0 0 0.5rem; color: var(--ink-soft); }
.bundle-line { margin: 0.2rem 0 0.8rem; color: var(--ink-soft); }
.bundle-line a { font-weight: 600; }
.shop-layout { display: block; margin-top: 0.8rem; }

/* categories: a drop-down on phones, a sticky sidebar from 768px */
.cat-side { display: none; }
.cat-drop { background: var(--white); border: 1px solid var(--rule); border-radius: 14px; margin-bottom: 1rem; }
.cat-drop summary { cursor: pointer; padding: 0.8rem 1rem; font-weight: 700; color: var(--leaf-dark); list-style: none; display: flex; justify-content: space-between; align-items: center; }
.cat-drop summary::-webkit-details-marker { display: none; }
.cat-drop summary::after { content: "▾"; font-size: 0.9rem; }
.cat-drop[open] summary::after { content: "▴"; }
.cat-drop .cat-list { padding: 0 0.5rem 0.6rem; }
.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-list a { display: flex; justify-content: space-between; gap: 0.6rem; padding: 0.55rem 0.7rem; border-radius: 10px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 0.97rem; }
.cat-list a:hover { background: var(--paper-2); color: var(--leaf-dark); }
.cat-list a[aria-current="true"] { background: var(--leaf); color: var(--white); }
.cat-list a[aria-current="true"] .count { color: var(--white); opacity: 0.85; }
.count { color: var(--ink-soft); font-weight: 500; font-size: 0.86rem; }
.cat-title { font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--clay); margin: 0 0 0.5rem 0.7rem; font-family: inherit; font-weight: 700; }

/* search and sort (hidden until the script runs; the page works without them) */
.shop-tools { display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; align-items: end; margin-bottom: 1.2rem; }
.shop-tools[hidden] { display: none; }
.shop-tools .tool { display: flex; flex-direction: column; gap: 0.25rem; flex: 1 1 14rem; }
.shop-tools .tool-sort { flex: 1 1 100%; }
@media (min-width: 768px) { .shop-tools .tool-sort { flex: 0 0 auto; } .shop-tools .tool:first-child { flex: 1 1 14rem; } }
.shop-tools .lbl { font-size: 0.82rem; font-weight: 700; color: var(--ink-soft); }
.seg { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.seg button { background: var(--white); color: var(--ink); border: 1px solid var(--rule); border-radius: 999px; padding: 0.4rem 0.8rem; min-height: 44px; font: inherit; font-size: 0.88rem; font-weight: 600; cursor: pointer; }
.seg button:hover { border-color: var(--leaf); background: var(--paper-2); color: var(--leaf-dark); }
.seg button[aria-pressed="true"] { background: var(--leaf); border-color: var(--leaf); color: var(--white); }
.shop-tools label { font-size: 0.82rem; font-weight: 700; color: var(--ink-soft); }
.shop-tools input { font: inherit; padding: 0.65rem 0.8rem; border: 1px solid var(--rule); border-radius: 12px; background: var(--white); color: var(--ink); min-height: 44px; }
.shop-tools input:focus, .seg button:focus-visible { outline: 2px solid var(--leaf); outline-offset: 1px; }
.shop-tools .status { flex-basis: 100%; margin: 0; font-size: 0.88rem; color: var(--ink-soft); min-height: 1.2em; }
.shop-empty { background: var(--white); border: 1px dashed var(--rule); border-radius: 12px; padding: 1rem 1.2rem; }
.shop-empty[hidden], .shop-section[hidden], .sc[hidden] { display: none; }
.linklike { background: none; border: 0; color: var(--leaf); text-decoration: underline; padding: 0; font: inherit; cursor: pointer; }
.linklike:hover { background: none; color: var(--clay); }

/* grid: one large card on a phone, two from 560px, three or four beside the sidebar */
.shop-section { scroll-margin-top: 1rem; margin-bottom: 1.4rem; }
.shop-group { margin: 1.6rem 0 0.6rem; }
.sgrid { list-style: none; margin: 0.8rem 0 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 1.1rem; }
@media (min-width: 560px) { .sgrid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .sgrid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); } }
.sc { background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease; }
.sc:hover, .sc:focus-within { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(28, 42, 36, 0.13); border-color: var(--leaf); }
.sc-media { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 5; background: var(--paper-2); overflow: hidden; }
.sc-media picture { display: contents; }
.sc-media img { position: absolute; inset: 0.7rem; margin: auto; width: auto; height: auto; max-width: calc(100% - 1.4rem); max-height: calc(100% - 1.4rem); border: 0; border-radius: 3px; background: #fff; box-shadow: 0 2px 10px rgba(28, 42, 36, 0.2); transition: transform 0.25s ease; }
.sc:hover .sc-media img { transform: scale(1.03); }
.badges { position: absolute; top: 0.6rem; left: 0.6rem; display: flex; gap: 0.35rem; flex-wrap: wrap; }
.badge { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; padding: 0.22rem 0.55rem; border-radius: 999px; background: var(--white); color: var(--leaf-dark); border: 1px solid var(--leaf); }
.badge-new { background: var(--clay); color: #fff; border-color: var(--clay); }
.badge-bundle { background: var(--leaf-dark); color: #fff; border-color: var(--leaf-dark); }
.badge-free { background: #e4f1ea; color: var(--leaf-dark); }
.peek { display: none; }
@media (hover: hover) and (min-width: 768px) {
  .peek { display: block; position: absolute; left: 0; right: 0; bottom: 0; padding: 0.8rem 0.9rem; background: rgba(29, 71, 58, 0.94); color: #fff; font-size: 0.82rem; line-height: 1.35; transform: translateY(101%); transition: transform 0.2s ease; pointer-events: none; }
  .sc:hover .peek, .sc:focus-within .peek { transform: translateY(0); }
  .peek ul { margin: 0.2rem 0 0; padding-left: 1.1rem; }
  .peek li { margin: 0 0 0.2rem; }
  .peek-title { font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.7rem; }
}
.sc-body { padding: 0.9rem 1rem 1rem; display: flex; flex-direction: column; flex: 1; }
.sc-title { margin: 0 0 0.25rem; font-size: 1.05rem; line-height: 1.25; }
.sc-title a { text-decoration: none; color: var(--leaf-dark); }
.sc-title a:hover { text-decoration: underline; }
.sc-tag { margin: 0 0 0.5rem; color: var(--ink-soft); font-size: 0.93rem; }
.sc-free { margin: 0 0 0.5rem; font-size: 0.86rem; }
.sc-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding-top: 0.4rem; }
.sc-foot .price { margin: 0; font-size: 1.15rem; }
.sc-foot form { margin: 0; }
.sc-buy { min-height: 44px; min-width: 6rem; padding: 0.55rem 1.2rem; font-weight: 700; text-align: center; border-radius: 12px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.sc-more { margin: 0.5rem 0 0; font-size: 0.88rem; }

@media (min-width: 768px) {
  .shop-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 2rem; align-items: start; }
  .cat-drop { display: none; }
  .cat-side { display: block; position: sticky; top: 1rem; }
  .shop-group:first-child { margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) { .sc, .sc-media img, .peek { transition: none; } .sc:hover { transform: none; } .sc:hover .sc-media img { transform: none; } }
.shop-main { scroll-margin-top: 10.5rem; }
@media (min-width: 768px) { .shop-main { scroll-margin-top: 5rem; } }
