/* 
 * Discount Positioning Fix
 * Moves discount rows below subtotal but above shipping/tax
 */

/* IMPROVED: Move discount row below subtotal but above shipping/tax */
/* .opc-block-summary .table-totals .totals.discount,
.cart-summary .cart-totals .totals.discount,
.checkout-summary .table-totals .totals.discount,
.cart-totals .totals.discount {
    order: 5 !important;
    margin-top: 8px !important;
    border-top: 1px solid #e9ecef !important;
    padding-top: 8px !important;
    background: #f8f9fa !important;
    border-radius: 4px !important;
    padding: 8px 12px !important;
} */

/* Ensure discount row is always visible and properly styled */
.opc-block-summary .table-totals .totals.discount,
.cart-summary .cart-totals .totals.discount,
.checkout-summary .table-totals .totals.discount,
.cart-totals .totals.discount {
    display: table-row !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
}

/* Style the discount label to be more prominent */
.opc-block-summary .table-totals .totals.discount .label,
.cart-summary .cart-totals .totals.discount .label,
.checkout-summary .table-totals .totals.discount .label,
.cart-totals .totals.discount .title,
.cart-totals .totals.discount .mark {
    color: #28a745 !important;
    font-weight: 600 !important;
    font-size: 14px !important;
}

/* Style the discount amount to be more prominent */
.opc-block-summary .table-totals .totals.discount .amount,
.cart-summary .cart-totals .totals.discount .amount,
.checkout-summary .table-totals .totals.discount .amount,
.cart-totals .totals.discount .amount {
    color: #28a745 !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    text-align: right !important;
}

/* Specific positioning for different totals sections */
.cart-totals tbody .totals.discount {
    position: relative !important;
}

/* Move subtotal to top */
.cart-totals .totals.sub {
    order: 1 !important;
}

/* Move shipping after discount */
.cart-totals .totals.shipping {
    order: 6 !important;
}

/* Move tax after shipping */
.cart-totals .totals.tax {
    order: 7 !important;
}

/* Move grand total to bottom */
.cart-totals .totals.grand_total,
.cart-totals .totals.grand {
    order: 10 !important;
    border-top: 2px solid #333 !important;
    margin-top: 10px !important;
    padding-top: 10px !important;
}

/* Enhanced styling for coupon code display */
.cart-totals .totals.discount .discount-code {
    font-family: monospace !important;
    background: #e9ecef !important;
    padding: 2px 6px !important;
    border-radius: 3px !important;
    font-size: 12px !important;
    margin-left: 8px !important;
}

/* Remove button styling */
.cart-totals .totals.discount .action-remove {
    background: #dc3545 !important;
    color: white !important;
    border: none !important;
    padding: 2px 6px !important;
    border-radius: 3px !important;
    font-size: 11px !important;
    margin-left: 6px !important;
    cursor: pointer !important;
}

.cart-totals .totals.discount .action-remove:hover {
    background: #c82333 !important;
}

/* Ensure discount totals row never hides on cart page */
.cart-summary #cart-totals .totals.discount { 
    display: table-row !important; 
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .cart-totals .totals.discount {
        padding: 6px 8px !important;
        margin-top: 6px !important;
    }
    
    .cart-totals .totals.discount .title,
    .cart-totals .totals.discount .mark,
    .cart-totals .totals.discount .amount {
        font-size: 13px !important;
    }
}

/* Animation for discount row appearance */
@keyframes fadeInDiscount {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cart-totals .totals.discount {
    animation: fadeInDiscount 0.3s ease-out !important;
}