/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f8f9fa;
    color: #1a1a2e;
    padding: 20px;
}

/* ===== HEADER ===== */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1a1a2e;
    color: white;
    padding: 16px 30px;
    border-radius: 12px;
    margin-bottom: 40px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
}

.cart-icon {
    font-size: 1.4rem;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 50px;
    transition: 0.3s;
}

.cart-icon:hover {
    background: rgba(255, 255, 255, 0.2);
}

#cart-count {
    background: #6c63ff;
    padding: 2px 10px;
    border-radius: 50px;
    font-size: 0.9rem;
    margin-left: 4px;
}

/* ===== PRODUCT GRID ===== */
h1 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2rem;
    color: #1a1a2e;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.product-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: 0.3s;
    text-align: center;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.product-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    background: #e9ecef;
}

.product-card h3 {
    margin: 12px 0 4px;
    font-size: 1.1rem;
}

.product-card .price {
    font-size: 1.3rem;
    font-weight: 700;
    color: #6c63ff;
    margin: 6px 0;
}

.product-card .add-btn {
    background: #6c63ff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    margin-top: 8px;
}

.product-card .add-btn:hover {
    background: #5a52d9;
    transform: scale(1.05);
}

/* ===== CART SIDEBAR ===== */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    height: 100%;
    background: white;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    padding: 24px;
    transition: 0.4s ease;
    z-index: 1000;
    overflow-y: auto;
}

.cart-sidebar.open {
    right: 0;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 12px;
    margin-bottom: 20px;
}

.cart-header button {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #6c757d;
}

.cart-items {
    min-height: 200px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e9ecef;
}

.cart-item-info h4 {
    font-size: 1rem;
    margin-bottom: 2px;
}

.cart-item-info p {
    color: #6c63ff;
    font-weight: 600;
}

.cart-item button {
    background: #ff4757;
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.cart-item button:hover {
    background: #e03a4a;
}

.cart-total {
    border-top: 2px solid #e9ecef;
    padding-top: 16px;
    margin-top: 16px;
    text-align: center;
}

.cart-total h3 {
    font-size: 1.4rem;
    margin-bottom: 12px;
}

#checkout-btn {
    background: #2ed573;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.3s;
    width: 100%;
}

#checkout-btn:hover {
    background: #26b865;
}

/* ===== OVERLAY ===== */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
    display: none;
}

.overlay.active {
    display: block;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 16px;
    }
}
