﻿/* --- Position außerhalb des Containers --- */
#discount-widget {
    position: fixed;
    left: 45px;
    top: 300px;
    z-index: 5000;
}

@media(max-width: 992px) {
    #discount-widget {
        position: static;
        margin-bottom: 20px;
    }
}

/* --- Icon Cluster --- */
#discount-icons {
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: relative;
}

    #discount-icons .condition {
        position: relative;
        width: 58px;
        height: 58px;
    }

    #discount-icons img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        filter: grayscale(70%);
        opacity: 0.7;
        transition: 0.25s ease-in-out;
    }

    /* Badge */
    #discount-icons .badge {
        position: absolute;
        bottom: -4px;
        right: -6px;
        padding: 0.5rem 1rem;
        font-size: 1.2rem;
        font-weight: bold;
        border-radius: 12px;
        box-shadow: 0 0 6px rgba(0,0,0,0.3);
        display: inline-block
    }

    /* Standard-Info */
    .badge-info {
        background: #ffc107;
        color: #333;
}

    /* Rabatt aktiv */
    .badge-discount {
        background: var(--brand-primary); /* grün */
        color: #fff;
        font-weight: bold;
}

    /* Aktiver Zustand */
    #discount-icons .condition.active img {
        filter: none;
        opacity: 1;
    }

    #discount-icons .condition.active .badge {
        background: #2ecc71;
        color: white;
    }

    /* Icons im Normalzustand (nicht erfüllt) */
    #discount-icons img {
        opacity: 0.6;
        filter: saturate(80%);
        transition: 0.25s ease-in-out;
    }

    /* Aktiver Zustand: klare Farben + Leuchten */
    #discount-icons .condition.active img {
        opacity: 1;
        filter: saturate(150%);
        box-shadow: 0 0 10px rgba(30, 144, 255, 0.6); /* blaues Glow */
        border-radius: 10px;
        transform: scale(1.05); /* leichte Betonung */
    }

    /* Badge im aktiven Zustand (optional stärker) */
    #discount-icons .condition.active .badge {
        background: #1e90ff;
        color: white;
        box-shadow: 0 0 8px rgba(30,144,255,0.6);
    }

/* --- Tooltip Panel --- */
.tooltip-panel {
    display: none;
    position: absolute;
    top: 0;
    left: 110%;
    width: 260px;
    padding: 14px;
    background: white;
    border-radius: 10px;
    border: 1px solid #ccc;
    box-shadow: 0 4px 14px rgba(0,0,0,0.18);
    z-index: 5100;
}

    .tooltip-panel h4 {
        margin-top: 0;
    }

@media(max-width: 992px) {
    .tooltip-panel {
        position: static;
        width: 100%;
        margin-top: 8px;
    }
}

/* Tooltip anzeigen */
#discount-widget.show-tooltip .tooltip-panel {
    display: block;
}
/* ===== MOBILE BUBBLE ===== */
.mobile-bubble {
    display: none;
    background: #1976d2;
    color: white;
    padding: 8px 14px;
    border-radius: 18px;
    font-size: 14px;
    margin-bottom: 10px;
    cursor: pointer;
}

/* Mobile zeigt nur Bubble */
@media(max-width: 992px) {
    #discount-icons {
        display: none;
    }

    .mobile-bubble {
        display: inline-block;
    }
}

/* Wenn geöffnet → Icons sichtbar */
@media(max-width: 992px) {
    #discount-widget.show-tooltip #discount-icons {
        display: flex;
        flex-direction: column;
    }
}

/* ===== PROGRESSBAR ===== */
#progress-container {
    width: 100%;
    height: 10px;
    background: #eee;
    border-radius: 6px;
    margin: 12px 0 6px 0;
    overflow: hidden;
}

#progress-bar {
    width: 0%;
    height: 100%;
    background: #1976d2;
    transition: width 0.4s ease;
}

#progress-text {
    font-size: 13px;
    margin-bottom: 10px;
    color: #444;
}

/* Nebeneinander-Anordnung */
#discount-icons .icon-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

/* Macht jedes Icon gleich groß */
#discount-icons .condition {
    width: 58px;
    height: 58px;
}

/* Mobile Ansicht — Icons übereinander */
@media(max-width: 992px) {
    #discount-icons .icon-row {
        display: block;
        margin-bottom: 10px;
    }

    #discount-icons .condition {
        margin-bottom: 8px;
    }
}
/* Trenner zwischen Icon-Reihen */
.icon-separator {
    height: 4px; /* Dicke der Linie */
    background-color: #ccc; /* Farbe der Linie */
    margin: 12px 0; /* Abstand oben/unten */
    width: 20%; /* volle Breite des Icon-Bereichs */
}

/* Optional: weicher Übergang auf Hover */
#discount-widget:hover .icon-separator {
    background-color: #999;
}
.icon-row {
    display: flex;
    align-items: center;
    gap: 2px; /* Abstand zwischen Icons */
}

/* Vertikaler Trenner zwischen Fass und Kanister */
.icon-separator-vertical-line {
    width: 4px; /* Dicke der Linie */
    background-color: var(--brand-primary);
    height: 40px; /* Höhe passend zu den Icons */
}

/* Vertikaler Trenner zwischen Fass und Kanister */
.icon-separator-vertical-text {
    writing-mode: vertical-rl; /* Textfluss von oben nach unten */
    text-orientation: upright; /* Buchstaben bleiben aufrecht */
    font-weight: bold;
    color: var(--brand-primary);
    height: 40px; /* Höhe passend zu den Icons */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Optional: hover */
.icon-row:hover .icon-separator-vertical {
    background-color: #999;
}

/* Mobile: trenner horizontal */
@media(max-width: 992px) {
    .icon-row {
        flex-direction: column;
        gap: 12px;
    }

    .icon-separator-vertical {
        width: 100%;
        height: 1px;
    }
}
/* Plus zwischen Gewicht und Fass */
.icon-plus {
    font-size: 24px;
    font-weight: bold;
    color: #333; /* Standardfarbe */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Optional: aktive Farbe, wenn beide Bedingungen erfüllt */
#cond-weight.active + .icon-plus,
#cond-barrel.active ~ .icon-plus {
    color: #1e90ff; /* Blau passend zu Icons */
}

/* Widget links fixieren und Mindestbreite geben */
#discount-widget {
    position: sticky;
    top: 1rem;
    min-width: 180px;
}

@media (max-width: 768px) {
    #discount-widget {
        position: static;
        width: 100%;
        margin-bottom: 1rem;
    }
}

/* Icons im Widget verkleinern */
#discount-icons img {
    width: 40px;
    height: 40px;
}

@media (max-width: 576px) {
    #discount-icons img {
        width: 32px;
        height: 32px;
    }
}

/* Widget Container */
.discount-widget {
    position: relative;
}

/* Mobile Bubble */
.mobile-bubble {
    position: absolute;
    top: 0;
    left: 0;
    transform: translateY(-100%);
    background: #009d39;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: .8rem;
    white-space: nowrap;
}

@media (min-width: 768px) {
    .mobile-bubble {
        display: none;
    }
}

.mobile-bubble {
    position: absolute;
    top: -6px;
    left: 0;
    font-size: .7rem;
    padding: 2px 6px;
    transform: none;
    background: #009d39;
    color: white;
    border-radius: 4px;
    white-space: nowrap;
}

@media (min-width: 768px) {
    .mobile-bubble {
        display: none;
    }
}
.discount-widget {
    position: relative;
}
/* Bezugspunkt für absolute Elemente im Widget */
.discount-widget {
    position: relative;
    width: 100%;
}

/* Bubble links und kleiner */
.mobile-bubble {
    position: absolute;
    top: -6px;
    left: 6px;
    font-size: .75rem;
    padding: 2px 6px;
    background: #009d39;
    color: #fff;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 60;
}

/* Tooltip Panel relativ zum Icon */
.tooltip-panel {
    position: absolute;
    top: 120%;
    left: 0;
    transform: translateY(6px);
    z-index: 70;
}

/* Produktkarte: volle Spaltenbreite nutzen und optisch größer */
.product-card {
    width: 100%;
    box-sizing: border-box;
    padding: 1rem;
}

/* Auf großen Bildschirmen etwas mehr Innenabstand, damit Karte breiter wirkt */
@media (min-width: 1200px) {
    .product-card {
        padding: 1.25rem 1.5rem;
    }
}

/* Produktbild kompakt halten */
.product-thumb {
    width: 120px !important;
    height: 120px !important;
    flex: 0 0 120px !important;
}

/* Bezugspunkt für absolute Elemente im Widget */
.discount-widget {
    position: relative;
    width: 100%;
}

/* Bubble links und kleiner */
.mobile-bubble {
    position: absolute;
    top: -6px;
    left: 6px;
    font-size: .75rem;
    padding: 2px 6px;
    background: #009d39;
    color: #fff;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 60;
}

/* Tooltip Panel relativ zum Icon */
.tooltip-panel {
    position: absolute;
    top: 120%;
    left: 0;
    transform: translateY(6px);
    z-index: 70;
}

/* --- Konsolidiertes Widget Styling --- */

/* Desktop: fixed, Mobile: normal flow */
@media (min-width: 992px) {
    #discount-widget-wrapper.fixed-left {
        position: fixed !important;
        width: 180px;
        z-index: 2147483000;
        box-shadow: 0 6px 18px rgba(0,0,0,0.08);
        pointer-events: auto;
    }
}

@media (max-width: 991.98px) {
    #discount-widget-wrapper.fixed-left {
        position: static !important;
        width: 100%;
        margin-bottom: 1rem;
    }
}

/* Sicherstellen, dass Tooltip/Bubble oben liegen */
#discount-widget-wrapper .discount-widget,
#discount-widget-wrapper .mobile-bubble,
#discount-widget-wrapper .tooltip-panel {
    z-index: 2147483001;
}

/* Fallback: entferne sticky-Regeln, damit keine Konflikte entstehen */
#discount-widget-wrapper {
    position: static !important;
}

    /* Bubble kompakt links */
    #discount-widget-wrapper .mobile-bubble {
        position: absolute;
        top: -6px;
        left: 6px;
        font-size: .75rem;
        padding: 2px 6px;
        background: #009d39;
        color: #fff;
        border-radius: 4px;
        white-space: nowrap;
        z-index: 2147483002;
    }

/* Produktkarte: volle Spaltenbreite nutzen */
.product-card {
    width: 100%;
    box-sizing: border-box;
    padding: 1rem;
}

@media (min-width: 1200px) {
    .product-card {
        padding: 1.25rem 1.5rem;
    }
}

/* Produktbild kompakt halten */
.product-thumb {
    width: 120px !important;
    height: 120px !important;
    flex: 0 0 120px !important;
}
