/* Product page styles */
.category-discount-notice {
    margin: 8px 0 0 0;
    padding: 2px;
    background: #ddffdd;
    border: 1px solid #e1e8ed;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.category-discount-notice h5 {
    margin-top: 0;
    color: #2d7a4c;
    border-bottom: 1px solid #e1e8ed;
    padding-bottom: 6px;
}
.discount-category {
    margin: 5px 0;
}
.discount-category ul {
    margin: 6px 0 0 6px;
}
.discount-category li {
    line-height: 1.6;
}

/* Tier messages styles */
.tier-messages {
    background: #ddffdd;
    border: 2px solid #e1e8ed;
    border-radius: 5px;
    padding: 2px 4px;
    margin-bottom: 5px;
    transition: all 0.3s ease;
    font-size: 13px;
}
.tier-messages h5 {
    margin-top: 0;
    color: #52b250;
    font-size: 1.2em;
}
.tier-messages ul {
    margin: 4px 4px 4px 4px;
    font-size: 13px;
    background: #d6ffd6;
}
.tier-messages li {
    margin-bottom: 3px;
    line-height: 1.8;
    font-size: 13px;
}
.tier-label {
    display: block;
    font-size: 13px;
}
.items-needed {
    color: #666;
    font-size: 1.0em;
}
.items-needed-footer {
    color: #666;
    font-size: 12px;
}

/* Highlight effect when updating */
.tier-messages-updating {
    background-color: #ddffdd;
    border-color: #1e90ff;
    box-shadow: 0 0 10px rgba(30, 144, 255, 0.3);
}

.tier-list {
    margin: 5px 0 0 10px;
    padding: 0;
    list-style: none;
}
.tier-item {
    margin-bottom: 2px;
    line-height: 1.2;
}
.tier-reached {
    font-family: 'Poppins', sans-serif;
    color: #52b250;
    font-weight: bold;
    font-size: 13px;
}
.tier-not-reached {
    font-family: 'Poppins', sans-serif;
    color: #2c3996;
    font-weight: bold;
    font-size: 13px;
}
.tier-achieved {
    color: #52b250;
    font-weight: 500;
}
.tier-next {
    color: #2196F3;
}

/* Tier messages */
.tier-messages ul {
    list-style: none;
    padding-left: 0;
}
.tier-messages li {
    padding: 8px 0;
    border-bottom: 2px solid #ccc;
}

/* Savings Breakdown Table */
.woocommerce-checkout #checkout-savings-table,
.woocommerce-cart #cart-savings-table {
    width: 100% !important;
    margin: 0.5em 0 !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    font-size: 14px !important;
    border: 1px solid #ddd !important;
    background-color: #fff !important;
}

/* Cart-specific Savings Table (optional differentiation) */
.woocommerce-cart #cart-savings-table {
    background-color: #f9f9f9 !important;
}

/* Header Row */
.woocommerce-checkout #checkout-savings-table .savings-header,
.woocommerce-cart #cart-savings-table .savings-header {
    background-color: #d6ffd6 !important;
}

.woocommerce-checkout #checkout-savings-table .savings-header td,
.woocommerce-cart #cart-savings-table .savings-header td {
    padding: 8px 12px !important;
    text-align: left !important;
    border-bottom: 1px solid #eee !important;
    color: #4CAF50 !important;
    font-weight: bold !important;
    line-height: 1.2 !important;
}

/* Discount Rows */
.woocommerce-checkout #checkout-savings-table .savings-row,
.woocommerce-cart #cart-savings-table .savings-row {
    border-bottom: 1px solid #eee !important;
}

.woocommerce-checkout #checkout-savings-table .savings-label,
.woocommerce-cart #cart-savings-table .savings-label {
    padding: 8px 12px !important;
    width: 70% !important;
    line-height: 1.2 !important;
    color: #333 !important;
}

.woocommerce-checkout #checkout-savings-table .savings-label .discount-percentage,
.woocommerce-cart #cart-savings-table .savings-label .discount-percentage {
    color: #666 !important;
    font-size: 0.9em !important;
}

.woocommerce-checkout #checkout-savings-table .savings-amount,
.woocommerce-cart #cart-savings-table .savings-amount {
    padding: 8px 12px !important;
    text-align: right !important;
    width: 30% !important;
    color: #4CAF50 !important;
    font-weight: bold !important;
    line-height: 1.2 !important;
}

/* Total Savings Row */
.woocommerce-checkout #checkout-savings-table .total-savings-row,
.woocommerce-cart #cart-savings-table .total-savings-row {
    background-color: #f8f8f8 !important;
    font-weight: bold !important;
}

.woocommerce-checkout #checkout-savings-table .total-savings-label,
.woocommerce-cart #cart-savings-table .total-savings-label {
    padding: 8px 12px !important;
    line-height: 1.2 !important;
    color: #333 !important;
}

.woocommerce-checkout #checkout-savings-table .total-savings-amount,
.woocommerce-cart #cart-savings-table .total-savings-amount {
    padding: 8px 12px !important;
    text-align: right !important;
    color: #4CAF50 !important;
    line-height: 1.2 !important;
}

/* Override CheckoutWC and Theme Styles */
.woocommerce-checkout .cfw-checkout-table #checkout-savings-table,
.woocommerce-cart .shop_table #cart-savings-table {
    display: table !important;
    table-layout: fixed !important;
    border-spacing: 0 !important;
    margin: 0.5em 0 !important;
    padding: 0 !important;
}

.woocommerce-checkout .cfw-checkout-table #checkout-savings-table td,
.woocommerce-cart .shop_table #cart-savings-table td {
    color: inherit !important;
}

/* Ensure green text in savings amounts */
.woocommerce-checkout #checkout-savings-table .savings-amount .woocommerce-Price-amount,
.woocommerce-cart #cart-savings-table .savings-amount .woocommerce-Price-amount,
.woocommerce-checkout #checkout-savings-table .total-savings-amount .woocommerce-Price-amount,
.woocommerce-cart #cart-savings-table .total-savings-amount .woocommerce-Price-amount {
    color: #4CAF50 !important;
}

/* Override generic table styles */
.woocommerce-checkout .shop_table:not(.checkout),
.woocommerce-cart .shop_table:not(.cart) {
    margin-bottom: 0 !important;
}

/* Shipping Methods on Cart Page */
.woocommerce-cart .woocommerce-shipping-totals .woocommerce-shipping-methods {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.woocommerce-cart .woocommerce-shipping-totals .woocommerce-shipping-methods li {
    display: block !important;
    margin: 16px 0 !important;
    padding: 0 !important;
    line-height: 1.5 !important;
    position: relative !important; /* Override absolute positioning */
    clear: both !important; /* Prevent float issues */
}

.woocommerce-cart .woocommerce-shipping-totals .woocommerce-shipping-methods input.shipping_method {
    margin-right: 8px !important;
    vertical-align: middle !important;
}

.woocommerce-cart .woocommerce-shipping-totals .woocommerce-shipping-methods label {
    display: inline !important;
    line-height: 1.5 !important;
    vertical-align: middle !important;
    color: #333 !important;
}

.woocommerce-cart .woocommerce-shipping-totals .woocommerce-shipping-methods .woocommerce-Price-amount {
    color: #333 !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .woocommerce-checkout #checkout-savings-table,
    .woocommerce-cart #cart-savings-table {
        font-size: 13px !important;
    }
    .woocommerce-checkout #checkout-savings-table .savings-label,
    .woocommerce-checkout #checkout-savings-table .savings-amount,
    .woocommerce-checkout #checkout-savings-table .total-savings-label,
    .woocommerce-checkout #checkout-savings-table .total-savings-amount,
    .woocommerce-cart #cart-savings-table .savings-label,
    .woocommerce-cart #cart-savings-table .savings-amount,
    .woocommerce-cart #cart-savings-table .total-savings-label,
    .woocommerce-cart #cart-savings-table .total-savings-amount {
        padding: 6px 8px !important;
    }
    .woocommerce-cart .woocommerce-shipping-totals .woocommerce-shipping-methods li {
        margin: 6px 0 !important;
    }
}