/* ============================================================
   Argentarius Edelmetalle – Main Stylesheet
   Complements Bootstrap 5 – design matching argentarius_archeive
   WCAG 2.1 AA compliant
   ============================================================ */

/* --- CSS Variables --- */
:root {
    --color-gold: #d4af37;
    --color-gold-dark: #b8960c;
    --color-price: #69b526;
    --color-cta: #e67200;
    --color-cta-hover: #b95c00;
    --color-danger: #920000;
    --color-muted: #999;
    --color-nav-bg: #555;
    --color-nav-bg-dark: #333;
    --color-ticker-bg: #333;
    --color-ticker-text: #d4af37;
    --font-body: 'Open Sans', sans-serif;
    --font-heading: 'Ubuntu', sans-serif;
}

body {
    font-family: var(--font-body);
    background: #f0f0f0;
    color: #666;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: #666;
}

/* --- Skip Link --- */
.skip-link:focus {
    background: var(--color-gold);
    color: #000;
    padding: 0.5rem 1rem;
    z-index: 10000;
}

/* --- Spot Price Ticker --- */
/* --- Testserver banner (shown sitewide when Testserver-Modus is on) --- */
.test-server-banner {
    background: #b02a37;
    color: #fff;
    text-align: center;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    letter-spacing: 0.3px;
    border-bottom: 2px solid #7a1c25;
}
.test-server-banner strong { letter-spacing: 1px; }
.test-server-banner .fa-triangle-exclamation { margin-right: 0.4rem; }

.spot-ticker {
    background: var(--color-ticker-bg);
    color: var(--color-ticker-text);
    padding: 0.35rem 0;
    font-size: 0.72rem;
    letter-spacing: normal;
    overflow: hidden;
}
/* Bulletin-style auto-scrolling marquee. Manual scrolling is impossible
   (overflow: hidden, no scrollbar); the track scrolls itself and loops
   seamlessly because the item group is rendered twice (translateX -50%). */
.spot-ticker-inner { display: flex; align-items: center; gap: 0.9rem; overflow: hidden; }
.spot-ticker-marquee { flex: 1 1 auto; min-width: 0; overflow: hidden; }
.spot-ticker-track { display: flex; width: max-content; animation: spot-ticker-scroll 32s linear infinite; }
.spot-ticker-track:hover { animation-play-state: paused; }
.spot-ticker-group { display: flex; align-items: center; flex: 0 0 auto; }
.spot-ticker-item { display: inline-flex; align-items: center; white-space: nowrap; margin-right: 1.6rem; }
.spot-ticker-fixed { flex: 0 0 auto; white-space: nowrap; color: #aaa; font-size: 0.68rem; }
@keyframes spot-ticker-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
/* Accessibility: honour reduced-motion — stop the scroll and show a single static
   (wrapping) group so all prices remain readable without movement. */
@media (prefers-reduced-motion: reduce) {
    .spot-ticker-track { animation: none; flex-wrap: wrap; width: 100%; }
    .spot-ticker-group[aria-hidden="true"] { display: none; }
}
@media (max-width: 575.98px) { .spot-ticker-stand { display: none; } }
.spot-ticker strong { color: var(--color-gold); }
.spot-ticker .text-muted { color: #aaa !important; font-size: 0.66rem; }
.spot-ticker .fa-coins { color: var(--color-gold); margin-right: 0.25rem; }
.spot-trend { font-size: 0.7rem; font-weight: 600; margin-left: 0.05rem; white-space: nowrap; }
.spot-trend--up { color: #35c46a; }
.spot-trend--down { color: #ff6b6b; }
.spot-trend--flat { color: #ffc107; }
.spot-trend .fa-solid { font-size: 0.7rem; }

/* --- Topbar --- */
#topbar {
    background: #fafafa;
    border-bottom: 1px solid #eee;
    padding: 0.4rem 0;
    font-size: 0.85rem;
    color: #666;
}
#topbar a { color: #666; text-decoration: none; }
#topbar a:hover { color: #333; }
#topbar .fa { margin-right: 0.3rem; }

/* --- Header --- */
#header {
    background: #fff;
    padding: 1.25rem 0;
    border-bottom: 1px solid #eee;
}
.brand img { max-height: 60px; }
#row-cart a { color: #333; }
#row-cart .fa-shopping-cart { color: #666; font-size: 1.5rem; }

/* Homepage header has no search bar: reclaim the freed space with a larger,
   more prominent logo, a tighter band, and the cart pinned to the right. */
.page-home #header { padding: 0.6rem 0; }
.page-home #header .row { flex-wrap: nowrap; }
.page-home #row-brand { flex: 0 0 auto; width: auto; max-width: 70%; }
.page-home #row-brand .brand img { max-height: 92px; }
.page-home #row-cart { margin-left: auto; }
.page-home #header .row > .col-sm-1 { display: none; }
@media (max-width: 575.98px) {
    .page-home #row-brand { max-width: 62%; }
    .page-home #row-brand .brand img { max-height: 60px; }
}

/* --- Navigation --- */
#navigation {
    background: linear-gradient(to bottom, #666, #333);
    border: 1px solid #000;
    border-radius: 0;
}
#navigation .navbar-nav .nav-link {
    color: #fff;
    font-weight: 500;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    transition: background 0.2s, color 0.2s;
}
#navigation .navbar-nav .nav-link:hover,
#navigation .navbar-nav .nav-link:focus {
    color: #666;
    background: #fff;
}
#navigation .navbar-toggler { border-color: rgba(255,255,255,0.5); }

/* --- Product Cards (matching archive thumbnail-product style) --- */
.product-card {
    background: #fff;
    border: 1px solid #eee;
    margin-bottom: 1.5rem;
    text-align: center;
    transition: box-shadow 0.2s;
}
.product-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.product-card .card-img-top {
    padding: 1rem;
    background: #fafafa;
    object-fit: contain;
    height: 220px;
}
.product-card .card-body { padding: 1rem; }
.product-card .card-title {
    font-size: 0.95rem;
    font-weight: 500;
    min-height: 2.8em;
    overflow: hidden;
    color: #333;
}
.product-card .card-title a { color: #333; text-decoration: none; }
.product-card .card-title a:hover { color: var(--color-cta); }
.product-card .price {
    font-size: 1.15rem;
    font-weight: 700;
    color: #333;
    margin: 0.5rem 0;
}
.product-card .vat-info { font-size: 0.8rem; color: var(--color-muted); }
.product-card .availability { font-size: 0.8rem; margin-bottom: 0.5rem; }
.product-card .availability .in-stock { color: var(--color-price); }
.product-card .availability .out-of-stock { color: var(--color-danger); font-weight: 600; }

/* Availability icon style (like archive green dot) */
.availability-dot {
    display: inline-block; width: 10px; height: 10px;
    border-radius: 50%; margin-right: 0.3rem; vertical-align: middle;
}
.availability-dot.available { background: #69b526; }
.availability-dot.sold-out { background: #cc0000; }

/* Sold-out overlay */
.product-card.sold-out { opacity: 0.7; }
.sold-out-badge {
    background: #f8d7da;
    color: var(--color-danger);
    font-size: 0.85rem;
    padding: 0.25rem 0.75rem;
    font-weight: 600;
    display: inline-block;
    margin-top: 0.5rem;
}

/* --- Homepage item carousel (multi-item, auto-advancing, manual arrows) --- */
.item-carousel { display: flex; align-items: center; gap: 0.5rem; }
.item-carousel-viewport { overflow: hidden; flex: 1 1 auto; }
/* Position is driven per animation frame in home_carousel.js (constant-speed
   conveyor), so no CSS transition here — one would lag/smear the frame updates. */
.item-carousel-track { display: flex; will-change: transform; }
.item-carousel-slide { flex: 0 0 25%; max-width: 25%; box-sizing: border-box; padding: 0 0.5rem; }
/* Carousel cards are a touch smaller than the full grid below. */
.item-carousel .product-card { margin-bottom: 0; }
.item-carousel .product-card .card-img-top { height: 150px; padding: 0.75rem; }
.item-carousel .product-card .card-body { padding: 0.75rem; }
.item-carousel .product-card .card-title { font-size: 0.85rem; min-height: 2.6em; }
.item-carousel .product-card .price { font-size: 1rem; margin: 0.35rem 0; }
.item-carousel .product-card .vat-info,
.item-carousel .product-card .availability { font-size: 0.72rem; }
.item-carousel-arrow {
    flex: 0 0 auto; width: 38px; height: 38px; padding: 0;
    border: 1px solid #ccc; background: #fff; border-radius: 50%;
    color: #333; cursor: pointer; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.item-carousel-arrow:hover { background: var(--color-cta); border-color: var(--color-cta); color: #fff; }
/* Page sizes are divisors of 4 (4 / 2 / 1) so full pages always tile cleanly. */
@media (max-width: 991.98px) { .item-carousel-slide { flex-basis: 50%; max-width: 50%; } }
@media (max-width: 575.98px) { .item-carousel-slide { flex-basis: 100%; max-width: 100%; } }

/* Compact "Aktuelle Angebote" belt — deliberately much smaller than the main grid below. */
.item-carousel--compact .item-carousel-slide { flex: 0 0 16.6667%; max-width: 16.6667%; padding: 0 0.35rem; }
.item-carousel--compact .product-card .card-img-top { height: 88px; padding: 0.4rem; }
.item-carousel--compact .product-card .card-body { padding: 0.5rem; }
.item-carousel--compact .product-card .card-title { font-size: 0.72rem; min-height: 2.2em; margin-bottom: 0.2rem; }
.item-carousel--compact .product-card .price { font-size: 0.82rem; margin: 0.2rem 0; }
.item-carousel--compact .product-card .vat-info,
.item-carousel--compact .product-card .availability { font-size: 0.6rem; margin-bottom: 0.25rem; }
.item-carousel--compact .product-card .sold-out-badge { font-size: 0.6rem; }
@media (max-width: 991.98px) { .item-carousel--compact .item-carousel-slide { flex-basis: 33.3333%; max-width: 33.3333%; } }
@media (max-width: 575.98px) { .item-carousel--compact .item-carousel-slide { flex-basis: 50%; max-width: 50%; } }

/* --- Category Grid --- */
.category-card {
    background: #fff;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid #eee;
    transition: transform 0.2s, box-shadow 0.2s;
    display: block;
    text-decoration: none;
    color: inherit;
}
.category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    text-decoration: none;
    color: inherit;
}
.category-card h3 { font-family: var(--font-heading); color: #333; margin-bottom: 0.3rem; font-size: 1.1rem; }

/* --- Buttons (custom overrides) --- */
.btn-gold {
    background: var(--color-gold);
    color: #fff;
    border-color: var(--color-gold-dark);
    font-weight: 600;
}
.btn-gold:hover { background: var(--color-gold-dark); color: #fff; }

.btn-cta {
    background: var(--color-cta);
    color: #fff;
    border-color: var(--color-cta-hover);
    font-weight: 600;
}
.btn-cta:hover { background: var(--color-cta-hover); color: #fff; }

/* Give a plain `.btn` (no colour variant) a real button appearance so admin
   navigation links don't look like plain text. Scoped with :not() so the
   coloured/outline Bootstrap variants keep their own styles. */
.btn:not(.btn-primary):not(.btn-secondary):not(.btn-success):not(.btn-danger):not(.btn-warning):not(.btn-info):not(.btn-light):not(.btn-dark):not(.btn-link):not(.btn-cta):not(.btn-gold):not(.btn-outline-primary):not(.btn-outline-secondary):not(.btn-outline-danger):not(.btn-close) {
    background-color: #eef2f7;
    border: 1px solid #b9c4d3;
    color: #1f2a37;
    font-weight: 600;
    box-shadow: 0 1px 1px rgba(16, 24, 40, 0.06);
}
.btn:not(.btn-primary):not(.btn-secondary):not(.btn-success):not(.btn-danger):not(.btn-warning):not(.btn-info):not(.btn-light):not(.btn-dark):not(.btn-link):not(.btn-cta):not(.btn-gold):not(.btn-outline-primary):not(.btn-outline-secondary):not(.btn-outline-danger):not(.btn-close):hover {
    background-color: #dfe6f0;
    border-color: #8a9bb2;
    color: #10151c;
}

/* --- Item Detail --- */
.item-detail { margin-bottom: 2rem; }
.item-detail .item-main-image { max-height: 400px; object-fit: contain; }
.item-detail .item-secondary-image { max-height: 150px; object-fit: contain; margin-top: 0.5rem; }
.item-specs dt { font-weight: 600; color: #333; }
.item-pricing .price-main { font-size: 2rem; font-weight: 700; color: #333; margin: 0.5rem 0; }
.item-pricing .vat-note { color: var(--color-muted); font-size: 0.85rem; }
.in-stock { color: var(--color-price); font-weight: 600; }
.out-of-stock { color: var(--color-danger); font-weight: 600; }

/* --- Tables --- */
.admin-table, .price-table {
    width: 100%;
    background: #fff;
}
.admin-table thead th, .price-table thead th {
    background: #333;
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
}

/* --- Dashboard Grid --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.dashboard-card {
    background: #fff;
    padding: 1.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    border-top: 3px solid #666;
}
.dashboard-card h2 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: #333;
}

/* --- Cart --- */
.cart-timer { font-size: 0.85rem; color: #cc0033; font-weight: 600; }
.qty-form { display: inline-flex; align-items: center; gap: 0.25rem; }
.qty-input { width: 3.5rem; text-align: center; }
.qty-btn { min-width: 1.75rem; }

/* --- Checkout --- */
.checkout-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 2rem; }
.checkout-summary {
    background: #fff;
    padding: 1.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    position: sticky;
    top: 120px;
}

/* --- Footer --- */
#footer {
    background: #333;
    color: #999;
    padding-top: 2rem;
    margin-top: 3rem;
}
#footer h3 { color: #fff; font-size: 1rem; margin-bottom: 0.75rem; font-family: var(--font-heading); }
#footer a { color: #ccc; text-decoration: none; }
#footer a:hover { color: #fff; }
.footer-membership {
    background: #fff;
    color: #333;
    border-top: 1px solid #444;
}
.footer-membership-logo {
    height: 64px;
    width: auto;
}
.footer-bottom {
    background: #222;
    color: #777;
    font-size: 0.85rem;
    border-top: 1px solid #444;
}

/* --- Chat Widget --- */
.chat-widget {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 9999;
}
.chat-fab {
    background: linear-gradient(135deg, #0d6b52, #15936f);
    color: #fff;
    border: none;
    min-width: 64px;
    height: 64px;
    padding: 0 1rem;
    border-radius: 999px;
    font-size: 1.4rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    box-shadow: 0 10px 24px rgba(13, 107, 82, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.chat-fab-label {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.chat-fab:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(13, 107, 82, 0.34);
}

/* Site-wide Widerruf (cancellation) floating button, sits above the chat FAB */
.widerruf-fab-wrap {
    position: fixed;
    right: 1rem;
    bottom: 5.75rem;
    z-index: 9999;
}
.widerruf-fab {
    background: linear-gradient(135deg, #b02a37, #dc3545);
    color: #fff;
    min-width: 64px;
    height: 48px;
    padding: 0 1rem;
    border-radius: 999px;
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(176, 42, 55, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.widerruf-fab:hover {
    transform: translateY(-1px);
    color: #fff;
    box-shadow: 0 14px 30px rgba(176, 42, 55, 0.34);
}
.widerruf-fab-label {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.widerruf-fallback-floating {
    position: absolute;
    right: 0;
    bottom: calc(100% + 0.5rem);
    width: 320px;
    max-width: 80vw;
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 0.75rem;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}
.widerruf-text {
    white-space: pre-wrap;
    word-break: break-word;
    background: #f8f9fa;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    padding: 0.5rem;
    margin: 0.25rem 0;
    font-family: inherit;
    font-size: 0.85rem;
    max-height: 8rem;
    overflow: auto;
}
.chat-header {
    background: #333;
    color: #fff;
    padding: 0.75rem 1rem;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    max-height: 300px;
    background: #f7faf8;
}
.chat-message {
    margin-bottom: 0.75rem;
    padding: 0.75rem 0.9rem;
    border-radius: 0.75rem;
    color: #1f2937;
}
.chat-message p {
    margin: 0.35rem 0 0;
    white-space: pre-wrap;
}
.chat-message-admin {
    background: #e7f6f0;
    border: 1px solid #b7e3d3;
}
.chat-message-customer {
    background: #ffffff;
    border: 1px solid #d9e2ec;
}
.chat-message-system {
    background: #f3f4f6;
    border: 1px dashed #cbd5e1;
}
.chat-time {
    display: block;
    margin-top: 0.35rem;
    color: #6b7280;
    font-size: 0.8rem;
}
.chat-panel-input { display: flex; border-top: 1px solid #eee; }
.chat-panel-input input {
    flex: 1;
    border: none;
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
}
.chat-panel-input button {
    background: var(--color-cta);
    color: #fff;
    border: none;
    padding: 0.6rem 1rem;
    cursor: pointer;
    font-weight: 600;
}
.chat-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border: none;
    color: #fff;
}
.chat-toggle-btn-active {
    background: #198754;
}
.chat-toggle-btn-active:hover,
.chat-toggle-btn-active:focus {
    background: #157347;
    color: #fff;
}
.chat-toggle-btn-inactive {
    background: #dc3545;
}
.chat-toggle-btn-inactive:hover,
.chat-toggle-btn-inactive:focus {
    background: #bb2d3b;
    color: #fff;
}
.admin-chat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
}
.admin-chat-panel {
    background: #fff;
    border: 1px solid #dbe5df;
    border-radius: 0.9rem;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
    padding: 1rem;
}
.admin-chat-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.9rem;
}
.admin-chat-panel-header h2 {
    margin: 0;
    font-size: 1rem;
}
.admin-chat-panel-header p {
    margin: 0.25rem 0 0;
    color: #64748b;
    font-size: 0.9rem;
}
.admin-chat-messages {
    min-height: 220px;
    max-height: 380px;
    margin-bottom: 1rem;
}
.admin-chat-form textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 0.65rem;
    padding: 0.75rem;
    resize: vertical;
}
.admin-live-chat-dock {
    position: fixed;
    right: 1rem;
    bottom: 9.5rem;  /* sit above the Widerruf FAB, not on top of it */
    width: min(420px, calc(100vw - 2rem));
    max-height: 70vh;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #cfe3d8;
    border-radius: 1rem;
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.18);
    z-index: 9998;
}
.admin-live-chat-dock-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1rem;
    background: #edf7f2;
    border-bottom: 1px solid #d9ece2;
}
.admin-live-chat-dock-header small {
    display: block;
    color: #4b5563;
}
.admin-live-chat-dock-header-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
#admin-live-chat-minimize {
    font-weight: 700;
    line-height: 1;
    padding: 0.1rem 0.55rem;
    border: 1px solid #b9b9b9;
    background: #fff;
}
/* Minimized launcher: a small headset badge that restores the dock. */
.admin-live-chat-restore {
    position: fixed;
    right: 1rem;
    bottom: 9.5rem;  /* clear the Widerruf FAB below it */
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 50%;
    border: 2px solid #fff;
    background: #1a8f5e;
    color: #fff;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
    z-index: 9998;
}
.admin-live-chat-restore[hidden] { display: none; }
.admin-live-chat-restore:hover { background: #147a4f; }
.admin-live-chat-restore-badge {
    position: absolute;
    top: -0.35rem;
    right: -0.35rem;
    min-width: 1.3rem;
    height: 1.3rem;
    padding: 0 0.3rem;
    border-radius: 0.65rem;
    background: #d92020;
    color: #fff;
    font-size: 0.8rem;
    line-height: 1.3rem;
    text-align: center;
}
.admin-live-chat-restore-badge[hidden] { display: none; }
.admin-live-chat-panels {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding: 1rem;
}
.admin-live-chat-panel {
    border: 1px solid #dbe5df;
    border-radius: 0.9rem;
    padding: 0.85rem;
    background: #fbfdfc;
}
.admin-live-chat-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.admin-live-chat-panel-header h3 {
    margin: 0;
    font-size: 1rem;
}
.admin-live-chat-panel-header p {
    margin: 0.2rem 0 0;
    color: #64748b;
    font-size: 0.85rem;
}
.admin-live-chat-messages {
    max-height: 220px;
    min-height: 120px;
    margin-bottom: 0.75rem;
}
.admin-live-chat-form {
    display: flex;
    gap: 0.6rem;
}
.admin-live-chat-form textarea {
    flex: 1;
    min-height: 70px;
    border: 1px solid #cbd5e1;
    border-radius: 0.65rem;
    padding: 0.65rem 0.75rem;
    resize: vertical;
}
/* Admin dock – pending request row */
.admin-live-pending-section {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.75rem 1rem 0;
}
.admin-pending-request {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 0.65rem;
    padding: 0.65rem 0.9rem;
}
.admin-pending-icon { color: #b45309; font-size: 1.1rem; flex-shrink: 0; }
.admin-pending-label { flex: 1; font-weight: 600; font-size: 0.9rem; }
/* Admin chat list – pending panels */
.admin-chat-panel-pending {
    border-color: #fde68a;
    background: #fffde7;
}
/* Admin live-chat panel header actions */
.admin-live-chat-panel-actions {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
}
/* Chat state panels inside the widget.
   [hidden] must take priority over the flex display rule – browsers apply
   the user-agent display:none for [hidden] at zero specificity, so any CSS
   property overrides it.  The !important here restores the expected behaviour. */
.chat-state-panel[hidden] { display: none !important; }
.chat-state-panel { flex: 1; display: flex; flex-direction: column; }
.chat-state-active-layout {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.chat-connect-prompt {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.5rem 1rem;
    gap: 0.5rem;
    color: #374151;
}
.chat-connect-prompt p { margin: 0; font-weight: 600; font-size: 1rem; }
.chat-connect-prompt small { color: #6b7280; font-size: 0.85rem; }
.chat-pending-prompt {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.5rem 1rem;
    gap: 0.6rem;
    color: #374151;
}
.chat-pending-prompt p { margin: 0; font-weight: 600; }
.chat-pending-prompt small { color: #6b7280; font-size: 0.85rem; }
.chat-spinner {
    width: 36px; height: 36px;
    border: 4px solid #d1fae5;
    border-top-color: #0d6b52;
    border-radius: 50%;
    animation: chat-spin 0.8s linear infinite;
}
@keyframes chat-spin { to { transform: rotate(360deg); } }
/* Chat panel must flex to fill the panel when states are inside */
.chat-panel {
    display: none;
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 350px;
    max-height: 480px;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    flex-direction: column;
    overflow: hidden;
    border-radius: 0.5rem;
}
.chat-panel.open { display: flex; }
@media (max-width: 640px) {
    .chat-fab-label,
    .widerruf-fab-label {
        display: none;
    }
    .chat-fab {
        width: 64px;
        padding: 0;
        border-radius: 50%;
    }
    .widerruf-fab {
        width: 48px;
        min-width: 48px;
        padding: 0;
        border-radius: 50%;
    }
    .admin-live-chat-dock {
        width: calc(100vw - 1rem);
        right: 0.5rem;
        bottom: 9.5rem;  /* clear the Widerruf FAB on phones too */
    }
}

/* --- Filter Nav --- */
.metal-filter { margin-bottom: 1.5rem; }
.metal-filter a {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border: 1px solid #ddd;
    font-size: 0.85rem;
    color: #666;
    text-decoration: none;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
}
.metal-filter a:hover, .metal-filter a.active {
    background: #333;
    color: #fff;
    border-color: #333;
}

/* --- Price / weight filters + sort toggle --- */
.shop-filters {
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 0.9rem 1rem;
}
.filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.25rem;
}
.filter-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.filter-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}
.filter-form .form-control {
    width: 6rem;
}
.range-dash { color: #999; }
.unit-toggle { margin-left: 0.25rem; }
.filter-actions { display: flex; gap: 0.4rem; }
.sort-toggle { margin-left: auto; white-space: nowrap; }

.weight-presets {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #eee;
}
.weight-presets .preset {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border: 1px solid #ddd;
    border-radius: 999px;
    font-size: 0.8rem;
    color: #555;
    text-decoration: none;
    background: #fff;
}
.weight-presets .preset:hover {
    border-color: #999;
    color: #333;
}
.weight-presets .preset.active {
    background: #0d6b52;
    color: #fff;
    border-color: #0d6b52;
}

@media (max-width: 575.98px) {
    .filter-form .form-control { width: 4.5rem; }
    .sort-toggle { margin-left: 0; }
}

/* --- Cart Timer & Price Updates --- */
.timer {
    font-family: monospace;
    font-size: 0.9rem;
    color: #666;
}
.timer.expired {
    color: var(--color-cta);
    font-weight: 600;
}
.price-updated {
    background: #fff3cd !important;
    transition: background 0.3s ease;
}

/* --- Breadcrumb --- */
.breadcrumb { font-size: 0.85rem; }

/* --- Profile --- */
.profile-card {
    background: #fff;
    padding: 1.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* --- Calendar Widget (Admin) --- */
.calendar-widget { background: #fff; padding: 1rem; margin-bottom: 2rem; }
.calendar-widget table { width: 100%; }
.calendar-widget th { text-align: center; padding: 0.5rem; background: #f8f9fa; font-size: 0.85rem; }
.calendar-widget td { text-align: center; padding: 0.5rem; vertical-align: top; min-width: 100px; height: 80px; border: 1px solid #eee; font-size: 0.85rem; }
.calendar-widget td.today { background: #fff3cd; }
.calendar-widget td .day-number { font-weight: 600; color: #333; display: block; margin-bottom: 0.25rem; }
.calendar-widget td .cal-event { font-size: 0.7rem; background: #e3f2fd; color: #1565c0; padding: 0.15rem 0.3rem; margin: 0.1rem 0; display: block; border-radius: 2px; text-decoration: none; }
.calendar-widget td .cal-event:hover { background: #bbdefb; }

/* --- Responsive --- */
@media (max-width: 767.98px) {
    .checkout-grid { grid-template-columns: 1fr; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .product-card .card-img-top { height: 160px; }
}

/* Phones: keep the header on one aligned row, cart shrinks to icon + count */
@media (max-width: 575.98px) {
    #header { padding: 0.75rem 0; }
    #row-search .form-control { font-size: 0.9rem; }
    #row-cart .fa-shopping-cart { font-size: 1.3rem; }
}

/* --- Misc --- */
.text-success { color: var(--color-price) !important; }
.text-danger { color: var(--color-danger) !important; }
.lang-btn { color: #666; font-size: 0.85rem; text-decoration: none; }
.lang-btn:hover { color: #333; }

/* ==========================================================================
   Barrierefreiheit / Accessibility
   Self-hosted a11y toolbar, contrast/colour themes, font scaling, focus and
   reduced-motion handling. No third-party code.
   ========================================================================== */

/* Visible keyboard focus everywhere (WCAG 2.4.7). */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
.btn:focus-visible {
    outline: 3px solid #1a73e8;
    outline-offset: 2px;
    border-radius: 2px;
}

/* User-toggled reduced motion + OS preference (WCAG 2.3.3). */
html[data-a11y-reduce="1"] *,
html[data-a11y-reduce="1"] *::before,
html[data-a11y-reduce="1"] *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* OS "more contrast" preference: stronger borders/links. */
@media (prefers-contrast: more) {
    a { text-decoration: underline; }
    .card, .product-card, .admin-table, table { border: 1px solid #000 !important; }
}

/* Font-size scaling (rem-based components scale with the root). */
html[data-a11y-fontscale="lg"] { font-size: 112.5%; }
html[data-a11y-fontscale="xl"] { font-size: 125%; }

/* --- High-contrast theme (black/white/yellow) --------------------------- */
html[data-a11y-theme="contrast"] body {
    background: #000 !important;
    color: #fff !important;
}
html[data-a11y-theme="contrast"] a,
html[data-a11y-theme="contrast"] .spot-ticker strong,
html[data-a11y-theme="contrast"] .text-muted,
html[data-a11y-theme="contrast"] small {
    color: #ffd400 !important;
}
html[data-a11y-theme="contrast"] .card,
html[data-a11y-theme="contrast"] .product-card,
html[data-a11y-theme="contrast"] #footer,
html[data-a11y-theme="contrast"] #topbar,
html[data-a11y-theme="contrast"] .navbar,
html[data-a11y-theme="contrast"] #navigation {
    background: #000 !important;
    color: #fff !important;
    border: 1px solid #fff !important;
}
html[data-a11y-theme="contrast"] .btn,
html[data-a11y-theme="contrast"] .btn-primary,
html[data-a11y-theme="contrast"] .btn-cta,
html[data-a11y-theme="contrast"] .btn-gold {
    background: #ffd400 !important;
    color: #000 !important;
    border: 2px solid #fff !important;
}
html[data-a11y-theme="contrast"] .out-of-stock,
html[data-a11y-theme="contrast"] .text-danger { color: #ff6b6b !important; }
html[data-a11y-theme="contrast"] .in-stock,
html[data-a11y-theme="contrast"] .text-success { color: #51e051 !important; }

/* --- Dark theme --------------------------------------------------------- */
html[data-a11y-theme="dark"] body {
    background: #14161a !important;
    color: #e6e6e6 !important;
}
html[data-a11y-theme="dark"] .card,
html[data-a11y-theme="dark"] .product-card,
html[data-a11y-theme="dark"] #footer {
    background: #1f232b !important;
    color: #e6e6e6 !important;
    border-color: #333 !important;
}
html[data-a11y-theme="dark"] a { color: #ffd768 !important; }
html[data-a11y-theme="dark"] .text-muted,
html[data-a11y-theme="dark"] small { color: #b9b9b9 !important; }

/* --- Colour-blind-safe theme (blue/orange, not green/red) --------------- */
html[data-a11y-theme="cblind"] {
    --color-price: #0072b2;   /* blue instead of green */
    --color-cta: #d55e00;     /* orange */
    --color-cta-hover: #a64600;
    --color-danger: #cc3311;
}
html[data-a11y-theme="cblind"] .in-stock,
html[data-a11y-theme="cblind"] .text-success { color: #0072b2 !important; }
html[data-a11y-theme="cblind"] .out-of-stock,
html[data-a11y-theme="cblind"] .text-danger { color: #cc3311 !important; }

/* --- Accessibility toolbar ---------------------------------------------- */
.a11y-toggle {
    position: fixed;
    left: 1rem;
    bottom: 1rem;
    z-index: 1080;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    border: 2px solid #fff;
    background: #1a4f8b;
    color: #fff;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.a11y-toggle:hover { background: #15406f; }

.a11y-panel {
    position: fixed;
    left: 1rem;
    bottom: 4.5rem;
    z-index: 1080;
    width: 18rem;
    max-width: calc(100vw - 2rem);
    background: #fff;
    color: #222;
    border: 1px solid #bbb;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    padding: 1rem;
}
.a11y-panel[hidden] { display: none; }
.a11y-panel h2 { font-size: 1.05rem; margin: 0 0 0.5rem; }
.a11y-group { margin-bottom: 0.75rem; }
.a11y-group > span.a11y-label { display: block; font-weight: 600; font-size: 0.85rem; margin-bottom: 0.25rem; }
.a11y-panel button.a11y-opt {
    display: inline-block;
    margin: 0.15rem 0.15rem 0 0;
    padding: 0.3rem 0.55rem;
    border: 1px solid #1a4f8b;
    background: #fff;
    color: #1a4f8b;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
}
.a11y-panel button.a11y-opt[aria-pressed="true"] { background: #1a4f8b; color: #fff; }
.a11y-panel .a11y-reset {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.4rem;
    border: 1px solid #920000;
    background: #fff;
    color: #920000;
    border-radius: 4px;
    cursor: pointer;
}
