/* ==========================================================================
   Post SV Nürnberg Basketball – Shop
   Mobile first. Farben: dunkles Vereinsblau / Weiß, Akzent Orange (Logo).
   ========================================================================== */

:root {
    --blau-dunkel: #0b2a4a;
    --blau: #12477d;
    --blau-hell: #e8f0f9;
    --orange: #f39200;
    --orange-dunkel: #d97f00;
    --weiss: #ffffff;
    --hintergrund: #f2f5f9;
    --text: #1a2330;
    --text-leise: #5b6676;
    --rand: #cfd8e3;
    --fehler: #c0262d;
    --fehler-hell: #fdecec;
    --erfolg: #1d7a46;
    --erfolg-hell: #e7f5ec;
    --radius: 12px;
    --schatten: 0 1px 3px rgba(11, 42, 74, .08), 0 4px 14px rgba(11, 42, 74, .06);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 12px; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
    background: var(--hintergrund);
}
body.mit-korbleiste { padding-bottom: 84px; }
a { color: var(--blau); }
[hidden] { display: none !important; }
img { max-width: 100%; }

/* ---------- Kopf ---------- */
.kopf { background: var(--blau-dunkel); color: var(--weiss); padding: 18px 16px 20px; border-bottom: 4px solid var(--orange); }
.kopf__innen { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: 14px; }
.kopf__logo { flex: none; width: 68px; height: 68px; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .35)); }
.kopf__text { min-width: 0; }
.kopf__verein { margin: 0 0 2px; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.kopf__titel { margin: 0; font-size: 1.55rem; line-height: 1.15; }
.kopf__untertitel { margin: 6px 0 0; opacity: .9; font-size: .95rem; }

/* ---------- Inhalt ---------- */
.inhalt { max-width: 1100px; margin: 0 auto; padding: 16px 12px 32px; }
.intro { margin: 0 4px 18px; }
.einleitung { margin: 0 0 6px; }
.frist { margin: 0; color: var(--text-leise); font-size: .93rem; }
.abschnitt { font-size: 1.3rem; color: var(--blau-dunkel); margin: 0 4px 10px; }

.karte { background: var(--weiss); border-radius: var(--radius); box-shadow: var(--schatten); padding: 18px 16px; margin-bottom: 16px; }
.karte h2 { margin: 0 0 14px; font-size: 1.2rem; color: var(--blau-dunkel); }
.karte--hinweis { border-left: 5px solid var(--blau); }
.karte--fehler { border-left: 5px solid var(--fehler); background: var(--fehler-hell); }
.karte--erfolg { border-top: 5px solid var(--erfolg); text-align: center; }
.leer { color: var(--text-leise); margin: 0; }

.hinweis-kasten {
    background: var(--blau-hell); border-left: 4px solid var(--blau); border-radius: 8px;
    padding: 10px 12px; font-size: .92rem; margin: 0 0 16px;
}

/* ---------- Filter ---------- */
.filter {
    display: flex; gap: 8px; overflow-x: auto; padding: 2px 4px 12px; margin: 0 -12px 4px; padding-left: 16px;
    scrollbar-width: none;
}
.filter::-webkit-scrollbar { display: none; }
.filter__knopf {
    flex: none; font: inherit; font-size: .92rem; font-weight: 600; cursor: pointer;
    padding: 8px 16px; border-radius: 99px; border: 1.5px solid var(--rand);
    background: var(--weiss); color: var(--blau-dunkel); white-space: nowrap;
}
.filter__knopf[aria-selected="true"] { background: var(--blau-dunkel); border-color: var(--blau-dunkel); color: var(--weiss); }

/* ---------- Produktkacheln ---------- */
.produkte { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.produkt {
    display: flex; flex-direction: column; text-align: left; font: inherit; color: inherit; cursor: pointer;
    background: var(--weiss); border: 0; border-radius: var(--radius); padding: 0; overflow: hidden;
    box-shadow: var(--schatten); transition: transform .15s ease, box-shadow .15s ease;
}
.produkt:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(11, 42, 74, .14); }
.produkt:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.produkt__bild { position: relative; aspect-ratio: 1; background: #eef2f7; }
.produkt__bild img { width: 100%; height: 100%; object-fit: cover; display: block; }
.produkt__bild--leer img { object-fit: contain; padding: 22%; opacity: .25; filter: grayscale(1); }
.produkt__anzahl {
    position: absolute; right: 8px; bottom: 8px; font-size: .72rem; font-weight: 700;
    background: rgba(11, 42, 74, .8); color: var(--weiss); padding: 2px 8px; border-radius: 99px;
}
.produkt__text { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.produkt__name { font-weight: 700; line-height: 1.25; }
.produkt__preis { color: var(--blau); font-weight: 700; }
.produkt__info { font-size: .8rem; color: var(--text-leise); }

/* ---------- Detailansicht (Dialog) ---------- */
.detail {
    border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 100%; max-height: 92vh;
    border-radius: 18px 18px 0 0; background: var(--weiss); color: var(--text);
    display: none; flex-direction: column; overflow: hidden;
}
.detail[open] { display: flex; animation: hoch .25s ease-out; }
.detail::backdrop { background: rgba(6, 22, 40, .6); }
@keyframes hoch { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.detail__zu-form { position: absolute; top: 10px; right: 10px; z-index: 2; margin: 0; }
.detail__zu {
    width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer; font-size: 1.1rem;
    background: rgba(255, 255, 255, .92); color: var(--blau-dunkel); box-shadow: 0 1px 6px rgba(0, 0, 0, .2);
}
.detail__galerie { position: relative; flex: none; background: #eef2f7; }
/* Feste Bildfläche: jedes Bild (hoch, quer, quadratisch) wird vollständig
   hineingepasst – kein Beschnitt, kein Scrollen im Bild. Mehrere Bilder: seitlich wischen. */
.galerie {
    display: flex; height: min(85vw, 46vh);
    overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scrollbar-width: none;
}
.galerie::-webkit-scrollbar { display: none; }
.galerie__bild { position: relative; flex: 0 0 100%; height: 100%; margin: 0; scroll-snap-align: center; overflow: hidden; }
.galerie__bild img {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: contain; padding: 8px 8px 22px;
}
.galerie__bild--leer img { padding: 25%; opacity: .25; filter: grayscale(1); }
.galerie__punkte { position: absolute; left: 0; right: 0; bottom: 8px; display: flex; justify-content: center; gap: 6px; }
.galerie__punkt { width: 9px; height: 9px; padding: 0; border-radius: 50%; border: 0; background: rgba(11, 42, 74, .3); cursor: pointer; }
.galerie__punkt.aktiv { background: var(--blau-dunkel); width: 22px; border-radius: 99px; }

.detail__inhalt { padding: 16px 16px 8px; overflow-y: auto; flex: 1; }
.detail__name { margin: 0 0 4px; font-size: 1.35rem; color: var(--blau-dunkel); line-height: 1.2; }
.detail__beschreibung { margin: 0 0 6px; color: var(--text-leise); font-size: .93rem; white-space: pre-line; }
.detail__preis { margin: 0 0 14px; font-size: 1.2rem; font-weight: 800; color: var(--blau); }
.detail__fuss { flex: none; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid #e6ebf1; background: var(--weiss); }
.detail__fuss .knopf { margin: 0; }

.wahl { margin-bottom: 14px; }
.wahl__titel { display: block; margin: 0 0 6px; font-weight: 700; font-size: .92rem; }
.pillen { display: flex; flex-wrap: wrap; gap: 8px; }
.pillen--groessen .pille { min-width: 54px; justify-content: center; }
.pille {
    display: inline-flex; flex-direction: column; align-items: flex-start; gap: 0;
    font: inherit; cursor: pointer; text-align: left;
    padding: 8px 14px; min-height: 44px; border-radius: 10px;
    border: 1.5px solid var(--rand); background: var(--weiss); color: var(--text);
}
.pille[aria-checked="true"] { border-color: var(--blau-dunkel); background: var(--blau-dunkel); color: var(--weiss); }
.pille:focus-visible { outline: 3px solid var(--orange); outline-offset: 1px; }
.pille__text { font-weight: 600; line-height: 1.2; }
.pille__zusatz { font-size: .82rem; opacity: .8; }

/* ---------- Felder ---------- */
.feld { margin-bottom: 14px; }
.feld label { display: block; font-weight: 600; margin-bottom: 4px; font-size: .95rem; }
.pflicht { color: var(--fehler); }
.optional { font-weight: 400; color: var(--text-leise); font-size: .85rem; }

input[type="text"], input[type="email"], input[type="tel"], input[type="number"],
input[type="password"], select, textarea {
    width: 100%; font: inherit; font-size: 16px; color: var(--text); background: var(--weiss);
    border: 1.5px solid var(--rand); border-radius: 8px; padding: 10px 12px; min-height: 46px;
    appearance: none; -webkit-appearance: none;
}
select {
    background-image: linear-gradient(45deg, transparent 50%, var(--blau) 50%), linear-gradient(135deg, var(--blau) 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
    background-size: 6px 6px; background-repeat: no-repeat; padding-right: 34px;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blau); box-shadow: 0 0 0 3px rgba(18, 71, 125, .2); }

.feld__hilfe { margin: 4px 0 0; font-size: .85rem; color: var(--text-leise); }
.feld__fehler { margin: 4px 0 0; font-size: .88rem; color: var(--fehler); font-weight: 600; }
.feld__fehler:empty { display: none; }
.feld__fehler--block { margin-bottom: 12px; }
.feld.hat-fehler input, .feld.hat-fehler select, .feld.hat-fehler textarea { border-color: var(--fehler); background-color: var(--fehler-hell); }

.raster { display: grid; gap: 0 12px; grid-template-columns: 1fr; }

.checkbox { display: flex; gap: 10px; align-items: flex-start; font-weight: 400 !important; cursor: pointer; }
.checkbox input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--blau); }
.feld--checkbox.hat-fehler .checkbox { color: var(--fehler); }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Menge ---------- */
.menge { display: inline-flex; align-items: stretch; }
.menge input, .menge__wert {
    width: 64px; text-align: center; border-radius: 0; min-width: 0; -moz-appearance: textfield;
    border: 1.5px solid var(--rand); display: grid; place-items: center; font-weight: 700;
}
.menge input::-webkit-outer-spin-button, .menge input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.menge__knopf {
    flex: none; width: 46px; min-height: 46px; font-size: 1.3rem; line-height: 1; cursor: pointer;
    background: var(--blau-hell); color: var(--blau-dunkel); border: 1.5px solid var(--rand);
}
.menge__knopf:first-child { border-radius: 8px 0 0 8px; border-right: 0; }
.menge__knopf:last-child { border-radius: 0 8px 8px 0; border-left: 0; }
.menge--klein .menge__knopf { width: 36px; min-height: 36px; font-size: 1.1rem; }
.menge--klein .menge__wert { width: 40px; }

/* ---------- Warenkorb ---------- */
.korb { list-style: none; margin: 0; padding: 0; }
.korb__eintrag {
    display: grid; grid-template-columns: 64px 1fr; gap: 10px 12px;
    padding: 12px 0; border-bottom: 1px solid #e6ebf1;
}
.korb__eintrag.hat-fehler { background: var(--fehler-hell); margin: 0 -8px; padding: 12px 8px; border-radius: 8px; }
.korb__bild { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; background: #eef2f7; }
.korb__bild--leer { object-fit: contain; padding: 10px; opacity: .3; filter: grayscale(1); }
.korb__text { display: flex; flex-direction: column; min-width: 0; }
.korb__details { font-size: .88rem; color: var(--text-leise); }
.korb__druck { font-size: .88rem; color: var(--blau-dunkel); font-weight: 600; }
.korb__rechts { grid-column: 2; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.korb__preis { font-weight: 700; margin-left: auto; white-space: nowrap; }
.korb__entfernen { font: inherit; font-size: .85rem; color: var(--fehler); background: none; border: 0; padding: 4px 0; cursor: pointer; text-decoration: underline; }

.summe {
    display: flex; justify-content: space-between; align-items: baseline;
    border-top: 2px solid var(--blau-dunkel); margin-top: 12px; padding-top: 10px; font-size: 1.1rem;
}
.summe strong { font-size: 1.35rem; color: var(--blau-dunkel); }
.kasse-summe { display: flex; justify-content: space-between; align-items: baseline; margin: 6px 0 4px; font-size: 1.05rem; }
.kasse-summe strong { font-size: 1.3rem; color: var(--blau-dunkel); }

/* ---------- Leiste unten ---------- */
.korbleiste {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    background: var(--blau-dunkel); color: var(--weiss); box-shadow: 0 -4px 16px rgba(0, 0, 0, .2);
}
.korbleiste__info { display: flex; align-items: center; gap: 10px; color: var(--weiss); text-decoration: none; flex: 1; min-width: 0; }
.korbleiste__info strong { display: block; line-height: 1.1; }
.korbleiste__info span span, #korbleiste-summe { display: block; font-size: .9rem; opacity: .85; }
.korbleiste__symbol { font-size: 1.5rem; }

.toast {
    position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 30;
    background: var(--erfolg); color: var(--weiss); font-weight: 600; padding: 10px 18px; border-radius: 99px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .25); transition: opacity .3s; max-width: calc(100% - 32px); text-align: center;
}
.toast.weg { opacity: 0; }

/* ---------- Knöpfe ---------- */
.knopf {
    display: inline-flex; align-items: center; justify-content: center; font: inherit; font-weight: 700;
    text-align: center; text-decoration: none; border-radius: 10px; padding: 12px 18px; min-height: 48px;
    cursor: pointer; border: 2px solid var(--blau);
}
.knopf--haupt { width: 100%; background: var(--blau-dunkel); border-color: var(--blau-dunkel); color: var(--weiss); font-size: 1.08rem; margin-top: 8px; }
.knopf--haupt:hover { background: var(--blau); }
.knopf--haupt[disabled] { opacity: .65; cursor: wait; }
.knopf--zweit { background: var(--weiss); color: var(--blau); }
.knopf--zweit:hover { background: var(--blau-hell); }
.knopf--orange { background: var(--orange); border-color: var(--orange); color: var(--weiss); padding: 10px 18px; min-height: 46px; flex: none; }
.knopf--orange:hover { background: var(--orange-dunkel); }
.knopf:focus-visible, .menge__knopf:focus-visible, summary:focus-visible, .filter__knopf:focus-visible {
    outline: 3px solid rgba(243, 146, 0, .7); outline-offset: 2px;
}

/* ---------- Datenschutz ---------- */
.datenschutz { border: 1.5px solid var(--rand); border-radius: 8px; margin-bottom: 14px; background: #fafbfd; }
.datenschutz summary { cursor: pointer; padding: 12px; font-weight: 600; color: var(--blau); }
.datenschutz__text { padding: 0 14px 10px; font-size: .9rem; }
.datenschutz__text h3 { font-size: 1rem; margin: 14px 0 4px; color: var(--blau-dunkel); }
.datenschutz__text p, .datenschutz__text ul { margin: 0 0 8px; }

.fehler-box {
    background: var(--fehler-hell); border-left: 5px solid var(--fehler); color: var(--fehler);
    font-weight: 600; border-radius: 8px; padding: 12px 14px; margin-bottom: 16px;
}

/* ---------- Danke-Seite ---------- */
.haken {
    width: 64px; height: 64px; line-height: 64px; margin: 0 auto 8px; border-radius: 50%;
    background: var(--erfolg-hell); color: var(--erfolg); font-size: 2rem; font-weight: 700;
}
.uebersicht { list-style: none; margin: 0; padding: 0; }
.uebersicht li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #e6ebf1; }
.uebersicht .preis { white-space: nowrap; font-weight: 600; }
.klein { font-size: .88rem; color: var(--text-leise); }
.bank { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0 0 10px; }
.bank dt { color: var(--text-leise); }
.bank dd { margin: 0; word-break: break-word; }
.mono { font-family: ui-monospace, Consolas, monospace; }
.zentriert { text-align: center; }
.danke-schmal { max-width: 720px; margin: 0 auto; }

.testliste { list-style: none; padding: 0; }
.testliste li { padding: 8px 10px; border-radius: 6px; margin-bottom: 6px; }
.testliste .ok { background: var(--erfolg-hell); }
.testliste .nok { background: var(--fehler-hell); }

/* ---------- Fuß ---------- */
.fuss { text-align: center; color: var(--text-leise); font-size: .85rem; padding: 0 16px 32px; }
.fuss p { margin: 2px 0; }

/* ---------- Größere Bildschirme ---------- */
@media (min-width: 600px) {
    .inhalt { padding: 24px 16px 40px; }
    .karte { padding: 24px; }
    .kopf { padding: 26px 16px 28px; }
    .kopf__titel { font-size: 2rem; }
    .kopf__logo { width: 96px; height: 96px; }
    .kopf__innen { gap: 20px; }
    .raster--2 { grid-template-columns: 1fr 1fr; }
    .produkte { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
    .knopf--zweit { width: auto; }
    .filter { margin: 0 0 4px; padding-left: 4px; }
    .korb__eintrag { grid-template-columns: 72px 1fr auto; align-items: center; }
    .korb__bild { width: 72px; height: 72px; }
    .korb__rechts { grid-column: auto; }
}

@media (min-width: 900px) {
    .produkte { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .shop .inhalt { display: grid; grid-template-columns: 1fr 380px; gap: 0 24px; align-items: start; }
    .shop .intro, .shop .inhalt > section:first-of-type, .shop noscript { grid-column: 1; }
    .shop #warenkorb { grid-column: 2; grid-row: 1 / span 3; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
    .shop .inhalt > section:first-of-type { grid-row: 2; }
    .shop #bestellformular { grid-column: 1; grid-row: 3; }
    .shop .produkte { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .shop .korbleiste { display: none !important; }
    body.shop.mit-korbleiste { padding-bottom: 0; }
    .korb__eintrag { grid-template-columns: 56px 1fr; }
    .korb__bild { width: 56px; height: 56px; }
    .korb__rechts { grid-column: 2; }

    .detail {
        margin: auto; width: min(960px, calc(100% - 48px)); height: min(88vh, 680px); max-height: 88vh; border-radius: 18px;
        display: none;
    }
    .detail[open] { display: grid; grid-template-columns: 1.1fr 1fr; grid-template-rows: minmax(0, 1fr) auto; animation: auf .2s ease-out; }
    @keyframes auf { from { transform: scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
    .detail__galerie { grid-row: 1 / span 2; min-height: 0; height: 100%; }
    .galerie { height: 100%; }
    .galerie__bild img { padding: 24px 24px 36px; }
    .detail__inhalt { padding: 24px 24px 8px; }
    .detail__fuss { padding: 12px 24px 20px; border-top: 0; }
}
@media (min-width: 1200px) {
    .shop .produkte { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
