* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Segoe UI", sans-serif;
}

body {
    background: #0f172a;
    color: white;
    min-height: 100vh;
}

.container {
    width: 90%;
    max-width: 1300px;
    margin: auto;
}

/* ================= HEADER ================= */

.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(15px);
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.header-content {
    min-height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    color: #38bdf8;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.username-display {
    color: #cbd5e1;
}

#username-text {
    color: #38bdf8;
    font-weight: bold;
}

.cart-icon {
    position: relative;
    color: white;
}

.cart-count {
    position: absolute;
    top: -10px;
    right: -12px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ef4444;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
}

.logout-btn {
    border: none;
    background: #ef4444;
    color: white;
    padding: 10px 18px;
    border-radius: 10px;
    cursor: pointer;
}

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

.cart-section {
    padding: 50px 0;
}

.cart-section h1 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.5rem;
}

/* ================= EMPTY CART ================= */

.cart-empty {
    background: #1e293b;
    padding: 60px;
    border-radius: 20px;
    text-align: center;
}

.cart-empty p {
    font-size: 1.4rem;
    margin-bottom: 20px;
}

.continue-shopping {
    display: inline-block;
    background: #38bdf8;
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: bold;
}

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

.cart-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

/* ================= CART ITEMS ================= */

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

.cart-item {
    background: #1e293b;
    border-radius: 20px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: .3s;
}

.cart-item:hover {
    transform: translateY(-3px);
}

.cart-item-image {
    width: 120px;
    height: 120px;
    object-fit: contain;
    background: white;
    padding: 10px;
    border-radius: 15px;
}

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

.cart-item-details h3 {
    margin-bottom: 10px;
    line-height: 1.5;
}

.cart-item-details p {
    color: #cbd5e1;
    margin-bottom: 8px;
}

.subtotal-text {
    color: #38bdf8 !important;
    font-weight: bold;
}

/* ================= CONTROLS ================= */

.cart-item-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.quantity-adjuster {
    display: flex;
    align-items: center;
    gap: 12px;
}

.qty-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: #38bdf8;
    color: white;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
}

.qty-btn:hover {
    background: #0284c7;
}

.qty-display {
    min-width: 30px;
    text-align: center;
    font-weight: bold;
}

.remove-btn {
    border: none;
    background: #ef4444;
    color: white;
    padding: 10px 15px;
    border-radius: 10px;
    cursor: pointer;
}

.remove-btn:hover {
    background: #dc2626;
}

/* ================= SUMMARY ================= */

.cart-summary {
    background: #1e293b;
    border-radius: 20px;
    padding: 25px;
    height: fit-content;
    position: sticky;
    top: 100px;
}

.cart-summary h3 {
    margin-bottom: 25px;
    font-size: 1.4rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    color: #cbd5e1;
}

.summary-row.total {
    border-top: 1px solid rgba(255, 255, 255, .1);
    margin-top: 15px;
    padding-top: 15px;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
}

.checkout-btn {
    width: 100%;
    margin-top: 20px;
    border: none;
    background: #38bdf8;
    color: white;
    padding: 15px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
}

.checkout-btn:hover {
    background: #0284c7;
}

/* ================= SCROLL BUTTON ================= */

.scroll-to-top {
    position: fixed;
    right: 25px;
    bottom: 25px;
    width: 55px;
    height: 55px;
    border: none;
    border-radius: 50%;
    background: #38bdf8;
    color: white;
    cursor: pointer;
    font-size: 24px;
    opacity: 0;
    pointer-events: none;
    transition: .3s;
}

.scroll-to-top.show {
    opacity: 1;
    pointer-events: auto;
}

/* ================= MOBILE ================= */

@media (max-width: 900px) {

    .cart-container {
        grid-template-columns: 1fr;
    }

    .cart-item {
        flex-direction: column;
        text-align: center;
    }

    .cart-item-controls {
        width: 100%;
        align-items: center;
    }

    .cart-summary {
        position: static;
    }

    .header-content {
        flex-direction: column;
        gap: 15px;
        padding: 15px 0;
    }
}