/* ============================================================
   solid_cart_table.css — стили корзины (div-layout)
   ============================================================ */

/* Обёртка */
#cart_area {
    width: 100%;
    overflow-x: auto;
    padding: 8px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.16), 0 2px 4px rgba(0,0,0,0.22);
}

/* Контейнер */
.cart-container {
    min-width: 1070px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-family: 'Open Sans', sans-serif;
    color: #212121;
}

/* Шапка и строки */
.cart-header,
.cart-row {
    display: flex;
    align-items: center;
    padding: 12px 8px;
    gap: 8px;
}

.cart-header {
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
    color: #212121;
    position: sticky;
    top: 0;
    z-index: 1;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.cart-row {
    background: #fff;
    border-bottom: 1px solid #eee;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.cart-row:hover {
    background: #f0f6ff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

/* Общий стиль колонок */
.cart-item {
    flex: 1;
    min-width: 0;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
}

/* Размеры колонок */
.cart-checkbox  { flex: 0 0 40px; }
.cart-image     { flex: 0 0 70px; }
.cart-image img { max-width: 50px; max-height: 70px; object-fit: contain; border-radius: 4px; }
.cart-name      { flex: 2; white-space: normal; min-width: 150px; font-size: 15px; justify-content: flex-start; }
.cart-name a    { color: #1b6bb1; text-decoration: none; transition: color 0.2s ease; }
.cart-name a:hover { color: #1b6bb1; text-decoration: underline; }
.cart-price     { flex: 0 0 90px; text-align: right; max-width: 90px; justify-content: flex-end; }
.cart-quantity  { flex: 0 0 130px; }
.cart-sum       { flex: 0 0 90px; text-align: right; max-width: 90px; justify-content: flex-end; }
.cart-discount  { flex: 0 0 90px; }
.cart-stock       { flex: 0 0 70px; font-size: 13px; color: #555; }
.cart-stock-green  { color: #388e3c; }
.cart-stock-orange { color: #f57f17; }
.cart-stock-red    { color: #e53935; }
.cart-stock-zero   { color: #c62828; font-weight: 600; }
.cart-actions   { flex: 0 0 64px; display: flex; justify-content: flex-end; gap: 8px; }

/* Чекбокс */
.cart-checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #212121;
    border-radius: 4px;
    position: relative;
    cursor: pointer;
    background: #f5f5f5;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.cart-checkbox input[type="checkbox"]:hover {
    border-color: #1b6bb1;
    background: #e3f2fd;
}

.cart-checkbox input[type="checkbox"]:checked {
    border-color: #1b6bb1;
    background: #1b6bb1;
}

.cart-checkbox input[type="checkbox"]:checked::after {
    content: '\e5ca';
    font-family: 'Material Icons';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 16px;
    line-height: 1;
}

/* Контролы количества */
.cart-quantity-controls {
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border: 1px solid #bdbdbd;
    border-radius: 4px;
    overflow: hidden;
}

.cart-quantity-controls a {
    width: 32px;
    height: 36px;
    background: #f5f5f5;
    text-decoration: none;
    border: none;
    color: #424242;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: background 0.2s ease, color 0.2s ease;
}

.cart-quantity-controls a:hover {
    background: #e3f2fd;
    color: #1b6bb1;
}

.cart-quantity-controls a:active {
    background: #bdbdbd;
}

.cart-quantity-controls input {
    width: 44px;
    height: 36px;
    text-align: center;
    border: none;
    border-left: 1px solid #bdbdbd;
    border-right: 1px solid #bdbdbd;
    background: #fff;
    font-family: 'Open Sans', sans-serif;
    font-size: 15px;
    color: #212121;
    box-shadow: none;
    border-radius: 0;
}

.cart-quantity-controls input:focus {
    outline: none;
    box-shadow: inset 0 0 0 2px #1b6bb1;
    border-color: #1b6bb1;
}

/* Иконки действий (Material Icons) */
.cart-actions a {
    color: #757575;
    transition: color 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
}

.cart-actions a:hover {
    color: #1b6bb1;
    transform: scale(1.1);
}

.cart-actions a:last-child:hover {
    color: #e53935;
}

.cart-actions i.material-icons {
    font-size: 22px;
}

/* Бейджи скидок */
.discount-label {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    white-space: nowrap;
    border: 1px solid;
}
.discount-label-pct    { background: #e3f2fd; color: #1b6bb1; border-color: #90caf9; }
.discount-label-opt    { background: #f5f5f5; color: #616161; border-color: #d0d0d0; }
.discount-label-retail { background: #fff8e1; color: #f57f17; border-color: #ffe082; }
.discount-label-promo  { background: #fce4ec; color: #c62828; border-color: #ef9a9a; }

/* Футер */
.cart-footer {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #fff;
}

.cart-info-text {
    background: #eee;
    padding: 10px;
    margin: 0;
    border-radius: 5px;
    border: 1px solid #ddd;
    font-size: 13px;
    color: #555;
}

.cart-total {
    text-align: right;
    font-size: 18px;
}

.cart-total .sum-total {
    color: #212121;
}

.cart-order-btn {
    text-align: right;
}

/* Кнопка оформления заказа (outlined primary) */
.cart-order-btn a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 9px 24px;
    border-radius: 5px;
    border: 1px solid #1b6bb1;
    background: #fff;
    color: #1b6bb1;
    font-size: 14px;
    font-family: 'Open Sans', sans-serif;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.cart-order-btn a:hover {
    background: #1b6bb1;
    color: #fff;
}

/* Гараж — модальное окно */
body {
    padding: 0 !important;
}

#my_modal_box_for_garage .modal {
    z-index: 99999999;
    padding-right: 0px !important;
}

#my_modal_box_for_garage .modal-header {
    text-align: center;
    font-size: 14px;
    background: #fff;
    color: #000;
    border-bottom: 1px solid #999;
    padding: 10px 15px;
}

#my_modal_box_for_garage .close {
    color: #000;
}

#my_modal_box_for_garage .modal-footer {
    border-top: 1px solid #999;
    text-align: center;
}

#my_modal_box_for_garage .modal-dialog {
    max-width: 601px;
    margin: 30px auto;
    width: 100%;
}

/* === Прогресс-бар === */
.cart-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 8px 12px;
    gap: 0;
    margin-bottom: 8px;
}

.cart-progress-step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    color: #999;
    white-space: nowrap;
}

.cart-progress-step.active {
    color: #1b6bb1;
}

.cart-progress-step.active .cart-progress-num {
    background: #1b6bb1;
    color: #fff;
    border-color: #1b6bb1;
}

.cart-progress-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #ccc;
    font-size: 13px;
    font-weight: 500;
    color: #999;
    background: #fff;
    flex-shrink: 0;
}

.cart-progress-label {
    font-weight: 400;
}

.cart-progress-line {
    flex: 0 0 40px;
    height: 2px;
    background: #ddd;
    margin: 0 8px;
}

/* === Информационная панель === */
.cart-info-panel {
    display: flex;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 8px;
    background: #f0f6ff;
    border: 1px solid #d0e3f7;
    border-radius: 6px;
    flex-wrap: wrap;
}

.cart-info-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Open Sans', sans-serif;
    font-size: 13px;
    color: #444;
}

.cart-info-item i.material-icons {
    font-size: 18px;
    color: #1b6bb1;
    flex-shrink: 0;
}

/* === Тулбар над таблицей === */
.cart-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    margin-bottom: 8px;
    background: #f9f9f9;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    font-family: 'Open Sans', sans-serif;
    font-size: 13px;
    color: #555;
}

.cart-toolbar-title {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
    color: #666;
    padding-right: 12px;
    border-right: 1px solid #ddd;
}

.cart-toolbar-title i.material-icons {
    font-size: 16px;
    color: #888;
}

.cart-toolbar-option {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    margin: 0;
    user-select: none;
    font-weight: normal;
}

.cart-toolbar-option input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid #999;
    border-radius: 3px;
    position: relative;
    cursor: pointer;
    background: #fff;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.cart-toolbar-option input[type="checkbox"]:hover {
    border-color: #1b6bb1;
}

.cart-toolbar-option input[type="checkbox"]:checked {
    border-color: #e53935;
    background: #e53935;
}

.cart-toolbar-option input[type="checkbox"]:checked::after {
    content: '\e5ca';
    font-family: 'Material Icons';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 14px;
    line-height: 1;
}

/* === Блок "Поделиться корзиной" === */
.cart-share-block {
    padding: 12px 16px;
    background: #f9f9f9;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
}

.cart-share-block-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #444;
    margin-bottom: 4px;
}

.cart-share-block-header i.material-icons {
    font-size: 18px;
    color: #1b6bb1;
}

.cart-share-block-desc {
    font-family: 'Open Sans', sans-serif;
    font-size: 12px;
    color: #888;
    margin-bottom: 10px;
}

.cart-share-panel {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.cart-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    color: #555;
    font-size: 13px;
    font-family: 'Open Sans', sans-serif;
    text-decoration: none;
    background: #fff;
    transition: all 0.2s ease;
    cursor: pointer;
}

.cart-share-btn:hover {
    border-color: #1b6bb1;
    color: #1b6bb1;
    text-decoration: none;
}

.cart-share-btn i.material-icons {
    font-size: 18px;
}

/* === Toast уведомление === */
.cart-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #333;
    color: #fff;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Open Sans', sans-serif;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}

.cart-toast-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* === Скролл-обёртка с fade-намёком === */
.cart-scroll-wrapper {
    position: relative;
}
.cart-scroll-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 32px;
    height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 100%);
    pointer-events: none;
    z-index: 2;
    transition: opacity 0.3s;
    display: none;
}
.cart-scroll-wrapper.has-scroll::after {
    display: block;
}
.cart-scroll-wrapper.scrolled-end::after {
    opacity: 0;
}

/* Адаптив */
@media (max-width: 768px) {
    .cart-item {
        font-size: 13px;
        padding: 4px;
    }

    .cart-checkbox { flex: 0 0 32px; }
    .cart-image    { flex: 0 0 50px; }
    .cart-image img { max-width: 40px; max-height: 50px; }
    .cart-name     { min-width: 120px; font-size: 13px; }
    .cart-price    { flex: 0 0 70px; max-width: 70px; }
    .cart-sum      { flex: 0 0 70px; max-width: 70px; }
    .cart-stock     { flex: 0 0 55px; font-size: 12px; }
    .cart-quantity { flex: 0 0 110px; }

    .cart-progress { padding: 12px 4px 8px; }
    .cart-progress-step { font-size: 12px; gap: 4px; }
    .cart-progress-num { width: 24px; height: 24px; font-size: 11px; }
    .cart-progress-line { flex: 0 0 20px; margin: 0 4px; }
    .cart-progress-label { display: none; }

    .cart-info-panel { flex-direction: column; gap: 6px; padding: 8px 10px; }
    .cart-info-item { font-size: 12px; }

    .cart-quantity-controls a     { width: 28px; height: 32px; }
    .cart-quantity-controls input { width: 38px; height: 32px; }

    .cart-actions  { flex: 0 0 52px; gap: 4px; }
    .cart-actions i.material-icons { font-size: 20px; }

    .cart-header,
    .cart-row { padding: 8px 4px; }
}
