/* === پایه === */
.bol-table { width: 100%; border-collapse: separate; border-spacing: 5px; margin-bottom: 20px; background: transparent; }
.bol-table th, .bol-table td { text-align: center; border: 1px solid #e0e0e0; padding: 10px 15px; border-radius: 8px; }
.bol-table tbody tr { background: transparent !important; }
.bol-table thead th { border-radius: 8px; white-space: nowrap; }

/* === کنترل‌های بالای جدول === */
.bol-top-controls { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; margin-bottom: 15px; }

/* === جستجو === */
.bol-search-wrapper { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 200px; }
.bol-search-input { flex: 1; height: 45px; padding: 8px 15px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; outline: none; transition: border-color 0.3s; min-width: 0; }
.bol-search-input:focus { border-color: #007cba; }
.bol-search-btn { width: 45px; height: 45px; min-width: 45px; background: #007cba; border: none; border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: opacity 0.3s; flex-shrink: 0; }
.bol-search-btn svg { fill: #fff; width: 18px; height: 18px; }
.bol-search-btn:hover { opacity: 0.85; }

/* === سوئیچ موجودی === */
.bol-stock-toggle-wrapper { display: flex; align-items: center; flex-shrink: 0; }
.bol-stock-toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.bol-stock-checkbox { display: none; }
.bol-stock-slider { position: relative; width: 44px; height: 24px; background: #ccc; border-radius: 12px; transition: background 0.3s; flex-shrink: 0; }
.bol-stock-slider::before { content: ''; position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; background: #fff; border-radius: 50%; transition: transform 0.3s; }
.bol-stock-checkbox:checked + .bol-stock-slider { background: #28a745; }
.bol-stock-checkbox:checked + .bol-stock-slider::before { transform: translateX(-20px); }
.bol-stock-label { font-size: 14px; color: #333; white-space: nowrap; }
.bol-product-row.out-of-stock-hidden { display: none; }

/* === فیلد تعداد با دکمه‌های +/- === */
.bol-qty-wrapper { display: inline-flex; align-items: center; gap: 0; border: 1px solid #ddd; border-radius: 8px; overflow: hidden; direction: ltr; }
.bol-qty-wrapper .bol-qty-btn { width: 32px; height: 38px; min-width: 32px; background: #f0f0f0; border: none; font-size: 20px; font-weight: bold; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; color: #333; user-select: none; flex-shrink: 0; line-height: 1; padding: 0; }
.bol-qty-wrapper .bol-qty-btn:hover { background: #007cba; color: #fff; }
.bol-qty-wrapper .bol-qty-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.bol-qty-wrapper .bol-qty { width: 60px; height: 38px; text-align: center; border: none; border-left: 1px solid #ddd; border-right: 1px solid #ddd; font-size: 14px; outline: none; padding: 0 5px; border-radius: 0; background: #fff; color: #333; font-family: inherit; }
.bol-qty-wrapper .bol-qty::placeholder { color: #ccc; font-size: 12px; }
.bol-qty-wrapper .bol-qty:focus { outline: none; background: #fafafa; }
.bol-qty-wrapper .bol-qty-minus { order: 1; }
.bol-qty-wrapper .bol-qty { order: 2; }
.bol-qty-wrapper .bol-qty-plus { order: 3; }

/* === دکمه‌ها === */
.bol-buttons-wrapper { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.bol-add-to-cart-btn { cursor: pointer; padding: 12px 25px; background: #007cba; color: #fff; border: none; border-radius: 6px; font-size: 16px; transition: all 0.3s; }
.bol-add-to-cart-btn:hover { background: #005a87; }
.bol-add-to-cart-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.bol-view-cart-btn { display: inline-block; padding: 12px 25px; background: #28a745; color: #fff; border: none; border-radius: 6px; font-size: 16px; text-decoration: none; transition: all 0.3s; cursor: pointer; }
.bol-view-cart-btn:hover { background: #218838; color: #fff; text-decoration: none; }

/* === پیام‌ها === */
.bol-message { margin-top: 10px; padding: 10px; border-radius: 4px; display: none; }
.bol-message.success { background: #d4edda; color: #155724; }
.bol-message.error { background: #f8d7da; color: #721c24; }

/* === ناموجود === */
.bol-out-of-stock { color: #dc3545; font-size: 0.85em; font-style: italic; }

/* === فوتر جدول === */
.bol-total-summary { text-align: left !important; font-weight: bold; padding: 12px 15px !important; }
.bol-total-label { margin-right: 10px; }
.bol-grand-total { font-size: 1.1em; }

/* === تخفیف کل سبد === */
#bol-cart-discount-row td { color: #28a745 !important; }
#bol-final-total-row td { font-size: 1.2em !important; font-weight: bold !important; }

/* === ریسپانسیو === */
.bol-table-responsive { width: 100%; overflow-x: auto; }

/* === ریسپانسیو کارتی راست‌چین === */
@media screen and (max-width: 767px) {
    .bol-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        padding: 8px 10px;
        border: none;
        border-bottom: 1px solid #eee;
    }
    .bol-table tbody td::before {
        content: attr(data-label);
        font-weight: bold;
        text-align: right;
        flex-shrink: 0;
        margin-right: 10px;
        margin-left: 0;
    }
    .bol-table tbody td:last-child { border-bottom: none; }
    .bol-table tbody tr {
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 8px;
        padding: 10px;
        background: #fff;
    }
    .bol-top-controls { flex-direction: column; align-items: stretch; }
    .bol-search-wrapper { min-width: auto; }
}