/* WooCommerce Cart Page Styling */

/* Cart Page Container */
.woocommerce-cart {
    background: #f8f9fa;
    min-height: 60vh;
}

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

/* Cart Table Styling */
.woocommerce-cart-form {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-bottom: 30px;
}

.woocommerce-cart-form__contents {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.woocommerce-cart-form__contents thead {
    background: var(--color-primary);
    color: white;
}

.woocommerce-cart-form__contents thead th {
    padding: 20px 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 14px;
    border: none;
    font-family: 'Oswald', sans-serif !important;
    color: #fff !important;
}
.woocommerce-cart-form__contents thead th.product-price{
    display: none;
}
.woocommerce-cart-form__contents thead th.product-name{
    display: unset;
}
.woocommerce-cart-form__contents tbody td {
    padding: 25px 15px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.woocommerce-cart-form__contents tbody tr:last-child td {
    border-bottom: none;
}

/* Product Image in Cart */
.cart_item .product-thumbnail img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #f0f0f0;
}

/* Product Name */
.cart_item .product-name a {
    color: var(--color-dark);
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    line-height: 1.4;
}

.cart_item .product-name a:hover {
    color: var(--color-primary);
}

/* Product Price */
.cart_item .product-price .woocommerce-Price-amount {
    font-weight: 600;
    color: var(--color-primary);
    font-size: 16px;
}

/* Quantity Input */
.cart_item .product-quantity .quantity {
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart_item .product-quantity .qty {
    width: 60px;
    height: 40px;
    text-align: center;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    margin: 0 5px;
}

.cart_item .product-quantity .qty:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

/* Quantity Buttons */
.quantity-btn {
    width: 35px;
    height: 35px;
    border: 2px solid #ddd;
    background: white;
    color: #666;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.3s ease;
}

.quantity-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: #fff0f2;
}

/* Subtotal */
.cart_item .product-subtotal .woocommerce-Price-amount {
    font-weight: 700;
    color: var(--color-dark);
    font-size: 18px;
}

/* Remove Button */
.cart_item .product-remove a {
    color: #dc3545;
    font-size: 18px;
    text-decoration: none;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.cart_item .product-remove a:hover {
    background: #dc3545;
    color: white;
    transform: scale(1.1);
}

/* Update Cart Button */
.button[name="update_cart"] {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.button[name="update_cart"]:hover {
    background: #b30015;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(219, 0, 24, 0.25);
}

/* Cart Collaterals (Totals Section) */
.cart-collaterals {
    margin-top: 30px;
}

.cart_totals {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 30px;
    max-width: 400px;
    margin-left: auto;
}

.cart_totals h2 {
    color: var(--color-dark);
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.cart_totals table {
    width: 100%;
    border-collapse: collapse;
}

.cart_totals th,
.cart_totals td {
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

.cart_totals th {
    font-weight: 600;
    color: var(--color-dark);
    text-align: left;
}

.cart_totals td {
    text-align: right;
    font-weight: 600;
}

.cart_totals .order-total th,
.cart_totals .order-total td {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-primary);
    border-bottom: none;
    padding-top: 20px;
}

/* Proceed to Checkout Button */
.wc-proceed-to-checkout .checkout-button {
    width: 100%;
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 18px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    text-decoration: none;
    display: block;
    text-align: center;
}

.wc-proceed-to-checkout .checkout-button:hover {
    background: #b30015;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(219, 0, 24, 0.25);
    color: white;
    text-decoration: none;
}

/* Empty Cart Message */
.cart-empty {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.cart-empty .woocommerce-info {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 30px;
    margin: 0;
    font-size: 18px;
    color: var(--color-dark);
}

.cart-empty .return-to-shop {
    margin-top: 25px;
}

.cart-empty .return-to-shop .button {
    background: var(--color-primary);
    color: white;
    padding: 15px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.cart-empty .return-to-shop .button:hover {
    background: #b30015;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(219, 0, 24, 0.25);
    color: white;
    text-decoration: none;
}

/* Coupon Form */
.coupon {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.coupon label {
    font-weight: 600;
    color: var(--color-dark);
    margin-bottom: 10px;
    display: block;
}

.coupon input[type="text"] {
    width: 200px;
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    margin-right: 10px;
    font-size: 14px;
}

.coupon input[type="text"]:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(219, 0, 24, 0.1);
}

.coupon .button {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.coupon .button:hover {
    background: #b30015;
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .woocommerce-cart .container {
        padding: 20px 10px;
    }
    
    .cart_totals {
        max-width: 100%;
        margin: 20px 0 0 0;
    }
    
    .woocommerce-cart-form__contents {
        font-size: 14px;
    }
    
    .woocommerce-cart-form__contents thead th {
        padding: 15px 8px;
        font-size: 12px;
    }
    
    .woocommerce-cart-form__contents tbody td {
        padding: 15px 8px;
    }
    
    .cart_item .product-thumbnail img {
        width: 60px;
        height: 60px;
    }
    
    .cart_item .product-quantity .qty {
        width: 50px;
        height: 35px;
        font-size: 14px;
    }
    
    .quantity-btn {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    
    .coupon input[type="text"] {
        width: 150px;
        margin-bottom: 10px;
    }
}

@media (max-width: 576px) {
    .woocommerce-cart-form__contents thead {
        display: none;
    }
    
    .woocommerce-cart-form__contents tbody tr {
        display: block;
        border: 1px solid #eee;
        border-radius: 8px;
        margin-bottom: 15px;
        padding: 15px;
    }
    
    .woocommerce-cart-form__contents tbody td {
        display: block;
        padding: 8px 0;
        border: none;
        text-align: left !important;
    }
    
    .woocommerce-cart-form__contents tbody td:before {
        content: attr(data-title) ": ";
        font-weight: 600;
        color: var(--color-dark);
        display: inline-block;
        width: 100px;
    }
    
    .cart_item .product-thumbnail {
        text-align: center;
        margin-bottom: 10px;
    }
    
    .cart_item .product-remove {
        text-align: center;
        margin-top: 15px;
    }
}

/* Cart Page Header */
.cart-page-header {
    background: linear-gradient(135deg, var(--color-primary) 0%, #a10012 100%);
    color: white;
    padding: 40px 0;
    margin-bottom: 0;
}

.cart-page-header h1 {
    color: white;
    font-size: 32px;
    font-weight: 700;
    margin: 0;
    text-align: center;
}

.cart-page-header .breadcrumb {
    background: transparent;
    margin: 10px 0 0 0;
    padding: 0;
    justify-content: center;
}

.cart-page-header .breadcrumb a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

.cart-page-header .breadcrumb a:hover {
    color: white;
}

/* Cart Actions */
.cart-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
}

.continue-shopping {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.continue-shopping:hover {
    color: #b30015;
    text-decoration: none;
    transform: translateX(-3px);
}

/* Cart Summary Cards */
.cart-summary-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 25px;
    margin-bottom: 20px;
}

.cart-summary-card h3 {
    color: var(--color-dark);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

/* Shipping Calculator */
.shipping-calculator-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 15px;
}

.shipping-calculator-form select,
.shipping-calculator-form input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
}

.shipping-calculator-form select:focus,
.shipping-calculator-form input:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.shipping-calculator-form .button {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.shipping-calculator-form .button:hover {
    background: #b30015;
    transform: translateY(-1px);
}

/* Cart Messages */
.woocommerce-message,
.woocommerce-error,
.woocommerce-info {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 4px solid var(--color-primary);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.woocommerce-error {
    border-left-color: #dc3545;
    background: #fff5f5;
}

.woocommerce-message {
    border-left-color: #28a745;
    background: #f8fff8;
}

/* Loading States */
.cart-loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.cart-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Cart Notification Styles */
.cart-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(40, 167, 69, 0.3);
    z-index: 9999;
    font-weight: 500;
    display: none;
    animation: slideInRight 0.3s ease;
    max-width: 350px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-notification-error {
    background: #dc3545;
    box-shadow: 0 4px 20px rgba(220, 53, 69, 0.3);
}

.cart-notification .notification-close {
    background: none;
    border: none;
    color: white;
    font-size: 14px;
    cursor: pointer;
    margin-left: auto;
    padding: 5px;
    border-radius: 3px;
    transition: background 0.3s ease;
}

.cart-notification .notification-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Floating button enhanced states */
.floating-add-to-cart.loading {
    background: #ffc107 !important;
    color: #212529 !important;
    pointer-events: none;
}

.floating-add-to-cart.success {
    background: #28a745 !important;
    color: white !important;
    animation: successPulse 0.6s ease;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Mobile notification adjustments */
@media (max-width: 768px) {
    .cart-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        text-align: center;
        max-width: none;
    }
}

/* Security Badges */
.cart-security-badges {
    display: flex;
    gap: 20px;
    align-items: center;
}

.security-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #28a745;
    font-size: 14px;
    font-weight: 600;
}

.security-badge i {
    font-size: 16px;
}

/* Cart Content Section */
.cart-content {
    background: #f8f9fa;
    padding: 40px 0;
    min-height: 60vh;
}

/* WooCommerce Notices Styling */
.woocommerce-notices-wrapper {
    margin-bottom: 30px;
}

.woocommerce-notices-wrapper .woocommerce-message,
.woocommerce-notices-wrapper .woocommerce-error,
.woocommerce-notices-wrapper .woocommerce-info {
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.woocommerce-notices-wrapper .woocommerce-message::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: #28a745;
}

.woocommerce-notices-wrapper .woocommerce-error::before {
    content: '\f071';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: #dc3545;
}

.woocommerce-notices-wrapper .woocommerce-info::before {
    content: '\f05a';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--color-primary);
}

/* Cross-sells Section */
.cross-sells {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 30px;
    margin-top: 30px;
}

.cross-sells h2 {
    color: var(--color-dark);
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 25px;
    text-align: center;
}

.cross-sells .products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* Desktop Two-Column Layout (Form + Totals) */
@media (min-width: 1024px) {
    /* Ensure left alignment inside cart area (theme centers body by default) */
    .woocommerce-cart,
    .cart-content,
    .woocommerce-cart .woocommerce {
        text-align: left;
    }

    .woocommerce-cart .woocommerce {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 380px;
        gap: 30px;
        align-items: start;
    }

    .woocommerce-cart-form {
        margin-bottom: 0;
    }

    .cart-collaterals {
        margin-top: 0;
    }

    .cart_totals {
        position: sticky;
        top: 30px;
        max-width: 100%;
        margin-left: 0;
        width: 100%;
    }
}

/* Accessibility & Focus States */
.woocommerce a:focus,
.woocommerce .button:focus,
.woocommerce input[type="submit"]:focus,
.woocommerce button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(219, 0, 24, 0.2);
}

/* Improve table row hover */
.woocommerce-cart-form__contents tbody tr:hover {
    background: #fff7f8;
}

/* Align cart text to left by default inside cart sections */
.cart-content,
.woocommerce-cart .container,
.woocommerce-cart-form,
.cart_totals,
.cart-summary-card,
.cross-sells {
    text-align: left;
}

/* Better spacing for product name and thumbnail on small screens */
@media (max-width: 576px) {
    .cart_item .product-name a {
        display: inline-block;
        margin-top: 6px;
    }
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .cart-page-header {
        padding: 30px 0;
    }

    .cart-page-header h1 {
        font-size: 24px;
    }

    .cart-actions {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .cart-security-badges {
        flex-direction: column;
        gap: 10px;
    }

    .cross-sells .products {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }
}
