/* Google Fonts  */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

body,
html {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    overflow-x: hidden;
}
/* Globals  */
*{
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    list-style: none;
    text-decoration: none;
    scroll-behavior: smooth;
    scroll-padding: 2rem;
}
/* Variables  */
:root{
    --main-color: #fd4646;
    --sec-color: #4946fd;
    --text-color: #171427;
    --bg-color: #fff;
}
::selection{
    color: var(--text-color);
    background-color: var(--main-color);
}
.container{
    max-width: 1068px;
    margin: auto;
    width: 100%;
}
section{
    padding: 4rem 0 3rem;
}
body{
    color: var(--text-color);
}
img{
    width: 100%;
}

/* =======================================  */
/* HEADER  */
header{
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--bg-color);
    box-shadow: 0 1px 4px hsl(0 4% 15% / 10%);
    z-index: 100;
}
.navbar-nav li:hover {
    color: midnightblue;
    text-decoration: underline;
}

.social-icon__link:hover {
    transform: translateY(-10px);
}

#cart-icon{
    font-size: 2rem;
    cursor: pointer;
    margin-top: 9px;
}

/* CART  */
#quet{
    text-align: center;
    color: #fd4646;
}
.cart{
    position: fixed;
    top: 0;
    right: 0;
    right: -100%; 
    width: 360px;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    background-color: var(--bg-color);
    box-shadow: -2px solid 4px hsl(0 4% 15% / 10%);
    border: 1px solid var(--main-color);
    transition: 1.5s;
    margin-top: 5rem;
}
.cart.active{
    right: 0;
    transition: .5s;
}
.cart-title{
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2rem;
}
.cart-box{
    display: grid;
    grid-template-columns: 32% 50% 18%;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}
.cart-img{
    width: 100px;
    height: 100px;
    object-fit: contain;
    padding: 10px;
}
.detail-box{
    display: grid;
    row-gap: .5rem;
}
.cart-product-title{
    font-size: 1rem;
    text-transform: uppercase;
}
.cart-price{
    font-weight: 500;
}
.cart-quantity{
    border: 1px solid var(--text-color);
    outline-color: var(--main-color);
    width: 2.4rem;
    text-align: center;
    font-size: 1rem;
}
.cart-remove{
    font-size: 24px;
    color: var(--main-color);
    cursor: pointer;
}
.total{
    display: flex;
    justify-content: flex-end;
    margin-top: 1.5rem;
    border-top: 1px solid var(--text-color);
}
.total-title{
    font-size: 1rem;
    font-weight: 600;
}
.total-price{
    margin-left: .5rem;
}
.btn-buy{
    display: flex;
    margin: 1.5rem auto 0 auto;
    padding: 12px 20px;
    border: none;
    background-color: var(--sec-color);
    color: var(--bg-color);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
}
.btn-buy:hover{
    background-color: var(--text-color);
}
#cart-close{
    position: absolute;
    top: 1rem;
    right: .8rem;
    font-size: 2rem;
    color: var(--text-color);
    cursor: pointer;
}

/* SHOP SECTION  */
.shop{
    margin-top: 6rem;
}
.section-title{
    font-style: 1.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 1.5rem;
}
.shop-content{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, auto));
    gap: 1.5rem;
}
.product-box{
    position: relative;
}
.product-box:hover{
    padding: 10px;
    border: 1px solid var(--text-color);
    transition: .4s;
}
.product-img{
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    margin-bottom: .5rem;
}
.product-title{
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: .5rem;
}
.product-price{
    font-weight: 500;
}
.add-cart{
    position: absolute;
    bottom: 0;
    right: 0;
    background-color: var(--text-color);
    color: var(--bg-color);
    padding: 10px;
    cursor: pointer;
}
.add-cart:hover{
    background-color: hsl(249, 32%, 17%);
}


/* ================ RESPONSIVE & BREAKPOINTS ============= */
@media (max-width: 1080px){
    .nav{
        padding: 15px;
    }
    .container{
        width: 90%;
        margin: 0 auto;
    }
    section{
        padding: 3rem 0 2rem;
    }
    .shop{
        margin-top: 2rem;
    }
}

/* For Medium Devices */
@media (max-width: 400px){
    .nav{
        padding: 11px;
    }
    .logo{
        font-size: 1rem;
    }
    .cart{
        width: 320px;
    }
}

/* For Small Devices */
@media (max-width: 360px){
    .shop{
        margin-top: 1rem;
    }
    .cart{
        width: 280px;
    }
}