/**
 * Vitalshop Discount Tool - Frontend Styles
 * 
 * @package VitalshopDiscountTool
 * @version 1.0.0
 */

/* ==========================================================================
   Discount Badges
   ========================================================================== */

.vdt-badge-container {
    position: relative;
    margin: 15px 0;
}

.vdt-quantity-badge,
.vdt-vitalratgeber-badge,
.vdt-cart-discount-badge {
    display: none !important;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 600;
    color: white;
    margin: 10px 0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.vdt-quantity-badge {
    background: #0073aa;
}

.vdt-vitalratgeber-badge {
    background: linear-gradient(135deg, #8e44ad 0%, #3498db 100%);
    box-shadow: 0 4px 12px rgba(142, 68, 173, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
    animation: vdt-pulse-glow 2s infinite;
}

.vdt-vitalratgeber-badge {
    background: linear-gradient(135deg, #8e44ad 0%, #3498db 100%);
    box-shadow: 0 4px 12px rgba(142, 68, 173, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
    animation: vdt-pulse-glow 2s infinite;
}

/* Cart Discount Badge Styles */
.vdt-cart-discount-badge {
    display: flex !important;
    flex-direction: column;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    animation: vdt-pulse-glow 2s infinite;
}

.vdt-cart-discount-badge.vdt-cart-theme-green {
    background: linear-gradient(135deg, #e5f3e9 0%, #67AC9F 100%);
    border: 2px solid #67AC9F;
    color: #2E2E2D;
}

.vdt-cart-discount-badge.vdt-cart-theme-red {
    background: linear-gradient(135deg, #ffe5e5 0%, #d65565 100%);
    border: 2px solid #d65565;
    color: #2E2E2D;
}

.vdt-cart-discount-badge.vdt-cart-theme-black {
    background: linear-gradient(135deg, #2E2E2D 0%, #575757 100%);
    border: 2px solid #2E2E2D;
    color: #ffffff;
}

.vdt-cart-badge-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.vdt-cart-badge-title {
    font-size: 16px;
    font-weight: 700;
}

.vdt-cart-badge-period {
    font-size: 13px;
    opacity: 0.9;
    font-weight: 500;
}

.vdt-cart-tier-section {
    margin-top: 12px;
}

.vdt-cart-tier-boxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin: 12px 0;
}

.vdt-cart-tier-box {
    position: relative;
    background: #E8E7DF;
    border: 1px solid #C6C6C6;
    border-radius: 10px;
    padding: 16px 12px 14px 12px;
    text-align: center;
    transition: background-color .2s ease, box-shadow .2s ease, transform .1s ease;
}

.vdt-cart-tier-box.active {
    background: #ffffff;
    border-color: #67AC9F;
    border-width: 2px;
    box-shadow: 0 4px 12px rgba(103, 172, 159, 0.2);
    animation: vdt-pulse-active 2s infinite;
}

.vdt-cart-tier-box.reached {
    background: #e5f3e9;
    opacity: 0.7;
}

.vdt-cart-tier-box-label {
    font-size: 14px;
    color: #575757;
    margin-bottom: 8px;
    font-weight: 500;
}

.vdt-cart-tier-box-discount {
    font-size: 18px;
    font-weight: 700;
    color: #2E2E2D;
    margin: 8px 0;
}

.vdt-cart-tier-box-amount {
    font-size: 12px;
    color: #2E2E2D;
    font-weight: 400;
}

.vdt-cart-badge-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    font-size: 13px;
    color: #2E2E2D;
}

.vdt-cart-badge-info .dashicons {
    flex-shrink: 0;
    font-size: 18px;
}

/* Slide-in Cart Progress Styles */
.vdt-slide-cart-discount-progress {
    /* Inline styles in PHP for dynamic theming */
}

.vdt-slide-discount-header {
    /* Inline styles in PHP */
}

.vdt-slide-progress-bar {
    /* Inline styles in PHP */
}

.vdt-slide-progress-fill {
    animation: vdt-progress-shine 2s infinite;
}

@keyframes vdt-progress-shine {
    0% { transform: translateX(-100%); opacity: 0.3; }
    50% { opacity: 0.6; }
    100% { transform: translateX(100%); opacity: 0.3; }
}

@keyframes vdt-pulse-glow {
    0%, 100% { 
        box-shadow: 0 4px 12px rgba(142, 68, 173, 0.3);
    }
    50% { 
        box-shadow: 0 6px 20px rgba(142, 68, 173, 0.5);
    }
}

.vdt-badge-icon {
    font-size: 1.2em;
}

.vdt-badge-text {
    font-weight: 700;
    display: none !important;
}

/* Badge positions for product images */
.vdt-badge-top_left {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
}

.vdt-badge-top_right {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

.vdt-badge-bottom_left {
    position: absolute;
    bottom: 10px;
    left: 10px;
    z-index: 10;
}

.vdt-badge-bottom_right {
    display: none !important;
    position: absolute;
    bottom: 10px;
    right: 10px;
    z-index: 10;
}

/* Shop page specific badges */
.vdt-shop-badge {
    position: absolute !important;
    top: 10px;
    right: 10px;
    z-index: 10;
    padding: 6px 10px;
    font-size: 0.8em;
    border-radius: 6px;
}

.vdt-context-shop {
    font-size: 0.8em;
    padding: 6px 10px;
}

/* ==========================================================================
   Multi-Tier Progress Indicators
   ========================================================================== */

.vdt-multi-tier-progress {
    margin: 15px 0;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid #dee2e6;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.vdt-multi-tier-progress.vdt-updating {
    background: linear-gradient(135deg, #fff3cd 0%, #ffffff 100%);
    border-color: #ffeaa7;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.2);
}

.vdt-multi-tier-progress.vdt-updated {
    background: linear-gradient(135deg, #d4edda 0%, #ffffff 100%);
    border-color: #c3e6cb;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
}

.vdt-tier-progress-container {
    width: 100%;
}

.vdt-tier-progress-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-weight: 600;
    color: #495057;
}

.vdt-progress-icon {
    font-size: 1.4em;
}

.vdt-progress-title {
    font-size: 1.1em;
}

/* Tier Progress Track */
.vdt-tier-progress-track {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 20px 0;
    position: relative;
}

.vdt-tier-milestone {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    z-index: 2;
}

.vdt-tier-dot {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e9ecef;
    border: 3px solid #dee2e6;
    font-weight: bold;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.vdt-tier-milestone.reached .vdt-tier-dot {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border-color: #28a745;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.vdt-tier-milestone.active .vdt-tier-dot {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border-color: #007bff;
    color: white;
    animation: vdt-pulse-active 2s infinite;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
}

.vdt-tier-milestone.current .vdt-tier-dot {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    border-color: #ffc107;
    color: #212529;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

@keyframes vdt-pulse-active {
    0%, 100% { 
        transform: scale(1.1);
        box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
    }
    50% { 
        transform: scale(1.2);
        box-shadow: 0 6px 16px rgba(0, 123, 255, 0.6);
    }
}

.vdt-tier-dot .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    line-height: 1;
}

.vdt-tier-number {
    font-size: 0.9em;
    font-weight: bold;
}

/* Tier Info */
.vdt-tier-info {
    margin-top: 12px;
    text-align: center;
    font-size: 0.85em;
}

.vdt-tier-qty {
    font-weight: 600;
    color: #495057;
    margin-bottom: 2px;
}

.vdt-tier-discount {
    color: #28a745;
    font-weight: bold;
    font-size: 0.9em;
}

.vdt-tier-milestone.reached .vdt-tier-discount {
    color: #155724;
}

.vdt-tier-milestone.active .vdt-tier-discount {
    color: #004085;
}

/* Tier Connectors */
.vdt-tier-connector {
    position: absolute;
    top: 25px;
    left: calc(50% + 25px);
    right: calc(-50% + 25px);
    height: 4px;
    background: #dee2e6;
    z-index: 1;
    transition: all 0.3s ease;
}

.vdt-tier-connector.completed {
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
}

/* Status Messages */
.vdt-tier-status {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
}

.vdt-current-status,
.vdt-next-status,
.vdt-max-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
    font-size: 0.95em;
}

.vdt-current-status {
    color: #155724;
    background: rgba(40, 167, 69, 0.1);
    padding: 8px 12px;
    border-radius: 6px;
    border-left: 4px solid #28a745;
}

.vdt-next-status {
    color: #004085;
    background: rgba(0, 123, 255, 0.1);
    padding: 8px 12px;
    border-radius: 6px;
    border-left: 4px solid #007bff;
}

.vdt-max-status {
    color: #721c24;
    background: rgba(220, 53, 69, 0.1);
    padding: 8px 12px;
    border-radius: 6px;
    border-left: 4px solid #dc3545;
}

.vdt-status-icon {
    font-size: 1.2em;
}

/* Cart Info Display */
.vdt-cart-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
    padding: 6px 10px;
    background: rgba(108, 117, 125, 0.1);
    border-radius: 4px;
    border-left: 3px solid #6c757d;
    font-size: 0.9em;
    color: #6c757d;
}

/* ==========================================================================
   Dynamic Pricing Display
   ========================================================================== */

.vdt-price-container {
    display: inline-block;
}

.vdt-original-price {
    text-decoration: line-through;
    color: #999;
    font-size: 16px !important;
    margin-right: 0px;
    line-height: 1.1 !important;
}

.vdt-original-prefix {
    text-decoration: none !important;
    color: #2e2e2d;
    font-size: 16px;
    margin-right: 6px;
    line-height: 1.1 !important;
}

.vdt-discounted-price {
    color: #28a745;
    font-weight: bold;
    font-size: 1.1em;
}

/* Auf der Single-Product nur für den rabattierten Preis eine größere Zeilenhöhe */
.single-product .vdt-discounted-price {
    line-height: 49px !important;
}

.vdt-price-suffix {
    color: #666;
    font-size: 0.85em;
    margin-left: 4px;
}

.vdt-discount-info {
    display: inline !important;
    color: #2e2e2d !important;
    font-size: 0.9em !important;
    font-weight: 600 !important;
    line-height: 1.1 !important;
    margin: 0 6px 0 6px !important;
    text-align: right !important;
}

/* Single Product Page Price Integration */
.single-product .vdt-price-container {
    display: block;
    margin: 0px 0;
    line-height: 1.1 !important; /* neutraler Container */
    text-align: right !important; /* alles rechtsbündig */
    width: 100% !important;
}

.single-product .vdt-price-container .vdt-original-price {
    /* Überschreibt alte Theme-Regeln mit !important */
    display: inline !important; /* mit Prefix in einer Zeile */
    margin-bottom: 0 !important;
    text-align: right !important;
    color: #2e2e2e !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 1.1 !important;
    margin-right: 0 !important; /* kein zusätzlicher Abstand rechts */
}

/* Höhere Spezifität, um Theme-Regel zu übersteuern */
.single-product .product-summary .price .vdt-price-container .vdt-original-price {
    margin-right: 0 !important;
}

.single-product .vdt-price-container .vdt-original-prefix {
    display: inline !important;
}

.single-product .vdt-discounted-price {
    font-size: 1.3em;
    display: block;
    margin-bottom: 2px;
    text-align: right !important;
}

.single-product .vdt-discount-info {
    margin-top: 0px !important;
    font-size: 16px !important;
    display: block !important; /* verhindert Überlauf als inline */
    width: 100% !important;
    max-width: 100% !important;
    margin-right: 0 !important;
    padding-right: 0 !important;
    text-align: right !important;
    box-sizing: border-box;
}

.single-product .vdt-discount-info .vdt-discount-info-inner {
    display: inline-flex !important;
    justify-content: flex-end !important;
    width: 100%;
}

/* Abstand rechts für Beträge (vdt-amount) */
/* Rechter Abstand NUR in der Ersparnis-Zeile, nicht beim Hauptpreis */
.single-product .product-summary .price .vdt-price-container .vdt-discount-info .vdt-amount {
    margin-right: 8px !important;
}

/* Animation for price changes */
.vdt-price-container {
    transition: all 0.3s ease;
}

.vdt-price-updating {
    animation: vdt-price-pulse 0.6s ease;
}

@keyframes vdt-price-pulse {
    0% { 
        transform: scale(1);
        background: transparent;
    }
    50% { 
        transform: scale(1.02);
        background: rgba(40, 167, 69, 0.1);
    }
    100% { 
        transform: scale(1);
        background: transparent;
    }
}

/* ==========================================================================
   Legacy Progress Indicators (for compatibility)
   ========================================================================== */

.vdt-progress-indicator {
    margin: 15px 0;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    transition: all 0.3s ease;
}

/* ==========================================================================
   Quantity Deal Boxes (new UI)
   ========================================================================== */

.vdt-qty-section {
    margin: 18px 0 6px 0;
}

.vdt-qty-separator {
    height: 1px;
    background: #e0e0e0;
    margin-bottom: 12px;
}

.vdt-qty-headline {
    font-size: 14px;
    color: #2E2E2D;
    margin-bottom: 24px;
    font-weight: 500;
}

.vdt-qty-boxes {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.vdt-qty-box {
    position: relative;
    background: #E8E7DF;
    border: 1px solid #C6C6C6;
    border-radius: 10px;
    padding: 16px 12px 14px 12px;
    text-align: center;
    cursor: pointer;
    transition: background-color .2s ease, box-shadow .2s ease, transform .1s ease;
}
.vdt-qty-box.vdt-disabled {
    opacity: .6;
    cursor: default;
}

.vdt-qty-box:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,.08);
    transform: translateY(-1px);
    background: #e5f3e9; /* helles Grün bei Hover */
}

/* Loading State: verhindert Doppelklicks und zeigt Spinner */
.vdt-qty-section.vdt-loading .vdt-qty-box { pointer-events: none; }
.vdt-qty-box.vdt-is-loading { opacity: .9; }
/* Overlay unter dem Spinner */
.vdt-qty-box.vdt-is-loading::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.55);
    border-radius: 10px;
    z-index: 5;
}
/* Spinner über allem (auch Tooltip) */
.vdt-qty-box.vdt-is-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 22px;
    height: 22px;
    margin: -11px 0 0 -11px;
    border: 2px solid #67AC9F;
    border-top-color: transparent;
    border-radius: 50%;
    animation: vdt-spin .6s linear infinite;
    z-index: 7;
}
@keyframes vdt-spin { to { transform: rotate(360deg); } }

.vdt-qty-box.reached {
    background: #e5f3e9; /* leichtes Grün */
}

.vdt-qty-box-qty {
    padding-top: 8px;
    font-size: 16px;
    color: #575757;
    margin-bottom: 8px;
}

.vdt-qty-box-divider {
    height: 2px;
    background: #ffffff;
    margin: 6px 0 10px 0;
}

.vdt-qty-box-price {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #2E2E2D !important;
}
.vdt-qty-box-price .woocommerce-Price-amount.amount,
.vdt-qty-box-price .woocommerce-Price-amount.amount bdi,
.vdt-qty-box-price .woocommerce-Price-amount.amount .woocommerce-Price-currencySymbol {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #2E2E2D !important;
    line-height: 1.2 !important;
}

.vdt-qty-box-sub {
    margin-top: 2px;
    font-size: 12px;
    font-weight: 400;
    color: #2E2E2D;
}

/* Nur der Preis vor "pro Stück" innerhalb der Sub-Zeile */
.vdt-qty-box-sub .woocommerce-Price-amount.amount,
.vdt-qty-box-sub .woocommerce-Price-amount.amount bdi,
.vdt-qty-box-sub .woocommerce-Price-amount.amount .woocommerce-Price-currencySymbol {
    font-size: 12px !important;
    font-weight: 600 !important;
}

/* Tooltip für Mengenboxen */
.vdt-qty-tooltip {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 10px;
    transform: translateY(10px);
    opacity: 0;
    pointer-events: none;
    background: #E6F2ED; /* kräftigeres, helles Grün */
    border: 1px solid #67AC9F;
    box-shadow: 0 6px 18px rgba(0,0,0,.12);
    color: #2E2E2D;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    padding: 10px 12px;
    border-radius: 10px;
    z-index: 5;
    text-align: center;
    transition: opacity .18s ease, transform .18s ease;
}

.vdt-qty-box:hover .vdt-qty-tooltip {
    opacity: 1;
    transform: translateY(0);
}

/* Tooltip während des Ladevorgangs ausblenden, damit Spinner sichtbar bleibt */
.vdt-qty-box.vdt-is-loading .vdt-qty-tooltip { opacity: 0 !important; }

/* Spinner für Add-to-Cart Button, wenn Klasse vdt-loading gesetzt ist */
.single_add_to_cart_button.vdt-loading { position: relative; pointer-events: none; }
.single_add_to_cart_button.vdt-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px; height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: vdt-spin .6s linear infinite;
}

/* kleiner Pfeil am Tooltip */
.vdt-qty-box:hover .vdt-qty-tooltip::before {
    content: "";
    position: absolute;
    left: 24px;
    bottom: -7px;
    width: 12px;
    height: 12px;
    background: #E6F2ED;
    border-left: 1px solid #67AC9F;
    border-bottom: 1px solid #67AC9F;
    transform: rotate(45deg);
}

/* Top tags */
.vdt-qty-tag {
    position: absolute;
    left: 12px;
    right: 12px;
    transform: translateY(-60%);
    top: 0;
    display: flex;
    justify-content: center; /* sorgt für gleichen Abstand links/rechts */
    align-items: center;
    gap: 0; /* kein Abstand zwischen Icon und Pill */
    height: 22px;
    min-height: 22px;
    padding: 0; /* Padding übernimmt die Pill selbst */
    border-radius: 10px;
    box-sizing: border-box;
    white-space: nowrap;
    z-index: 3;
}

.vdt-qty-tag--bestseller {
    --vdt-tag-bg: #67AC9F;
    padding-left: 0px;
    padding-right: 12px;
}

.vdt-qty-tag--bestprice {
    --vdt-tag-bg: #C9A000;
    padding-left: 0px;
    padding-right: 12px;
}

.vdt-qty-tag-text {
    display: inline-block;
    font-size: 14px;
    line-height: 22px; /* exakt Tag-Höhe, damit vertikal mittig */
    font-weight: 400;
    background-color: var(--vdt-tag-bg, transparent);
    color: #fff;
    padding: 0 12px 0 24px; /* zusätzlicher Innenabstand links */
    border-radius: 10px;
    margin-left: -12px; /* Pill ragt unter das Icon */
    position: relative;
    z-index: 1; /* unter dem Icon */
}

.vdt-qty-tag-icon svg {
    display: block;
    width: 30px;
    height: 30px; /* größer als die 22px hohe Tag-Box */
    margin-top: 0;
    margin-left: 0;
}

/* Support external <img> icons equally */
.vdt-qty-tag-icon img {
    display: block;
    width: 30px !important;
    height: 30px !important;
}

/* Prevent theme rules from shrinking images */
.vdt-qty-tag-icon { flex: 0 0 auto; line-height: 0; position: relative; z-index: 2; }
.vdt-qty-tag-icon + .vdt-qty-tag-text { display: inline-block; }

/* Ensure zero margins for specific tags (explicit override) */
.vdt-qty-tag--bestseller .vdt-qty-tag-icon svg,
.vdt-qty-tag--bestprice .vdt-qty-tag-icon svg {
    margin-top: 0;
    margin-left: 0;
}

@media (max-width: 640px) {
    .vdt-qty-boxes { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Add to cart button layout (single product)
   - Border radius 10px
   - Button füllt Restbreite neben .quantity
   ========================================================================== */

.single-product form.cart {
    display: flex;
    align-items: stretch;
    gap: 0; /* individueller Abstand über Elemente */
    flex-wrap: nowrap;
    justify-content: flex-end; /* rechts ausrichten */
}

.single-product form.cart .quantity { flex: 0 0 0px; margin-right: 12px; }

.single-product form.cart .single_add_to_cart_button {
    flex: 0 0 auto !important; /* nur Eigenbreite, rechts neben Quantity */
    width: auto;
    margin-left: 0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-direction: row-reverse; /* nutzt ::after-Icon links vom Text */
}

/* Noch spezifischer – falls Variations-Wrapper dazwischen liegt */
.single-product .product-summary form.cart .single_add_to_cart_button,
.single-product .single_variation_wrap .woocommerce-variation-add-to-cart .single_add_to_cart_button {
    margin-left: 0 !important;
    flex: 0 0 auto !important;
}

.single-product form.cart .single_add_to_cart_button::after {
    margin: 0; /* evtl. Theme-Margin entfernen, damit Icon eng am Text steht */
}

/* Variation layout wrapper can introduce inner containers; keep rule robust */
.single-product .single_variation_wrap .single_add_to_cart_button {
    border-radius: 10px;
}

/* Variations-Wrapper nebeneinander wie im einfachen Formular */
.single-product .single_variation_wrap .woocommerce-variation-add-to-cart {
    display: flex;
    align-items: stretch;
    gap: 0;
    justify-content: flex-end;
}
.single-product .single_variation_wrap .woocommerce-variation-add-to-cart .quantity { flex: 0 0 0px; margin-right: 12px; }
.single-product .single_variation_wrap .woocommerce-variation-add-to-cart .single_add_to_cart_button { flex: 0 0 auto !important; margin-left: 0; }

.vdt-progress-bar {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
    position: relative;
}

.vdt-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0073aa 0%, #005a87 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
}

.vdt-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.2) 50%, transparent 100%);
    animation: vdt-progress-shine 2s infinite;
}

@keyframes vdt-progress-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.vdt-progress-text {
    font-size: 0.9em;
    color: #6c757d;
    font-weight: 500;
}

/* ==========================================================================
   Cart & Checkout Displays
   ========================================================================== */

.vdt-discount-row th,
.vdt-discount-row td {
    border-top: 1px solid #dee2e6;
    padding: 10px 0;
}

.vdt-discount-amount {
    color: #2e2e2e !important;
    font-weight: bold;
    font-size: 1.1em;
}

.vdt-discount-heading {
    font-size: 1.05em;
    font-weight: 700;
    color: #2e2e2e;
}

.vdt-discount-note {
    font-size: 0.9em;
    color: #555555;
    line-height: 1.4;
    margin-top: 4px;
}

.vdt-cart-progress-row td {
    padding: 15px 0;
}

.vdt-cart-progress-notice {
    background: linear-gradient(135deg, #e8f4f8 0%, #f0f8ff 100%);
    border: 2px solid #0073aa;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.vdt-cart-progress-notice::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    animation: vdt-cart-shine 3s infinite;
}

@keyframes vdt-cart-shine {
    0% { left: -100%; }
    100% { left: 100%; }
}

.vdt-progress-container {
    margin-bottom: 15px;
}

.vdt-cart-progress-notice .vdt-progress-bar {
    height: 12px;
    background: rgba(0, 115, 170, 0.2);
    border-radius: 6px;
    margin-bottom: 15px;
}

.vdt-cart-progress-notice .vdt-progress-fill {
    background: linear-gradient(90deg, #0073aa 0%, #00a0d2 100%);
    height: 12px;
}

.vdt-progress-icon {
    font-size: 1.3em;
    margin-right: 8px;
}

.vdt-cart-progress-notice p {
    margin: 0;
    font-size: 1.1em;
    font-weight: 600;
    color: #0073aa;
}

/* ==========================================================================
   Black Week Rosa Box (Produktseite)
   ========================================================================== */

.vdt-cart-black-week-box {
    background: #B87AA8;
    border-radius: 12px;
    padding: 32px 24px;
    margin: 20px 0;
    text-align: center;
    color: #ffffff;
}

.vdt-cart-black-week-box .vdt-bw-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    display: block;
    filter: brightness(0) invert(1);
}

.vdt-cart-black-week-box .vdt-bw-title {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
    line-height: 1.4;
}

.vdt-cart-black-week-box .vdt-bw-action {
    font-size: 16px;
    font-weight: 400;
    color: #ffffff;
    margin-bottom: 10px;
    line-height: 1.5;
    opacity: 0.95;
}

.vdt-cart-black-week-box .vdt-bw-advantage {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 6px;
}

.vdt-cart-black-week-box .vdt-bw-percentage {
    font-size: 14px;
    color: #ffffff;
    margin-bottom: 18px;
    line-height: 1.4;
    opacity: 0.9;
}

.vdt-cart-black-week-box .vdt-bw-period {
    font-size: 14px;
    color: #ffffff;
    margin-bottom: 24px;
    opacity: 0.9;
}

/* Progress Bar Container */
.vdt-bw-progress-container {
    position: relative;
    margin: 32px 0 24px;
    padding: 0 8px;
}

.vdt-bw-progress-track {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.vdt-bw-progress-fill {
    height: 100%;
    background: #5A0050;
    border-radius: 10px;
    transition: width 0.4s ease;
}

/* Milestones (evenly distributed) */
.vdt-bw-milestones {
    position: relative;
    width: 100%;
    height: 80px;
    margin-top: 0; /* KEIN Abstand zur Progress Bar */
}

.vdt-bw-milestone {
    position: absolute;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    top: -4px; /* SVG ragt direkt an Progress Bar */
}

/* SVG Icon statt Dot */
.vdt-bw-milestone-icon {
    width: 15px !important;
    height: auto !important;
    display: block;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.vdt-bw-milestone-label {
    font-size: 12px;
    color: #ffffff !important;
    font-weight: 400;
    white-space: nowrap;
    margin-bottom: 4px;
    margin-top: 4px;
}

.vdt-bw-milestone-percent {
    font-size: 14px;
    color: #ffffff !important;
    font-weight: 700;
}

.vdt-bw-milestone.reached .vdt-bw-milestone-percent {
    color: #5A0050 !important;
}

/* Remaining Text */
.vdt-bw-remaining {
    font-size: 16px;
    color: #ffffff !important;
    font-weight: 600;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
}

/* Override WooCommerce price styles in remaining text */
.vdt-bw-remaining .woocommerce-Price-amount,
.vdt-bw-remaining .amount,
.vdt-bw-remaining bdi,
.vdt-bw-remaining .woocommerce-Price-currencySymbol {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #ffffff !important;
}

/* Current Savings */
.vdt-bw-savings {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    margin-top: 20px;
}

.vdt-bw-savings-label {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
}

.vdt-bw-savings-amount {
    font-size: 28px;
    font-weight: 700;
    color: #5A0050;
}

.vdt-bw-savings-amount .woocommerce-Price-amount,
.vdt-bw-savings-amount .amount,
.vdt-bw-savings-amount bdi {
    font-size: 28px !important;
    font-weight: 700 !important;
    color: #5A0050 !important;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .vdt-quantity-badge,
    .vdt-vitalratgeber-badge {
        font-size: 0.8em;
        padding: 8px 12px;
        gap: 6px;
    }
    
    .vdt-shop-badge {
        font-size: 0.7em;
        padding: 4px 8px;
    }
    
    .vdt-badge-text {
        display: none !important;
    }
    
    .vdt-badge-icon {
        font-size: 1.4em;
    }
    
    .vdt-cart-progress-notice {
        padding: 15px;
        font-size: 0.9em;
    }
    
    .vdt-progress-indicator {
        padding: 10px;
    }
    
    /* Multi-Tier Progress Mobile */
    .vdt-multi-tier-progress {
        padding: 15px;
        margin: 10px 0;
    }
    
    .vdt-tier-progress-track {
        flex-direction: column;
        gap: 20px;
    }
    
    .vdt-tier-milestone {
        flex-direction: row;
        justify-content: flex-start;
        width: 100%;
        text-align: left;
    }
    
    .vdt-tier-dot {
        width: 40px;
        height: 40px;
        margin-right: 15px;
        flex-shrink: 0;
    }
    
    .vdt-tier-info {
        margin-top: 0;
        text-align: left;
        display: flex;
        flex-direction: column;
        gap: 2px;
    }
    
    .vdt-tier-connector {
        display: none;
    }
    
    .vdt-tier-status {
        font-size: 0.9em;
    }
    
    .vdt-current-status,
    .vdt-next-status,
    .vdt-max-status {
        padding: 6px 10px;
        font-size: 0.85em;
    }
    
    /* Dynamic Pricing Mobile */
    .single-product .vdt-price-container {
        margin: 15px 0;
    }

    /* Cart row rechts ausrichten (mobil) */
    .single-product form.cart { justify-content: flex-end; }
    
    .vdt-original-price {
        font-size: 0.85em;
        margin-right: 6px;
    }
    
    .vdt-discounted-price {
        font-size: 1.2em;
    }
    
    .vdt-discount-info {
        font-size: 12px !important;
        padding: 3px 6px !important;
        margin-top: 6px !important;
    }
}

@media (max-width: 480px) {
    .vdt-quantity-badge,
    .vdt-vitalratgeber-badge {
        font-size: 0.75em;
        padding: 6px 10px;
    }
    
    .vdt-cart-progress-notice p {
        font-size: 1em;
    }
    
    .vdt-progress-icon {
        font-size: 1.2em;
    }
    
    /* Dynamic Pricing Very Small Screens */
    .vdt-discount-info {
        font-size: 12px !important;
        padding: 2px 4px !important;
    }
    
    .single-product .vdt-discounted-price {
        font-size: 1.1em;
    }

    /* Cart & Button auf zwei Zeilen, rechts ausgerichtet */
    .single-product form.cart { flex-direction: column; align-items: flex-end; gap: 12px; }
    .single-product form.cart .quantity { margin-right: 0; }
}

/* ==========================================================================
   Animations & Interactions
   ========================================================================== */

.vdt-quantity-badge:hover,
.vdt-vitalratgeber-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.vdt-progress-indicator.vdt-updating {
    background: #fff3cd;
    border-color: #ffeaa7;
}

.vdt-progress-indicator.vdt-updated {
    background: #d4edda;
    border-color: #c3e6cb;
}

/* Loading states */
.vdt-loading {
    position: relative;
    opacity: 0.7;
}

.vdt-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: vdt-spin 1s linear infinite;
}

@keyframes vdt-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   Compatibility & Theme Integration
   ========================================================================== */

/* Ensure badges work with common themes */
.woocommerce ul.products li.product .vdt-shop-badge,
.woocommerce-page ul.products li.product .vdt-shop-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

/* Integration with WooCommerce notices */
.woocommerce-message.vdt-discount-applied {
    border-left-color: #28a745;
}

.vdt-discount-applied::before {
    content: '💰';
    margin-right: 8px;
}

/* Hide on print */
@media print {
    .vdt-quantity-badge,
    .vdt-vitalratgeber-badge,
    .vdt-progress-indicator,
    .vdt-cart-progress-notice {
        display: none !important;
    }
}

/* ==========================================================================
   Checkout Coupon Blocked Notice
   ========================================================================== */

/* Coupon blocked notice on checkout page - match content width */
.woocommerce-checkout .vdt-coupon-blocked-notice {
    border-radius: 10px !important;
    max-width: 1200px;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 20px;
    padding-right: 20px;
    box-sizing: border-box;
}

/* Mobile: Adjust padding */
@media (max-width: 768px) {
    .woocommerce-checkout .vdt-coupon-blocked-notice {
        padding-left: 16px;
        padding-right: 16px;
    }
}

@media (max-width: 520px) {
    .woocommerce-checkout .vdt-coupon-blocked-notice {
        padding-left: 12px;
        padding-right: 12px;
    }
}