/**
 * Cart Totals Light Theme Fix
 * Addresses color issues in light theme for cart totals section
 * Priority: High specificity to override existing styles
 */

/* =============================================================================
   CART TOTALS LIGHT THEME - COMPLETE OVERRIDE
   ============================================================================= */

/* Main container with maximum specificity */
html[data-theme="light"] .cart-collaterals .cart_totals,
html[data-theme="light"] .woocommerce .cart-collaterals .cart_totals,
html[data-theme="light"] .woocommerce-page .cart-collaterals .cart_totals,
html[data-theme="light"] .woocommerce-cart .cart_totals,
body.light-theme .cart-collaterals .cart_totals,
body.light-theme .woocommerce .cart-collaterals .cart_totals,
body.light-theme .woocommerce-page .cart-collaterals .cart_totals,
body.light-theme .woocommerce-cart .cart_totals,
.light-theme .cart-collaterals .cart_totals,
.light-theme .woocommerce .cart-collaterals .cart_totals,
.light-theme .cart_totals {
    background: rgba(255, 255, 255, 0.95) !important;
    color: #1a1a1a !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    backdrop-filter: blur(20px) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
    border-radius: 20px !important;
    padding: 24px !important;
}

/* Cart totals heading */
html[data-theme="light"] .cart_totals h2,
body.light-theme .cart_totals h2,
.light-theme .cart_totals h2 {
    color: var(--neon-green) !important;
    background: transparent !important;
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    margin: 0 0 20px 0 !important;
    text-align: center !important;
    border: none !important;
    padding: 0 !important;
}

/* Shop table background */
html[data-theme="light"] .cart_totals .shop_table,
html[data-theme="light"] .cart_totals .shop_table_responsive,
body.light-theme .cart_totals .shop_table,
body.light-theme .cart_totals .shop_table_responsive,
.light-theme .cart_totals .shop_table,
.light-theme .cart_totals .shop_table_responsive {
    background: transparent !important;
    border: none !important;
    width: 100% !important;
    border-collapse: collapse !important;
}

/* Table headers and cells */
html[data-theme="light"] .cart_totals th,
html[data-theme="light"] .cart_totals td,
body.light-theme .cart_totals th,
body.light-theme .cart_totals td,
.light-theme .cart_totals th,
.light-theme .cart_totals td {
    color: #1a1a1a !important;
    background: transparent !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    padding: 12px 0 !important;
}

/* Table headers specific styling */
html[data-theme="light"] .cart_totals th,
body.light-theme .cart_totals th,
.light-theme .cart_totals th {
    text-align: left !important;
    font-weight: 600 !important;
    color: rgba(26, 26, 26, 0.8) !important;
}

/* Table data specific styling */
html[data-theme="light"] .cart_totals td,
body.light-theme .cart_totals td,
.light-theme .cart_totals td {
    text-align: right !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
}

/* Order total row - special styling */
html[data-theme="light"] .cart_totals .order-total th,
html[data-theme="light"] .cart_totals .order-total td,
body.light-theme .cart_totals .order-total th,
body.light-theme .cart_totals .order-total td,
.light-theme .cart_totals .order-total th,
.light-theme .cart_totals .order-total td {
    color: var(--neon-green) !important;
    font-size: 1.2rem !important;
    font-weight: 700 !important;
    border-bottom: none !important;
    padding-top: 16px !important;
}

/* Subtotal, shipping, tax rows */
html[data-theme="light"] .cart_totals .cart-subtotal th,
html[data-theme="light"] .cart_totals .cart-subtotal td,
html[data-theme="light"] .cart_totals .shipping th,
html[data-theme="light"] .cart_totals .shipping td,
html[data-theme="light"] .cart_totals .tax-rate th,
html[data-theme="light"] .cart_totals .tax-rate td,
body.light-theme .cart_totals .cart-subtotal th,
body.light-theme .cart_totals .cart-subtotal td,
body.light-theme .cart_totals .shipping th,
body.light-theme .cart_totals .shipping td,
body.light-theme .cart_totals .tax-rate th,
body.light-theme .cart_totals .tax-rate td,
.light-theme .cart_totals .cart-subtotal th,
.light-theme .cart_totals .cart-subtotal td,
.light-theme .cart_totals .shipping th,
.light-theme .cart_totals .shipping td,
.light-theme .cart_totals .tax-rate th,
.light-theme .cart_totals .tax-rate td {
    color: #1a1a1a !important;
}

/* Strong tags inside totals */
html[data-theme="light"] .cart_totals strong,
body.light-theme .cart_totals strong,
.light-theme .cart_totals strong {
    color: inherit !important;
}

/* Coupon discount rows */
html[data-theme="light"] .cart_totals .cart-discount th,
html[data-theme="light"] .cart_totals .cart-discount td,
body.light-theme .cart_totals .cart-discount th,
body.light-theme .cart_totals .cart-discount td,
.light-theme .cart_totals .cart-discount th,
.light-theme .cart_totals .cart-discount td {
    color: #28a745 !important;
}

/* Proceed to checkout button */
html[data-theme="light"] .wc-proceed-to-checkout .checkout-button,
body.light-theme .wc-proceed-to-checkout .checkout-button,
.light-theme .wc-proceed-to-checkout .checkout-button {
    background: var(--neon-green) !important;
    color: #000000 !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 15px 24px !important;
    font-weight: 700 !important;
    font-size: 1.1rem !important;
    text-decoration: none !important;
    display: block !important;
    width: 100% !important;
    text-align: center !important;
    margin-top: 20px !important;
    transition: all 0.3s ease !important;
}

html[data-theme="light"] .wc-proceed-to-checkout .checkout-button:hover,
body.light-theme .wc-proceed-to-checkout .checkout-button:hover,
.light-theme .wc-proceed-to-checkout .checkout-button:hover {
    transform: translateY(-2px) !important;
    box-shadow: var(--glow-green), 0 5px 15px rgba(4, 122, 58, 0.4) !important;
    color: #000000 !important;
}

/* =============================================================================
   MOBILE RESPONSIVE FIXES
   ============================================================================= */

@media (max-width: 768px) {
    html[data-theme="light"] .cart_totals,
    body.light-theme .cart_totals,
    .light-theme .cart_totals {
        margin: 16px 0 !important;
        padding: 16px !important;
        border-radius: 15px !important;
    }
    
    html[data-theme="light"] .cart_totals h2,
    body.light-theme .cart_totals h2,
    .light-theme .cart_totals h2 {
        font-size: 1.2rem !important;
        margin-bottom: 16px !important;
    }
    
    html[data-theme="light"] .wc-proceed-to-checkout .checkout-button,
    body.light-theme .wc-proceed-to-checkout .checkout-button,
    .light-theme .wc-proceed-to-checkout .checkout-button {
        padding: 12px 20px !important;
        font-size: 1rem !important;
    }
}

/* =============================================================================
   FALLBACK OVERRIDES - ENSURE COMPATIBILITY
   ============================================================================= */

/* Override any remaining dark theme styles */
[data-theme="light"] .cart_totals *,
.light-theme .cart_totals * {
    border-color: rgba(0, 0, 0, 0.1) !important;
}

/* Ensure no white text remains */
[data-theme="light"] .cart_totals,
[data-theme="light"] .cart_totals *:not(.checkout-button),
.light-theme .cart_totals,
.light-theme .cart_totals *:not(.checkout-button) {
    color: #1a1a1a !important;
}

/* Special case for order total */
[data-theme="light"] .cart_totals .order-total *,
.light-theme .cart_totals .order-total * {
    color: var(--neon-green) !important;
}

/* Ensure checkout button stays correctly colored */
[data-theme="light"] .checkout-button,
[data-theme="light"] .checkout-button *,
.light-theme .checkout-button,
.light-theme .checkout-button * {
    color: #000000 !important;
}