/* Основной контейнер */
.fcpro-cart {
    position: fixed;
    z-index: 999999;
}

.fcpro-cart.right {
    right: 0;
}

.fcpro-cart.left {
    left: 0;
}

/* Кнопка корзины */
.fcpro-cart-button {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.25s ease;
    position: relative;
}

.fcpro-cart-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

.fcpro-cart-button svg {
    width: 28px;
    height: 28px;
}

/* Счетчик */
.fcpro-cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 20px;
    height: 20px;
    border-radius: 30px;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    font-family: monospace;
}

/* Попап */
.fcpro-cart-popup {
    position: absolute;
    bottom: 70px;
    background: white;
    border-radius: 14px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
}

.fcpro-cart.right .fcpro-cart-popup {
    right: 0;
}

.fcpro-cart.left .fcpro-cart-popup {
    left: 0;
}

.fcpro-cart:hover .fcpro-cart-popup {
    opacity: 1;
    visibility: visible;
    transform: translateY(-8px);
}

/* Заголовок попапа */
.fcpro-popup-header {
    padding: 12px 15px;
    border-radius: 14px 14px 0 0;
}

.fcpro-popup-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

/* Список товаров */
.fcpro-popup-items {
    max-height: 320px;
    overflow-y: auto;
    padding: 10px;
}

.fcpro-empty {
    text-align: center;
    padding: 25px;
    font-size: 13px;
    color: #999;
}

/* Товар в попапе */
.fcpro-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.fcpro-item:last-child {
    border-bottom: none;
}

.fcpro-item-img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.fcpro-item-info {
    flex: 1;
    min-width: 0;
}

.fcpro-item-title {
    font-size: 13px;
    font-weight: 500;
    margin: 0 0 5px;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.fcpro-item-price {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 3px;
}

.fcpro-item-quantity {
    font-size: 11px;
    color: #888;
}

/* Футер попапа */
.fcpro-popup-footer {
    padding: 12px 15px;
    border-top: 1px solid #eee;
    background: #fafafa;
    border-radius: 0 0 14px 14px;
}

.fcpro-total {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-weight: 700;
    font-size: 15px;
}

.fcpro-cart-link {
    display: block;
    text-align: center;
    padding: 8px;
    border-radius: 8px;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-bottom: 8px;
    border: 1px solid;
    background: white;
}

.fcpro-checkout-btn {
    display: block;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.fcpro-checkout-btn:hover {
    transform: translateY(-1px);
}

/* Анимации */
.fcpro-bounce {
    animation: fcproBounceAnim 0.3s ease;
}

.fcpro-pulse {
    animation: fcproPulseAnim 0.3s ease;
}

.fcpro-shake {
    animation: fcproShakeAnim 0.4s ease;
}

@keyframes fcproBounceAnim {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

@keyframes fcproPulseAnim {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.08); }
}

@keyframes fcproShakeAnim {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .fcpro-cart-popup {
        width: 280px !important;
        bottom: 60px;
    }
    
    .fcpro-cart-button {
        width: 48px !important;
        height: 48px !important;
    }
    
    .fcpro-cart-button svg {
        width: 22px;
        height: 22px;
    }
    
    .fcpro-popup-items {
        max-height: 280px;
    }
    
    .fcpro-item-title {
        font-size: 12px;
    }
    
    .fcpro-item-img {
        width: 40px;
        height: 40px;
    }
}

/* Мобильная адаптация — исправление горизонтального скролла */
@media (max-width: 768px) {
    /* Запрещаем горизонтальный скролл */
    html, body {
        overflow-x: hidden !important;
        max-width: 100% !important;
        position: relative;
    }
    
    .fcpro-cart {
        /* Гарантируем, что корзина не вылезает за экран */
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    .fcpro-cart.right {
        right: 0 !important;
    }
    
    .fcpro-cart.left {
        left: 0 !important;
    }
    
    .fcpro-cart-popup {
        width: 280px !important;
        bottom: 60px;
        /* Чтобы попап не вылазил за экран */
        right: 0 !important;
        left: auto !important;
    }
    
    .fcpro-cart.left .fcpro-cart-popup {
        left: 0 !important;
        right: auto !important;
    }
    
    .fcpro-cart-button {
        width: 48px !important;
        height: 48px !important;
        /* Фиксируем кнопку без сдвигов */
        margin: 0;
    }
    
    .fcpro-cart-button svg {
        width: 22px;
        height: 22px;
    }
    
    .fcpro-popup-items {
        max-height: 280px;
    }
    
    .fcpro-item-title {
        font-size: 12px;
    }
    
    .fcpro-item-img {
        width: 40px;
        height: 40px;
    }
}