/* =========================
   DESKTOP DEFAULT
========================= */

.basket-page {
    width: min(92%, 1350px);
    margin: 0 auto;
}

.basket-title {
    font-size: 34px;
    font-weight: 700;
    margin-bottom: 24px;
    line-height: 1.1;
}

.basket-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 28px;
    align-items: start;
}

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

/* =========================
   CART CARD
========================= */

.cart-card {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    grid-template-areas:
        "image info"
        "image actions";

    gap: 14px 22px;
    align-items: start;

    background: var(--cardBgColor);
    border: 1px solid #e8e8e8;
    border-radius: 12px;

    padding: 16px;
}

.cart-image-wrap {
    grid-area: image;

    position: relative;

    width: 100%;
    aspect-ratio: 1 / 1;

    overflow: hidden;

    background: #f7f2ee;
    border-radius: 8px;
}

.cart-image-wrap img {
    width: 100%;
    height: 100%;

    object-fit: cover;
    display: block;
}

.wishlist-heart {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;

    border: none;
    background: transparent;

    font-size: 18px;
    line-height: 1;

    padding: 0;
    margin: 0;

    cursor: pointer;
}

/* =========================
   INFO
========================= */

.cart-info {
    grid-area: info;
    min-width: 0;
}

.cart-name {
    display: block;
    max-width: 100%;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    text-decoration: none;
    color: #000;

    font-size: 22px;
    font-weight: 700;
    line-height: 1.15;

    margin-bottom: 18px;
}

.cart-size,
.cart-price {
    font-size: 16px;
    color: #666;

    margin: 4px 0;
}

.item-stock {
    color: #b00020;
    margin-top: 8px;

    font-size: 12px;
    font-weight: 600;
}

/* =========================
   ACTIONS
========================= */

.cart-actions {
    grid-area: actions;

    display: flex;
    align-items: center;
    justify-content: space-between;

    width: 100%;
    gap: 16px;
}

.cart-subtotal {
    font-size: 22px;
    font-weight: 700;
    white-space: nowrap;
}

.quantity-buttons {
    display: flex;
    align-items: center;
    justify-content: space-between;

    width: 120px;
    height: 42px;

    border: var(--btnBorder);
    border-radius: 8px;

    overflow: hidden;

    background: var(--btnBgColor);
}

.quantity-buttons button {
    width: 38px;
    height: 42px;

    border: none;
    background: var(--btnBgColor);

    font-size: 20px;
    font-weight: 700;

    cursor: pointer;
}

.quantity {
    font-size: 16px;
    font-weight: 700;
}

/* =========================
   ORDER SUMMARY
   (UNCHANGED)
========================= */

.order-summary {
    background: var(--cardBgColor);
    border: 1px solid #e8e8e8;
    border-radius: 14px;
    padding: 32px;

    position: sticky;
    top: 90px;
}

.order-summary h2 {
    font-size: 30px;
    font-weight: 700;
    margin-bottom: 30px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 24px 0;
    border-top: 1px solid #e4e4e4;

    font-size: 20px;
}

.summary-total {
    font-size: 24px;
    font-weight: 700;
}

.checkout-btn {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 60px;
    margin-top: 22px;

    background: #000;
    color: #fff;
    border-radius: 8px;

    text-decoration: none;
    font-size: 20px;
    font-weight: 600;
}

/* =========================
   EMPTY / ERROR
========================= */

.error-msg {
    padding: 14px 18px;
    border-radius: 8px;

    background: #ffecec;
    color: #a40000;

    margin-bottom: 16px;
}

.state-empty {
    font-size: 18px;
    padding: 36px 0;
}

/* =========================
   MOBILE <= 768px
========================= */

@media (max-width: 768px) {

    .basket-page {
        width: calc(100% - 24px);
    }

    .basket-title {
        font-size: 32px;
        margin-bottom: 20px;
    }

    .basket-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .cart-card {
        grid-template-columns: 120px minmax(0, 1fr);

        grid-template-areas:
            "image info"
            "image actions";

        gap: 12px 18px;

        align-items: start;

        padding: 16px;
    }

    .cart-image-wrap {
        width: 120px;
        aspect-ratio: 1 / 1;
    }

    .wishlist-heart {
        top: 8px;
        right: 8px;
        font-size: 18px;
    }

    .cart-name {
        font-size: 20px;
        line-height: 1.2;
        margin-bottom: 12px;
    }

    .cart-size,
    .cart-price {
        font-size: 15px;
        margin: 4px 0;
    }

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

        width: 100%;
        gap: 12px;
    }

    .cart-subtotal {
        font-size: 20px;
    }

    .quantity-buttons {
        width: 110px;
        height: 40px;
    }

    .quantity-buttons button {
        width: 36px;
        height: 40px;
        font-size: 20px;
    }

    .quantity {
        font-size: 16px;
    }

    .order-summary {
        position: static;
        padding: 24px 18px;
    }

    .order-summary h2 {
        font-size: 24px;
        margin-bottom: 20px;
    }

    .summary-row {
        font-size: 16px;
        padding: 18px 0;
    }

    .summary-total {
        font-size: 20px;
    }

    .checkout-btn {
        height: 54px;
        font-size: 18px;
    }
}