/**
 * WooCommerce Bundle Discount - Frontend Styles
 * Navy Blue Minimal Design
 */

/* ========================
   Contextual Hiding
   ======================== */

/* Hide Bundle Discount in Quick View / Lightbox / Popups */
.sticky-add-to-cart .wbd-discount-box,
.sticky-add-to-cart--active .wbd-discount-box,
.sticky-add-to-cart-wrapper .wbd-discount-box,
.sticky-atc .wbd-discount-box,
.floating-add-to-cart .wbd-discount-box,
.fixed-add-to-cart .wbd-discount-box,
.sticky-cart .wbd-discount-box,
.wd-sticky-btn .wbd-discount-box,
.wd-sticky-btn-container .wbd-discount-box,
.ecomus-sticky-add-to-cart .wbd-discount-box,
.ecomus-sticky-atc__content .wbd-discount-box,
.product-quickadd .wbd-discount-box,
.quick-view .wbd-discount-box,
.quickview .wbd-discount-box,
.quick-add .wbd-discount-box,
.product-quick-view .wbd-discount-box,
.wd-popup .wbd-discount-box,
.popup-quick-view .wbd-discount-box,
.single-product-content .wbd-discount-box,
.product-lightbox .wbd-discount-box,
.product-lightbox-inner .wbd-discount-box,
.mfp-content .wbd-discount-box,
.lightbox-content .wbd-discount-box {
  display: none !important;
}

/* ========================
   Bundle Discount Box
   ======================== */

.wbd-discount-box {
    background: transparent;
    border: 1px solid #1e3a8a;
    border-radius: 6px;
    margin: 12px 0;
    overflow: hidden;
    box-shadow: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.wbd-discount-box:hover {
    transform: translateY(-2px);
    border-color: #1e40af;
    box-shadow: 0 4px 16px rgba(30, 58, 138, 0.15);
}

/* Header */
.wbd-box-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    background: transparent;
    border-bottom: 1px solid #1e3a8a;
}

.wbd-icon {
    color: #1e3a8a;
    flex-shrink: 0;
    width: 14px;
    height: 14px;
}

.wbd-header-text {
    color: #1e3a8a;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Tiers Container */
.wbd-tiers {
    padding: 4px;
    background: transparent;
}

/* Individual Tier */
.wbd-tier {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    margin: 2px;
    background: transparent;
    border: 1px solid #1e3a8a;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.wbd-tier::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #1e3a8a;
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.wbd-tier:hover {
    transform: translateX(4px);
    border-color: #1e40af;
    box-shadow: 0 2px 12px rgba(30, 58, 138, 0.1);
}

.wbd-tier:hover::before {
    transform: scaleY(1);
}

.wbd-tier.wbd-active {
    background: transparent;
    border: 3px solid #1e3a8a;
}

.wbd-tier.wbd-active::before {
    transform: scaleY(1);
    width: 6px;
}

/* Left Side */
.wbd-tier-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wbd-qty-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 6px;
    background: transparent;
    border: 1px solid #1e3a8a;
    border-radius: 4px;
    box-shadow: none;
    flex-shrink: 0;
}

.wbd-qty-num {
    font-size: 14px;
    font-weight: 700;
    color: #1e3a8a;
    line-height: 1;
}

.wbd-qty-plus {
    font-size: 10px;
    font-weight: 600;
    color: #1e3a8a;
    margin-left: 1px;
}

.wbd-tier-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
}

.wbd-tier-label {
    font-size: 11px;
    font-weight: 600;
    color: #1e3a8a;
    line-height: 1.2;
}

.wbd-discount-tag {
    display: inline-block;
    padding: 2px 6px;
    background: transparent;
    border: 1px solid #1e3a8a;
    color: #1e3a8a;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

/* Right Side */
.wbd-tier-right {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.wbd-price-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
}

.wbd-price-new {
    font-size: 13px;
    font-weight: 700;
    color: #1e3a8a;
    line-height: 1;
}

.wbd-price-new .woocommerce-Price-amount {
    font-weight: 700;
}

.wbd-price-old {
    font-size: 10px;
    color: #6b7280;
    text-decoration: line-through;
    line-height: 1;
}

.wbd-save-amount {
    font-size: 9px;
    font-weight: 600;
    color: #1e3a8a;
    padding: 2px 5px;
    background: transparent;
    border: 1px solid #1e3a8a;
    border-radius: 3px;
    white-space: nowrap;
}

/* Footer */
.wbd-box-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 10px;
    background: transparent;
    border-top: 1px solid #1e3a8a;
}

.wbd-footer-icon {
    color: #1e3a8a;
    flex-shrink: 0;
    width: 10px;
    height: 10px;
}

.wbd-box-footer span {
    font-size: 9px;
    color: #1e3a8a;
    font-weight: 500;
    letter-spacing: 0.1px;
}

/* ========================
   Mini Cart Discount
   ======================== */

.wbd-mini-cart-discount {
    padding: 12px;
    margin: 10px;
    background: transparent;
    border: 2px solid #1e3a8a;
    border-radius: 10px;
}

.wbd-mini-cart-title {
    font-size: 12px;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wbd-discount-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #1e3a8a;
}

.wbd-discount-line:last-child {
    border-bottom: none;
}

.wbd-discount-label {
    font-size: 12px;
    font-weight: 600;
    color: #1e3a8a;
}

.wbd-discount-amount {
    font-size: 14px;
    font-weight: 800;
    color: #1e3a8a;
}

/* ========================
   Responsive Design
   ======================== */

@media screen and (max-width: 768px) {
    .wbd-discount-box {
        margin: 10px 15px;
        border-radius: 5px;
    }

    .wbd-box-header {
        padding: 6px 10px;
    }

    .wbd-header-text {
        font-size: 11px;
    }

    .wbd-tier {
        padding: 5px 8px;
    }

    .wbd-tier-left {
        gap: 6px;
    }

    .wbd-qty-badge {
        min-width: 28px;
        height: 28px;
    }

    .wbd-qty-num {
        font-size: 13px;
    }

    .wbd-qty-plus {
        font-size: 9px;
    }

    .wbd-tier-label {
        font-size: 10px;
    }

    .wbd-discount-tag {
        font-size: 8px;
        padding: 2px 5px;
    }

    .wbd-price-new {
        font-size: 12px;
    }

    .wbd-price-old {
        font-size: 9px;
    }

    .wbd-save-amount {
        font-size: 8px;
    }

    .wbd-box-footer {
        padding: 5px 8px;
    }

    .wbd-box-footer span {
        font-size: 8px;
    }
}

@media screen and (max-width: 480px) {
    .wbd-discount-box {
        margin: 8px 10px;
        border-radius: 4px;
    }

    .wbd-box-header {
        padding: 5px 8px;
        gap: 4px;
    }

    .wbd-icon {
        width: 12px;
        height: 12px;
    }

    .wbd-header-text {
        font-size: 10px;
    }

    .wbd-tier {
        padding: 4px 6px;
        gap: 6px;
    }

    .wbd-tier-left {
        gap: 6px;
    }

    .wbd-qty-badge {
        min-width: 26px;
        height: 26px;
    }

    .wbd-qty-num {
        font-size: 12px;
    }

    .wbd-qty-plus {
        font-size: 8px;
    }

    .wbd-tier-label {
        font-size: 9px;
    }

    .wbd-discount-tag {
        font-size: 8px;
        padding: 1px 4px;
    }

    .wbd-price-new {
        font-size: 11px;
    }

    .wbd-price-old {
        font-size: 9px;
    }

    .wbd-save-amount {
        font-size: 8px;
        padding: 1px 4px;
    }

    .wbd-box-footer {
        padding: 4px 6px;
    }

    .wbd-footer-icon {
        width: 9px;
        height: 9px;
    }

    .wbd-box-footer span {
        font-size: 8px;
    }
}

/* ========================
   Animation
   ======================== */

@keyframes wbdPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.wbd-tier.wbd-active .wbd-qty-badge {
    animation: wbdPulse 2s ease-in-out infinite;
}

/* ========================
   Cart Page Integration
   ======================== */

.woocommerce-cart .wbd-mini-cart-discount,
.woocommerce-checkout .wbd-mini-cart-discount {
    max-width: 400px;
}
