/* Панель корзины: выезжает справа, макс. ширина 750px, на всю высоту экрана */
.custom-basket-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    pointer-events: none;
    visibility: hidden;
    transition: visibility 0.3s ease;
}

.custom-basket-panel_open {
    pointer-events: auto;
    visibility: visible;
}

.custom-basket-panel__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-basket-panel_open .custom-basket-panel__overlay {
    opacity: 1;
}

.custom-basket-panel__drawer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 750px;
    background: #fff;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.custom-basket-panel_open .custom-basket-panel__drawer {
    transform: translateX(0);
}

/* Шапка: крестик слева, "Корзина" справа на одном уровне */
.custom-basket-panel__header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e5e5;
}

.custom-basket-panel__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #171717;
    border-radius: 6px;
    transition: background 0.2s;
}

.custom-basket-panel__close:hover {
    background: #f2f2f2;
}

.custom-basket-panel__title {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
    text-transform: uppercase;
    font-family: 'Noto Sans', sans-serif;
    color: #171717;
}

/* Скролл товаров: полосу скролла скрыть */
.custom-basket-panel__scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.custom-basket-panel__scroll::-webkit-scrollbar {
    display: none;
}

.custom-basket-panel__items {
    padding: 16px 24px 24px;
}

/* Внешний вид товара как в bootstrap_v4 (order-detail-item) */
.custom-basket-panel__item.order-detail-item {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid #e5e5e5;
    align-items: center;
    transition: opacity 0.3s, transform 0.3s;
}

.custom-basket-panel__item.order-detail-item:last-child {
    border-bottom: none;
}

.custom-basket-panel__item .order-detail-item-image {
    flex-shrink: 0;
    width: 210px;
    height: 210px;
    border-radius: 4px;
    overflow: hidden;
}

.custom-basket-panel__item .order-detail-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.custom-basket-panel__item .order-detail-item-info {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.custom-basket-panel__item .order-detail-item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.custom-basket-panel__item .order-detail-item-name-wrapper {
    flex: 1;
    min-width: 0;
}

.custom-basket-panel__item .order-detail-item-name {
    font-size: 16px;
    font-weight: 500;
    color: #111;
    text-decoration: none;
    margin: 0;
    font-family: 'Noto Sans', sans-serif;
}

.custom-basket-panel__item a.order-detail-item-name:hover {
    text-decoration: underline;
}

.custom-basket-panel__item .order-detail-item-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.custom-basket-panel__item .order-detail-item-btn-favorite,
.custom-basket-panel__item .order-detail-item-btn-remove {
    display: inline-flex;
    align-items: flex-start;
    justify-content: flex-end;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    background: none!important;
}

.custom-basket-panel__item .order-detail-item-btn-favorite
{
    padding-top: 2px;
}

.custom-basket-panel__item .order-detail-item-btn-favorite:hover,
.custom-basket-panel__item .order-detail-item-btn-remove:hover {
    background: #e5e5e5;
}

.custom-basket-panel__item .order-detail-item-btn-favorite svg {
    width: 19px;
    height: 16px;
}

.custom-basket-panel__item .order-detail-item-btn-remove svg {
    width: 20px;
    height: 20px;
    color: #171717;
}

.custom-basket-panel__item .order-detail-item-btn-remove:hover svg {
    color: #ff4444;
}

.custom-basket-panel__item .order-detail-item-btn-favorite svg path {
    fill: none;
    stroke: #171717;
}

.custom-basket-panel__item .order-detail-item-btn-favorite.product__btn-favorite_active svg path {
    fill: #171717;
}

/* Состояние удаления */
.custom-basket-panel__item.removing {
    opacity: 0.5;
    pointer-events: none;
}

/* Состояние обновления количества */
.custom-basket-panel__item.updating .order-detail-item-qty {
    opacity: 0.6;
    pointer-events: none;
}

/* Блок количества: кнопки − и + по бокам от цифры */
.order-detail-item-prop_qty {
    align-items: center;
}

.order-detail-item-qty {
    display: inline-flex;
    align-items: center;
    gap: 0;
    border: none!important;
    border-radius: 6px;
    overflow: hidden;
}

.order-detail-item-qty-btn {
    width: 15px;
    height: 32px;
    padding: 0;
    border: none!important;
    background: none!important;
    color: #171717;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.order-detail-item-qty-value {
    min-width: 36px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Noto Sans', sans-serif;
    color: #111;
}

.order-detail-item-qty-minus {
    border-right: 1px solid #e5e5e5;
}

.order-detail-item-qty-plus {
    border-left: 1px solid #e5e5e5;
}

.custom-basket-panel__item .order-detail-item-props {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 14px;
}

.custom-basket-panel__item .order-detail-item-prop {
    display: flex;
    gap: 8px;
}

.custom-basket-panel__item .order-detail-item-prop-label {
    color: #111;
    flex-shrink: 0;
    width: 56px;
}

.custom-basket-panel__item .order-detail-item-prop-value {
    color: #111;
    font-family: 'Noto Sans', sans-serif;
}

.custom-basket-panel__empty {
    padding: 40px 20px;
    text-align: center;
    color: #666;
    font-size: 14px;
    font-family: 'Noto Sans', sans-serif;
}

/* Подвал: кнопки всегда внизу */
.custom-basket-panel__footer {
    flex-shrink: 0;
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid #e5e5e5;
    background: #fff;
}

.custom-basket-panel__btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Noto Sans', sans-serif;
    text-transform: uppercase;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.custom-basket-panel__btn_primary {
    background: #171717;
    color: #fff;
    max-height: 45px;
}

.custom-basket-panel__btn_primary:hover {
    background: #333;
    color: #fff;
}

.custom-basket-panel__btn_secondary {
    border: 1px solid #171717;
    color: #171717;
    background: #fff;
    max-height: 45px;
}

/* Индикатор загрузки */
.custom-basket-panel__loading {
    padding: 60px 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
    font-family: 'Noto Sans', sans-serif;
    position: relative;
}

.custom-basket-panel__loading::before {
    content: '';
    display: inline-block;
    width: 40px;
    height: 40px;
    margin-bottom: 16px;
    border: 3px solid #f3f3f3;
    border-top-color: #171717;
    border-radius: 50%;
    animation: custom-basket-spin 0.8s linear infinite;
}

@keyframes custom-basket-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


@media (max-width: 701px)
{
    .custom-basket-panel__item .order-detail-item-image
    {
        width: 100%;
        height: auto;
        max-width: 210px;
        max-height: 210px;
    }

    .custom-basket-panel__item .order-detail-item-image img
    {
        max-width: 210px;
        max-height: 210px;
    }
}

@media (max-width: 612px)
{
    .custom-basket-panel__item .order-detail-item-image
    {
        width: 100%;
        height: auto;
        max-width: 150px;
        max-height: 150px;
    }
}

@media (max-width: 543px)
{
    .custom-basket-panel__item .order-detail-item-image
    {
        width: 100%;
        height: auto;
        max-width: 100px;
        max-height: 100px;
    }

    .custom-basket-panel__item .order-detail-item-name
    {
        font-size: 14px;
    }

    .custom-basket-panel__btn_primary
    {
        font-size: 14px;
    }

    .custom-basket-panel__btn_secondary
    {
        font-size: 14px;
    }

    .custom-basket-panel__item .order-detail-item-actions
    {
        gap: 0;
    }
}

@media (max-width: 492px)
{
    .custom-basket-panel__item .order-detail-item-image
    {
        width: 100%;
        height: auto;
        max-width: 80px;
        max-height: 100px;
    }
}

@media (max-width: 451px)
{
    .custom-basket-panel__footer
    {
        flex-flow: column nowrap;
    }

    .custom-basket-panel__btn_primary
    {
        max-height: 40px;
    }

    .custom-basket-panel__btn_secondary
    {
        max-height: 40px;
    }
}

@media (max-width: 501px)
{
    .custom-basket-panel__header
    {
        border: none;
        padding: 10px 24px 5px 24px;
    }

    .custom-basket-panel__items
    {
        padding: 0 24px 10px 24px;
    }

    .custom-basket-panel__btn_primary,
    .custom-basket-panel__btn_secondary
    {
        font-size: 12px;
    }

    .custom-basket-panel__footer
    {
        padding: 5px 20px;
    }

    .custom-basket-panel__item .order-detail-item-btn-favorite
    {
        height: auto!important;
    }

    .custom-basket-panel__item .order-detail-item-btn-remove
    {
        height: auto!important;
    }

    .custom-basket-panel__item.order-detail-item
    {
        padding: 5px 0;
    }


}