/* Основной контейнер */
.bx-basket {
    margin: 0 auto;
    opacity: 0;
    animation: basket-fade-in 0.3s ease-out forwards;
}

@keyframes basket-fade-in {
    to {
        opacity: 1;
    }
}

/* Заголовок корзины */
.bx-basket h1,
.bx-basket .basket-page-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 1.5rem;
}

/* Grid layout для разделения на товары и итог */
.bx-basket .row {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin: 0;
}

.bx-basket .col-xs-12 {
    width: 100%;
    padding: 0;
}

/* Основная раскладка: товары слева, итог справа */
.basket-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .basket-layout {
        grid-template-columns: 1fr 380px;
        align-items: start;
    }
}

.basket-layout__items {
    min-width: 0;
}

.basket-layout__total {
    position: relative;
}

@media (min-width: 1024px) {
    .basket-layout__total {
        position: sticky;
        top: 2rem;
    }
}

/* Список товаров */
.basket-items-list-wrapper {
    background: transparent;
    border: none;
    box-shadow: none;
}

.basket-items-list-wrapper-height-fixed,
.basket-items-list-wrapper-light {
    background: transparent !important;
}

/* Заголовок списка с поиском */
.basket-items-list-header {
    display: none;
}

/* Контейнер списка */
.basket-items-list-container {
    padding: 0;
}

/* Таблица товаров */
.basket-items-list-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

/* Строка товара - карточка */
.basket-items-list-table tr.basket-items-list-item-container {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    gap: 1rem;
    margin-bottom: 1rem;
    overflow: hidden;
}

.basket-items-list-table tr.basket-items-list-item-container:last-child {
    margin-bottom: 0;
}

@media (min-width: 768px) {
    .basket-items-list-table tr.basket-items-list-item-container {
        flex-direction: row;
        align-items: center;
    }
}

.basket-items-list-table tr.basket-items-list-item-container > td {
    border: none;
    padding: 0;
    background: transparent;
}

/* Ячейка с описанием товара */
.basket-items-list-item-descriptions {
    flex: 1;
    display: flex;
    align-items: center;
}

.basket-items-list-item-descriptions-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

/* Изображение товара */
.basket-item-block-image {
    flex-shrink: 0;
    width: 6rem;
    height: 6rem;
    min-width: 6rem;
    max-width: 6rem;
}

.basket-item-image {
    width: 6rem;
    height: 6rem;
    object-fit: contain;
    border-radius: 0.5rem;
}

.basket-item-image-link {
    display: block;
}

/* Информация о товаре */
.basket-item-block-info {
    flex: 1;
    text-align: center;
}

@media (min-width: 768px) {
    .basket-item-block-info {
        text-align: left;
    }
}

.basket-item-info-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 0.25rem 0;
}

.basket-item-info-name-link {
    color: inherit;
    text-decoration: none;
}

.basket-item-info-name-link:hover {
    color: #843687;
}

/* Характеристики товара */
.basket-item-block-properties {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 0.25rem;
}

@media (min-width: 768px) {
    .basket-item-block-properties {
        justify-content: flex-start;
    }
}

.basket-item-property {
    font-size: 0.875rem;
    color: #6b7280;
    display: inline-flex;
    gap: 0.25rem;
}

.basket-item-property-name {
    font-weight: 500;
}

.basket-item-property-value {
    color: #4b5563;
}

/* Блок с количеством */
.basket-items-list-item-amount {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

@media (min-width: 768px) {
    .basket-items-list-item-amount {
        margin-top: 0;
    }
}

.basket-item-block-amount {
    display: flex;
    align-items: center;
    background: #f3f4f6;
    border-radius: 0.5rem;
    padding: 0.25rem;
}

.basket-item-amount-btn-minus,
.basket-item-amount-btn-plus {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6b7280;
    font-size: 1.25rem;
    font-weight: 300;
    user-select: none;
    transition: color 0.2s;
}

.basket-item-amount-btn-minus:hover,
.basket-item-amount-btn-plus:hover {
    color: #4f46e5;
}

.basket-item-amount-btn-minus::before {
    content: '−';
}

.basket-item-amount-btn-plus::before {
    content: '+';
}

.basket-item-amount-filed-block {
    display: flex;
    align-items: center;
}

.basket-item-amount-filed {
    width: 3rem;
    text-align: center;
    border: none;
    background: transparent;
    font-weight: 600;
    font-size: 1rem;
    color: #1a1a1a;
    padding: 0.25rem;
}

.basket-item-amount-filed:focus {
    outline: none;
}

.basket-item-amount-field-description {
    display: none;
}

/* Блок с ценой */
.basket-items-list-item-price {
    text-align: center;
    margin-top: 1rem;
}

@media (min-width: 768px) {
    .basket-items-list-item-price {
        margin-top: 0;
        width: 8rem;
    }
}

.basket-item-block-price {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.basket-item-price-old {
    font-size: 0.875rem;
    color: #6b7280;
    text-decoration: line-through;
    margin-bottom: 0.25rem;
}

.basket-item-price-current {
    font-size: 1.125rem;
    font-weight: 700;
    color: #ef4444;
}

.basket-item-price-title {
    display: none;
}

.basket-item-price-difference {
    font-size: 0.75rem;
    color: #10b981;
    margin-top: 0.25rem;
}

/* Кнопка удаления */
.basket-items-list-item-remove {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

@media (min-width: 768px) {
    .basket-items-list-item-remove {
        margin-top: 0;
    }
}

.basket-item-block-actions {
    display: flex;
    align-items: center;
}

.basket-item-actions-remove {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #9ca3af;
    transition: color 0.2s;
    background: none;
    border: none;
    padding: 0;
}

.basket-item-actions-remove:hover {
    color: #ef4444;
}

.basket-item-actions-remove::before {
    content: '';
    display: block;
    width: 1.5rem;
    height: 1.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M6 18L18 6M6 6l12 12'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

/* Блок "Итого" */
.basket-checkout-container {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1.5rem;
}

.basket-checkout-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 1rem;
}

.basket-checkout-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    font-size: 1rem;
}

.basket-checkout-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.basket-checkout-label {
    color: #4b5563;
}

.basket-checkout-value {
    color: #1a1a1a;
    font-weight: 500;
}

.basket-checkout-discount .basket-checkout-value {
    color: #ef4444;
}

.basket-checkout-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #e5e7eb;
    padding-top: 0.75rem;
    margin-top: 0.5rem;
}

.basket-checkout-total .basket-checkout-label {
    font-weight: 700;
    color: #1a1a1a;
}

.basket-checkout-total .basket-checkout-value {
    font-weight: 700;
    font-size: 1.125rem;
}

/* Секция с промокодом - ПОСЛЕ итогов */
.basket-coupon-section {
    margin-top: 1.5rem;
}

.basket-coupon-field {
    display: flex;
    gap: 0.5rem;
}

.basket-coupon-input {
    flex: 1;
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    background: #ffffff;
}

.basket-coupon-input:focus {
    outline: none;
    border-color: #843687;
}

.basket-coupon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background: #843687;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.basket-coupon-btn:hover {
    background: #6b2a6e;
}

.basket-coupon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background: #4f46e5;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.basket-coupon-btn:hover {
    background: #4338ca;
}

.basket-coupon-btn-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: #ffffff;
}

/* Кнопки */
.basket-checkout-buttons {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.basket-btn-checkout {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: #843687;
    color: #ffffff;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    display: block;
    transition: background 0.2s;
}

.basket-btn-checkout:hover {
    background: #6b2a6e;
    color: #ffffff;
}

.basket-btn-checkout:hover {
    color: #ffffff;
}

.basket-btn-checkout.disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

/* Сообщения о промокодах */
.basket-coupon-messages {
    margin-top: 1rem;
}

.basket-coupon-message {
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.basket-coupon-message.text-success {
    background: #d1fae5;
    color: #065f46;
}

.basket-coupon-message.text-error {
    background: #fee2e2;
    color: #991b1b;
}

/* Ссылка "Продолжить покупки" */
.basket-continue-shopping {
    display: block;
    text-align: center;
    color: #6b2a6e;
    font-weight: 500;
    text-decoration: none;
    padding: 0.5rem;
    transition: text-decoration 0.2s;
}

.basket-continue-shopping:hover {
    text-decoration: underline;
}

/* Alert сообщения */
.alert-warning {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    color: #92400e;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.alert-warning .close {
    float: right;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
    color: #92400e;
    cursor: pointer;
    opacity: 0.7;
}

.alert-warning .close:hover {
    opacity: 1;
}

/* Уведомления о восстановлении */
.basket-items-list-item-notification {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 0.5rem;
    padding: 1rem;
}

.basket-items-list-item-removed-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.basket-items-list-item-removed-container > div:first-child {
    color: #92400e;
}

.basket-items-list-item-removed-block a {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 500;
}

.basket-items-list-item-removed-block a:hover {
    text-decoration: underline;
}

.basket-items-list-item-clear-btn {
    cursor: pointer;
    color: #6b7280;
    margin-left: 0.5rem;
}

/* SKU переключатели */
.basket-item-scu-list {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0 0;
}

.basket-item-scu-item {
    cursor: pointer;
}

.basket-item-scu-item-inner {
    display: block;
    width: 2rem;
    height: 2rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.25rem;
    background-size: cover;
    background-position: center;
    transition: border-color 0.2s;
}

.basket-item-scu-item.selected .basket-item-scu-item-inner {
    border-color: #4f46e5;
}

.basket-item-scu-item-text .basket-item-scu-item-inner {
    width: auto;
    height: auto;
    padding: 0.25rem 0.75rem;
    background: #f3f4f6;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Скрыть лишние элементы на мобильных */
@media (max-width: 767px) {
    .hidden-xs {
        display: none !important;
    }
    
    .visible-xs {
        display: block !important;
    }
}

@media (min-width: 768px) {
    .visible-xs {
        display: none !important;
    }
}

/* Адаптивная сетка для основной раскладки */
@media (min-width: 1024px) {
    .bx-basket > .row:first-child {
        display: grid;
        grid-template-columns: 2fr 1fr;
        gap: 2rem;
    }
    
    .bx-basket > .row:first-child > .col-xs-12:first-child {
        min-width: 0;
    }
    
    .bx-basket > .row:first-child > .col-xs-12:last-child {
        min-width: 0;
    }
}

/* Уведомления о купонах */
.basket-coupon-alert-section {
    margin-top: 1rem;
}

.basket-coupon-alert {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.basket-coupon-alert.text-success {
    background: #d1fae5;
    color: #065f46;
}

.basket-coupon-alert.text-error {
    background: #fee2e2;
    color: #991b1b;
}

.close-link {
    cursor: pointer;
    font-weight: 500;
}

.close-link:hover {
    text-decoration: underline;
}

/* Поиск - скрыть по умолчанию */
.basket-items-search-field {
    display: none;
}

/* Фильтры - скрыть */
.basket-items-list-header-filter {
    display: none;
}

/* Пустая корзина */
.basket-search-not-found {
    text-align: center;
    padding: 3rem 1rem;
}

.basket-search-not-found-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    background: #f3f4f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.basket-search-not-found-text {
    color: #6b7280;
    font-size: 1rem;
}

/* Пустая корзина */
.bx-sbb-empty-cart-container {
    text-align: center;
    padding: 4rem 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.bx-sbb-empty-cart-image {
    margin-bottom: 1.5rem;
}

.bx-sbb-empty-cart-image img {
    max-width: 200px;
    height: auto;
}

.bx-sbb-empty-cart-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 1rem;
}

.bx-sbb-empty-cart-desc {
    color: #6b7280;
    font-size: 1rem;
    line-height: 1.6;
}

.bx-sbb-empty-cart-desc a {
    color: #4f46e5;
    text-decoration: none;
}

.bx-sbb-empty-cart-desc a:hover {
    text-decoration: underline;
}

