/* ============================================================
   Shop-Grundgerüst (templates/base.html) - ersetzt im eigenständigen
   Shop die App-weite style.css der Athleten-App (Sidebar/Topbar entfallen).
   Enthält: Manrope-Schrift, Body-Basis, Flash-Meldungen (aus style.css
   übernommen), Kontomenü im Header, Auth-, Fehler- und Konto-Seiten.
   Die Storefront selbst bleibt in shop_storefront.css (.shop-*).
   ============================================================ */

@font-face {
    font-family: 'Manrope';
    src: url('../fonts/Manrope-variable.woff2') format('woff2');
    font-weight: 200 800;
    font-style: normal;
    font-display: swap;
}

html, body {
    font-family: 'Manrope', "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: #15191f;
    background: #ffffff;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    width: 100%;
    margin: 0;
}
.shop-app { min-height: 100vh; }

.shop-skiplink {
    position: absolute; left: -9999px; top: 0; z-index: 2000;
    background: #15191f; color: #fff; padding: .6rem 1rem; border-radius: 0 0 8px 0; text-decoration: none;
}
.shop-skiplink:focus { left: 0; color: #fff; }

/* ---------- Flash-Meldungen (aus style.css der App) ---------- */
.flash-messages-container {
    position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
    z-index: 1090; width: min(560px, calc(100% - 32px)); pointer-events: none;
}
.flash-message {
    margin-bottom: 12px; padding: 14px 56px 14px 18px; border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16); display: flex; align-items: center; gap: 12px;
    position: relative; animation: shopFlashIn .3s ease-out; border: none; font-size: .95rem;
    overflow-wrap: anywhere; pointer-events: auto; overflow: hidden;
}
.flash-message.hiding { animation: shopFlashOut .3s ease-out forwards; }
.flash-message::before { font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: 1.2rem; flex-shrink: 0; }
.flash-message.alert-success { background: #1e7a46; color: #fff; }
.flash-message.alert-success::before { content: '\f058'; }
.flash-message.alert-danger { background: #b3261e; color: #fff; }
.flash-message.alert-danger::before { content: '\f057'; }
.flash-message.alert-warning { background: #9a6a00; color: #fff; }
.flash-message.alert-warning::before { content: '\f071'; }
.flash-message.alert-info { background: #285180; color: #fff; }
.flash-message.alert-info::before { content: '\f05a'; }
.flash-message span { flex: 1; line-height: 1.4; }
.flash-close {
    position: absolute; top: 50%; right: 12px; transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2); border: none; color: #fff; width: 32px; height: 32px;
    border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.flash-close:hover { background: rgba(255, 255, 255, 0.32); }
.flash-progress {
    position: absolute; bottom: 0; left: 0; height: 3px; width: 100%;
    background: rgba(255, 255, 255, 0.45); transform-origin: left; animation: shopFlashProgress 6s linear forwards;
}
@keyframes shopFlashIn { from { transform: translateY(-12px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes shopFlashOut { to { transform: translateY(-12px); opacity: 0; } }
@keyframes shopFlashProgress { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ---------- Kontomenü im Header ---------- */
.shop-account { flex-shrink: 0; }
.shop-app .shop-account__toggle {
    display: inline-flex; align-items: center; gap: .5rem; min-height: 42px; padding: .35rem .8rem .35rem .4rem;
    border-radius: 999px; border: 1.5px solid var(--shop-line-strong); background: #fff; color: var(--shop-ink);
    font-weight: 700; font-size: .95rem; cursor: pointer; line-height: 1;
}
.shop-app .shop-account__toggle:hover, .shop-app .shop-account__toggle[aria-expanded="true"] { border-color: var(--shop-ink); }
.shop-app .shop-account__toggle--guest { padding: .35rem 1rem; }
.shop-account__avatar {
    width: 30px; height: 30px; border-radius: 50%; background: var(--shop-ink); color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-size: .85rem; font-weight: 800;
}
.shop-account__name { max-width: 12ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shop-account__chev { font-size: .7rem; color: var(--shop-muted); }
.shop-app .shop-account__menu {
    border: 1px solid var(--shop-line); border-radius: 14px; padding: .4rem; min-width: 260px;
    box-shadow: 0 16px 40px rgba(21, 25, 31, .14); font-size: .95rem;
}
.shop-app .shop-account__menu .dropdown-item {
    display: flex; align-items: center; gap: .6rem; border-radius: 10px; padding: .55rem .75rem;
    color: var(--shop-ink); font-weight: 600;
}
.shop-app .shop-account__menu .dropdown-item i { width: 1.1rem; text-align: center; color: var(--shop-muted); }
.shop-app .shop-account__menu .dropdown-item:hover, .shop-app .shop-account__menu .dropdown-item:focus { background: var(--shop-bg-soft); color: var(--shop-ink); }
.shop-account__ext { margin-left: auto; font-size: .72rem; font-weight: 700; color: var(--shop-muted); white-space: nowrap; }
.shop-app .shop-account__ext i { width: auto; font-size: .65rem; }
.shop-account__who { padding: .45rem .75rem .25rem; display: flex; flex-direction: column; font-size: .8rem; color: var(--shop-muted); }
.shop-account__who strong { color: var(--shop-ink); font-size: .9rem; overflow-wrap: anywhere; }
.shop-app .shop-nav__link--admin i { font-size: .8rem; margin-right: .2rem; }

@media (max-width: 860px) {
    .shop-account { order: 2; }
}
@media (max-width: 520px) {
    .shop-account__name { display: none; }
    .shop-app .shop-account__toggle { padding: .35rem; min-width: 42px; justify-content: center; }
    .shop-app .shop-account__toggle--guest { padding: .35rem; }
    .shop-account__chev { display: none; }
    .shop-header__inner { gap: .5rem .6rem; }
}

/* ---------- Auth-Seiten (Login, Registrierung, Passwort) ---------- */
.shop-auth { padding: clamp(2rem, 6vw, 4.5rem) 0; background: var(--shop-bg-soft); }
.shop-auth__card {
    max-width: 440px; margin: 0 auto; background: #fff; border: 1px solid var(--shop-line);
    border-radius: 18px; box-shadow: var(--shop-shadow); padding: clamp(1.5rem, 5vw, 2.4rem);
}
.shop-app .shop-auth__title { font-size: 1.6rem; font-weight: 800; letter-spacing: -.03em; margin-bottom: .35rem; }
.shop-auth__lead { color: var(--shop-muted); font-size: .95rem; margin-bottom: 1.5rem !important; }
.shop-auth__field { margin-bottom: .9rem; }
.shop-auth__field label { display: block; font-size: .85rem; font-weight: 700; margin-bottom: .3rem; color: var(--shop-ink-2); }
.shop-app .shop-auth__input {
    width: 100%; height: 48px; border: 1.5px solid var(--shop-line-strong); border-radius: 12px;
    padding: 0 .95rem; font: inherit; font-size: 1rem; color: var(--shop-ink); background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.shop-app .shop-auth__input:focus { outline: none; border-color: var(--shop-accent); box-shadow: 0 0 0 3px rgba(40, 81, 128, .15); }
.shop-auth__hint { display: block; font-size: .78rem; color: var(--shop-muted); margin-top: .3rem; }
.shop-auth__row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: .2rem 0 1.2rem; font-size: .9rem; }
.shop-auth__check { display: flex; align-items: flex-start; gap: .55rem; font-size: .88rem; color: var(--shop-ink-2); cursor: pointer; margin-bottom: .75rem; line-height: 1.45; }
.shop-auth__check input { width: 17px; height: 17px; margin-top: .15rem; accent-color: var(--shop-ink); flex-shrink: 0; }
.shop-auth__divider { display: flex; align-items: center; gap: .75rem; margin: 1.1rem 0; color: var(--shop-muted); font-size: .8rem; }
.shop-auth__divider::before, .shop-auth__divider::after { content: ''; flex: 1; height: 1px; background: var(--shop-line); }
.shop-app .shop-btn-google {
    display: flex; align-items: center; justify-content: center; gap: .6rem; width: 100%; min-height: 48px;
    border: 1.5px solid var(--shop-line-strong); border-radius: 999px; background: #fff; color: var(--shop-ink);
    font-weight: 700; text-decoration: none; transition: border-color .15s, background .15s;
}
.shop-app .shop-btn-google:hover { border-color: var(--shop-ink); color: var(--shop-ink); background: var(--shop-bg-soft); }
.shop-auth__foot { margin-top: 1.25rem; text-align: center; font-size: .9rem; color: var(--shop-muted); }
.shop-auth__note { margin-top: 1rem; font-size: .8rem; color: var(--shop-muted); text-align: center; }
.shop-auth__note a { color: var(--shop-muted); }
.shop-auth__error { color: #b3261e; font-size: .85rem; margin: -.4rem 0 .8rem; }
.grecaptcha-badge { visibility: hidden !important; }

/* ---------- Fehlerseiten ---------- */
.shop-error { padding: clamp(3rem, 10vw, 7rem) 0; text-align: center; }
.shop-error__code { font-size: clamp(4rem, 12vw, 7rem); font-weight: 800; letter-spacing: -.06em; line-height: 1; color: var(--shop-line-strong); margin-bottom: .5rem !important; }
.shop-app .shop-error__title { font-size: clamp(1.5rem, 1.1rem + 1.5vw, 2.1rem); font-weight: 800; letter-spacing: -.03em; margin-bottom: .75rem; }
.shop-error__text { color: var(--shop-muted); max-width: 52ch; margin: 0 auto 1.75rem !important; }
.shop-error__actions { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; }

/* ---------- Meine Bestellungen ---------- */
.shop-orders { display: grid; gap: 1rem; }
.shop-app .shop-order { border: 1px solid var(--shop-line); border-radius: var(--shop-radius); background: #fff; box-shadow: var(--shop-shadow); overflow: hidden; }
.shop-order__head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--shop-line); background: var(--shop-bg-soft); }
.shop-order__no { font-weight: 800; letter-spacing: -.01em; }
.shop-order__date { color: var(--shop-muted); font-size: .9rem; }
.shop-order__badges { display: flex; flex-wrap: wrap; gap: .4rem; margin-left: auto; }
.shop-order__body { padding: 1rem 1.25rem 1.25rem; }
.shop-app .shop-order__items { list-style: none; display: grid; gap: .5rem; margin-bottom: 1rem; }
.shop-order__item { display: flex; justify-content: space-between; gap: 1rem; font-size: .95rem; }
.shop-order__item-name { font-weight: 600; overflow-wrap: anywhere; }
.shop-order__item-name a { text-decoration: none; }
.shop-order__meta { display: grid; gap: .75rem 1.5rem; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); font-size: .9rem; padding-top: .9rem; border-top: 1px solid var(--shop-line); }
.shop-order__meta dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--shop-muted); font-weight: 700; margin-bottom: .15rem; }
.shop-order__meta dd { margin: 0; }
.shop-order__total { font-weight: 800; font-size: 1.05rem; }
.shop-order__notice { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; padding: .85rem 1rem; border-radius: 12px; background: #fff8e8; border: 1px solid #f0dca8; margin-bottom: 1rem; font-size: .92rem; }
.shop-order__notice--ok { background: var(--shop-accent-soft); border-color: #cbd9ea; }
.shop-order__actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.shop-app .shop-order__actions .shop-btn { min-height: 40px; padding: .45rem 1rem; font-size: .9rem; }
.shop-app .shop-status--bad { background: #fdecea; color: #8c1d18; }
.shop-app .shop-btn--danger-outline { background: #fff; color: #b3261e; border-color: #e9b6b2; }
.shop-app .shop-btn--danger-outline:hover { background: #fdecea; color: #8c1d18; border-color: #b3261e; }
@media (max-width: 560px) {
    .shop-order__badges { margin-left: 0; width: 100%; }
}

/* ---------- Verwaltung (Platzhalter, wird beim Port der Shop-Verwaltung erweitert) ---------- */
.shop-admin { padding: 2rem 0 3rem; }
.shop-admin__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.shop-admin__grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.shop-app .shop-admin__tile { display: block; padding: 1.25rem; border: 1px solid var(--shop-line); border-radius: var(--shop-radius); background: #fff; color: var(--shop-ink); text-decoration: none; }
.shop-admin__tile i { font-size: 1.3rem; color: var(--shop-accent); margin-bottom: .6rem; display: block; }
.shop-admin__tile strong { display: block; margin-bottom: .2rem; }
.shop-admin__tile span { color: var(--shop-muted); font-size: .88rem; }
.shop-admin__tile.is-soon { opacity: .6; }

/* Mobil blendet shop_storefront.css die Wortmarke im Header aus (<480px) - im Footer bleibt sie sichtbar. */


/* ---------- Cookie-Einwilligung (components/cookie_consent.html) ---------- */
.shop-consent {
    position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 1080;
    display: flex; justify-content: center; pointer-events: none;
}
.shop-consent[hidden] { display: none; }
.shop-consent__box {
    pointer-events: auto; width: min(640px, 100%); max-height: calc(100vh - 32px); overflow-y: auto;
    background: #fff; color: #15191f; border: 1px solid #e5e6e8; border-radius: 14px;
    box-shadow: 0 2px 4px rgba(21, 25, 31, .05), 0 16px 36px rgba(21, 25, 31, .14);
    padding: 1.25rem 1.35rem;
}
.shop-consent__title { font-size: 1.05rem; font-weight: 800; margin: 0 0 .5rem; color: #15191f; }
.shop-consent__text { font-size: .86rem; line-height: 1.55; color: #2b3139; margin: 0 0 1rem; }
.shop-consent a { color: #285180; }
.shop-consent__settings { border-top: 1px solid #e5e6e8; margin: 0 0 1rem; }
.shop-consent__settings[hidden] { display: none; }
.shop-consent__cat { padding: .8rem 0; border-bottom: 1px solid #e5e6e8; font-size: .84rem; color: #2b3139; }
.shop-consent__cat p { margin: .3rem 0 .4rem; }
.shop-consent__cat-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.shop-consent__switch { display: inline-flex; align-items: center; gap: .55rem; font-weight: 700; color: #15191f; cursor: pointer; margin: 0; }
.shop-consent__switch input { width: 1.1rem; height: 1.1rem; accent-color: #15191f; cursor: pointer; }
.shop-consent__switch input:disabled { cursor: default; }
.shop-consent__always { font-size: .76rem; color: #5d6671; }
.shop-consent details summary { cursor: pointer; color: #285180; font-weight: 600; font-size: .8rem; }
.shop-consent__list { margin: .5rem 0 0; padding-left: 1.1rem; font-size: .8rem; line-height: 1.5; color: #5d6671; }
.shop-consent__list li + li { margin-top: .3rem; }
.shop-consent__actions { display: flex; flex-wrap: wrap; gap: .5rem; }
/* "Alle akzeptieren" und "Nur notwendige" bewusst gleich gewichtet (kein Nudging). */
.shop-consent__btn {
    flex: 1 1 160px; border: 1px solid #15191f; background: #15191f; color: #fff; border-radius: 10px;
    padding: .65rem 1rem; font: inherit; font-size: .9rem; font-weight: 700; cursor: pointer;
}
.shop-consent__btn:hover { background: #2b3139; }
.shop-consent__btn--ghost { flex: 0 1 auto; background: #fff; color: #15191f; border-color: #cfd2d6; }
.shop-consent__btn--ghost:hover { background: #f6f5f3; }
.shop-consent__btn[hidden] { display: none; }
.shop-consent__btn:focus-visible { outline: 3px solid rgba(40, 81, 128, .45); outline-offset: 2px; }
@media (max-width: 575.98px) {
    .shop-consent { left: 0; right: 0; bottom: 0; }
    .shop-consent__box { border-radius: 14px 14px 0 0; padding-bottom: calc(1.25rem + env(safe-area-inset-bottom)); }
    .shop-consent__btn, .shop-consent__btn--ghost { flex: 1 1 100%; }
}
