/*
 * Lierac Israel — Cart UI Improvements v2.0
 * cart-improvements.css
 *
 * גישה: שינויים מינימליים ומדויקים בלבד
 * ללא שינוי display של אלמנטי טבלה
 */

/* ============================================
   QUANTITY CONTROLS — פקדי כמות
   (selectors confirmed in template.css)
   ============================================ */

/* Wrapper — pill shape */
.cart-info .eshop-quantity,
.quote-info .eshop-quantity {
    display: inline-flex !important;
    align-items: center;
    border: 1.5px solid #d0cac3;
    border-radius: 50px;
    overflow: hidden;
    background: #fff;
    vertical-align: middle;
}

/* +/- buttons */
.cart-info .eshop-quantity .btn,
.quote-info .eshop-quantity .btn {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    font-size: 18px !important;
    font-weight: 300 !important;
    color: #2c2c2c !important;
    line-height: 36px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.cart-info .eshop-quantity .btn:hover {
    background: #f5f4f2 !important;
    color: #b89a6b !important;
}

/* Quantity input */
.cart-info .eshop-quantity input[type="text"] {
    width: 40px !important;
    height: 36px !important;
    text-align: center !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    border: none !important;
    border-right: 1.5px solid #d0cac3 !important;
    border-left: 1.5px solid #d0cac3 !important;
    border-radius: 0 !important;
    background: #fff !important;
    color: #2c2c2c !important;
    outline: none !important;
    box-shadow: none !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ============================================
   CART TABLE — responsive on mobile
   Convert to scrollable instead of squeezing
   ============================================ */

/* On mobile: allow table to scroll, don't squeeze columns */
@media (max-width: 767px) {

    /* The Bootstrap .table-responsive adds overflow-x:auto,
       but we need to ensure the table keeps its natural column widths */
    #eshop-list,
    table#eshop-list {
        min-width: 480px; /* force enough width so product name isn't squeezed */
        table-layout: auto !important;
    }

    /* Wrap the table properly (Bootstrap does this, but reinforce) */
    .table-responsive {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        border: none !important;
    }

    /* Text cells: allow natural wrapping */
    #eshop-list tbody tr td {
        white-space: normal !important;
        word-break: break-word !important;
        vertical-align: middle !important;
    }

    /* Product name column: wider minimum */
    #eshop-list tbody tr td.cart-name,
    #eshop-list tbody tr td:nth-child(2) {
        min-width: 140px !important;
        word-break: break-word !important;
    }

    /* Make product name links readable */
    #eshop-list tbody tr td a {
        font-size: 13px !important;
        line-height: 1.5 !important;
        white-space: normal !important;
        word-break: break-word !important;
        display: block;
    }
    td.cart-product-name {
    min-width: 180px !important;
    font-weight: bold;
}
}

/* ============================================
   REMOVE ITEM BUTTON — כפתור הסרה
   ============================================ */
a.eshop-remove-item,
.eshop-remove-item {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 26px !important;
    height: 26px !important;
    background: #f5f4f2 !important;
    border: 1px solid #d0cac3 !important;
    border-radius: 50% !important;
    color: #888 !important;
    font-size: 15px !important;
    font-weight: 400 !important;
    text-decoration: none !important;
    line-height: 1 !important;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

a.eshop-remove-item:hover,
.eshop-remove-item:hover {
    background: #fee2e2 !important;
    border-color: #fca5a5 !important;
    color: #dc2626 !important;
}

/* ============================================
   CHECKOUT BUTTON — כפתור מעבר לתשלום
   ============================================ */
.checkout-content .btn.btn-primary,
.rtl .checkout-content .btn.btn-primary.pull-left {
    display: block !important;
    width: 100% !important;
    padding: 14px 24px !important;
    border-radius: 50px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    letter-spacing: 0.3px !important;
    text-align: center !important;
    margin-top: 8px !important;
    box-sizing: border-box !important;
}

/* ============================================
   CART ITEM COUNT BADGE — מונה פריטים
   ============================================ */
span.itemsincart {
    background: #e66a87 !important;
    color: #fff !important;
    border-radius: 50% !important;
    min-width: 18px !important;
    height: 18px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0 3px;
}

/* ============================================
   CHECKOUT FORM — שדות טופס צ'קאאוט
   Fix max-width: 200px that cuts fields on mobile
   ============================================ */
@media (max-width: 767px) {
    body.site.com_eshop.view-checkout input[type="text"],
    body.site.com_eshop.view-checkout input[type="password"],
    body.site.com_eshop.view-checkout input[type="email"],
    body.site.com_eshop.view-checkout input[type="tel"],
    body.site.com_eshop.view-checkout textarea {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
}

/* ============================================
   STICKY HEADER — mobile
   overflow:clip allows sticky without scroll container
   ============================================ */
@media (max-width: 767px) {
    /* Override overflow:hidden so sticky works on the header child */
    .body#top > .container {
        overflow: clip !important;
    }

    header.header.regular.topmenu {
        position: sticky;
        top: 0;
        z-index: 100;
        background: #fff;
        box-shadow: 0 1px 8px rgba(0, 0, 0, 0.08);
    }
}

/* ============================================
   LOADING SPINNER — אנימציית טעינה
   ============================================ */
.wait:empty::after {
    content: '';
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid #e0dbd4;
    border-top-color: #b89a6b;
    border-radius: 50%;
    animation: cart-spin 0.8s linear infinite;
    vertical-align: middle;
    margin: 20px auto;
}

@keyframes cart-spin {
    to { transform: rotate(360deg); }
}
