/* =====================================================================
   Xamu Shop — Storefront
   Fuer ALLE Installationen identisch. Was einen Kunden ausmacht, kommt
   aus der Datenbank (Theme::cssVariables() im <head>) und ueberschreibt
   die :root-Werte hier.
   ===================================================================== */

:root {
  --brand-bg: #ffffff;
  --brand-surface: #f6f5f3;
  --brand-text: #1a1a1a;
  --brand-muted: #6b6b6b;
  --brand-primary: #1a1a1a;
  --brand-accent: #b08d57;
  --brand-border: #e3e0dc;

  --font-heading: 'Playfair Display', serif;
  --font-body: 'Inter', sans-serif;

  --container: 1240px;
  --radius: 2px;
  --gap: clamp(1rem, 2.5vw, 2rem);
  --section-y: clamp(3rem, 8vw, 6rem);
  --transition: 180ms cubic-bezier(.4, 0, .2, 1);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--brand-bg);
  color: var(--brand-text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-heading); font-weight: 500; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
img { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand-accent); }

.muted { color: var(--brand-muted); }
.center { text-align: center; }

.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;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--brand-text); color: var(--brand-bg); padding: .75rem 1.25rem;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 3px; }

.container { width: min(100% - 2.5rem, var(--container)); margin-inline: auto; }
.container--narrow { width: min(100% - 2.5rem, 720px); }

.section { padding-block: var(--section-y); }
.section--tight { padding-block: clamp(1.5rem, 4vw, 3rem); }
.section--surface { background: var(--brand-surface); }

.section__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; margin-bottom: calc(var(--gap) * 1.25); flex-wrap: wrap;
}
.section__head h2 { margin: 0; }

.page-head { margin-bottom: calc(var(--gap) * 1.25); }
.page-head h1 { margin-bottom: .15em; }

/* ── Buttons ──────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.75rem; border: 1px solid transparent; border-radius: var(--radius);
  font: inherit; font-size: .95rem; letter-spacing: .02em; cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.btn--primary { background: var(--brand-primary); color: var(--brand-bg); }
.btn--primary:hover { background: var(--brand-accent); color: var(--brand-bg); }
.btn--outline { border-color: var(--brand-border); color: var(--brand-text); }
.btn--outline:hover { border-color: var(--brand-accent); color: var(--brand-accent); }
.btn--lg { padding: 1rem 2.25rem; font-size: 1rem; }
.btn--block { width: 100%; }

.link-arrow { color: var(--brand-accent); font-size: .9rem; letter-spacing: .04em; }
.link-arrow::after { content: ' →'; }

/* ── Kopfzeile ────────────────────────────────────────────────── */

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--brand-bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--brand-border);
}
.site-header__inner {
  display: flex; align-items: center; gap: var(--gap);
  min-height: 72px;
}
.brand { margin-right: auto; }
.brand__logo { max-height: 44px; width: auto; }
.brand__text { font-family: var(--font-heading); font-size: 1.35rem; letter-spacing: .06em; }

.site-nav { display: flex; gap: 1.5rem; font-size: .93rem; }
.site-nav a { padding-block: .35rem; border-bottom: 1px solid transparent; }
.site-nav a:hover { border-color: var(--brand-accent); }

.nav-toggle { display: none; background: none; border: 0; padding: .5rem; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 1.5px; background: var(--brand-text); margin: 4px 0; }

.cart-button {
  position: relative; background: none; border: 0; padding: .5rem;
  color: inherit; cursor: pointer; display: flex; align-items: center;
}
.cart-button__count {
  position: absolute; top: 0; right: 0;
  min-width: 18px; height: 18px; padding: 0 4px;
  background: var(--brand-accent); color: #fff;
  border-radius: 9px; font-size: .7rem; line-height: 18px; text-align: center;
}
.cart-button__count[hidden] { display: none; }

/* ── Hero ─────────────────────────────────────────────────────── */

.hero { padding-block: clamp(3rem, 9vw, 7rem); background: var(--brand-surface); }
.hero--image {
  background: linear-gradient(rgba(0,0,0,.42), rgba(0,0,0,.42)), var(--hero-image) center/cover no-repeat;
  color: #fff;
}
.hero__inner { max-width: 640px; }
.hero__title { margin-bottom: .35em; }
.hero__text { font-size: 1.075rem; margin-bottom: 1.75em; }
.hero--image .btn--primary { background: #fff; color: #111; }

/* ── Produktraster ────────────────────────────────────────────── */

.product-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.product-card__media {
  position: relative; aspect-ratio: 1; overflow: hidden;
  background: var(--brand-surface);
}
.product-card__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 500ms cubic-bezier(.4, 0, .2, 1);
}
.product-card:hover .product-card__media img { transform: scale(1.04); }
.product-card__placeholder { width: 100%; height: 100%; background: var(--brand-surface); }

.product-card__body { padding-top: .85rem; }
.product-card__title { font-size: 1rem; margin: 0 0 .15em; }
.product-card__subtitle { font-size: .875rem; margin: 0 0 .3em; }
.product-card__price { margin: 0; font-size: .95rem; }

/* Verkauftes bleibt sichtbar (Portfolio), aber deutlich zurueckgenommen */
.product-card.is-sold .product-card__media img { filter: grayscale(.65); opacity: .68; }

.badge {
  position: absolute; top: .75rem; left: .75rem;
  padding: .3rem .7rem; font-size: .7rem; letter-spacing: .08em;
  text-transform: uppercase; border-radius: var(--radius);
}
.badge--sold { background: var(--brand-text); color: var(--brand-bg); }
.badge--unique { background: var(--brand-accent); color: #fff; }
.badge--lg { top: 1rem; left: 1rem; font-size: .78rem; padding: .45rem 1rem; }

/* ── Katalog mit Filtern ──────────────────────────────────────── */

.catalog { display: grid; grid-template-columns: 250px 1fr; gap: calc(var(--gap) * 1.75); align-items: start; }

.filters { position: sticky; top: 96px; display: grid; gap: 1.5rem; }
.filters__group { display: grid; gap: .5rem; }
.filters__label { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--brand-muted); }
.filters__list { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; font-size: .93rem; }
.filters__list a { display: flex; justify-content: space-between; gap: .5rem; padding: .2rem 0; }
.filters__list a.is-active { color: var(--brand-accent); }
.filters__row { display: flex; align-items: center; gap: .5rem; }
.filters__hint { font-size: .8rem; margin: 0; }
.filters__reset { display: block; text-align: center; font-size: .85rem; color: var(--brand-muted); }

.filters input[type="search"],
.filters input[type="number"],
.filters select,
.field__input {
  width: 100%; padding: .6rem .75rem;
  border: 1px solid var(--brand-border); border-radius: var(--radius);
  background: var(--brand-bg); color: inherit; font: inherit; font-size: .93rem;
}
.checkbox { display: flex; align-items: center; gap: .5rem; font-size: .93rem; cursor: pointer; }

.empty { padding: 3rem 0; color: var(--brand-muted); }

.pagination { display: flex; gap: .4rem; justify-content: center; margin-top: calc(var(--gap) * 2); }
.pagination a {
  min-width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid var(--brand-border); border-radius: var(--radius); font-size: .9rem;
}
.pagination a.is-active { background: var(--brand-primary); color: var(--brand-bg); border-color: var(--brand-primary); }

/* ── Produktseite ─────────────────────────────────────────────── */

.breadcrumb { padding-block: 1.25rem; font-size: .85rem; color: var(--brand-muted); display: flex; gap: .45rem; flex-wrap: wrap; }

.product { display: grid; grid-template-columns: 1.15fr 1fr; gap: calc(var(--gap) * 2); align-items: start; }

.product__main { position: relative; margin: 0; aspect-ratio: 1; background: var(--brand-surface); overflow: hidden; }
.product__main img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.product__placeholder { width: 100%; }

.product__thumbs {
  list-style: none; margin: .75rem 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: .5rem;
}
.product__thumb {
  padding: 0; border: 1px solid transparent; background: none; cursor: pointer;
  aspect-ratio: 1; overflow: hidden;
}
.product__thumb img { width: 100%; height: 100%; object-fit: cover; }
.product__thumb.is-active { border-color: var(--brand-accent); }

.product__title { margin-bottom: .1em; }
.product__subtitle { color: var(--brand-muted); margin-bottom: 1em; }
.product__price { font-size: 1.5rem; font-family: var(--font-heading); margin-bottom: .1em; }
.product__vat { font-size: .82rem; margin-bottom: 1.5em; }
.product__description { margin-bottom: 1.75em; }

.product__buy { display: grid; gap: 1rem; margin-bottom: 2rem; }
.product__buy-row { display: flex; gap: .75rem; }
.field__input--qty { width: 84px; flex: none; text-align: center; }
.product__unique-hint { font-size: .87rem; color: var(--brand-muted); margin: 0; }
.field__label { display: block; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--brand-muted); margin-bottom: .35rem; }

.notice { padding: 1.25rem 1.5rem; background: var(--brand-surface); border-left: 2px solid var(--brand-accent); margin-bottom: 2rem; }
.notice p:last-of-type { margin-bottom: 1em; }

.specs { width: 100%; border-collapse: collapse; font-size: .93rem; margin-bottom: 2rem; }
.specs th, .specs td { text-align: left; padding: .6rem 0; border-bottom: 1px solid var(--brand-border); vertical-align: top; }
.specs th { font-weight: 500; color: var(--brand-muted); width: 40%; }

.product__story h2 { font-size: 1.2rem; }

/* ── Kategorien ───────────────────────────────────────────────── */

.category-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.category-card {
  display: grid; gap: .2rem; padding: 1.5rem;
  background: var(--brand-bg); border: 1px solid var(--brand-border); border-radius: var(--radius);
  transition: border-color var(--transition);
}
.category-card:hover { border-color: var(--brand-accent); }
.category-card__name { font-family: var(--font-heading); font-size: 1.1rem; }
.category-card__count { font-size: .85rem; }

/* ── Über-Sektion ─────────────────────────────────────────────── */

.about { display: grid; grid-template-columns: 1fr 1fr; gap: calc(var(--gap) * 1.75); align-items: center; }
.about__image { width: 100%; aspect-ratio: 4/5; object-fit: cover; }

.prose { max-width: 68ch; }
.prose h1 { margin-bottom: .75em; }

/* ── Warenkorb-Schublade ──────────────────────────────────────── */

.cart-drawer { position: fixed; inset: 0; z-index: 60; }
.cart-drawer[hidden] { display: none; }
.cart-drawer__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.cart-drawer__panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(420px, 100%); background: var(--brand-bg);
  display: flex; flex-direction: column;
  animation: drawer-in 240ms cubic-bezier(.4, 0, .2, 1);
}
@keyframes drawer-in { from { transform: translateX(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .cart-drawer__panel { animation: none; }
  html { scroll-behavior: auto; }
  .product-card__media img { transition: none; }
}
.cart-drawer__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--brand-border);
}
.cart-drawer__head h2 { margin: 0; font-size: 1.15rem; }
.cart-drawer__close { background: none; border: 0; font-size: 1.75rem; line-height: 1; cursor: pointer; color: inherit; }
.cart-drawer__body { padding: 1.5rem; overflow-y: auto; flex: 1; }

/* ── Fusszeile ────────────────────────────────────────────────── */

.site-footer { margin-top: var(--section-y); background: var(--brand-surface); border-top: 1px solid var(--brand-border); }
.site-footer__inner { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--gap); padding-block: calc(var(--gap) * 1.75); }
.site-footer__brand { font-family: var(--font-heading); font-size: 1.15rem; margin-bottom: .35em; }
.site-footer__nav { display: grid; gap: .4rem; align-content: start; font-size: .9rem; }
.site-footer__contact { display: grid; gap: .4rem; align-content: start; font-size: .9rem; }
.site-footer__legal { padding-block: 1.25rem; border-top: 1px solid var(--brand-border); font-size: .82rem; color: var(--brand-muted); }

/* ── Schmale Viewports ────────────────────────────────────────── */

@media (max-width: 900px) {
  .product { grid-template-columns: 1fr; }
  .catalog { grid-template-columns: 1fr; }
  .filters { position: static; }
  .about { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-toggle { display: block; order: 3; }
  .cart-button { order: 2; }
  .site-nav {
    order: 4; flex-basis: 100%; flex-direction: column; gap: .25rem;
    padding-bottom: 1rem; display: none;
  }
  .site-nav.is-open { display: flex; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* ── Warenkorb ────────────────────────────────────────────────── */

.cart-empty { color: var(--brand-muted); margin-bottom: 1.5rem; }

.cart-lines { list-style: none; margin: 0 0 1.5rem; padding: 0; display: grid; gap: 1.25rem; }
.cart-line { display: grid; grid-template-columns: 72px 1fr; gap: .9rem; }
.cart-line__media img { width: 72px; height: 72px; object-fit: cover; }
.cart-line__placeholder { display: block; width: 72px; height: 72px; background: var(--brand-surface); }
.cart-line__body { display: grid; gap: .3rem; align-content: start; }
.cart-line__title { font-family: var(--font-heading); font-size: 1rem; }
.cart-line__variant { font-size: .85rem; }
.cart-line__row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.cart-line__qty { display: flex; align-items: center; gap: .35rem; }
.cart-line__qty input {
  width: 62px; padding: .35rem .45rem; text-align: center; font: inherit; font-size: .88rem;
  border: 1px solid var(--brand-border); border-radius: var(--radius); background: var(--brand-bg);
}
.cart-line__update, .cart-line__remove {
  background: none; border: 0; padding: 0; font: inherit; font-size: .8rem;
  color: var(--brand-muted); text-decoration: underline; cursor: pointer;
}
.cart-line__update:hover, .cart-line__remove:hover { color: var(--brand-accent); }
.cart-line__price { font-size: .95rem; white-space: nowrap; }

.cart-freehint {
  padding: .65rem .9rem; margin-bottom: 1rem; font-size: .88rem;
  background: var(--brand-surface); border-radius: var(--radius);
}

.cart-totals {
  display: grid; grid-template-columns: 1fr auto; gap: .35rem 1rem;
  margin: 0 0 1.5rem; padding-top: 1rem; border-top: 1px solid var(--brand-border);
  font-size: .93rem;
}
.cart-totals dt { margin: 0; }
.cart-totals dd { margin: 0; text-align: right; }
.cart-totals .is-total { font-size: 1.1rem; font-family: var(--font-heading); padding-top: .35rem; }

.cart-page { max-width: 620px; }

.notice--info { border-left-color: var(--brand-accent); }
.notice--warn { border-left-color: #a3702c; }
.notice ul { margin: .4rem 0 .8rem; padding-left: 1.1rem; font-size: .9rem; }

/* ── Kasse ────────────────────────────────────────────────────── */

.checkout { display: grid; grid-template-columns: 1fr 340px; gap: calc(var(--gap) * 2); align-items: start; }
.checkout__form h1 { margin-bottom: 1rem; }

.fieldset { border: 0; padding: 0; margin: 0 0 1.75rem; }
.fieldset legend {
  padding: 0; margin-bottom: .75rem; font-size: .8rem;
  text-transform: uppercase; letter-spacing: .1em; color: var(--brand-muted);
}

.field { display: grid; gap: .3rem; margin-bottom: 1rem; }
.field__label { font-size: .85rem; }
.field__hint { color: var(--brand-muted); font-size: .8rem; }
.field__error { color: #a33a2c; font-size: .82rem; }
.field input, .field select, .field textarea {
  width: 100%; padding: .65rem .8rem; font: inherit; font-size: .95rem;
  border: 1px solid var(--brand-border); border-radius: var(--radius);
  background: var(--brand-bg); color: inherit;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.field--narrow { max-width: 140px; }

.checkout__legal { font-size: .82rem; margin-top: 1rem; }

.checkout__summary {
  position: sticky; top: 96px;
  padding: 1.5rem; background: var(--brand-surface); border-radius: var(--radius);
}
.checkout__summary h2 { font-size: 1.1rem; }

.summary-lines { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .6rem; font-size: .9rem; }
.summary-lines li { display: grid; grid-template-columns: auto 1fr auto; gap: .5rem; }
.summary-lines__qty { color: var(--brand-muted); }
.summary-lines__price { white-space: nowrap; }

/* ── Simulierte Bezahlseite ───────────────────────────────────── */

.paybox {
  padding: 2rem; background: var(--brand-surface); border-radius: var(--radius);
  border: 1px solid var(--brand-border);
}
.paybox__badge {
  display: inline-block; padding: .25rem .7rem; margin: 0 0 1rem;
  font-size: .72rem; letter-spacing: .08em; text-transform: uppercase;
  background: var(--brand-accent); color: #fff; border-radius: var(--radius);
}
.paybox__data { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1.25rem; margin: 1.5rem 0; font-size: .93rem; }
.paybox__data dt { color: var(--brand-muted); margin: 0; }
.paybox__data dd { margin: 0; }
.paybox__actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.paybox__hint { font-size: .84rem; margin: 0; }

/* ── Bestätigung ──────────────────────────────────────────────── */

.lead { font-size: 1.05rem; margin-bottom: 2rem; }
.order-summary h2 { font-size: 1.1rem; margin-top: 2rem; }
.order-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.order-table td { padding: .5rem 0; border-bottom: 1px solid var(--brand-border); }
.order-table .num { text-align: right; white-space: nowrap; }
.order-table tfoot td { border-bottom: 0; padding-top: .6rem; }

@media (max-width: 900px) {
  .checkout { grid-template-columns: 1fr; }
  .checkout__summary { position: static; order: -1; }
}
