@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

* {
    font-family: "Poppins", serif;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
    scroll-padding-top: 2rem;
}

img {
    width: 100%;
}

.container {
    max-width: 1070px;
    width: 100%;
    margin: auto;
}

header{
    position: sticky;
    top: 0;
    width: 100%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    z-index: 200;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    background: linear-gradient(to right, #e2aef4, #705eb4);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #000;
}

.cart-icon {
    position: relative;
    cursor: pointer;
}

.cart-icon i {
    font-size: 24px;
}

.cart-icon span {
    position: absolute;
    top: -8px;
    right: -10px;
    background: #705eb4;
    color: #fff;
    font-size: 12px;
    padding: 2px 4px;
    border-radius: 50%;
}

.products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, auto));
    gap: 1.5rem;
    padding: 2rem 0;
}

.product-card {
    background: #e7deec;
    border-radius: 1.5rem;
    padding: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    position: relative;
}

.product-image {
    width: 100%;
    max-height: 250px;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 1rem;
    margin-bottom: 10px;
}

.product-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    padding: 0 14px;
}

.product-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    margin: 8px 0;
}

.product-price {
    color: #705eb4;
    font-size: 1.2rem;
    font-weight: 600;
}

.product-info p {
    font-size: 0.88rem;
    font-weight: 500;
    color: #343131;
}

.add-to-cart i {
    background: #705eb4;
    background: linear-gradient(to bottom right, #e2aef4, #705eb4);
    color: #fff;
    font-size: 20px;
    padding: 10px;
    text-align: center;
    border-radius: 50%;
    cursor: pointer;
}

.cart-model {
    position: fixed;
    top: 0;
    right: -100%;
    max-width: 500px;
    width: 100%;
    height: 100vh;
    background: #fff;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    transition: all 0.5s cubic-bezier(0.075, 0.82, 0.165, 1);
}

.open-cart {
    right: 0;
    transition: all 0.5s cubic-bezier(0.075, 0.82, 0.165, 1);
}

.cart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid #eee;
    padding-bottom: 1rem;
}

.cart-head h2 {
    color: #333;
}

.close-btn {
    font-size: 20px;
    background: #eee;
    border: none;
    padding: 2px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.075, 0.82, 0.165, 1);
}

.cart-model ul {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
    max-height: 60vh;
    overflow-y: auto;
    display: grid;
    gap: 10px;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 5px;
    background: #f9fafb;
    gap: 1rem;
}

.cart-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.cart-item-details {
    flex-grow: 1;
}
.cart-item-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.cart-item-price {
    color: #666;
    font-size: 0.9rem;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-controls button {
    background: #eee;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
}

.remove-item {
    background: #ff4757;
    color: #fff;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
}
.cart-total {
    font-weight: 600;
    font-size: 1.2rem;
    text-align: right;
    border-top: 1px solid #eee;
    padding-top: 1rem;
    margin-top: 1rem;
}

.checkout-btn a {
    text-decoration: none;
    padding: 8px 10px;
    background: #6c47ff;
    color: #fff;
    text-align: center;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 8px;
}

.flying-item {
    position: fixed;
    width: 150px;
    height: 150px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    border-radius: 50%;
    overflow: hidden;
    animation: flyToCart 0.8s cubic-bezier(0.42, 0, 0.58, 1);
}

.flying-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
 @keyframes flyToCart {
    0% {
        transform: scale(0.5);
        opacity: 1;
    }

    50% {
        transform: scale(0.5);
        opacity: 0.7;
    }

    100% {
        transform: scale(0.5);
        opacity: 0;
    }
 }

 @media (max-width: 1140px) {
    .container {
        margin: 0 auto;
        width: 90%;
    }
 }

 @media (max-width: 400px) {
    .product-image {
        max-height: 300px;
    }

    .cart-model {
        padding: 1rem;
    }
 }