/* ===========================================================================
   Design E — like D, but the categories and display options live in a left
   sidebar instead of the top navigation and toolbar.
   Same colour and type language as D; shared components come from /lib/ui.css.
   =========================================================================== */

:root {
  --accent: #2fb6a3;
  --accent-strong: #6fe0cf;
  --accent-soft: rgba(47, 182, 163, .12);
  --mint: #4fd18b;
  --page: #0e1316;
  --surface: #151c20;
  --surface-2: #1b2429;
  /* Panels in the content area (boxes, cards) — the sidebar keeps --surface.
     Identical to --surface here, so dark mode is untouched. */
  --surface-box: var(--surface);
  /* Header and footer: the stronger green in light mode. */
  --surface-chrome: var(--surface);
  /* Previous/next navigation: set apart from the content boxes. */
  --surface-nav: var(--surface);
  --muted-chrome: var(--muted);
  --accent-chrome: var(--accent);
  /* Mat behind a letterboxed photo. */
  --media-mat: #000;
  /* Article number as a tag. */
  --tag-bg: #0d6b5e;
  --tag-text: #ffffff;
  /* "Verkauft" badge: white on red, in both themes. */
  --sold: #c1121f;
  --text: #e4ebee;
  --muted: #90a2a9;
  --line: #26333a;
  --warn: #e0a458;
  --radius: 8px;
  --radius-sm: 6px;
}

html[data-theme="light"] {
  --accent: #0f7d70;
  --accent-strong: #0a5c52;
  --accent-soft: rgba(15, 125, 112, .10);
  /* Darkened so the price keeps 4.5:1 on the green cards. */
  --mint: #177a50;
  --page: #f1f4f5;
  --surface: #ffffff;
  --surface-2: #f5f8f9;
  /* Same light green as an active sidebar entry, as a solid colour so the
     panels stay readable where the page behind them shows through. */
  --surface-box: #e4f1ee;
  /* Header/footer: a step stronger. Muted text and links are darkened so they
     still clear 4.5:1 against the deeper green. */
  --surface-chrome: #cfe8e2;
  /* Navigation is grey on purpose: it is navigation, not content. */
  --surface-nav: #dde3e6;
  --muted-chrome: #4a6067;
  --accent-chrome: #0d6f63;
  /* The bars around a photo follow the theme: white in light mode. */
  --media-mat: #ffffff;
  /* Dark green tag with bold white text for the article number. */
  --tag-bg: #0d6b5e;
  --tag-text: #ffffff;
  /* Sold badge stays this red in light mode too: it must read as a warning. */
  --sold: #c1121f;
  --text: #16211f;
  --muted: #5d6f76;
  --line: #dde4e6;
  --warn: #9a6a1f;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.pv {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}
body.pv-no-scroll { overflow: hidden; }
img { display: block; max-width: 100%; height: auto; }

a { color: var(--accent); text-decoration: none; }
a:hover, a:focus-visible { color: var(--accent-strong); }
h1, h2, h3 { margin: 0 0 .45em; line-height: 1.22; letter-spacing: -.015em; }
h1 { font-size: clamp(1.35rem, 1.1rem + 1.1vw, 1.75rem); }
h2 { font-size: 1.1rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
h3 { font-size: 1rem; }
p { margin: 0 0 .85em; }
ul, ol { margin: 0 0 .85em; padding-left: 1.2rem; }
li { margin-bottom: .3em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

.pv-wrap { width: min(112rem, 100% - 1.5rem); margin-inline: auto; }
.pv-narrow { width: min(48rem, 100% - 1.5rem); }

.pv-skip { position: absolute; left: -9999px; background: var(--surface); color: var(--text); padding: .6rem .9rem; }
.pv-skip:focus { left: 0; top: 0; z-index: 90; }

.pv-placeholder {
  display: grid; place-items: center; min-height: 7rem; padding: .6rem;
  background: var(--surface-2); color: var(--muted); font-size: .78rem;
  border: 1px dashed var(--line);
}

/* ------------------------------------------------------------ header
   The category navigation is dropped here: the sidebar owns it. */
.pv-header { background: var(--surface-chrome); border-bottom: 1px solid var(--line); }
/* Header: brand on the left, the claim centred, tools on the right. The
   centre column stays empty on pages without a claim, so nothing shifts. */
.pv-header__bar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 1rem; padding: .85rem 0;
}
.pv-header__claim {
  grid-column: 2; text-align: center; font-size: clamp(1.05rem, .9rem + .5vw, 1.3rem);
  font-weight: 700; line-height: 1.22; text-transform: none; letter-spacing: -.02em;
  margin: 0; white-space: nowrap;
}
.pv-header__tools { justify-self: end; }
.pv-brand { display: flex; align-items: baseline; gap: .5rem; color: var(--text); }
.pv-brand__name { font-weight: 800; letter-spacing: -.03em; font-size: 1.1rem; }
.pv-brand__sub { font-size: .74rem; color: var(--muted-chrome); text-transform: uppercase; letter-spacing: .12em; }
.pv-header__tools { display: flex; align-items: center; gap: .85rem; }

/* ------------------------------------------------------------ main */
.pv-main { padding: 1.75rem 0 3rem; }

/* ------------------------------------------------------------ sidebar
   Visible on the overview and on article pages alike, as long as there is
   room for it. Below the breakpoint it is replaced by the burger menu. */
.pv-layout--sidebar { grid-template-columns: 17rem minmax(0, 1fr); gap: 1.5rem; }
.pv-sidebar { position: sticky; top: 1rem; }
.pv-sidebar__card { background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.pv-sidebar__title { font-size: .78rem; font-weight: 700; }
.pv-sidebar__item { font-weight: 600; }
.pv-sidebar__item .pv-sidebar__count { font-weight: 700; }
.pv-sidebar__item.is-active { box-shadow: inset 2px 0 0 var(--accent); }
/* No font override here: "Ansicht"/"Verkaufte Artikel" must read exactly like
   the "Kategorien" heading above them (both come from lib/ui.css). */

/* The categories sit indented under "Alle Anzeigen" so the hierarchy reads
   as what it is: the sub-areas of the whole list. */
.pv-sidebar__sub { display: grid; gap: .12rem; margin: .1rem 0 .1rem .55rem; padding-left: .45rem; border-left: 1px solid var(--line); }
.pv-sidebar__item--all { font-weight: 700; }
.pv-sidebar__sub--nested { margin-left: .55rem; }

/* ------------------------------------------------------------ boxes
   A light panel used to set one option apart from its neighbours. */
.pv-box {
  background: var(--surface-2); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm); padding: .85rem 1rem; margin: 0 0 .9rem;
}
.pv-box > p:last-child { margin-bottom: 0; }
.pv-box__title {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--accent); font-weight: 700; margin: 0 0 .35rem;
}

/* ------------------------------------------------------------ panels
   Standalone content panels (payment options): siblings with a gap, never
   nested, so each option reads as its own block. */
.pv-content > .pv-block { margin-bottom: 1rem; }
.pv-content > .pv-block:last-of-type { margin-bottom: 0; }
.pv-content > .pv-block + .pv-block { margin-top: 0; }

/* Pager: sibling navigation for an article, sits above the breadcrumb. */
.pv-pager--top { margin-bottom: 1rem; }
.pv-more { display: inline-flex; align-items: center; gap: .3rem; font-weight: 600; }
.pv-more__arrow { display: inline-block; transition: transform .15s ease; }
.pv-more:hover .pv-more__arrow { transform: translateX(3px); }

/* ------------------------------------------------------------ categories */
.pv-cat { margin-bottom: 2.25rem; }
.pv-cat__head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  border-bottom: 1px solid var(--line); padding-bottom: .4rem; margin-bottom: .85rem;
}
.pv-cat__head h2 { margin: 0; color: var(--accent); }
.pv-cat__count { color: var(--muted); font: .78rem/1 ui-monospace, monospace; }
.pv-cat:target .pv-cat__head { border-bottom-color: var(--accent); }

/* ------------------------------------------------------------ cards */
.pv-card { background: transparent; }
/* Article number: a compact tag, so it is found at a glance. */
.pv-id {
  display: inline-block;
  font: 700 .82rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--tag-text); background: var(--tag-bg);
  border-radius: var(--radius-sm); padding: .28rem .5rem;
  letter-spacing: .04em;
}
.pv-detail__intro > .pv-id { font-size: .92rem; padding: .32rem .6rem; }
.pv-price { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; color: var(--mint); }
.pv-price--lg { font-size: 1.35rem; }
.pv-price--block { padding: .7rem .9rem; background: var(--surface-2); border-left: 2px solid var(--mint); border-radius: var(--radius-sm); }
.pv-vb {
  font-size: .62rem; font-weight: 700; margin-left: .4rem; vertical-align: middle;
  color: var(--page); background: var(--mint); border-radius: 3px; padding: .08rem .3rem;
}
.pv-badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: .15rem .5rem; border-radius: 3px; text-transform: uppercase; letter-spacing: .06em; }
/* Sold is a warning, not a quiet state: solid red with white text. */
.pv-badge--sold { color: #fff; background: var(--sold); }
.pv-card__sub { color: var(--muted); font-size: .82rem; }

body.pv--mode-tiles .pv-card { background: var(--surface-box); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .6rem .1rem; }
body.pv--mode-tiles .pv-card:hover { border-color: var(--accent); }
body.pv--mode-tiles .pv-card__media { border-radius: var(--radius-sm); }
body.pv--mode-tiles .pv-card__body { padding: .6rem .25rem .6rem; }

body.pv--mode-list .pv-card:hover { border-color: var(--accent); }
body.pv--mode-compact .pv-card:hover { background: var(--accent-soft); }

/* ------------------------------------------------------------ detail */
.pv-breadcrumb { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; font: .8rem/1 ui-monospace, monospace; color: var(--muted); margin-bottom: .85rem; }

/* Left: the picture slider (fixed box). Right: everything a buyer needs at a
   glance — title, price with shipping, condition and the pick-up/shipping
   notes, so the long prose stays below. */
.pv-detail__head {
  display: grid; grid-template-columns: minmax(16rem, 32rem) minmax(0, 1fr); gap: 1.25rem;
  align-items: start;
}
.pv-detail__intro { background: var(--surface-box); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; }
.pv-detail__intro h1 { margin: .25rem 0; }
.pv-detail__intro > section { margin-top: .9rem; }
.pv-detail__intro .pv-block--flat { background: transparent; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: .85rem 0 0; }
.pv-detail__intro .pv-block--flat > h2 { margin-bottom: .55rem; }
.pv-detail__intro .pv-block--flat p:last-child { margin-bottom: 0; }
.pv-detail__intro .pv-price--block { margin-bottom: .6rem; }
.pv-detail__logistics p { font-size: .92rem; }
.pv-detail__logistics .pv-fineprint { margin-bottom: .3rem; }

.pv-subtitle { color: var(--muted); margin: 0 0 .7rem; font-size: .9rem; }
.pv-meta { color: var(--muted); font: .82rem/1.4 ui-monospace, monospace; margin: .5rem 0 0; }
.pv-price__note { font-size: .78rem; font-weight: 600; color: var(--muted); margin-left: .45rem; }

.pv-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 0; }
.pv-button {
  display: inline-block; padding: .5rem .95rem; border-radius: var(--radius-sm);
  background: var(--accent); color: #fff; font-weight: 700; font-size: .88rem;
}
.pv-button:hover { background: var(--accent-strong); color: #fff; }
/* In dark mode the accent is a light mint, so white would be unreadable there;
   the near-black that the dark theme already uses returns for it. */
html[data-theme="dark"] .pv-button,
html[data-theme="dark"] .pv-button:hover { color: #06110f; }

.pv-detail__body { margin-top: 1rem; display: grid; gap: 1rem; }
.pv-block { background: var(--surface-box); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; }
.pv-block > h2 { border-bottom: 1px solid var(--line); padding-bottom: .35rem; margin-bottom: .75rem; font-size: .82rem; color: var(--accent); }
.pv-prose { max-width: 74ch; }
.pv-prose p:last-child { margin-bottom: 0; }
.pv-hint { color: var(--muted); font-size: .82rem; }
.pv-note {
  background: var(--surface-2); border-left: 2px solid var(--warn); padding: .7rem .85rem;
  margin: 0 0 .85em; border-radius: var(--radius-sm); font-size: .92rem;
}
.pv-note p:last-child { margin-bottom: 0; }

.pv-facts { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1.25rem; margin: 0; font-size: .92rem; }
.pv-facts dt { color: var(--muted); font-family: ui-monospace, monospace; font-size: .82rem; }
.pv-facts dd { margin: 0; }
.pv-fineprint { font-size: .8rem; color: var(--muted); }

.pv-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: .6rem; }
.pv-figure { margin: 0; }
.pv-figure__link { display: block; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--media-mat); }
.pv-figure__link img { width: 100%; aspect-ratio: 4/3; object-fit: contain; }

.pv-pager { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-top: 1rem; }
.pv-pager__link {
  display: flex; gap: .6rem; align-items: center; padding: .6rem .8rem; font-size: .85rem;
  background: var(--surface-nav); border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--text);
}
.pv-pager__link:hover { border-color: var(--accent); }
/* Muted text and links darkened so they clear 4.5:1 on the grey box. */
.pv-pager__link small { display: block; color: var(--muted-chrome); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.pv-pager__link--next { justify-content: flex-end; text-align: right; }

.pv-signature { color: var(--muted); }
.pv-back { display: inline-block; margin-top: .4rem; }
.pv-panel--error { border-left: 3px solid #e05a52; background: var(--surface); border-radius: var(--radius); padding: 1.1rem 1.25rem; }
.pv-panel--error h1 { color: #e05a52; }

/* ------------------------------------------------------------ footer */
.pv-footer { background: var(--surface-chrome); border-top: 1px solid var(--line); padding: 1.5rem 0 1rem; margin-top: .5rem; }
/* Contact on the left, the legal links in their own column on the right. */
.pv-footer__grid { display: grid; grid-template-columns: 1fr auto; gap: 1.75rem; align-items: start; }
.pv-footer__legal { justify-self: end; display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; font-size: .85rem; }
.pv-footer h2 { font-size: .8rem; color: var(--accent-chrome); }
.pv-footer p { font-size: .85rem; color: var(--muted-chrome); margin: 0 0 .6rem; }
.pv-footer a { color: var(--accent-chrome); }

/* ------------------------------------------------------------ responsive
   The sidebar is dropped on narrow screens and replaced by the burger menu,
   so the content column always gets the full width. */
@media (max-width: 960px) {
  .pv-burger { display: inline-flex; }
  .pv-layout--sidebar { grid-template-columns: 1fr; }
  .pv-sidebar { display: none; }
  .pv-detail__head { grid-template-columns: 1fr; }
  .pv-detail__media { max-width: 34rem; margin-inline: auto; width: 100%; }
}

@media (max-width: 720px) {
  .pv-wrap { width: min(112rem, 100% - 1rem); }
  .pv-header__bar { padding: .7rem 0; grid-template-columns: 1fr auto; row-gap: .3rem; }
  .pv-brand { grid-area: 1 / 1; }
  .pv-header__tools { grid-area: 1 / 2; }
  .pv-header__claim {
    grid-area: 2 / 1 / 3 / -1; text-align: center;
    white-space: normal; font-size: clamp(1rem, .9rem + .6vw, 1.2rem);
  }
  .pv-brand__sub { display: none; }
  .pv-pager, .pv-footer__grid { grid-template-columns: 1fr; }
  /* One column here, so the links sit under the contact text, aligned with it. */
  .pv-footer__legal { justify-self: start; align-items: flex-start; }
  .pv-facts { grid-template-columns: 1fr; gap: 0 0 .6rem; }
  .pv-cat { margin-bottom: 1.6rem; }
  .pv-actions .pv-button { width: 100%; text-align: center; }
}

@media (max-width: 460px) {
  .pv-theme-toggle__pair { padding: .16rem .4rem; }
  .pv-theme-toggle__pair span { display: none; }
}

@media print {
  .pv-header__tools, .pv-sidebar, .pv-footer, .pv-pager, .pv-actions,
  .pv-lightbox, .pv-drawer, .pv-slider__controls { display: none; }
  body.pv { background: #fff; color: #000; }
}
