/*
 * WooCommerce Cart & Checkout Styles
 * Part of Jacadi Theme Modular CSS System
 */

/* ================================
   CART PAGE STYLES
   ================================ */

.woocommerce-cart .woocommerce {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 15px 60px;
}

/* Product Links in Cart */
.woocommerce-cart .product-name a,
.woocommerce-cart td.product-name a,
.woocommerce table.cart td.product-name a {
    color: #333 !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    transition: color 0.3s ease !important;
    border-bottom: 1px solid transparent !important;
}

.woocommerce-cart .product-name a:hover,
.woocommerce-cart td.product-name a:hover,
.woocommerce table.cart td.product-name a:hover {
    color: #555 !important;
    border-bottom-color: #555 !important;
    text-decoration: none !important;
}

/* Save Badge Styling - Direct approach */
.woocommerce-cart td.product-subtotal,
.woocommerce table.cart td.product-subtotal {
    position: relative;
    font-weight: 600;
}

/* Target the SAVE text directly in the cell */
.woocommerce-cart td.product-subtotal,
.woocommerce table.cart .product-subtotal {
    text-align: right !important;
}

/* Style for elements containing SAVE */
.woocommerce table.cart td.product-subtotal > span:first-of-type,
.woocommerce table.cart td.product-subtotal > div:first-of-type,
.woocommerce table.cart td.product-subtotal > p:first-of-type {
    display: inline-block !important;
    background-color: #e74c3c !important;
    color: #fff !important;
    padding: 6px 16px !important;
    border-radius: 20px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 8px !important;
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.3) !important;
}

.woocommerce-cart .product-subtotal del {
    display: block;
    color: #999;
    font-size: 0.9em;
    text-decoration: line-through;
    margin-bottom: 5px;
}

.woocommerce-cart .product-subtotal ins {
    text-decoration: none;
    font-weight: 600;
    color: #333;
}

/* Custom Save Badge - Target elements containing "SAVE" */
.woocommerce-cart td.product-subtotal {
    text-align: right;
}

/* Style any element in the subtotal that contains "SAVE" */
.woocommerce-cart .product-subtotal span:first-child,
.woocommerce-cart .product-subtotal > :first-child:not(.woocommerce-Price-amount) {
    display: inline-block;
    background-color: #e74c3c;
    color: #fff !important;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

/* Save Badge created by JavaScript */
.woocommerce-cart .save-badge {
    display: inline-block !important;
    background-color: #e74c3c !important;
    color: #fff !important;
    padding: 6px 16px !important;
    border-radius: 20px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-right: 10px !important;
    position: relative !important;
    top: -2px !important;
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.3) !important;
    animation: pulse 2s infinite !important;
}

@keyframes pulse {
    0% {
        box-shadow: 0 2px 4px rgba(231, 76, 60, 0.3);
    }
    50% {
        box-shadow: 0 2px 8px rgba(231, 76, 60, 0.5);
    }
    100% {
        box-shadow: 0 2px 4px rgba(231, 76, 60, 0.3);
    }
}

/* Cart Table Improvements */
.woocommerce-cart table.shop_table {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.woocommerce-cart table.shop_table th {
    background-color: #f8f8f8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 13px;
}

.cart_totals {
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 30px;
    margin-top: 30px;
}

.cart_totals h2 {
    font-family: "futura-pt", sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: #333;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 15px;
}

/* ================================
   CART BUTTONS STYLING
   ================================ */

/* Proceed to Checkout Button Container */
.wc-proceed-to-checkout {
    margin-top: 30px !important;
    text-align: right !important;
}

/* Proceed to Checkout Button */
.wc-proceed-to-checkout a.checkout-button,
.wc-proceed-to-checkout .checkout-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    background: #000 !important;
    color: white !important;
    padding: 18px 45px !important;
    font-family: "brandon-grotesque", sans-serif !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    text-align: center !important;
    text-decoration: none !important;
    border: 2px solid #000 !important;
    border-radius: 0 !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    position: relative !important;
    overflow: hidden !important;
    min-width: 280px !important;
}

/* Add arrow icon after text */
.wc-proceed-to-checkout a.checkout-button::after,
.wc-proceed-to-checkout .checkout-button::after {
    content: "→" !important;
    font-size: 18px !important;
    margin-left: 8px !important;
    transition: transform 0.3s ease !important;
    display: inline-block !important;
}

.wc-proceed-to-checkout a.checkout-button:hover,
.wc-proceed-to-checkout .checkout-button:hover {
    background: white !important;
    color: #000 !important;
    border-color: #000 !important;
}

/* Animate arrow on hover */
.wc-proceed-to-checkout a.checkout-button:hover::after,
.wc-proceed-to-checkout .checkout-button:hover::after {
    transform: translateX(5px) !important;
}

.wc-proceed-to-checkout a.checkout-button:active,
.wc-proceed-to-checkout .checkout-button:active {
    transform: scale(0.98) !important;
}

/* Alternative selectors for checkout button */
.woocommerce-cart .cart-collaterals .cart_totals .wc-proceed-to-checkout a,
.woocommerce-cart .wc-proceed-to-checkout a[href*="checkout"] {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #000 !important;
    color: white !important;
    padding: 18px 45px !important;
    font-family: "brandon-grotesque", sans-serif !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    text-decoration: none !important;
    border: 2px solid #000 !important;
    transition: all 0.3s ease !important;
    min-width: 280px !important;
}

.woocommerce-cart .cart-collaterals .cart_totals .wc-proceed-to-checkout a:hover,
.woocommerce-cart .wc-proceed-to-checkout a[href*="checkout"]:hover {
    background: white !important;
    color: #000 !important;
}

/* WooCommerce Blocks Checkout Button */
.wc-block-components-button.wc-block-cart__submit-button,
.wc-block-components-button.wc-block-cart__submit-button.contained,
.wp-block-woocommerce-proceed-to-checkout-block .wc-block-components-button,
.wc-block-cart__submit-container .wc-block-components-button {
    background: #000 !important;
    color: white !important;
    padding: 18px 45px !important;
    font-family: "brandon-grotesque", sans-serif !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    text-decoration: none !important;
    border: 2px solid #000 !important;
    border-radius: 0 !important;
    transition: all 0.3s ease !important;
    min-width: 280px !important;
    width: 100% !important;
    max-width: 400px !important;
    margin: 0 auto !important;
    display: block !important;
    box-shadow: none !important;
}

.wc-block-components-button.wc-block-cart__submit-button:hover,
.wc-block-components-button.wc-block-cart__submit-button.contained:hover,
.wp-block-woocommerce-proceed-to-checkout-block .wc-block-components-button:hover,
.wc-block-cart__submit-container .wc-block-components-button:hover {
    background: white !important;
    color: #000 !important;
    border-color: #000 !important;
    box-shadow: none !important;
}

.wc-block-components-button.wc-block-cart__submit-button:focus,
.wc-block-components-button.wc-block-cart__submit-button.contained:focus,
.wp-block-woocommerce-proceed-to-checkout-block .wc-block-components-button:focus {
    outline: 2px solid #000 !important;
    outline-offset: 2px !important;
}

/* Override the button text span */
.wc-block-components-button__text {
    color: inherit !important;
}

/* Ensure proper container alignment */
.wc-block-cart__submit-container,
.wp-block-woocommerce-proceed-to-checkout-block {
    text-align: center !important;
    margin-top: 30px !important;
}

/* Force override WooCommerce Blocks button with higher specificity */
.woocommerce .wc-block-components-button.wc-block-cart__submit-button,
.woocommerce-page .wc-block-components-button.wc-block-cart__submit-button,
.wc-block-cart .wc-block-components-button.wc-block-cart__submit-button,
body .wc-block-components-button.wc-block-cart__submit-button.contained {
    background-color: #000 !important;
    color: #fff !important;
    border: 2px solid #000 !important;
    font-family: "brandon-grotesque", sans-serif !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    padding: 18px 45px !important;
    min-height: auto !important;
    line-height: 1.2 !important;
}

body .wc-block-components-button.wc-block-cart__submit-button:not(:disabled):hover,
body .wc-block-components-button.wc-block-cart__submit-button.contained:not(:disabled):hover {
    background-color: #fff !important;
    color: #000 !important;
    border-color: #000 !important;
}

/* Update Cart Button */
.woocommerce button[name="update_cart"] {
    background: #f8f8f8 !important;
    color: #333 !important;
    border: 2px solid #e0e0e0 !important;
    padding: 12px 30px !important;
    font-family: "futura-pt", sans-serif !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    letter-spacing: 0.05em !important;
    text-transform: uppercase !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.woocommerce button[name="update_cart"]:hover:not(:disabled) {
    background: #333 !important;
    color: white !important;
    border-color: #333 !important;
}

.woocommerce button[name="update_cart"]:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

/* Coupon Button */
.woocommerce .coupon button[name="apply_coupon"] {
    background: white !important;
    color: #333 !important;
    border: 2px solid #333 !important;
    padding: 10px 25px !important;
    font-family: "futura-pt", sans-serif !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    letter-spacing: 0.05em !important;
    text-transform: uppercase !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    margin-left: 10px !important;
}

.woocommerce .coupon button[name="apply_coupon"]:hover {
    background: #333 !important;
    color: white !important;
}

/* Coupon Input Field */
.woocommerce .coupon input[type="text"] {
    padding: 10px 15px !important;
    border: 2px solid #e0e0e0 !important;
    border-radius: 4px !important;
    font-family: "brandon-grotesque", sans-serif !important;
    font-size: 14px !important;
    transition: border-color 0.3s ease !important;
}

.woocommerce .coupon input[type="text"]:focus {
    outline: none !important;
    border-color: #333 !important;
}

/* Cart Table Styling */
.woocommerce table.shop_table {
    border-collapse: collapse;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 30px;
}

.woocommerce table.shop_table th {
    background: #f8f8f8;
    font-family: "futura-pt", sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.woocommerce table.shop_table td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    font-family: "brandon-grotesque", sans-serif;
    font-size: 14px;
}

/* Remove item X button */
.woocommerce a.remove {
    color: #999 !important;
    font-size: 20px !important;
    font-weight: 300 !important;
    width: 24px !important;
    height: 24px !important;
    line-height: 22px !important;
    text-align: center !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 50% !important;
    display: inline-block !important;
    transition: all 0.3s ease !important;
}

.woocommerce a.remove:hover {
    background: #dc3545 !important;
    border-color: #dc3545 !important;
    color: white !important;
}

/* Quantity Input */
.woocommerce .quantity input[type="number"] {
    width: 60px;
    padding: 8px 10px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    text-align: center;
    font-family: "brandon-grotesque", sans-serif;
    font-size: 14px;
}

/* Cart Totals Table */
.cart_totals table {
    width: 100%;
}

.cart_totals tr {
    border-bottom: 1px solid #e0e0e0;
}

.cart_totals tr:last-child {
    border-bottom: none;
}

.cart_totals th,
.cart_totals td {
    padding: 15px 0;
    font-family: "brandon-grotesque", sans-serif;
    font-size: 15px;
}

.cart_totals th {
    font-weight: 600;
    text-align: left;
}

.cart_totals .order-total th,
.cart_totals .order-total td {
    font-family: "futura-pt", sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    padding-top: 20px;
}

/* ================================
   CHECKOUT PAGE STYLES
   ================================ */

.woocommerce-checkout .woocommerce {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 15px 60px;
}

.checkout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.woocommerce-billing-fields h3,
.woocommerce-shipping-fields h3,
.woocommerce-additional-fields h3 {
    font-family: "futura-pt", sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 10px;
}

.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="tel"],
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-family: "brandon-grotesque", sans-serif;
    font-size: 14px;
    color: #333;
    background: #fff;
    transition: border-color 0.3s ease;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    outline: none;
    border-color: #333;
    box-shadow: 0 0 0 3px rgba(51, 51, 51, 0.1);
}

.woocommerce-checkout-review-order-table {
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 25px;
}

.woocommerce-checkout-review-order-table h3 {
    font-family: "futura-pt", sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 10px;
}

/* ================================
   RESPONSIVE CART & CHECKOUT
   ================================ */

@media (max-width: 768px) {
    .checkout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .cart_totals,
    .woocommerce-checkout-review-order-table {
        padding: 20px;
    }
    
    /* Responsive button adjustments */
    .wc-proceed-to-checkout a.checkout-button {
        font-size: 15px !important;
        padding: 16px 30px !important;
    }
    
    .woocommerce button[name="update_cart"],
    .woocommerce .coupon button[name="apply_coupon"] {
        font-size: 13px !important;
        padding: 10px 20px !important;
    }
    
    /* Stack coupon field and button on mobile */
    .woocommerce .coupon {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .woocommerce .coupon button[name="apply_coupon"] {
        margin-left: 0 !important;
        width: 100%;
    }
    
    .woocommerce .coupon input[type="text"] {
        width: 100%;
    }
    
    /* Cart table responsive */
    .woocommerce table.shop_table {
        font-size: 13px;
    }
    
    .woocommerce table.shop_table th,
    .woocommerce table.shop_table td {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .woocommerce-cart .woocommerce,
    .woocommerce-checkout .woocommerce {
        padding: 15px 10px 30px;
    }
} 