/* Caress Cart Widget Styles - Version 1.0.4 */
.caress-cart-widget {
    font-family: inherit;
}

.caress-cart-widget .woocommerce {
    margin: 0;
}

.caress-cart-widget .woocommerce-cart-form {
    margin-bottom: 2em;
}

.caress-cart-widget .woocommerce-cart-form__contents {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 1em;
}

.caress-cart-widget .woocommerce-cart-form__contents th,
.caress-cart-widget .woocommerce-cart-form__contents td {
    padding: 1em;
    text-align: right;
    border-bottom: 1px solid #ddd;
}

.caress-cart-widget .woocommerce-cart-form__contents thead th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.caress-cart-widget .product-remove {
    width: 50px;
    text-align: center;
}

.caress-cart-widget .product-remove a,
.caress-cart-widget .woocommerce-cart-form__cart-item .product-remove a,
.caress-cart-widget .product-remove a[role="button"],
.caress-cart-widget .woocommerce-cart-form__cart-item .product-remove a[role="button"] {
    color: #dc3545 !important;
    text-decoration: none !important;
    font-size: 2.5em !important;
    font-weight: bold !important;
    display: inline-block !important;
    width: 40px !important;
    height: 40px !important;
    line-height: 40px !important;
    text-align: center !important;
    border-radius: 50% !important;
    background-color: #fff !important;
    border: 2px solid #dc3545 !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2) !important;
    position: relative !important;
    z-index: 10 !important;
}

.caress-cart-widget .product-remove a:hover,
.caress-cart-widget .woocommerce-cart-form__cart-item .product-remove a:hover,
.caress-cart-widget .product-remove a[role="button"]:hover,
.caress-cart-widget .woocommerce-cart-form__cart-item .product-remove a[role="button"]:hover {
    color: #fff !important;
    background-color: #dc3545 !important;
    transform: scale(1.1) !important;
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3) !important;
}

.caress-cart-widget .product-thumbnail {
    width: 100px;
}

.caress-cart-widget .product-thumbnail img {
    max-width: 80px;
    height: auto;
    border-radius: 4px;
}

.caress-cart-widget .product-name {
    font-weight: 600;
}

.caress-cart-widget .product-name a {
    color: #333;
    text-decoration: none;
}

.caress-cart-widget .product-name a:hover {
    color: #007cba;
}

.caress-cart-widget .product-price,
.caress-cart-widget .product-subtotal {
    font-weight: 600;
    color: #333;
}

.caress-cart-widget .product-quantity {
    width: 120px;
}

.caress-cart-widget .quantity {
    display: flex;
    align-items: center;
}

.caress-cart-widget .quantity input {
    width: 60px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.5em;
}

.caress-cart-widget .actions {
    text-align: left;
}

.caress-cart-widget .coupon {
    display: flex;
    gap: 1em;
    align-items: center;
    margin-bottom: 1em;
}

.caress-cart-widget .coupon input,
.caress-cart-widget .woocommerce-cart-form .coupon input {
    flex: 1 !important;
    max-width: 400px !important;
    padding: 0.75em 1em !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    height: 44px !important;
    box-sizing: border-box !important;
    font-size: 14px !important;
}

.caress-cart-widget .button,
.caress-cart-widget .woocommerce-cart-form .button {
    background-color: #007cba !important;
    color: white !important;
    border: none !important;
    padding: 0.75em 1.5em !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    text-decoration: none !important;
    display: inline-block !important;
    font-size: 14px !important;
    transition: background-color 0.3s ease !important;
    height: 44px !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
}

/* Override theme button styling */
.caress-cart-widget [type=button],
.caress-cart-widget [type=submit],
.caress-cart-widget button {
    border: 1px solid #B77695 !important;
    color: #B77695 !important;
}

/* Force remove button styling - very specific selectors */
.caress-cart-widget a.remove[role="button"],
.caress-cart-widget .product-remove a.remove,
.caress-cart-widget .woocommerce-cart-form__cart-item a.remove,
.caress-cart-widget a[data-product_id] {
    color: #dc3545 !important;
    text-decoration: none !important;
    text-decoration-line: none !important;
    text-decoration-style: none !important;
    text-decoration-color: transparent !important;
    font-size: 0 !important;
    font-weight: bold !important;
    display: inline-block !important;
    width: 40px !important;
    height: 40px !important;
    line-height: 40px !important;
    text-align: center !important;
    border-radius: 50% !important;
    background-color: #fff !important;
    border: 2px solid #dc3545 !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2) !important;
    position: relative !important;
    z-index: 10 !important;
}

/* Loading state for remove button */
.caress-cart-widget a.remove.loading {
    opacity: 0.6 !important;
    pointer-events: none !important;
}

.caress-cart-widget a.remove.loading::before {
    content: "⟳" !important;
    animation: spin 1s linear infinite !important;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modern X icon using CSS */
.caress-cart-widget a.remove[role="button"]::before,
.caress-cart-widget .product-remove a.remove::before,
.caress-cart-widget .woocommerce-cart-form__cart-item a.remove::before,
.caress-cart-widget a[data-product_id]::before {
    content: "✕" !important;
    font-size: 18px !important;
    font-weight: 300 !important;
    line-height: 1 !important;
    display: block !important;
    margin-top: 8px !important;
}

.caress-cart-widget a.remove[role="button"]:hover,
.caress-cart-widget .product-remove a.remove:hover,
.caress-cart-widget .woocommerce-cart-form__cart-item a.remove:hover,
.caress-cart-widget a[data-product_id]:hover {
    color: #fff !important;
    background-color: #dc3545 !important;
    transform: scale(1.1) !important;
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3) !important;
}

.caress-cart-widget .button:hover {
    background-color: #005a87;
}

.caress-cart-widget .button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.caress-cart-widget .cart-collaterals {
    margin-top: 2em;
}

.caress-cart-widget .cart_totals {
    background-color: #f8f9fa;
    padding: 1.5em;
    border-radius: 8px;
}

.caress-cart-widget .cart_totals h2 {
    margin-top: 0;
    margin-bottom: 1em;
    font-size: 1.5em;
    color: #333;
}

.caress-cart-widget .shop_table {
    width: 100%;
    border-collapse: collapse;
}

.caress-cart-widget .shop_table th,
.caress-cart-widget .shop_table td {
    padding: 0.75em;
    text-align: right;
    border-bottom: 1px solid #ddd;
}

.caress-cart-widget .shop_table th {
    font-weight: 600;
    color: #333;
}

.caress-cart-widget .order-total th,
.caress-cart-widget .order-total td {
    font-size: 1.2em;
    font-weight: bold;
    border-bottom: none;
}

.caress-cart-widget .wc-proceed-to-checkout {
    margin-top: 1.5em;
    text-align: center;
}

.caress-cart-widget .checkout-button {
    background-color: #28a745;
    color: white;
    padding: 1em 2em;
    font-size: 1.1em;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.3s ease;
}

.caress-cart-widget .checkout-button:hover {
    background-color: #218838;
    color: white;
}

.caress-cart-widget .woocommerce-message {
    background-color: #d4edda;
    color: #155724;
    padding: 1em;
    margin-bottom: 1em;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
}

.caress-cart-widget .woocommerce-message a {
    color: #155724;
    text-decoration: underline;
}

.caress-cart-widget .woocommerce-cart-empty {
    text-align: center;
    padding: 2em;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin: 1em 0;
}

/* Hide update cart button immediately to prevent flash */
.caress-cart-widget .actions .button[name="update_cart"],
.caress-cart-widget .actions .button:contains("לעדכן סל קניות") {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Hide quantity and subtotal columns immediately to prevent flash */
.caress-cart-widget .product-quantity,
.caress-cart-widget .product-subtotal {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Hide quantity and subtotal column headers */
.caress-cart-widget .woocommerce-cart-form__contents th:nth-child(3),
.caress-cart-widget .woocommerce-cart-form__contents th:nth-child(4),
.caress-cart-widget .woocommerce-cart-form__contents td:nth-child(3),
.caress-cart-widget .woocommerce-cart-form__contents td:nth-child(4) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Force product image width to 100px */
.caress-cart-widget .product-thumbnail img,
.caress-cart-widget .product-thumbnail a img {
    width: 100px !important;
    height: auto !important;
    max-width: 100px !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .caress-cart-widget .woocommerce-cart-form__contents {
        font-size: 16px;
        display: block;
        width: 100%;
    }
    
    .caress-cart-widget .woocommerce-cart-form__contents thead {
        display: none;
    }
    
    .caress-cart-widget .woocommerce-cart-form__contents tbody {
        display: block;
        width: 100%;
    }
    
    .caress-cart-widget .woocommerce-cart-form__contents tr {
        display: block;
        margin-bottom: 20px;
        padding: 15px;
        border: 1px solid #ddd;
        border-radius: 8px;
        background: #fff;
        position: relative;
    }
    
    .caress-cart-widget .woocommerce-cart-form__contents th,
    .caress-cart-widget .woocommerce-cart-form__contents td {
        display: block;
        padding: 8px 0;
        text-align: right;
        border: none;
        width: 100%;
    }
    
    .caress-cart-widget .product-remove {
        position: absolute;
        top: 10px;
        left: 10px;
        width: 35px;
        height: 35px;
    }
    
    .caress-cart-widget .product-remove a,
    .caress-cart-widget .product-remove a[role="button"] {
        width: 35px !important;
        height: 35px !important;
        line-height: 35px !important;
        font-size: 0 !important;
    }
    
    .caress-cart-widget .product-remove a::before,
    .caress-cart-widget .product-remove a[role="button"]::before {
        font-size: 16px !important;
        margin-top: 6px !important;
    }
    
    .caress-cart-widget .product-thumbnail {
        width: 100%;
        text-align: center;
        margin-bottom: 10px;
    }
    
    .caress-cart-widget .product-thumbnail img {
        max-width: 80px;
        height: auto;
    }
    
    .caress-cart-widget .product-name {
        font-size: 18px;
        font-weight: 600;
        margin-bottom: 10px;
        padding-right: 50px;
        display: inline-block;
        width: 60%;
        vertical-align: top;
    }
    
    .caress-cart-widget .product-price,
    .caress-cart-widget .product-subtotal {
        font-size: 16px;
        font-weight: 600;
        color: #bd7696;
        margin-bottom: 10px;
        display: inline-block;
        width: 35%;
        text-align: left;
        vertical-align: top;
    }
    
    /* Hide price label on mobile */
    .caress-cart-widget .product-price .woocommerce-Price-amount,
    .caress-cart-widget .product-subtotal .woocommerce-Price-amount {
        display: inline;
    }
    
    .caress-cart-widget .product-price .woocommerce-Price-currencySymbol,
    .caress-cart-widget .product-subtotal .woocommerce-Price-currencySymbol {
        display: inline;
    }
    
    /* Hide "מחיר:" label on mobile */
    .caress-cart-widget .product-price:before,
    .caress-cart-widget .product-subtotal:before {
        display: none !important;
    }
    
    /* Alternative selectors for price labels */
    .caress-cart-widget .product-price span:first-child:not(.woocommerce-Price-amount):not(.woocommerce-Price-currencySymbol),
    .caress-cart-widget .product-subtotal span:first-child:not(.woocommerce-Price-amount):not(.woocommerce-Price-currencySymbol) {
        display: none !important;
    }
    
    .caress-cart-widget .product-quantity {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .caress-cart-widget .quantity {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
    }
    
    .caress-cart-widget .quantity input {
        width: 80px;
        height: 44px;
        font-size: 16px;
        text-align: center;
        border: 2px solid #ddd;
        border-radius: 6px;
        padding: 8px;
    }
    
    .caress-cart-widget .coupon {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        margin-bottom: 20px;
    }
    
    .caress-cart-widget .coupon input {
        max-width: none;
        height: 50px;
        font-size: 16px;
        padding: 12px 15px;
    }
    
    .caress-cart-widget .button {
        height: 50px;
        font-size: 16px;
        padding: 12px 20px;
        width: 100%;
        max-width: none;
    }
    
    .caress-cart-widget .actions {
        text-align: center;
    }
    
    .caress-cart-widget .cart_totals {
        padding: 20px;
        margin-top: 20px;
    }
    
    .caress-cart-widget .shop_table th,
    .caress-cart-widget .shop_table td {
        padding: 12px 0;
        font-size: 16px;
    }
    
    .caress-cart-widget .checkout-button {
        width: 100%;
        padding: 15px 20px;
        font-size: 18px;
        height: auto;
        min-height: 50px;
    }
}

@media (max-width: 480px) {
    .caress-cart-widget .woocommerce-cart-form__contents tr {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .caress-cart-widget .product-name {
        font-size: 16px;
        padding-right: 40px;
        width: 55%;
    }
    
    .caress-cart-widget .product-price,
    .caress-cart-widget .product-subtotal {
        width: 40%;
        font-size: 14px;
    }
    
    .caress-cart-widget .product-thumbnail img {
        max-width: 60px;
    }
    
    .caress-cart-widget .quantity input {
        width: 70px;
        height: 40px;
        font-size: 14px;
    }
    
    .caress-cart-widget .button {
        height: 45px;
        font-size: 15px;
        padding: 10px 15px;
    }
    
    .caress-cart-widget .checkout-button {
        font-size: 16px;
        padding: 12px 15px;
        min-height: 45px;
    }
}

/* Coupon Button Styles */
.caress-cart-widget .coupon-style-default {
    background-color: #f8f9fa !important;
    color: #333 !important;
    border: 1px solid #ddd !important;
}

.caress-cart-widget .coupon-style-primary {
    background-color: #007cba !important;
    color: white !important;
    border: 1px solid #007cba !important;
}

.caress-cart-widget .coupon-style-secondary {
    background-color: #6c757d !important;
    color: white !important;
    border: 1px solid #6c757d !important;
}

.caress-cart-widget .coupon-style-success {
    background-color: #28a745 !important;
    color: white !important;
    border: 1px solid #28a745 !important;
}

.caress-cart-widget .coupon-style-danger {
    background-color: #dc3545 !important;
    color: white !important;
    border: 1px solid #dc3545 !important;
}

.caress-cart-widget .coupon-style-warning {
    background-color: #ffc107 !important;
    color: #212529 !important;
    border: 1px solid #ffc107 !important;
}

.caress-cart-widget .coupon-style-info {
    background-color: #17a2b8 !important;
    color: white !important;
    border: 1px solid #17a2b8 !important;
}

.caress-cart-widget .coupon-style-light {
    background-color: #f8f9fa !important;
    color: #212529 !important;
    border: 1px solid #f8f9fa !important;
}

.caress-cart-widget .coupon-style-dark {
    background-color: #343a40 !important;
    color: white !important;
    border: 1px solid #343a40 !important;
}

/* Hover effects for coupon buttons */
.caress-cart-widget .coupon-style-primary:hover {
    background-color: #005a87 !important;
}

.caress-cart-widget .coupon-style-secondary:hover {
    background-color: #545b62 !important;
}

.caress-cart-widget .coupon-style-success:hover {
    background-color: #1e7e34 !important;
}

.caress-cart-widget .coupon-style-danger:hover {
    background-color: #c82333 !important;
}

.caress-cart-widget .coupon-style-warning:hover {
    background-color: #e0a800 !important;
}

.caress-cart-widget .coupon-style-info:hover {
    background-color: #138496 !important;
}

.caress-cart-widget .coupon-style-light:hover {
    background-color: #e2e6ea !important;
}

.caress-cart-widget .coupon-style-dark:hover {
    background-color: #23272b !important;
}

/* Hide quantity section when quantity is 1 */
.caress-cart-widget .woocommerce-cart-form__contents tr:has(.quantity input[value="1"]) .product-quantity,
.caress-cart-widget .woocommerce-cart-form__contents tr:has(.quantity input[value="1"]) .product-quantity * {
    display: none !important;
}

/* Ensure product-name is always visible on mobile */
@media (max-width: 768px) {
    .caress-cart-widget .product-name,
    .caress-cart-widget .product-name * {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Hide quantity section completely on mobile */
    .caress-cart-widget .product-quantity {
        display: none !important;
    }

/* Alternative approach for browsers that don't support :has() */
.caress-cart-widget .woocommerce-cart-form__contents .product-quantity {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.caress-cart-widget .woocommerce-cart-form__contents .product-quantity.hide-quantity {
    display: none;
    pointer-events: none;
} 
}
