:root {
    --primary-color: #4a90e2;
    --secondary-color: #f0f8ff;
    --text-color: #333;
    --border-color: #ddd;
}

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

body {
    background-color: var(--secondary-color);
    color: var(--text-color);
    line-height: 1.6;
    
}

header {
    width: 100%;
    position: fixed;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
    a {
        text-decoration: none;
        color: black;
        }
}

      

.cart-icon-container {
    display: flex;
    align-items: center;
    position: relative;
}

#cart-count {
    background-color: #e94e77;
    color: #fff;
    border-radius: 50%;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    position: absolute;
    top: -10px;
    right: 0;
}

#view-cart-btn {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: 5px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding: 90px 30px 30px;
}

.product-card {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.product-card img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.product-card h3 {
    margin: 1rem 0 0.5rem;
}

.product-card p {
    color: #666;
    margin-bottom: 1rem;
}

.add-to-cart-btn {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.add-to-cart-btn:hover {
    background-color: #3876c1;
}

.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px; /* Initially hidden */
    width: 350px;
    height: 100%;
    background-color: #fff;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    transition: right 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.cart-sidebar.open {
    right: 0; /* Visible */
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

#close-cart-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

#cart-items {
    list-style: none;
    padding: 1rem;
    overflow-y: auto;
    flex-grow: 1;
}

.cart-item {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.cart-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    margin-right: 1rem;
    border-radius: 4px;
}

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

.item-details h4 {
    margin: 0 0 0.25rem;
}

.item-quantity-controls {
    display: flex;
    align-items: center;
}

.item-quantity-controls button {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    border-radius: 3px;
}

.item-quantity-controls span {
    margin: 0 0.5rem;
}

.remove-item-btn {
    background-color: #e94e77;
    color: #fff;
    border: none;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    border-radius: 3px;
    margin-left: 1rem;
}

.cart-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    text-align: right;
}

#checkout-btn {
    width: 100%;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    border-radius: 5px;
    font-size: 1.1rem;
    margin-top: 1rem;
}
