/* ========================================= */
/* --- СТОРІНКА КОШИКА ТА ДОСТАВКИ --- */
/* ========================================= */
.page-title{
    text-align: center;
    color: #00008b;
    font-size: 2.5rem; /* Зробимо заголовок трохи більшим і виразнішим */
    margin-bottom: 30px;
    text-transform: uppercase; /* Додаємо стилю */
    letter-spacing: 1px;
}
.cart-main {
    width: 100%;
    max-width: 980px; 
    margin: 40px auto;
    padding: 0 10px;
    box-sizing: border-box;
    font-family: 'PT Sans', sans-serif;
    flex-grow: 1; 
}

/* --- КОНТЕЙНЕР КОШИКА --- */
.cart-container {
    display: flex;
    gap: 30px;
    align-items: flex-start; /* Щоб правий блок не розтягувався по висоті лівого */
}

.cart-items {
    flex: 1; /* Займає весь вільний простір зліва */
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* --- КАРТКА ТОВАРУ --- */
.cart-item {
    display: flex;
    align-items: center;
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(104, 9, 206, 0.05); /* Легка фіолетова тінь */
}

.card-info-container{
    display: flex;
    gap: 20px;
}
.item-img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 10px;
    margin-right: 25px;
}

.item-details {
    flex-grow: 1; /* Виштовхує ціну і кнопки вправо */
}

.item-category {
    margin: 0 0 5px 0;
    color: #6495ED;
    font-size: 0.9rem;
    font-weight: 600;
}

.item-title {
    margin: 0 0 8px 0;
    color: #00008b;
    font-size: 1.4rem;
    font-weight: 700;
}

.item-subtitle {
    margin: 0;
    color: #6495ED;
    font-size: 0.95rem;
}

.item-price-qty {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 15px;
}

.item-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1a1a1a;
}

/* Кнопки кількості */
.qty-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-btn {
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid #ccc;
    border-radius: 50%;
    font-size: 1.2rem;
    color: #333;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
}

.qty-btn:hover {
    border-color: #6809CE;
    color: #6809CE;
}

.qty-input {
    width: 40px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 5px;
    font-family: inherit;
    font-size: 1rem;
}

/* --- БЛОК СУМИ (Права колонка) --- */
.cart-summary {
    width: 300px; /* Фіксована ширина */
    background: #ffffff;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(104, 9, 206, 0.08);
    position: sticky; /* Блок прилипає при скролі (якщо товарів багато) */
    top: 20px;
    box-sizing: border-box;
}

.cart-summary h3 {
    margin: 0 0 15px 0;
    font-size: 1.2rem;
    color: #6495ED;
    font-weight: 600;
}

.total-price {
    font-size: 2.2rem;
    color: #1a1a1a;
    font-weight: 700;
    margin-bottom: 25px;
}

.checkout-btn {
    width: 100%;
    background-color: #6809CE; /* Темний колір кнопки, як на твоєму макеті */
    color: #ffffff;
    border: none;
    border-radius: 25px;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.checkout-btn:hover {
    background-color: #00008b; /* При наведенні стає фірмовим фіолетовим */
}
/* ========================================= */
/* --- ВАРІАНТИ ДОСТАВКИ --- */
/* ========================================= */

.delivery-options {
    display: flex;
    gap: 20px;
    flex-wrap: wrap; /* Дозволяє перенесення карток на нові рядки, якщо екран малий */
    justify-content: center; /* Завжди тримає картки по центру екрана */
}

.delivery-card {
    /* ВИПРАВЛЕННЯ: Прибрали flex: 1; і задали фіксовану ширину */
    width: 300px; 
    box-sizing: border-box;
    
    background: #ffffff;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(104, 9, 206, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center; 
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.delivery-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(104, 9, 206, 0.1);
}

/* --- КОНТЕЙНЕР ДЛЯ ІКОНКИ ТА ТЕКСТУ (Нова Пошта, Укрпошта) --- */
.card-info-container {
    display: flex;
    align-items: center;
    justify-content: center; 
    gap: 15px; 
    margin-bottom: 15px;
    width: 100%;
}

.card-info-container div {
    text-align: left; 
}

/* --- СТИЛІ ДЛЯ КАРТКИ БЕЗ ІКОНКИ (Самовивіз) --- */
.delivery-card > .delivery-title {
    margin-top: 5px;
    margin-bottom: 5px;
}

.delivery-card > .delivery-time {
    margin-bottom: 15px;
}

/* --- ТИПОГРАФІКА ДОСТАВКИ --- */
.delivery-title {
    margin: 0 0 5px 0;
    color: #00008b;
    font-size: 1.4rem;
    font-weight: 700;
}

.delivery-time {
    margin: 0;
    color: #6809CE;
    font-weight: 700;
    font-size: 1.1rem;
}

.delivery-prices {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px; 
}

.delivery-prices p {
    margin: 0;
    color: #6495ED;
    font-size: 1rem;
}

/* ========================================= */
/* --- АДАПТИВНІСТЬ ДЛЯ ДОСТАВКИ --- */
/* ========================================= */

@media (max-width: 900px) {
    /* На планшеті картки самі перенесуться вниз, якщо не влізуть в один ряд, 
       залишаючись по 300px і по центру, завдяки flex-wrap та justify-content: center */
}

@media (max-width: 600px) {
    .delivery-options {
        flex-direction: column; /* На телефоні жорстко ставимо в колонку */
        align-items: center; /* Центруємо колонку */
    }
    
    .delivery-card {
        width: 100%; /* Картка займає всю ширину екрана... */
        max-width: 350px; /* ...але не розтягується більше ніж на 350px, щоб виглядати естетично */
    }
}

/* ========================================= */
/* --- СЕКЦІЯ "УМОВИ ЗАМОВЛЕННЯ" --- */
/* ========================================= */
.terms-section {
    margin-top: 60px;
    margin-bottom: 20px;
}

.terms-container {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    margin-top: 30px;
}

.term-item {
    flex: 1; /* Всі три блоки будуть однакової ширини */
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Іконка в фіолетовому кружечку */
.term-icon {
    width: 50px;
    height: 50px;
    background-color: #e5e0ff; /* Ніжно-фіолетовий фон (з твого градієнта body) */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
    flex-shrink: 0;
    transition: background-color 250ms cubic-bezier(0.175, 0.885, 0.32, 1.275);

}

.term-icon svg {
    width: 26px;
    height: 26px;
    fill: #6809CE; /* Фірмовий фіолетовий */
}

.term-text h3 {
    margin: 0 0 10px 0;
    color: #00008b; /* Темно-синій, як у всіх заголовків */
    font-size: 1.25rem;
    font-weight: 700;
    text-align: center;
}

.term-text p {
    margin: 0;
    color: #555;
    font-size: 0.95rem;
    line-height: 1.6;
}

.term-text strong {
    color: #1a1a1a;
}

/* ========================================= */
/* --- АДАПТИВНІСТЬ --- */
/* ========================================= */

/* Планшети (до 900px) */
@media (max-width: 900px) {
    .cart-container {
        flex-direction: column; 
        align-items: stretch; /* МАГІЯ ТУТ: змушує всі елементи тягнутися на 100% ширини */
    }

    .cart-items {
        width: 100%; /* Гарантуємо, що лівий блок займе всю ширину */
    }

    .cart-item {
        width: 100%; 
        box-sizing: border-box;
    }

    .cart-summary {
        width: 100%; 
        position: static; 
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .checkout-btn {
        max-width: 400px;
    }
    .terms-container {
        flex-direction: column; /* Складаємо колонки одна під одну */
        gap: 25px;
    }
    
    .term-item {
        flex-direction: row; /* На планшеті іконка буде зліва, а текст справа */
        gap: 20px;
    }
    
    .term-icon {
        margin-bottom: 0;
    }
}

@media (max-width: 768px) {
    .cart-item {
        flex-direction: column; /* Картинка зверху, текст під нею */
        text-align: center;
        padding: 25px 15px;
    }

    .item-img {
        margin: 0 0 15px 0;
        width: 150px;
        height: 150px;
    }

    .item-price-qty {
        align-items: center; /* Центруємо ціну і кнопки */
        margin-top: 15px;
        width: 100%;
    }

    .delivery-card {
        flex: 0 0 100%; /* Картки доставки стають в одну колонку */
    }
    .terms-section {
        margin-top: 40px;
    }

    .term-item {
        flex-direction: column; /* Повертаємо іконку наверх для вузьких телефонів */
        gap: 10px;
        text-align: center;
        align-items: center;
    }
}