/* Кнопка "Вам может понадобиться" */
.cross-sell-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    margin-top: 15px;
}
.cross-sell-trigger__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.cross-sell-trigger__icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    display: block;
}

/* Инлайновый блок под описанием */
.cross-sell-inline-block {
    margin-top: 32px;
}
.cross-sell-inline-block .ordered-block__title {
    margin-bottom: 18px;
}
.cross-sell-inline-shell {
    border: 1px solid #eee;
    border-radius: 8px;
    background: #fff;
}
.cross-sell-content--inline {
    max-height: none;
    overflow: visible;
}

/* Оверлей попапа */
.cross-sell-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}
.cross-sell-popup-overlay.active {
    display: flex;
}

/* Попап */
.cross-sell-popup {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 960px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: crossSellFadeIn 0.3s ease;
}
@keyframes crossSellFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Заголовок попапа */
.cross-sell-popup__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
}
.cross-sell-popup__title {
    font-size: 20px;
    font-weight: 700;
    color: #0d237d;
    margin: 0;
}
.cross-sell-popup__close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}
.cross-sell-popup__close:hover {
    color: #333;
}

/* Табы */
.cross-sell-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 24px;
    border-bottom: 1px solid #eee;
}
.cross-sell-chip {
    white-space: nowrap;
    transition: all 0.2s ease;
}
.cross-sell-chip:hover {
    text-decoration: none;
}
.cross-sell-chip.active {
    cursor: default;
}
.cross-sell-chip.cross-sell-chip--inactive,
.cross-sell-chip:disabled {
    background: #fff !important;
    border-color: #d9d9d9 !important;
    color: #b6b6b6 !important;
    opacity: 1 !important;
    box-shadow: none !important;
}
.cross-sell-chip.cross-sell-chip--inactive:hover {
    background: #fff !important;
    border-color: #cfcfcf !important;
    color: #8f8f8f !important;
}

/* Контент табов */
.cross-sell-content {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}
.cross-sell-tab-pane {
    display: none;
}
.cross-sell-tab-pane.active {
    display: block;
}

/* Сетка товаров */
.cross-sell-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

/* Карточка товара */
.cross-sell-item {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 12px;
    transition: box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}
.cross-sell-item:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
.cross-sell-item__img-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1;
    margin-bottom: 10px;
    overflow: hidden;
    border-radius: 4px;
    text-decoration: none;
}
.cross-sell-item__img-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.cross-sell-item__img-wrap .no-photo {
    width: 60px;
    height: 60px;
    opacity: 0.3;
}
.cross-sell-item__code {
    font-size: 11px;
    color: #999;
    margin-bottom: 4px;
}
.cross-sell-item__name {
    font-size: 13px;
    color: #333;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    flex: 1;
}
.cross-sell-item__name:hover {
    color: #0d237d;
}

/* Наличие — используем .item-stock из каталога, лишь добавляем отступ */
.cross-sell-item .item-stock {
    margin-top: 4px;
}

/* Блок цен */
.cross-sell-item__prices {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.cross-sell-item__price {
    font-size: 15px;
    font-weight: 700;
    color: #333;
}
.cross-sell-item__old-price {
    font-size: 12px;
    color: #999;
    text-decoration: line-through;
}

/* Бейдж скидки — визуал как в каталоге (.sale_block .sale-number) */
.cross-sell-item__discount-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0;
    margin-top: 4px;
    white-space: nowrap;
    line-height: 14px;
}
.cross-sell-item__discount-pct {
    display: inline-block;
    background: #ffd83a;
    color: #333;
    font-size: 11px;
    font-weight: 400;
    padding: 2px 4px 2px 6px;
    white-space: nowrap;
}
.cross-sell-item__discount-eco {
    display: inline-block;
    background: #fff8db;
    border: 1px solid #ffd83a;
    border-radius: 0 3px 3px 0;
    font-size: 11px;
    font-weight: 400;
    color: #333;
    padding: 2px 5px 1px;
    white-space: nowrap;
}

/* Область кнопки/счётчика */
.cross-sell-item__cart-area {
    margin-top: 10px;
}

/* Кнопка "В корзину" — визуал как в каталоге */
.cross-sell-item__cart-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0 12px;
    height: 40px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    white-space: nowrap;
}
.cross-sell-item__cart-btn.loading {
    opacity: 0.6;
    pointer-events: none;
}
.cross-sell-item__cart-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Счётчик количества — визуал как в каталоге (.counter_block) */
.cross-sell-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    border: 1px solid #eee;
    border-radius: 3px;
    overflow: hidden;
    background: #fafafa;
    height: 40px;
    width: 100%;
    box-sizing: border-box;
}
.cross-sell-counter.loading {
    opacity: 0.5;
    pointer-events: none;
}
.cross-sell-counter__btn {
    width: 30px;
    height: 100%;
    background: transparent;
    border: none;
    font-size: 18px;
    font-weight: 400;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    flex-shrink: 0;
}
.cross-sell-counter__btn:hover {
    background: #f0f0f0;
}
.cross-sell-counter__minus:hover {
    color: #c62828;
}
.cross-sell-counter__qty {
    flex: 1;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    min-width: 30px;
}

/* Тост-уведомление "В корзине" */
.cross-sell-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 0;
    min-width: 280px;
    max-width: 340px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}
.cross-sell-toast.visible {
    opacity: 1;
    transform: translateX(0);
}
.cross-sell-toast__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}
.cross-sell-toast__close {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}
.cross-sell-toast__close:hover {
    color: #333;
}
.cross-sell-toast__body {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
}
.cross-sell-toast__img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    flex-shrink: 0;
}
.cross-sell-toast__name {
    font-size: 13px;
    color: #555;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Лоадер */
.cross-sell-loader {
    text-align: center;
    padding: 40px;
}
.cross-sell-loader__spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #eee;
    border-top-color: #0d237d;
    border-radius: 50%;
    animation: crossSellSpin 0.8s linear infinite;
    margin: 0 auto 12px;
}
@keyframes crossSellSpin {
    to { transform: rotate(360deg); }
}

/* Адаптив */
@media (max-width: 768px) {
    .cross-sell-popup {
        width: 95%;
        max-height: 90vh;
        border-radius: 8px;
    }
    .cross-sell-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .cross-sell-popup__header {
        padding: 16px;
    }
    .cross-sell-popup__title {
        font-size: 17px;
    }
    .cross-sell-tabs {
        padding: 12px 16px;
        gap: 6px;
    }
    .cross-sell-chip {
        white-space: normal;
    }
    .cross-sell-content {
        padding: 16px;
    }
    .cross-sell-trigger {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .cross-sell-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .cross-sell-item {
        padding: 8px;
    }
    .cross-sell-item__name {
        font-size: 12px;
    }
    .cross-sell-item__cart-btn {
        font-size: 11px;
        letter-spacing: 0.6px;
    }
    .cross-sell-counter__btn {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
    .cross-sell-counter__qty {
        font-size: 13px;
    }
}
