/* Das Weinkontor – Stylesheet (lädt keinerlei externe Ressourcen)
   Farben & Schriften zentral als Variablen: hier anpassen = überall angepasst. */
:root {
  --bg: #f0ece2;
  --paper: #fbf9f4;
  --ink: #180600;
  --muted: #6b5d55;
  --wine: #7b1e2b;
  --wine-dark: #5a1520;
  --gold: #b08a3e;
  --line: #ddd3c2;
  --ok: #2f6b3a;
  --err: #a12a2a;
  --radius: 10px;
  --serif: Georgia, "Times New Roman", Times, serif;
  --sans: system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;  /* nur Systemschriften – keine Webfonts */
  --max: 1140px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.65 var(--sans); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--wine); text-underline-offset: 3px; }
a:hover { color: var(--wine-dark); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.3; font-weight: 700; margin: 0 0 .6em; }
h1 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
h2 { font-size: clamp(1.35rem, 2.4vw, 1.75rem); }
h3 { font-size: 1.15rem; }
code { background: #ece4d5; padding: 1px 5px; border-radius: 4px; font-size: .9em; }
.skip { position: absolute; left: -999px; top: 0; background: var(--wine); color: #fff; padding: 8px 14px; z-index: 10; }
.skip:focus { left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- Header ---------- */
/* Kopfbild: WebP mit JPEG-Fallback, kleine Variante für Smartphones.
   Bild austauschen: Dateien in assets/img ersetzen und ?v=… hochzählen (Browser-Cache). */
.site-header {
  position: relative; padding: 24px 16px 0; text-align: center;
  background: #6b5a3a url("../img/hero-1536.jpg?v=1") center 62%/cover no-repeat;
  background-image: image-set(url("../img/hero-1536.webp?v=1") type("image/webp"), url("../img/hero-1536.jpg?v=1") type("image/jpeg"));
}
@media (max-width: 800px) {
  .site-header {
    background-image: url("../img/hero-800.jpg?v=1");
    background-image: image-set(url("../img/hero-800.webp?v=1") type("image/webp"), url("../img/hero-800.jpg?v=1") type("image/jpeg"));
  }
}
.site-header::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(24,6,0,.10), rgba(24,6,0,.25) 45%, rgba(24,6,0,.55)); pointer-events: none; }
.site-header > * { position: relative; z-index: 1; }
.site-header--hero { min-height: 540px; display: flex; flex-direction: column; align-items: center; }
.brand__link { display: inline-block; text-decoration: none; }
.brand__logo { width: min(340px, 78vw); border-radius: 46% / 50%; box-shadow: 0 8px 30px rgba(0,0,0,.18); }
.brand__text { display: inline-block; background: #fff; color: var(--wine); padding: 18px 40px; border-radius: 60px; font: 700 2rem var(--serif); }
.brand__text small { display: block; font-size: .95rem; color: var(--ink); font-weight: 400; }
.nav { margin: 18px auto 0; }
.nav__toggle { display: none; }
.nav__list { list-style: none; display: flex; justify-content: center; gap: 6px 26px; flex-wrap: wrap; margin: 0; padding: 10px 0 16px; }
.nav__list a { color: #fff; font-weight: 700; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; text-decoration: none; text-shadow: 0 1px 4px rgba(0,0,0,.85); padding: 6px 2px; border-bottom: 2px solid transparent; }
.nav__list a:hover, .nav__list a[aria-current] { border-bottom-color: #fff; color: #fff; }
.nav__has-sub { position: relative; }
.nav__sub { display: none; position: absolute; left: 50%; transform: translateX(-50%); top: 100%; background: var(--paper); list-style: none; padding: 8px 0; margin: 0; min-width: 230px; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.18); text-align: left; z-index: 5; }
.nav__sub a { display: block; color: var(--ink); text-shadow: none; text-transform: none; letter-spacing: 0; font-weight: 400; font-size: .95rem; padding: 8px 18px; border: 0; }
.nav__sub a:hover { background: var(--bg); color: var(--wine); }
.nav__has-sub:hover .nav__sub, .nav__has-sub:focus-within .nav__sub { display: block; }
.badge { display: inline-block; background: var(--wine); color: #fff; border-radius: 99px; padding: 0 7px; font-size: .75rem; text-shadow: none; }
.hero { margin: auto 0 60px; max-width: 900px; }
.hero__title { font: 700 clamp(1.6rem, 3.5vw, 2.6rem) var(--serif); color: #fff; text-shadow: 0 2px 14px rgba(0,0,0,.7); margin: 0; }

/* ---------- Inhalt ---------- */
.main { max-width: var(--max); margin: 0 auto; padding: 0 16px 40px; }
.section { padding: 48px 0; }
.section--light { background: var(--paper); margin: 0 -16px; padding: 56px 16px; }
.prose { max-width: 760px; }
.prose--center { margin: 0 auto; text-align: center; }
.prose ul { text-align: left; display: inline-block; }
.center { text-align: center; }
.r { text-align: right; }
.motto { text-align: center; font: italic 1.2rem var(--serif); color: var(--wine); padding: 28px 0 8px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.split__art { display: block; aspect-ratio: 4/3; border-radius: var(--radius); overflow: hidden; background: #3b3a26; box-shadow: 0 12px 30px rgba(24,6,0,.15); }
.split__art img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; }
.crumbs { color: var(--muted); font-size: .9rem; }

/* ---------- Inhaltsseiten (Über uns, Impressum, AGB …): volle Inhaltsbreite ---------- */
.section--page { padding: 56px clamp(16px, 4vw, 56px); }
.prose--full { max-width: none; }

/* ---------- Rich-Text (HTML aus dem WYSIWYG-Editor) – Website und Editor-Vorschau ---------- */
.rich::after, .rich-editor .ql-editor::after { content: ""; display: table; clear: both; }
.rich h2 { margin-top: 1.4em; }
.rich h2:first-child, .rich h3:first-child { margin-top: 0; }
.rich blockquote { margin: 1.2em 0; padding: 6px 0 6px 20px; border-left: 4px solid var(--gold); font-style: italic; color: var(--muted); }
.rich ul, .rich ol { padding-left: 1.4em; }
.rich ol > li[data-list="bullet"] { list-style-type: disc; }
.rich ol > li[data-list="ordered"] { list-style-type: decimal; }
.rich img, .rich-editor .ql-editor img { max-width: 100%; height: auto; border-radius: 8px; margin: 0 0 14px; }
.rich img.ql-img-size-small,  .rich-editor .ql-editor img.ql-img-size-small  { width: auto; max-width: 25%; }
.rich img.ql-img-size-medium, .rich-editor .ql-editor img.ql-img-size-medium { width: auto; max-width: 45%; }
.rich img.ql-img-size-large,  .rich-editor .ql-editor img.ql-img-size-large  { width: auto; max-width: 70%; }
.rich img.ql-img-size-full,   .rich-editor .ql-editor img.ql-img-size-full   { width: 100%; }
.rich img.ql-img-align-left,  .rich-editor .ql-editor img.ql-img-align-left  { float: left; margin: 4px 24px 14px 0; }
.rich img.ql-img-align-right, .rich-editor .ql-editor img.ql-img-align-right { float: right; margin: 4px 0 14px 24px; }
.rich img.ql-img-align-center, .rich-editor .ql-editor img.ql-img-align-center { float: none; display: block; margin-left: auto; margin-right: auto; }
.rich img.ql-img-align-left.ql-img-wrap-off,  .rich-editor .ql-editor img.ql-img-align-left.ql-img-wrap-off  { float: none; display: block; margin: 0 0 14px; }
.rich img.ql-img-align-right.ql-img-wrap-off, .rich-editor .ql-editor img.ql-img-align-right.ql-img-wrap-off { float: none; display: block; margin: 0 0 14px auto; }
@media (max-width: 640px) {
  .rich img.ql-img-align-left, .rich img.ql-img-align-right { float: none; display: block; margin: 0 auto 14px; max-width: 100%; }
}

/* Buttons */
.btn { display: inline-block; background: var(--wine); color: #fff; border: 2px solid var(--wine); border-radius: 99px; padding: 10px 24px; font: 700 .9rem var(--sans); letter-spacing: .03em; text-decoration: none; cursor: pointer; transition: background .15s; }
.btn:hover { background: var(--wine-dark); border-color: var(--wine-dark); color: #fff; }
.btn:disabled { background: #a99; border-color: #a99; cursor: not-allowed; }
.btn--ghost { background: transparent; color: var(--wine); }
.btn--ghost:hover { color: #fff; }
.btn--big { padding: 13px 32px; font-size: 1rem; }
.link { background: none; border: 0; color: var(--wine); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }
.link--danger { color: var(--err); }

/* Filter */
.filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 28px; }
.filter a { padding: 6px 16px; border: 1px solid var(--line); border-radius: 99px; text-decoration: none; color: var(--ink); background: var(--paper); font-size: .92rem; }
.filter a[aria-current] { background: var(--wine); border-color: var(--wine); color: #fff; }

/* Produktkarten */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 26px; margin: 32px 0; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s; }
.card:hover { box-shadow: 0 12px 28px rgba(24,6,0,.1); transform: translateY(-2px); }
.card__img { background: #f6f2ea; height: 260px; padding: 16px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.card__img img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.card__body { padding: 16px 18px 20px; display: flex; flex-direction: column; flex: 1; }
.card__meta { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; margin: 0 0 4px; }
.card__title { margin: 0 0 6px; }
.card__title a { color: var(--ink); text-decoration: none; }
.card__text { font-size: .93rem; color: var(--muted); flex: 1; }
.card__buy { margin-top: 12px; }
.card__buy .btn { width: 100%; }

.price { margin: 10px 0; }
.price__amount { display: block; font: 700 1.45rem var(--serif); color: var(--wine); }
.price__info { display: block; font-size: .8rem; color: var(--muted); line-height: 1.5; }

/* Detail */
.detail { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 44px; }
.detail__img { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; align-self: start; }
.detail__img img { margin: 0 auto; max-height: 560px; object-fit: contain; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; margin: 0 0 12px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.buy { display: flex; gap: 14px; align-items: end; flex-wrap: wrap; margin: 18px 0 28px; }
.buy input { width: 80px; }

/* Formulare */
.form label { display: block; margin: 0 0 14px; font-weight: 500; font-size: .93rem; }
.form input:not([type=checkbox]):not([type=file]), .form select, .form textarea, .buy input, .cart input, .inline-form select {
  display: block; width: 100%; margin-top: 4px; padding: 10px 12px; font: inherit; color: var(--ink);
  background: #fff; border: 1px solid #cbbfab; border-radius: 8px; }
.form textarea { resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--wine); outline: 2px solid rgba(123,30,43,.2); }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.form .check input { margin-top: 5px; }
.form fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin: 0 0 18px; background: #fff; }
.form legend { font-weight: 700; padding: 0 6px; }
.hint { color: var(--muted); font-size: .85rem; }
.hp { position: absolute; left: -9999px; }

/* Warenkorb & Kasse */
.table-wrap { overflow-x: auto; }
.cart, .admin-table, .totals { width: 100%; border-collapse: collapse; }
.cart th, .cart td, .admin-table th, .admin-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.cart th.r, .cart td.r, .admin-table .r { text-align: right; }
.cart input { width: 76px; margin: 0; }
.cart__wine { display: flex; align-items: center; gap: 12px; }
.cart__wine img { width: 48px; height: 64px; object-fit: contain; background: #fff; border-radius: 4px; }
.totals { max-width: 420px; margin: 20px 0 10px auto; }
.totals th { text-align: left; font-weight: 400; padding: 5px 0; }
.totals td { text-align: right; padding: 5px 0; }
.totals__sum th, .totals__sum td { font-weight: 700; font-size: 1.15rem; border-top: 2px solid var(--ink); padding-top: 10px; }
.totals__vat th, .totals__vat td { color: var(--muted); font-size: .85rem; }
.checkout { display: grid; grid-template-columns: 3fr 2fr; gap: 40px; align-items: start; }
.summary { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; position: sticky; top: 16px; }
.summary__list { list-style: none; padding: 0; margin: 0; }
.summary__list li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.summary .totals { margin-left: 0; max-width: none; }

/* Meldungen */
.flash { padding: 12px 16px; border-radius: 8px; margin: 18px 0; border-left: 5px solid; background: #fff; }
.flash ul { margin: 0; padding-left: 18px; }
.flash--ok { border-color: var(--ok); color: var(--ok); }
.flash--error { border-color: var(--err); color: var(--err); }

/* Footer */
.site-footer { background: #2b1a14; color: #e9dfd2; padding: 44px 16px 24px; }
.site-footer a { color: #f2c9a0; }
.site-footer h2 { font-size: 1.05rem; color: #fff; }
.footer__grid { max-width: var(--max); margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.footer__legal { max-width: var(--max); margin: 28px auto 0; padding-top: 18px; border-top: 1px solid #4a372e; font-size: .82rem; color: #bfae9c; text-align: center; }

/* ---------- Admin ---------- */
.admin-body { background: #f4f1ea; }
.admin-bar { background: var(--wine-dark); color: #fff; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 26px; padding: 10px 20px; }
.admin-bar a, .admin-bar .link { color: #fff; text-decoration: none; }
.admin-bar__brand { font: 700 1.05rem var(--serif); }
.admin-bar ul { display: flex; flex-wrap: wrap; gap: 4px 18px; list-style: none; margin: 0; padding: 0; }
.admin-bar ul a { padding: 4px 0; border-bottom: 2px solid transparent; font-size: .95rem; }
.admin-bar ul a[aria-current] { border-bottom-color: #fff; }
.admin-bar__user { margin-left: auto; display: flex; gap: 16px; align-items: center; font-size: .9rem; }
.admin-bar__user form { margin: 0; }
.admin-main { max-width: 1200px; margin: 0 auto; padding: 24px 20px 60px; }
.admin-table { background: #fff; border-radius: var(--radius); }
.admin-table th { background: #efe8da; font-size: .85rem; }
.admin-table .muted td { opacity: .55; }
.admin-table .actions { white-space: nowrap; }
.admin-table .actions form { display: inline; margin-left: 12px; }
.thumb { width: 40px; height: 54px; object-fit: contain; background: #f6f2ea; border-radius: 4px; }
.tag { display: inline-block; font-size: .75rem; padding: 1px 8px; border-radius: 99px; background: #efe8da; }
.tag--neu { background: #fde7c4; } .tag--bezahlt { background: #d9ecd9; } .tag--versendet { background: #d8e6f3; } .tag--storniert { background: #f3d6d6; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin: 0 0 24px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; text-decoration: none; color: var(--ink); }
.stat strong { display: block; font: 700 2rem var(--serif); color: var(--wine); }
.cols { display: grid; grid-template-columns: 3fr 2fr; gap: 28px; }
.box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 20px; }
.form--wide { max-width: none; }
.preview { max-height: 220px; width: auto; margin: 0 0 12px; background: #f6f2ea; border-radius: 6px; }
.inline-form { display: flex; gap: 10px; align-items: center; }
.inline-form select { width: auto; margin: 0; }
.login { max-width: 460px; margin: 6vh auto; background: #fff; padding: 32px 34px; border-radius: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.08); }
.login__logo { width: 220px; margin: 0 auto 10px; }
.login .form__row { grid-template-columns: 1fr; }
.captcha { background: #faf7f1; border: 1px dashed #cbbfab; border-radius: 8px; padding: 10px 12px; }
.captcha__task { font: 700 1.1rem var(--serif); color: var(--wine); white-space: nowrap; }

/* Admin: WYSIWYG-Editor (Quill) */
.form__label { display: block; font-weight: 500; font-size: .93rem; margin: 0 0 4px; }
.rich-editor { background: #fff; border-radius: 8px; margin-bottom: 8px; }
.rich-editor .ql-toolbar.ql-snow { border-color: #cbbfab; border-radius: 8px 8px 0 0; font-family: var(--sans); background: #faf7f1; position: sticky; top: 0; z-index: 2; }
.rich-editor .ql-container.ql-snow { border-color: #cbbfab; border-radius: 0 0 8px 8px; font: 16px/1.65 var(--sans); }
.rich-editor .ql-editor { min-height: 360px; }
.rich-editor .ql-editor p, .rich-editor .ql-editor ul, .rich-editor .ql-editor ol { margin: 0 0 .9em; }
.rich-editor .ql-editor h2, .rich-editor .ql-editor h3 { margin: .8em 0 .5em; }
.form [hidden] { display: none !important; }
/* Quill-Oberfläche auf Deutsch */
.ql-snow .ql-picker.ql-header { width: 140px; }
.ql-snow .ql-picker.ql-header .ql-picker-label::before, .ql-snow .ql-picker.ql-header .ql-picker-item::before { content: "Text"; }
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="2"]::before, .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before { content: "Überschrift"; }
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before, .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before { content: "Zwischentitel"; }
.ql-snow .ql-tooltip::before { content: "Link:"; }
.ql-snow .ql-tooltip[data-mode="link"]::before { content: "Link-Adresse:"; }
.ql-snow .ql-tooltip a.ql-action::after { content: "Bearbeiten"; }
.ql-snow .ql-tooltip a.ql-remove::before { content: "Entfernen"; }
.ql-snow .ql-tooltip.ql-editing a.ql-action::after { content: "Speichern"; }
.rich-editor .ql-editor h2, .rich-editor .ql-editor h3 { font-family: var(--serif); }
.rich-editor .ql-editor blockquote { border-left: 4px solid var(--gold); color: var(--muted); font-style: italic; }
.ql-image-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 10px 14px; margin-bottom: 10px; background: #efe8da; border-radius: 8px; font-size: .85rem; }
.ql-image-tools[hidden] { display: none; }
.ql-image-tools__group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ql-image-tools__label { font-weight: 700; color: var(--muted); }
.ql-image-tools button { border: 1px solid #cbbfab; background: #fff; border-radius: 99px; padding: 4px 12px; font-size: .85rem; cursor: pointer; }
.ql-image-tools button:hover { border-color: var(--wine); }
.ql-image-tools button.is-active { background: var(--wine); border-color: var(--wine); color: #fff; font-weight: 700; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .split, .detail, .checkout, .cols { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; gap: 12px; }
  .summary { position: static; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .site-header--hero { min-height: 430px; }
  .nav__toggle { display: inline-block; background: rgba(255,255,255,.9); border: 0; border-radius: 99px; padding: 8px 20px; font: 700 .9rem var(--sans); color: var(--wine); cursor: pointer; }
  .nav__list { display: none; flex-direction: column; background: var(--paper); border-radius: 10px; margin: 10px 0; padding: 8px 0; }
  .nav__list.is-open { display: flex; }
  .nav__list a { color: var(--ink); text-shadow: none; display: block; padding: 8px 16px; }
  .nav__list a:hover, .nav__list a[aria-current] { color: var(--wine); border-color: transparent; }
  .nav__sub { display: block; position: static; transform: none; box-shadow: none; background: transparent; text-align: center; }
  .form__row { grid-template-columns: 1fr; }
  .card__img { height: 220px; }
  .admin-bar__user { margin-left: 0; }
}
