/* =====================================================
   FarmerKart Cart Page
   ===================================================== */

.cart-page {
    padding: 40px 0 70px;
}

.page-title {
    font-family: 'Poppins', sans-serif;
    font-size: 34px;
    margin-bottom: 30px;
    color: var(--text);
}

/* ==============================
   Cart Layout
================================= */

.cart-container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 30px;
    align-items: start;
}

/* ==============================
   Cart Items
================================= */

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.cart-item {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    box-shadow: var(--shadow);

    display: grid;
    grid-template-columns: 120px minmax(180px, 1fr) 120px 120px 100px;
    gap: 20px;
    align-items: center;
}

/* ==============================
   Product Image
================================= */

.cart-item-image {
    width: 120px;
    height: 120px;
    border-radius: 10px;
    overflow: hidden;
    background: #f5f5f5;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==============================
   Product Information
================================= */

.cart-item-info h3 {
    margin-bottom: 8px;
    font-size: 18px;
}

.cart-item-info h3 a {
    color: var(--text);
}

.cart-item-info h3 a:hover {
    color: var(--primary);
}

.cart-unit {
    color: var(--gray);
    margin-bottom: 8px;
}

.cart-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.cart-farmer {
    color: var(--primary);
    font-size: 14px;
}

/* ==============================
   Quantity
================================= */

.cart-quantity form {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    width: 110px;
}

.cart-quantity button {
    width: 34px;
    height: 36px;
    border: none;
    background: #f5f5f5;
    font-size: 20px;
    cursor: pointer;
}

.cart-quantity button:hover {
    background: #e8f5e9;
}

.cart-quantity span {
    width: 40px;
    text-align: center;
    font-weight: 600;
}

/* ==============================
   Subtotal
================================= */

.cart-item-subtotal {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    text-align: right;
}

/* ==============================
   Remove
================================= */

.cart-item-remove {
    text-align: right;
}

.cart-item-remove a {
    color: #d32f2f;
    font-size: 14px;
}

.cart-item-remove a:hover {
    text-decoration: underline;
}

/* ==============================
   Cart Summary
================================= */

.cart-summary {
    background: #fff;
    border-radius: 14px;
    padding: 25px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 100px;
}

.cart-summary h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 22px;
    margin-bottom: 25px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.summary-row strong {
    color: var(--text);
}

.summary-divider {
    height: 1px;
    background: #e5e5e5;
    margin: 20px 0;
}

.total-row {
    font-size: 20px;
}

.total-row strong {
    color: var(--primary);
    font-size: 24px;
}

/* ==============================
   Checkout Button
================================= */

.checkout-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 14px 20px;
    background: var(--primary);
    color: #fff;
    border-radius: 8px;
    font-weight: 700;
    margin-top: 25px;
}

.checkout-btn:hover {
    background: var(--primary-dark);
}

/* ==============================
   Continue Shopping
================================= */

.continue-shopping {
    display: block;
    text-align: center;
    margin-top: 18px;
    color: var(--primary);
    font-weight: 600;
}

/* ==============================
   Empty Cart
================================= */

.empty-cart {
    background: #fff;
    border-radius: 14px;
    padding: 70px 30px;
    text-align: center;
    box-shadow: var(--shadow);
}

.empty-cart-icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.empty-cart h2 {
    margin-bottom: 10px;
}

.empty-cart p {
    color: var(--gray);
    margin-bottom: 25px;
}

/* ==============================
   Responsive
================================= */

@media (max-width: 1100px) {

    .cart-item {
        grid-template-columns: 100px 1fr 100px;
    }

    .cart-item-image {
        width: 100px;
        height: 100px;
    }

    .cart-item-subtotal {
        text-align: left;
    }

    .cart-item-remove {
        text-align: left;
    }
}

@media (max-width: 800px) {

    .cart-container {
        grid-template-columns: 1fr;
    }

    .cart-summary {
        position: static;
    }

    .cart-item {
        grid-template-columns: 90px 1fr;
        gap: 15px;
    }

    .cart-item-image {
        width: 90px;
        height: 90px;
    }

    .cart-quantity,
    .cart-item-subtotal,
    .cart-item-remove {
        grid-column: 2;
        text-align: left;
    }
}

@media (max-width: 500px) {

    .page-title {
        font-size: 28px;
    }

    .cart-item {
        padding: 15px;
    }

    .cart-item-info h3 {
        font-size: 16px;
    }
}