/* ============================================
   KLUKVA CAFE - UPSELL BLOCK STYLES
   "Добавить к заказу" - как у Dodo Pizza
   С плавными анимациями
   
   HOVER STYLE: Soft Slate (Мягкий серый)
   ============================================ */

/* ============================================
   ОСНОВНОЙ БЛОК UPSELL
   Вариант: Минималистичные карточки
   ============================================ */

.cart-upsell {
    padding: 16px;
    border-top: 1px solid #F0F0F0;
    background: #fff;
}

@media (min-width: 768px) {
    .cart-upsell {
        padding: 16px 20px;
    }
}

.cart-upsell-title {
    font-size: 14px;
    font-weight: 600;
   
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

/* ============================================
   СЛАЙДЕР КАТЕГОРИЙ
   ============================================ */

.upsell-slider-wrapper {
    position: relative;
    overflow: hidden;
}

.upsell-slider {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 4px;
}

.upsell-slider::-webkit-scrollbar {
    display: none;
}

/* Кнопки навигации слайдера */
.upsell-slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.25s ease;
    opacity: 0;
    visibility: hidden;
}

.upsell-slider-nav:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.upsell-slider-nav.prev {
    left: -4px;
}

.upsell-slider-nav.next {
    right: -4px;
}

@media (min-width: 768px) {
    .upsell-slider-wrapper:hover .upsell-slider-nav {
        opacity: 1;
        visibility: visible;
    }
}

.upsell-slider-nav svg {
    width: 16px;
    height: 16px;
    color: #6B7280;
}

/* ============================================
   КАРТОЧКА КАТЕГОРИИ UPSELL
   Стиль: Soft Slate
   ============================================ */

.upsell-category-card {
    flex: 1;
    min-width: 90px;
    max-width: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 12px;
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
}

.upsell-category-card:hover {
    border-color: #D1D5DB;
    background: #FAFAFA;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-4px);
}

.upsell-category-card:active {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.upsell-category-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    overflow: hidden;
    background: #F9FAFB;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.upsell-category-card:hover .upsell-category-icon {
    background: #F3F4F6;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.upsell-category-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upsell-category-icon i {
    font-size: 18px;
    color: #C8102E;
}

.upsell-category-name {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    line-height: 1.2;
    transition: color 0.3s ease;
}

.upsell-category-card:hover .upsell-category-name {
    color: #111827;
}

.upsell-category-price {
    font-size: 12px;
    color: #EF4444;
    font-weight: 500;
}

/* ============================================
   МОДАЛЬНОЕ ОКНО ТОВАРОВ - BOTTOM SHEET
   Минималистичный стиль
   ============================================ */

.upsell-products-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    display: none;
    pointer-events: none;
}

.upsell-products-modal.show {
    display: block;
    pointer-events: auto;
}

.upsell-products-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
}

.upsell-products-modal.show .upsell-products-backdrop {
    background: rgba(0, 0, 0, 0.25);
}

/* Bottom Sheet */
.upsell-products-sheet {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 85%;
    background: #fff;
    border-radius: 16px 16px 0 0;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.upsell-products-modal.show .upsell-products-sheet {
    transform: translateY(0);
}

@media (min-width: 768px) {
    .upsell-products-sheet {
        max-height: 80%;
        border-radius: 14px 14px 0 0;
    }
}

/* Индикатор перетаскивания */
.upsell-sheet-handle {
    width: 36px;
    height: 4px;
    background: #E5E7EB;
    border-radius: 2px;
    margin: 10px auto 0;
}

@media (min-width: 768px) {
    .upsell-sheet-handle {
        display: none;
    }
}

/* Заголовок */
.upsell-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #F3F4F6;
    flex-shrink: 0;
}

.upsell-sheet-title {
    font-size: 17px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.upsell-sheet-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F3F4F6;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: #6B7280;
    font-size: 18px;
    transition: all 0.25s ease;
    -webkit-tap-highlight-color: transparent;
}

.upsell-sheet-close:hover {
    background: #E5E7EB;
    color: #374151;
}

/* Список товаров */
.upsell-products-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 16px;
    overscroll-behavior: contain;
}

/* ============================================
   КАРТОЧКА ТОВАРА В МОДАЛКЕ
   Стиль: Soft Slate
   ============================================ */

.upsell-product-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    margin-bottom: 8px;
    transition: all 0.25s ease;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.upsell-product-card:hover {
    border-color: #D1D5DB;
    background: #FAFAFA;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.upsell-product-card:active {
    transform: scale(0.99);
}

.upsell-product-card:last-child {
    margin-bottom: 0;
}

.upsell-product-image {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    overflow: hidden;
    background: #F9FAFB;
    flex-shrink: 0;
    transition: all 0.25s ease;
}

.upsell-product-card:hover .upsell-product-image {
    background: #F3F4F6;
    transform: scale(1.05);
}

.upsell-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upsell-product-info {
    flex: 1;
    min-width: 0;
}

.upsell-product-name {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 2px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.upsell-product-weight {
    font-size: 12px;
    color: #9CA3AF;
}

.upsell-product-price-btn {
    flex-shrink: 0;
    padding: 10px 16px;
    background: #F3F4F6;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all 0.25s ease;
    -webkit-tap-highlight-color: transparent;
    min-width: 72px;
    text-align: center;
}

.upsell-product-price-btn:hover {
    background: #E5E7EB;
    color: #111827;
    transform: scale(1.05);
}

.upsell-product-price-btn:active {
    transform: scale(0.97);
}

/* Состояние "добавлено" */
.upsell-product-card.added {
    background: #F0FDF4;
    border-color: #86EFAC;
}

.upsell-product-card.added .upsell-product-price-btn {
    background: #22C55E;
    color: #fff;
}

.upsell-product-card.added .upsell-product-price-btn i {
    animation: checkmark 0.3s ease;
}

@keyframes checkmark {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ============================================
   ПРИМЕЧАНИЕ: body.upsell-modal-open не нужен,
   т.к. корзина уже блокирует скролл
   ============================================ */

/* ============================================
   SAFE AREA ДЛЯ IPHONE
   ============================================ */

@supports (padding: max(0px)) {
    .upsell-products-list {
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
    
    .upsell-products-sheet {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .upsell-products-modal,
    .upsell-products-backdrop,
    .upsell-products-sheet,
    .upsell-category-card,
    .upsell-category-icon,
    .upsell-product-card,
    .upsell-product-image,
    .upsell-product-price-btn,
    .upsell-sheet-close,
    .upsell-slider {
        transition: none !important;
        animation: none !important;
    }
    
    .upsell-slider {
        scroll-behavior: auto;
    }
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */

.upsell-products-list::-webkit-scrollbar {
    width: 6px;
}

.upsell-products-list::-webkit-scrollbar-track {
    background: transparent;
}

.upsell-products-list::-webkit-scrollbar-thumb {
    background: #DDD;
    border-radius: 3px;
}

.upsell-products-list::-webkit-scrollbar-thumb:hover {
    background: #CCC;
}