/* wirga.ch: handgemachte Unikate. Verspielt, aber ruhig: warmes Creme, Pflaume, Salbei, ein Hauch Gold. */
:root {
  --bg: #fbf7f0;
  --surface: #ffffff;
  --lilac: #efe6f5;
  --plum: #4b2e5e;
  --plum-2: #6b4a82;
  --sage: #7fa38a;
  --gold: #d9a441;
  --rose: #c75c7a;
  --text: #2b2233;
  --muted: #6f6577;
  --border: #e6dcee;
  --radius: 16px;
  --shadow: 0 6px 20px rgba(75, 46, 94, .10);
  --max: 1080px;
  --btn: #4b2e5e;
  --input-bg: #ffffff;
  --input-border: #cbbdd6;
  --warn-bg: #fbe7c4;
  --warn-text: #7a5410;
  --err: #b3261e;
  --err-bg: #fdecea;
  --footer-bg: #4b2e5e;
  --footer-text: #e9dff1;
  --serif: Georgia, "Palatino Linotype", "Book Antiqua", serif;
}
* { box-sizing: border-box; }
html { font-size: 112.5%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
}
img { max-width: 100%; height: auto; }
a { color: var(--plum-2); }
a:hover { color: var(--rose); }
h1, h2, h3 { font-family: var(--serif); color: var(--plum); line-height: 1.25; margin: 0 0 .6rem; font-weight: 700; }
h1 { font-size: clamp(1.8rem, 5vw, 2.7rem); }
h2 { font-size: clamp(1.35rem, 3.5vw, 1.8rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1rem; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Kopf */
.site-header { background: var(--surface); border-bottom: 3px solid var(--lilac); position: relative; }
.site-header::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px; background: linear-gradient(90deg, var(--gold), var(--lilac) 40%, var(--sage)); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem 1rem; padding: .7rem 0; }
.brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--plum); font-family: var(--serif); font-size: 1.55rem; font-weight: 700; }
.brand img { width: 38px; height: 38px; }
.brand span small { display: block; font-family: system-ui, sans-serif; font-size: .68rem; font-weight: 400; color: var(--muted); letter-spacing: .04em; margin-top: -.25rem; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .4rem; }
.main-nav a { display: inline-flex; align-items: center; min-height: 42px; padding: .35rem .8rem; border-radius: 999px; text-decoration: none; color: var(--plum); font-weight: 600; font-size: .95rem; }
.main-nav a:hover, .main-nav a[aria-current="page"] { background: var(--lilac); color: var(--plum); }
.main-nav .cart-link { background: var(--btn); color: #fff; }
.main-nav .cart-link:hover { background: var(--rose); color: #fff; }

/* Hero */
.hero { background: radial-gradient(circle at 85% 20%, var(--lilac), transparent 55%), var(--bg); padding: 1.8rem 0 1rem; }
.hero-inner { display: grid; gap: 1rem; align-items: center; }
.hero p.lead { font-size: 1.1rem; color: var(--text); max-width: 34rem; }
.hero img.hero-art { width: min(100%, 360px); justify-self: center; }
@media (min-width: 760px) { .hero-inner { grid-template-columns: 1.2fr 1fr; } .hero { padding: 2.6rem 0 1.5rem; } }
.trenner { display: block; margin: 1.2rem auto; width: 220px; }

/* Abschnitte */
.section { padding-top: 1.4rem; padding-bottom: 1.8rem; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.hint { color: var(--muted); font-size: .95rem; }

/* Buttons */
.btn, button.btn {
  display: inline-flex; align-items: center; gap: .4rem; justify-content: center;
  background: var(--btn); color: #fff; font: inherit; font-weight: 600; font-size: 1rem;
  padding: .65rem 1.3rem; border: 0; border-radius: 999px; text-decoration: none; cursor: pointer;
  transition: background .15s, transform .15s;
}
.btn:hover { background: var(--rose); color: #fff; transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--plum); border: 2px solid var(--plum); padding: .55rem 1.2rem; }
.btn-outline:hover { background: var(--rose); border-color: var(--rose); color: #fff; }
.btn-small { padding: .35rem .9rem; font-size: .9rem; }
.btn[disabled], .btn-disabled { background: #b8adc2; cursor: not-allowed; transform: none; }
.btn-disabled:hover { background: #b8adc2; transform: none; }

/* Karten und Raster */
.grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: var(--text); border: 1px solid var(--border); transition: transform .15s, box-shadow .15s; }
a.card:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(75, 46, 94, .16); color: var(--text); }
.card .thumb { aspect-ratio: 1 / 1; background: var(--lilac); display: block; width: 100%; object-fit: cover; }
.card .body { padding: .8rem 1rem 1rem; }
.card h3 { margin: 0 0 .2rem; font-size: 1.05rem; }
.price { font-weight: 700; color: var(--plum); font-variant-numeric: tabular-nums; }
.badge { display: inline-block; font-size: .8rem; padding: .1rem .6rem; border-radius: 999px; background: var(--lilac); color: var(--plum); font-weight: 600; }
.badge-res { background: var(--warn-bg); color: var(--warn-text); }
.kat-card { padding: 1.1rem 1rem; text-align: center; }
.kat-card h3 { margin: 0; }
.kat-card .hint { margin: .2rem 0 0; }

/* Zufallsartikel */
.feature { display: grid; gap: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow); padding: 1rem; align-items: center; }
.feature img { border-radius: 14px; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: var(--lilac); }
@media (min-width: 700px) { .feature { grid-template-columns: 1fr 1fr; padding: 1.3rem; gap: 1.6rem; } }
.feature .eyebrow { font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; color: var(--sage); font-weight: 700; margin-bottom: .3rem; }

/* Artikeldetail */
.detail { display: grid; gap: 1.4rem; }
@media (min-width: 760px) { .detail { grid-template-columns: 1.1fr 1fr; } }
.gallery .main-img { width: 100%; border-radius: var(--radius); background: var(--lilac); aspect-ratio: 1 / 1; object-fit: cover; box-shadow: var(--shadow); }
.gallery .thumbs { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.gallery .thumbs a { display: block; border-radius: 10px; overflow: hidden; border: 2px solid transparent; }
.gallery .thumbs a[aria-current="true"] { border-color: var(--gold); }
.gallery .thumbs img { width: 70px; height: 70px; object-fit: cover; display: block; }
.detail .price-big { font-size: 1.7rem; font-family: var(--serif); color: var(--plum); margin: .2rem 0 1rem; }
.detail .beschreibung { white-space: pre-line; margin-bottom: 1rem; }
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: .8rem; }

/* Warenkorb */
.cart-list { display: grid; gap: .8rem; margin-bottom: 1.2rem; }
.cart-item { display: grid; grid-template-columns: 76px 1fr auto; gap: .9rem; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .7rem; }
.cart-item img { width: 76px; height: 76px; object-fit: cover; border-radius: 10px; background: var(--lilac); }
.cart-item h3 { margin: 0; font-size: 1.02rem; }
.cart-item .restzeit { font-size: .85rem; color: var(--muted); }
.sum { max-width: 24rem; margin-left: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.2rem; }
.sum div { display: flex; justify-content: space-between; gap: 1rem; padding: .15rem 0; }
.sum .total { border-top: 2px solid var(--lilac); margin-top: .4rem; padding-top: .5rem; font-weight: 700; font-size: 1.1rem; color: var(--plum); }
.empty { text-align: center; padding: 2rem 1rem; }
.empty img { width: 150px; }

/* Formulare */
.form { display: grid; gap: 1rem; max-width: 620px; }
.form label { display: grid; gap: .3rem; font-weight: 600; }
.form input[type=text], .form input[type=email], .form textarea, .form select {
  font: inherit; font-weight: 400; padding: .6rem .8rem; border: 1px solid var(--input-border); border-radius: 10px; background: var(--input-bg); color: var(--text); width: 100%;
}
.form input:focus, .form textarea:focus, .form select:focus { outline: 3px solid var(--lilac); border-color: var(--plum-2); }
.form .row { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 560px) { .form .row.plz-ort { grid-template-columns: 140px 1fr; } }
.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400 !important; }
.check input { margin-top: .35rem; width: 1.1rem; height: 1.1rem; flex-shrink: 0; }
.field-error { color: var(--err); font-weight: 400; font-size: .9rem; }
.input-error { border-color: var(--err) !important; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.notice { background: var(--lilac); border-left: 5px solid var(--gold); border-radius: 10px; padding: .8rem 1rem; margin-bottom: 1.2rem; }
.error-box { background: var(--err-bg); border-left: 5px solid var(--err); border-radius: 10px; padding: .8rem 1rem; margin-bottom: 1.2rem; }
.zahlarten { border: 1px solid var(--border); border-radius: 12px; padding: .8rem 1rem; margin: 0; }
.zahlarten legend { font-weight: 600; padding: 0 .4rem; }

/* Fuss */
.site-footer { margin-top: 2rem; background: var(--footer-bg); color: var(--footer-text); padding: 1.4rem 0 1.2rem; font-size: .95rem; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--gold); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.4rem; }
.footer-left { display: flex; align-items: center; gap: .8rem; }
.footer-links { flex: 1; justify-content: flex-end; }
.footer-inner ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; }
@media (max-width: 640px) {
  .footer-left { order: 1; flex: 1; }
  .reload-btn { order: 2; }
  .footer-links { order: 3; flex-basis: 100%; justify-content: flex-start; }
}
.footer-note { opacity: .85; margin: .8rem 0 0; font-size: .85rem; }

/* Rechtstexte */
.legal h2 { margin-top: 1.6rem; }
.legal { max-width: 46rem; }
.draft { font-size: .85rem; color: var(--muted); border: 1px dashed var(--border); border-radius: 10px; padding: .5rem .8rem; }

/* Dunkles Farbschema: folgt der Einstellung des Geräts, ohne JavaScript. Mit JavaScript lässt es sich per Knopf umschalten. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16121b;
    --surface: #211a29;
    --lilac: #2e2239;
    --plum: #dcc6ee;
    --plum-2: #b99ad6;
    --sage: #92b89d;
    --rose: #e57c9b;
    --text: #ece6f2;
    --muted: #a79bb4;
    --border: #3b2f48;
    --shadow: 0 6px 20px rgba(0, 0, 0, .45);
    --btn: #7a52a0;
    --input-bg: #1b1522;
    --input-border: #4d3f5c;
    --warn-bg: #4a3a14;
    --warn-text: #f1d28a;
    --err: #ff8a80;
    --err-bg: #3d1f1d;
    --footer-bg: #231530;
    --footer-text: #cdbfdb;
  }
}
:root[data-theme="dark"] {
  --bg: #16121b;
  --surface: #211a29;
  --lilac: #2e2239;
  --plum: #dcc6ee;
  --plum-2: #b99ad6;
  --sage: #92b89d;
  --rose: #e57c9b;
  --text: #ece6f2;
  --muted: #a79bb4;
  --border: #3b2f48;
  --shadow: 0 6px 20px rgba(0, 0, 0, .45);
  --btn: #7a52a0;
  --input-bg: #1b1522;
  --input-border: #4d3f5c;
  --warn-bg: #4a3a14;
  --warn-text: #f1d28a;
  --err: #ff8a80;
  --err-bg: #3d1f1d;
  --footer-bg: #231530;
  --footer-text: #cdbfdb;
}
:root[data-theme="dark"] a.card:hover, :root:not([data-theme="light"]) a.card:hover { box-shadow: 0 10px 26px rgba(0, 0, 0, .55); }
.site-header { background: var(--surface); }
a.card:hover { color: var(--text); }

/* Runde Knöpfe in der Fusszeile: Farbschema (links, nur mit JavaScript) und Seite neu laden (rechts, normaler Link) */
.round-btn {
  width: 42px; height: 42px; border-radius: 50%; padding: 0; cursor: pointer; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none; font: inherit;
  background: transparent; border: 1px solid rgba(255, 255, 255, .45); color: #fff;
}
.round-btn:hover { color: var(--gold); border-color: var(--gold); }
.round-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }

/* Längere Texte im Blocksatz mit automatischer Silbentrennung (die Seite ist als de-CH ausgezeichnet) */
.legal p, .detail .beschreibung, .hero p.lead { text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
