/* ============================================================
   CrossSell Module — стиль upstore
   Подключить в Simple Checkout или в header.twig шаблона
   ============================================================ */

.crossell-wrapper {
    margin: 32px 0 8px;
    font-family: inherit;
}

.crossell-inner {
    max-width: 100%;
}

/* --- Секция (категория) --- */
.crossell-section {
    margin-bottom: 32px;
}

/* --- Заголовок --- */
.crossell-title {
    font-size: 17px;
    font-weight: 700;
    color: #222;
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
    text-transform: uppercase;
    letter-spacing: .04em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.crossell-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background: #e8392a;   /* upstore accent */
    border-radius: 2px;
    flex-shrink: 0;
}

/* --- Обёртка карусели --- */
.crossell-carousel-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
}

.crossell-viewport {
    overflow: hidden;
    flex: 1;
}

.crossell-track {
    display: flex;
    gap: 16px;
    transition: transform .35s cubic-bezier(.4,0,.2,1);
    will-change: transform;
}

/* --- Карточка товара --- */
.crossell-card {
    flex: 0 0 calc(25% - 12px);
    min-width: 160px;
    background: #fff;
    border: 1px solid #ebebeb;
    border-radius: 6px;
    overflow: hidden;
    transition: box-shadow .2s, border-color .2s;
    display: flex;
    flex-direction: column;
}

.crossell-card:hover {
    box-shadow: 0 4px 18px rgba(0,0,0,.10);
    border-color: #d8d8d8;
}

.crossell-img-wrap {
    display: block;
    background: #fafafa;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.crossell-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
    transition: transform .3s ease;
}

.crossell-card:hover .crossell-img-wrap img {
    transform: scale(1.05);
}

.crossell-card-body {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.crossell-name {
    font-size: 13px;
    line-height: 1.4;
    color: #333;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.crossell-name:hover { color: #e8392a; }

/* --- Цены --- */
.crossell-price-wrap {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 5px;
}

.crossell-price {
    font-size: 15px;
    font-weight: 700;
    color: #222;
}

.crossell-price-new {
    font-size: 15px;
    font-weight: 700;
    color: #e8392a;
}

.crossell-price-old {
    font-size: 12px;
    color: #999;
    text-decoration: line-through;
}

/* --- Кнопка В корзину --- */
.crossell-btn-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px 10px;
    background: #e8392a;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, opacity .2s, transform .1s;
    white-space: nowrap;
    letter-spacing: .02em;
    margin-top: auto;
}

.crossell-btn-cart:hover:not(:disabled) {
    background: #c92f22;
}

.crossell-btn-cart:active:not(:disabled) {
    transform: scale(.97);
}

.crossell-btn-cart.crossell-btn-loading {
    opacity: .65;
    cursor: wait;
    pointer-events: none;
}

.crossell-btn-cart.crossell-btn-added {
    background: #27ae60;
    pointer-events: none;
}

/* --- Навигационные кнопки --- */
.crossell-nav {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: #fff;
    color: #555;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .2s, color .2s, background .2s;
    padding: 0;
    user-select: none;
}

.crossell-nav:hover:not(:disabled) {
    border-color: #e8392a;
    color: #e8392a;
    background: #fff8f7;
}

.crossell-nav:disabled {
    opacity: .3;
    cursor: default;
}

/* --- Адаптив --- */
@media (max-width: 900px) {
    .crossell-card { flex: 0 0 calc(33.333% - 11px); }
}

@media (max-width: 650px) {
    .crossell-card { flex: 0 0 calc(50% - 8px); }
    .crossell-nav  { width: 28px; height: 28px; font-size: 18px; }
}

@media (max-width: 420px) {
    .crossell-card { flex: 0 0 calc(100% - 0px); }
}
