/* ========== КОРЗИНА ========== */

:root {
    --cart-primary: #ff6900;
    --cart-success: #ff6900;
    --cart-danger: #f44336;
    --cart-border: #e0e0e0;
    --cart-bg: #f9f9f9;
}

.cart-page-section {
    padding: 40px 0 80px;
    background: #fff;
}

.cart-page-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.cart-page-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 32px;
    color: #333;
}

/* ========== ПУСТАЯ КОРЗИНА ========== */

.cart-empty {
    text-align: center;
    padding: 80px 20px;
    background: var(--cart-bg);
    border-radius: 12px;
}

.cart-empty-icon {
    font-size: 80px;
    color: #ccc;
    margin-bottom: 24px;
}

.cart-empty-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
}

.cart-empty-text {
    font-size: 16px;
    color: #666;
    margin-bottom: 32px;
}

.cart-empty-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: var(--cart-primary);
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s;
}

.cart-empty-btn:hover {
    background: #ff6900;
}

/* ========== LAYOUT ========== */

.cart-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 32px;
}

@media (max-width: 1024px) {
    .cart-layout {
        grid-template-columns: 1fr;
    }
}

/* ========== ТОВАРЫ ========== */

.cart-items-column {
    background: #fff;
}

.cart-items-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--cart-bg);
    border-radius: 8px;
    margin-bottom: 20px;
}

.cart-items-count {
    font-weight: 600;
    font-size: 16px;
    color: #333;
}

.cart-clear-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    color: var(--cart-danger);
    font-size: 14px;
    border-radius: 6px;
    transition: all 0.2s;
}

.cart-clear-btn:hover {
    background: rgba(244, 67, 54, 0.1);
}

.cart-items-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ========== КАРТОЧКА ТОВАРА ========== */

.cart-item {
    display: grid;
    grid-template-columns: 100px 1fr auto auto 40px;
    gap: 20px;
    align-items: center;
    padding: 20px;
    background: #fff;
    border: 1px solid var(--cart-border);
    border-radius: 8px;
    transition: all 0.2s;
}

.cart-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.cart-item-image {
    width: 100px;
    height: 100px;
    overflow: hidden;
    border-radius: 8px;
    background: var(--cart-bg);
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-details {
    flex: 1;
}

.cart-item-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.cart-item-name a {
    color: #333;
    transition: color 0.2s;
}

.cart-item-name a:hover {
    color: var(--cart-primary);
}

.cart-item-price-unit {
    font-size: 14px;
    color: #666;
    margin-top: 4px;
}

/* Вариации товара */
.woocommerce-variation {
    font-size: 13px;
    color: #999;
    margin-top: 4px;
}

.woocommerce-variation dt {
    display: inline;
    font-weight: 500;
}

.woocommerce-variation dd {
    display: inline;
    margin: 0;
}

/* ========== КОЛИЧЕСТВО ========== */

.cart-item-quantity {
    min-width: 120px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    border: 1px solid var(--cart-border);
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.qty-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cart-bg);
    color: #666;
    transition: all 0.2s;
    cursor: pointer;
}

.qty-btn:hover {
    background: var(--cart-primary);
    color: #fff;
}

.qty-btn:active {
    transform: scale(0.95);
}

.qty-input {
    width: 48px;
    height: 36px;
    text-align: center;
    border: none;
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

/* ========== ИТОГОВАЯ ЦЕНА И УДАЛЕНИЕ ========== */

.cart-item-total {
    min-width: 100px;
    text-align: right;
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.cart-item-remove {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: #999;
    transition: all 0.2s;
}

.cart-item-remove:hover {
    background: rgba(244, 67, 54, 0.1);
    color: var(--cart-danger);
}

/* ========== ИТОГО ========== */

.cart-summary-column {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.cart-summary {
    background: #fff;
    border: 1px solid var(--cart-border);
    border-radius: 12px;
    padding: 24px;
}

.cart-summary-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #333;
}

.cart-summary-rows {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
}

.cart-summary-label {
    color: #666;
}

.cart-summary-value {
    font-weight: 600;
    color: #333;
}

.cart-summary-row.discount .cart-summary-value {
    color: var(--cart-success);
}

.cart-summary-divider {
    height: 1px;
    background: var(--cart-border);
    margin: 20px 0;
}

.cart-summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
}

.cart-summary-total-label {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.cart-summary-total-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--cart-primary);
}

/* ========== КНОПКИ ========== */

.cart-checkout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 16px;
    background: var(--cart-primary);
    color: #fff;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    transition: all 0.3s;
}

.cart-checkout-btn:hover {
    background: #ff6900;
}

.cart-continue-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    color: #666;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s;
}

.cart-continue-btn:hover {
    background: var(--cart-bg);
    color: var(--cart-primary);
}

/* ========== ГАРАНТИИ ========== */

.cart-guarantees {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--cart-border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cart-guarantee-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #666;
}

.cart-guarantee-item i {
    color: var(--cart-success);
    font-size: 16px;
}

/* ========== АДАПТИВ ========== */

@media (max-width: 768px) {
    .cart-item {
        grid-template-columns: 80px 1fr;
        gap: 12px;
    }

    .cart-item-image {
        width: 80px;
        height: 80px;
    }

    .cart-item-quantity,
    .cart-item-total {
        grid-column: 1 / -1;
        justify-self: start;
    }

    .cart-item-remove {
        position: absolute;
        top: 12px;
        right: 12px;
    }

    .cart-item {
        position: relative;
        padding-right: 50px;
    }
}