.basket {
    min-height: 45vh;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.075);
    padding: 24px 16px;      
    margin: 0;                 /* убираем центровку */
}

.cart-page {
    padding-top: 128px;
}

.alert {
    margin-top: 5px;
}
.alert a {
    color: #7F3476;            /* акцентный цвет для ссылок */
    font-weight: 600;
}
.alert a:hover {
    cursor: pointer;
    text-decoration: underline;
    transition: all 0.3s ease;
}

.table-responsive {
    margin-top: 10px;
    max-width: 100%;
    background-color: white;
    border-radius: 8px;
}
/* === Группа кнопок количества (единый блок) === */
.quantity {
    display: flex;
    align-items: center;
    gap: 0;
    max-width: 120px;
    background-color: white;
    border-radius: 6px;
    border: 1px solid #ced4da;
    overflow: hidden;
}

.qty-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background-color: #f8f9fa;
    color: #212529;
    font-weight: bold;
    font-size: 19px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    cursor: pointer;
    user-select:none;
}

.qty-btn:first-child {
    border-radius: 6px 0 0 6px;
}
.qty-btn:last-child {
    border-radius: 0 6px 6px 0;
}
.qty-btn:hover {
    background-color: #e2e6ea;
}

/* Убираем переопределение цветов для primary-кнопок — они остаются стандартными */
/* .qty-btn.btn-primary { ... } удалено */

.qty-input {
    width: 48px;
    height: 36px;
    text-align: center;
    border: none;
    border-left: 1px solid #ced4da;
    border-right: 1px solid #ced4da;
    border-radius: 0;
    padding: 0;
    -moz-appearance: textfield;
    background-color: white;
    font-size: 16px;
}
.qty-input:focus {
    outline: none;
    box-shadow: inset 0 0 0 3px rgba(127, 52, 118, 0.25); /* акцентный цвет для фокуса */
    z-index: 1;
}
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Кнопка удаления товара — стандартный Bootstrap .btn-danger */
.ms-remove .btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    line-height: 1;
    /* цвет не переопределяем, остаётся как в Bootstrap */
}

/* Кнопка очистки корзины — стандартный Bootstrap .btn-danger */
.ms3_form .btn-danger ,.btn-order{
    padding: 8px 24px;
    font-size: 16px;
    border-radius:10px;
    margin-top:10px;
}
.btn-order{
    background:#7F3476;
    color:#fff;
    transition:all .3s ease;
    border: 1px solid #7F3476;
}
.btn-order:hover{
     background:#7f34767d;
    
}
.table-responsive table {
    width: 100%;
    table-layout: fixed; /* фиксированная вёрстка, ширина колонок будет такой, как зададим */
}
.qty-btn:disabled,
.qty-btn.qty-btn--disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #e9ecef; /* светло-серый фон */
    pointer-events: none; /* запрет кликов */
}

/* Можно также убрать hover-эффекты для disabled */
.qty-btn:disabled:hover,
.qty-btn.qty-btn--disabled:hover {
    background-color: #e9ecef;
    transform: none;
    box-shadow: none;
}
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.table-responsive table {
    width: 100%;
    table-layout: fixed; /* фиксированная ширина колонок по заданным процентам */
    border-collapse: collapse;
}
.table tbody tr th{
    padding-bottom: 9px;
}
.table tbody tr td{
   padding: 9px;
   border-bottom:1px solid #e5e5e5;
   border-top:1px solid #e5e5e5;
}
.table tbody tr th{
    padding-top: 9px;
}
/* Чуть больше отступов по краям */
.table-responsive th:first-child{
    padding-left: 16px;
}
.table-responsive th:last-child:not(.total_cost){
    padding-right: 16px;
}
.ms-price,.ms-cost,.total_cost,.ms-count,.ms-remove {
   text-align: center;
}

/* Ширина колонок (проценты можно менять под свои предпочтения) */
.ms-title,.total {
    width: 45%;
}
.ms-count,.total_count {
    width: 15%;
}
.ms-price,.total_cost  {
    width: 12%;
}
.ms-cost {
    width: 12%;
}
.ms-remove {
    width: 8%;
}

/* Чтобы длинные числа в ценах не переносились */
.ms-price span,
.ms-cost span {
    white-space: nowrap;
}

/* Блок количества по центру ячейки */
.ms-count .quantity {
    margin: 0 auto;
}

/* Растягиваем flex-блок с картинкой и названием на всю ширину ячейки */
.ms-title .d-flex {
    align-items: center;
    display: flex;
    width: 100%;
    gap: 24px;
}

/* Перенос длинных названий */
.ms-title a,
.ms-title span {
    word-break: break-word;
    transition: all .2s ease;
}
.ms-title a:hover{
    color:#7F3476;
    font-weight:500;
    
}
.ms-image {
    flex-shrink: 0;
    width: 90px;
}
.ms-image img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

/* Селекты опций на всю ширину */
.ms3_cart_options {
    width: 100% !important;
    margin-top: 8px;
}

.btns-wrapper{
    display:flex;
    justify-content:space-between;
}
@media (max-width: 768px) {
    .basket {
        box-shadow:none;
        background-color:#FFFFF0;
    }
  
    .cart-page {
        padding-top:46px;
    }
    
    .table-responsive {
        overflow:hidden;
    }
    /* Сбрасываем табличную модель */
    .table-responsive table,
    .table-responsive thead,
    .table-responsive tbody,
    .table-responsive tr:not(.ms-header),
    .table-responsive td {
        display: block;
    }
    .ms-header{
        display: none;
        overflow: hidden;
    }
    /* Прячем заголовок таблицы */
    /* Каждая строка становится карточкой */
    .table-responsive tr {
        margin-bottom: 20px;
        border: 1px solid #dee2e6;
        border-radius: 12px;
        padding: 16px;
        
        position: relative;
    }

    /* Ячейки — флекс-контейнеры с подписями */
    .table-responsive td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 8px 0;
        border: none;
        border-bottom: 1px solid #f0f0f0;
    }
    .table-responsive td:first-child{
        border-top:none;
    }
    .table-responsive td:last-child {
        border-bottom: none;
    }
     .table-responsive tr:last-child,.table-responsive tr:nth-last-child(2){
         margin-bottom:0;
     }
    .ms-count::before {
        content: "Количество: ";
        font-weight: 600;
        width: 40%;
        color: #7F3476;
        text-align:left;
    }
    .ms-price::before {
        content: "Цена: ";
        font-weight: 600;
        width: 40%;
        color: #7F3476;
        text-align:left;
    }
    .ms-cost::before {
        content: "Сумма: ";
        font-weight: 600;
        width: 40%;
        color: #7F3476;
        text-align:left;
    }
    .ms-remove::before {
        content: "Удалить: ";
        font-weight: 600;
        width: 40%;
        color: #7F3476;
        text-align:left;
    }
    .ms-title,.total {
        width: 100%;
    }
    .ms-count,.total_count {
        width: 100%;
    }
    .ms-price,.total_cost  {
        width: 100%;
    }
    .ms-cost {
        width: 100%;
    }
    .ms-remove {
        width: 100%;
    }
    /* Блок с изображением и названием */
    .ms-title .d-flex {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 12px;
        width: 100%;
    }
    .ms-image {
        width: 100px; /* фиксированная ширина для картинки */
        margin-bottom: 4px;
    }
    .ms-image img {
        max-width: 100%;
        height: auto;
    }
    /* Количество по левому краю */
    .quantity {
        margin-left: 0 !important;
        max-width: 120px;
    }

    /* Селекты опций на всю ширину */
    .ms3_cart_options {
        width: 100% !important;
    }

    /* Кнопка удаления — справа */
    .ms-remove {
        justify-content: flex-end;
    }
    .ms-remove .btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    /* Строка итогов (ms-footer) */
    .ms-footer {
        background-color: #FFFFF0;
        border-radius: 12px;
        padding: 12px 16px !important;
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        border:none!important;
    }
    .ms-footer th {
        display: inline-block !important;
        padding: 0 !important;
        border: none;
        width: auto !important;
    }
    .ms-footer .total {
        font-weight: 600;
    }
    .ms-footer .total_count,
    .ms-footer .total_cost {
        text-align: right;
    }
}
@media(max-width:460px){
    .btns-wrapper .btn-danger,.btns-wrapper .btn-order{
        padding: 8px 6px;
    }
}