/* Кнопка-корзина (плавающий кружок) */
.cart-floating-btn {
    position: fixed;
    top: 100px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #B54B5F;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
}

.cart-floating-btn:hover {
    transform: scale(1.1);
}

.cart-floating-btn svg {
    width: 30px;
    height: 30px;
    stroke: white;
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Оверлей */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1001;
    display: none;
}

.cart-overlay.active {
    display: block;
}

/* Модальное окно корзины */
.cart-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    max-width: 1000px;
    width: 90%;
    background: white;
    border-radius: 20px;
    z-index: 1002;
    display: none;
    flex-direction: column;
    transition: all 0.3s ease;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    max-height: 85vh;
}

.cart-modal.active {
    display: flex;
    transform: translate(-50%, -50%) scale(1);
}

.cart-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.cart-modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.cart-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
}

.cart-close:hover {
    color: #ff6b6b;
}

.cart-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 25px;
}

/* Таблица корзины */
.cart-table {
    width: 100%;
}

.cart-table-header {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 0.5fr;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    color: #999;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cart-table-header span:first-child {
    text-align: left;
    padding-left: 80px;
}

.cart-table-header span:nth-child(2),
.cart-table-header span:nth-child(3) {
    text-align: center;
}

.cart-table-header span:last-child {
    text-align: right;
}

/* Товар в корзине */
.cart-item {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 0.5fr;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #f0f0f0;
}

.cart-item-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cart-item-image {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 12px;
}

.cart-item-title {
    font-weight: 600;
    font-size: 16px;
    color: #333;
}

/* Количество */
.cart-item-qty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s;
}

.qty-btn:hover {
    background: #ff6b6b;
    color: white;
    border-color: #ff6b6b;
}

.qty-value {
    min-width: 30px;
    text-align: center;
    font-weight: 500;
    font-size: 16px;
}

/* Стоимость */
.cart-item-price {
    text-align: center;
    font-weight: 600;
    font-size: 18px;
    color: #333;
}

/* Удалить */
.cart-item-delete {
    text-align: right;
    background: none;
    border: none;
    color: #ff4444;
    cursor: pointer;
    font-size: 20px;
    padding: 8px;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    transition: all 0.3s;
}

.cart-item-delete:hover {
    background: #ffe0e0;
    transform: scale(1.1);
}

/* Итого */
.cart-summary {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.cart-total {
    display: flex;
    justify-content: flex-end;
    align-items: baseline;
    gap: 20px;
    font-size: 18px;
}

.cart-total span:first-child {
    color: #666;
}

.cart-total span:last-child {
    color: #B54B5F;
    font-size: 28px;
    font-weight: bold;
}

/* Кнопки */
.cart-buttons {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 20px;
    padding: 20px 25px;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}

.btn-continue {
    background: #f0f0f0;
    color: #666;
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-continue:hover {
    background: #e0e0e0;
}

.btn-checkout {
    background: #B54B5F;
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-checkout:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255,107,107,0.4);
}

/* Пустая корзина */
.cart-empty {
    text-align: center;
    padding: 60px 20px;
}

.cart-empty svg {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.cart-empty h3 {
    margin: 15px 0 10px;
    color: #666;
}

.cart-empty p {
    color: #999;
}

/* Уведомление */
.cart-notification {
    position: fixed;
    bottom: 100px;
    right: 30px;
    background: #4caf50;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    z-index: 10000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Адаптив для планшетов и телефонов */
@media (max-width: 768px) {
    /* Скрываем шапку таблицы */
    .cart-table-header {
        display: none;
    }
    
    /* Карточка товара */
    .cart-item {
        display: flex;
        align-items: center;
        gap: 15px;
        padding: 15px 0;
        border-bottom: 1px solid #f0f0f0;
        margin-bottom: 0;
        background: transparent;
        box-shadow: none;
        border-radius: 0;
        position: relative;
    }
    
    /* Фото */
    .cart-item-image {
        width: 80px;
        height: 80px;
        border-radius: 12px;
        object-fit: cover;
        flex-shrink: 0;
    }
    
    /* Информация о товаре */
    .cart-item-info {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .cart-item-title {
        font-size: 16px;
        font-weight: 500;
        color: #000;
        margin: 0;
    }
    
    /* Правая часть: количество и цена */
    .cart-item-right {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 12px;
    }
    
    /* Количество */
    .cart-item-qty {
        display: flex;
        align-items: center;
        gap: 12px;
    }
    
    .qty-btn {
        width: 32px;
        height: 32px;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        background: white;
        cursor: pointer;
        font-size: 18px;
        transition: all 0.3s;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .qty-btn:hover {
        background: #f5f5f5;
    }
    
    .qty-value {
        font-size: 16px;
        font-weight: 500;
        min-width: 30px;
        text-align: center;
    }
    
    /* Цена */
    .cart-item-price {
        font-size: 16px;
        font-weight: 500;
        color: #000;
    }
    
    /* Крестик удаления */
    .cart-item-delete {
        position: absolute;
        top: 15px;
        right: 0;
        background: none;
        border: none;
        color: #ccc;
        cursor: pointer;
        font-size: 18px;
        padding: 0;
        width: auto;
        height: auto;
        margin: 0;
    }
    
    .cart-item-delete:hover {
        color: #ff4444;
        background: none;
        transform: none;
    }
    
    /* Итого */
    .cart-summary {
        margin-top: 20px;
        padding: 20px 0;
    }
    
    .cart-total {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        padding: 15px 0;
        border-top: 1px solid #f0f0f0;
    }
    
    .cart-total span:first-child {
        font-size: 14px;
        font-weight: 400;
        color: #999;
    }
    
    .cart-total span:last-child {
        font-size: 20px;
        font-weight: 500;
        color: #B54B5F;  /* оригинальный розовый цвет */
    }
    
    /* Кнопка "Очистить" */
    .cart-clear-btn {
        background: none;
        border: none;
        color: #999;
        font-size: 14px;
        cursor: pointer;
        padding: 0;
        margin-left: auto;
    }
    
    .cart-clear-btn:hover {
        color: #ff4444;
    }
    
    /* Шапка корзины */
    .cart-header-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
    }
    
    .cart-header-row h2 {
        margin: 0;
        font-size: 24px;
        font-weight: 500;
        color: #000;
    }
    
    /* Кнопки внизу - горизонтально, компактные, по центру */
    .cart-buttons {
        display: flex;
        flex-direction: row;
        justify-content: center;
        gap: 15px;
        padding: 20px 0;
        border-top: 1px solid #f0f0f0;
    }
    
    .btn-continue {
        width: auto;
        padding: 8px 20px;  /* уменьшено */
        background: #f0f0f0;  /* оригинальный цвет */
        border: none;
        border-radius: 30px;
        font-size: 13px;  /* уменьшено */
        font-weight: 400;
        cursor: pointer;
        color: #666;
    }
    
    .btn-continue:hover {
        background: #e0e0e0;
    }
    
    .btn-checkout {
        width: auto;
        padding: 8px 24px;  /* уменьшено */
        background: #B54B5F;  /* оригинальный розовый цвет */
        color: white;
        border: none;
        border-radius: 30px;
        font-size: 14px;  /* уменьшено */
        font-weight: 500;
        cursor: pointer;
    }
    
    .btn-checkout:hover {
        transform: translateY(-1px);
        box-shadow: 0 3px 10px rgba(181, 75, 95, 0.3);
    }
    
    /* Кнопка корзины */
    .cart-floating-btn {
        top: 100px;
        bottom: auto;
        right: 20px;
        width: 50px;
        height: 50px;
    }
    
    .cart-floating-btn svg {
        width: 24px;
        height: 24px;
    }
    
    .cart-badge {
        width: 20px;
        height: 20px;
        font-size: 11px;
        top: -4px;
        right: -4px;
    }
}

/* Телефоны (до 480px) */
@media (max-width: 480px) {
    .cart-modal {
        width: 95%;
        border-radius: 20px;
    }
    
    .cart-modal-header {
        padding: 15px 20px;
    }
    
    .cart-modal-body {
        padding: 0 15px 15px;
    }
    
    .cart-item-image {
        width: 70px;
        height: 70px;
    }
    
    .cart-item-title {
        font-size: 15px;
    }
    
    .qty-btn {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }
    
    .qty-value {
        font-size: 15px;
    }
    
    .cart-item-price {
        font-size: 15px;
    }
    
    .cart-total span:last-child {
        font-size: 18px;
    }
    
    .btn-continue {
        padding: 6px 16px;
        font-size: 12px;
    }
    
    .btn-checkout {
        padding: 6px 20px;
        font-size: 13px;
    }
    
    .cart-floating-btn {
        top: 100px;
        right: 15px;
        width: 48px;
        height: 48px;
    }
    
    .cart-floating-btn svg {
        width: 22px;
        height: 22px;
    }
}