/**
 * WooCommerce Bundle Discount - Frontend Styles
 * Modern Navy Blue Design with Enhanced Mobile Experience
 */

/* ========================
   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 rgba(30, 58, 138, 0.2);
    border-radius: 6px;
    margin: 16px 0;
    overflow: hidden;
    box-shadow: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wbd-discount-box:hover {
    transform: none;
    border-color: rgba(30, 58, 138, 0.35);
    box-shadow: none;
    background: rgba(30, 58, 138, 0.02);
}

/* Header */
.wbd-box-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    background: transparent;
    border-bottom: 1px solid rgba(30, 58, 138, 0.15);
}

.wbd-icon {
    color: rgba(30, 58, 138, 0.6);
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    transition: transform 0.3s ease;
}

.wbd-discount-box:hover .wbd-icon {
    transform: none;
    color: rgba(30, 58, 138, 0.8);
}

.wbd-header-text {
    color: rgba(30, 58, 138, 0.7);
    font-size: 11px;
    font-weight: 600;
    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;
    gap: 8px;
    padding: 6px 8px;
    margin: 2px;
    background: transparent;
    border: 1px solid rgba(30, 58, 138, 0.15);
    border-radius: 4px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.wbd-tier::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(30, 58, 138, 0.3);
    transform: scaleY(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wbd-tier:hover {
    transform: none;
    border-color: rgba(30, 58, 138, 0.25);
    box-shadow: none;
    background: rgba(30, 58, 138, 0.02);
}

.wbd-tier:hover::before {
    transform: scaleY(1);
}

.wbd-tier.wbd-active {
    background: rgba(30, 58, 138, 0.03);
    border: 1px solid rgba(30, 58, 138, 0.3);
    box-shadow: none;
}

.wbd-tier.wbd-active::before {
    transform: scaleY(1);
    width: 2px;
    background: rgba(30, 58, 138, 0.5);
}

/* Left Side */
.wbd-tier-left {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 1 auto;
    min-width: 0;
}

.wbd-qty-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 5px;
    background: transparent;
    border: 1px solid rgba(30, 58, 138, 0.2);
    border-radius: 4px;
    box-shadow: none;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.wbd-tier:hover .wbd-qty-badge {
    transform: none;
    box-shadow: none;
    border-color: rgba(30, 58, 138, 0.3);
}

.wbd-qty-num {
    font-size: 14px;
    font-weight: 800;
    color: #1e3a8a;
    line-height: 1;
}

.wbd-qty-plus {
    font-size: 10px;
    font-weight: 700;
    color: #1e3a8a;
    margin-left: 1px;
}

.wbd-tier-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    flex: 0 1 auto;
    min-width: 0;
    flex-wrap: nowrap;
}

.wbd-tier-label {
    font-size: 11px;
    font-weight: 600;
    color: #1e3a8a;
    line-height: 1.2;
    white-space: nowrap;
    flex-shrink: 0;
}

.wbd-discount-tag {
    display: inline-block;
    padding: 2px 5px;
    background: transparent;
    border: 1px solid rgba(30, 58, 138, 0.25);
    color: rgba(30, 58, 138, 0.8);
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1px;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: none;
    transition: all 0.3s ease;
}

.wbd-tier:hover .wbd-discount-tag {
    transform: none;
    box-shadow: none;
    border-color: rgba(30, 58, 138, 0.35);
    color: rgba(30, 58, 138, 0.9);
}

/* Right Side */
.wbd-tier-right {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    margin-left: auto;
}

.wbd-price-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.wbd-price-new {
    font-size: 13px;
    font-weight: 800;
    color: #1e3a8a;
    line-height: 1;
}

.wbd-price-new .woocommerce-Price-amount {
    font-weight: 800;
}

.wbd-price-old {
    font-size: 10px;
    color: #9ca3af;
    text-decoration: line-through;
    line-height: 1;
}

.wbd-save-amount {
    font-size: 9px;
    font-weight: 600;
    color: rgba(5, 150, 105, 0.8);
    padding: 2px 5px;
    background: transparent;
    border: 1px solid rgba(5, 150, 105, 0.25);
    border-radius: 3px;
    white-space: nowrap;
    box-shadow: none;
    transition: all 0.3s ease;
}

.wbd-tier:hover .wbd-save-amount {
    transform: none;
    box-shadow: none;
    border-color: rgba(5, 150, 105, 0.35);
    color: rgba(5, 150, 105, 0.9);
}

/* Footer */
.wbd-box-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 10px;
    background: transparent;
    border-top: 1px solid rgba(30, 58, 138, 0.1);
}

.wbd-footer-icon {
    color: rgba(30, 58, 138, 0.5);
    flex-shrink: 0;
    width: 11px;
    height: 11px;
}

.wbd-box-footer span {
    font-size: 9px;
    color: rgba(30, 58, 138, 0.6);
    font-weight: 500;
    letter-spacing: 0.1px;
}

/* ========================
   Mini Cart Discount
   ======================== */

.wbd-mini-cart-discount {
    padding: 8px 10px;
    margin: 8px 10px;
    background: transparent;
    border: 1px solid rgba(30, 58, 138, 0.2);
    border-radius: 4px;
    box-shadow: none;
}

.wbd-mini-cart-title {
    font-size: 11px;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.wbd-mini-cart-title svg {
    width: 12px;
    height: 12px;
}

.wbd-discount-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid rgba(30, 58, 138, 0.15);
}

.wbd-discount-line:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.wbd-discount-line:first-child {
    padding-top: 0;
}

.wbd-discount-label {
    font-size: 11px;
    font-weight: 600;
    color: #1e3a8a;
    line-height: 1.3;
}

.wbd-discount-amount {
    font-size: 13px;
    font-weight: 800;
    color: #1e3a8a;
    line-height: 1;
}

/* ========================
   Tablet Responsive (768px - 1024px)
   ======================== */

@media screen and (max-width: 1024px) and (min-width: 769px) {
    .wbd-discount-box {
        margin: 12px 0;
    }

    .wbd-tier {
        padding: 6px 8px;
        gap: 7px;
    }

    .wbd-qty-badge {
        min-width: 28px;
        height: 28px;
    }

    .wbd-qty-num {
        font-size: 13px;
    }

    .wbd-price-new {
        font-size: 12px;
    }
}

/* ========================
   Mobile Responsive (max-width: 768px)
   ======================== */

@media screen and (max-width: 768px) {
    .wbd-discount-box {
        margin: 10px 0;
        border-radius: 6px;
        border-width: 1.5px;
    }

    .wbd-box-header {
        padding: 8px 10px;
        gap: 6px;
    }

    .wbd-icon {
        width: 14px;
        height: 14px;
    }

    .wbd-header-text {
        font-size: 12px;
        letter-spacing: 0.3px;
    }

    .wbd-tiers {
        padding: 4px;
    }

    .wbd-tier {
        padding: 5px 6px;
        margin: 2px;
        gap: 6px;
    }

    .wbd-tier-left {
        gap: 5px;
        flex: 0 1 auto;
        min-width: 0;
    }

    .wbd-tier-right {
        gap: 5px;
        flex-shrink: 0;
    }

    .wbd-qty-badge {
        min-width: 26px;
        height: 26px;
        padding: 0 4px;
    }

    .wbd-qty-num {
        font-size: 13px;
    }

    .wbd-qty-plus {
        font-size: 10px;
    }

    .wbd-tier-label {
        font-size: 11px;
    }

    .wbd-discount-tag {
        font-size: 10px;
        padding: 2px 4px;
    }

    .wbd-price-new {
        font-size: 12px;
    }

    .wbd-price-old {
        font-size: 10px;
    }

    .wbd-save-amount {
        font-size: 9px;
        padding: 2px 4px;
    }

    .wbd-box-footer {
        padding: 7px 10px;
    }

    .wbd-footer-icon {
        width: 11px;
        height: 11px;
    }

    .wbd-box-footer span {
        font-size: 9px;
    }

    .wbd-mini-cart-discount {
        padding: 6px 8px;
        margin: 6px 8px;
    }

    .wbd-mini-cart-title {
        font-size: 11px;
        margin-bottom: 5px;
        gap: 3px;
    }

    .wbd-mini-cart-title svg {
        width: 11px;
        height: 11px;
    }

    .wbd-discount-line {
        padding: 3px 0;
    }

    .wbd-discount-label {
        font-size: 11px;
    }

    .wbd-discount-amount {
        font-size: 13px;
    }
}

/* ========================
   Small Mobile (max-width: 480px)
   ======================== */

@media screen and (max-width: 480px) {
    .wbd-discount-box {
        margin: 8px 0;
        border-radius: 5px;
    }

    .wbd-box-header {
        padding: 7px 8px;
        gap: 5px;
    }

    .wbd-icon {
        width: 12px;
        height: 12px;
    }

    .wbd-header-text {
        font-size: 11px;
    }

    .wbd-tiers {
        padding: 3px;
    }

    .wbd-tier {
        padding: 4px 5px;
        margin: 2px;
        gap: 4px;
    }

    .wbd-tier-left {
        gap: 4px;
        flex: 0 1 auto;
        min-width: 0;
    }

    .wbd-tier-right {
        gap: 4px;
        flex-shrink: 0;
        margin-left: auto;
    }

    .wbd-qty-badge {
        min-width: 24px;
        height: 24px;
        padding: 0 3px;
    }

    .wbd-qty-num {
        font-size: 12px;
    }

    .wbd-qty-plus {
        font-size: 9px;
    }

    .wbd-tier-info {
        gap: 3px;
        flex-wrap: nowrap;
        display: flex;
        flex-direction: row;
        align-items: center;
    }

    .wbd-tier-label {
        font-size: 10px;
        white-space: nowrap;
    }

    .wbd-discount-tag {
        font-size: 9px;
        padding: 1px 3px;
    }

    .wbd-price-group {
        gap: 3px;
        display: flex;
        flex-direction: row;
        align-items: center;
    }

    .wbd-price-new {
        font-size: 11px;
    }

    .wbd-price-old {
        font-size: 9px;
    }

    .wbd-save-amount {
        font-size: 8px;
        padding: 1px 3px;
    }

    .wbd-box-footer {
        padding: 7px 10px;
        gap: 5px;
    }

    .wbd-footer-icon {
        width: 10px;
        height: 10px;
    }

    .wbd-box-footer span {
        font-size: 8px;
        line-height: 1.4;
    }

    .wbd-mini-cart-discount {
        padding: 6px 8px;
        margin: 6px;
    }

    .wbd-mini-cart-title {
        font-size: 11px;
        margin-bottom: 4px;
        gap: 3px;
    }

    .wbd-mini-cart-title svg {
        width: 10px;
        height: 10px;
    }

    .wbd-discount-line {
        padding: 3px 0;
    }

    .wbd-discount-label {
        font-size: 11px;
    }

    .wbd-discount-amount {
        font-size: 12px;
    }
}

/* ========================
   Extra Small Mobile (max-width: 360px)
   ======================== */

@media screen and (max-width: 360px) {
    .wbd-discount-box {
        margin: 8px 0;
    }

    .wbd-tier {
        padding: 3px 4px;
        gap: 3px;
    }

    .wbd-tier-left {
        gap: 3px;
        flex: 0 1 auto;
    }

    .wbd-tier-right {
        gap: 3px;
        flex-shrink: 0;
    }

    .wbd-qty-badge {
        min-width: 22px;
        height: 22px;
        padding: 0 2px;
    }

    .wbd-qty-num {
        font-size: 11px;
    }

    .wbd-qty-plus {
        font-size: 8px;
    }

    .wbd-tier-label {
        font-size: 9px;
    }

    .wbd-discount-tag {
        font-size: 8px;
        padding: 1px 2px;
    }

    .wbd-price-group {
        gap: 2px;
    }

    .wbd-price-new {
        font-size: 10px;
    }

    .wbd-price-old {
        font-size: 8px;
    }

    .wbd-save-amount {
        font-size: 7px;
        padding: 1px 2px;
    }

    .wbd-mini-cart-discount {
        padding: 5px 6px;
        margin: 5px;
    }

    .wbd-mini-cart-title {
        font-size: 10px;
        margin-bottom: 3px;
    }

    .wbd-discount-label {
        font-size: 10px;
    }

    .wbd-discount-amount {
        font-size: 11px;
    }
}

/* ========================
   Animation & Effects
   ======================== */

/* Minimal animations only */
.wbd-tier.wbd-active .wbd-qty-badge {
    animation: none;
}

.wbd-tier.wbd-active .wbd-discount-tag {
    background: transparent;
    border-color: rgba(30, 58, 138, 0.4);
    color: rgba(30, 58, 138, 0.95);
}

/* Smooth transitions for all interactive elements */
.wbd-tier *,
.wbd-discount-box * {
    transition: all 0.2s ease;
}

/* ========================
   Touch-Friendly Enhancements
   ======================== */

@media (hover: none) and (pointer: coarse) {
    /* Touch devices */
    .wbd-tier {
        min-height: 48px; /* Minimum touch target size */
        cursor: pointer;
    }

    .wbd-qty-badge {
        min-width: 40px;
        height: 40px;
    }

    /* Remove hover effects on touch devices */
    .wbd-discount-box:hover,
    .wbd-tier:hover {
        transform: none;
    }

    /* Active state for touch */
    .wbd-tier:active {
        transform: scale(0.98);
        background: rgba(30, 58, 138, 0.1);
    }
}

/* ========================
   Cart Page Integration
   ======================== */

.woocommerce-cart .wbd-mini-cart-discount,
.woocommerce-checkout .wbd-mini-cart-discount {
    max-width: 450px;
}

/* ========================
   Accessibility
   ======================== */

@media (prefers-reduced-motion: reduce) {
    .wbd-discount-box,
    .wbd-tier,
    .wbd-qty-badge,
    .wbd-discount-tag,
    .wbd-save-amount {
        animation: none !important;
        transition: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .wbd-discount-box {
        border-width: 2px;
    }

    .wbd-tier {
        border-width: 2px;
    }

    .wbd-discount-tag,
    .wbd-save-amount {
        border: 1px solid currentColor;
    }
}
