/* ============================================
   Единые стили для корзины на всех страницах
   ============================================ */

/* Корзина в хэдере */
.cart {
    color: white;
    font-size: 16px;
    font-family: 'Poiret One', cursive;
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #555;
    padding: 5px 15px;
    border-radius: 4px;
    white-space: nowrap;
    transition: all 0.3s;
}

.cart:hover {
    background: #666;
    transform: translateY(-1px);
}

/* Бейдж корзины */
.cart-badge {
    background: #ff6b6b;
    color: white;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
    display: none;
    font-weight: bold;
}

/* Модальное окно корзины */
.cart-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2499;
}

.cart-overlay.active {
    display: block;
}

.cart-modal {
    display: none;
    position: fixed;
    top: 70px;
    right: 30px;
    width: 380px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 2500;
    overflow: hidden;
}

.cart-modal.active {
    display: block;
}

/* Заголовок корзины */
.cart-header {
    background: #333;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-title {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.close-cart {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s;
}

.close-cart:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Список товаров в корзине */
.cart-items {
    max-height: 400px;
    overflow-y: auto;
    padding: 20px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.cart-item:last-child {
    border-bottom: none;
}

.item-info {
    flex: 1;
}

.item-name {
    font-family: 'Playfair Display', serif;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.item-price {
    font-family: 'Poiret One', cursive;
    font-size: 14px;
    color: #666;
}

.item-qty {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 15px;
}

.qty-btn {
    width: 28px;
    height: 28px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s;
}

.qty-btn:hover {
    background: #e9e9e9;
}

.item-qty span {
    font-family: 'Poiret One', cursive;
    font-size: 16px;
    min-width: 30px;
    text-align: center;
}

.item-total {
    font-family: 'Poiret One', cursive;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    min-width: 60px;
    text-align: right;
}

.remove-item {
    background: none;
    border: none;
    color: #ff6b6b;
    cursor: pointer;
    font-size: 20px;
    padding: 5px;
    margin-left: 10px;
    border-radius: 4px;
    transition: all 0.3s;
}

.remove-item:hover {
    background: #ffeaea;
}

/* Пустая корзина */
.cart-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.cart-empty p {
    font-family: 'Poiret One', cursive;
    font-size: 16px;
    margin: 0;
}

/* Итоги корзины */
.cart-total {
    background: #f9f9f9;
    padding: 20px;
    border-top: 1px solid #eee;
}

.total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-family: 'Poiret One', cursive;
    font-size: 16px;
    color: #666;
}

.total-row.delivery {
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.total-row.final {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
}

.free-delivery {
    color: #28a745;
    font-weight: 600;
}

/* Кнопки корзины */
.cart-actions {
    display: flex;
    gap: 10px;
}

.cart-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-family: 'Poiret One', cursive;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.clear-cart {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #ddd;
}

.clear-cart:hover {
    background: #e9ecef;
}

.checkout-btn {
    background: #333;
    color: white;
}

.checkout-btn:hover {
    background: #555;
    transform: translateY(-2px);
}

/* Адаптивность корзины */
@media (max-width: 1199px) {
    .cart-modal {
        top: 65px;
        right: 20px;
        width: 350px;
    }
}

@media (max-width: 767px) {
    .cart-modal {
        top: 60px;
        right: 15px;
        left: 15px;
        width: auto;
    }

    .cart {
        font-size: 14px;
        padding: 5px 10px;
    }
}

/* Корзина в мобильном меню */
.mobile-cart-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid transparent;
}

.mobile-cart-section:hover {
    background: #e9ecef;
    border-color: #ddd;
}

.mobile-cart {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-cart span:first-child {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    color: #333;
}

.mobile-cart-total {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-cart-total span:first-child {
    font-family: 'Poiret One', cursive;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.mobile-cart-total .cart-badge {
    background: #ff6b6b;
    color: white;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
    display: none;
}


body.no-product-cards .product-modal {
    display: none !important;
}
