*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;

    font-family: "Poppins", sans-serif;
}


html{
    scroll-behavior: smooth;
}


body{
    background: #f8f1e7;

    color: #4e342e;

    transition: .3s;
}


/* ================= NAVBAR ================= */

nav{
    background: #4e342e;

    color: white;

    display: flex;

    justify-content: space-between;

    align-items: center;

    padding: 15px 60px;

    position: sticky;

    top: 0;

    z-index: 1000;

    box-shadow: 0 3px 12px rgba(0,0,0,.2);
}


nav h1{
    font-size: 26px;

    font-weight: 600;
}


nav ul{
    list-style: none;

    display: flex;

    gap: 28px;
}


nav ul a{
    color: white;

    text-decoration: none;

    font-size: 15px;

    transition: .3s;
}


nav ul a:hover{
    color: #d7b899;
}


.nav-buttons{
    display: flex;

    gap: 10px;
}


.nav-buttons button{
    background: #6d4c41;

    color: white;

    border: none;

    width: 38px;

    height: 38px;

    border-radius: 50%;

    cursor: pointer;

    font-size: 17px;

    position: relative;
}


#cartCount{
    position: absolute;

    top: -6px;

    right: -5px;

    background: #d7b899;

    color: #4e342e;

    width: 18px;

    height: 18px;

    border-radius: 50%;

    font-size: 11px;

    display: flex;

    align-items: center;

    justify-content: center;
}


/* ================= HERO ================= */

.hero{
    height: 48vh;

    min-height: 350px;

    background:

        linear-gradient(
            rgba(50,30,20,.32),
            rgba(50,30,20,.32)
        ),

        url("coffee.jpg") center center / cover no-repeat;

    display: flex;

    justify-content: center;

    align-items: center;

    text-align: center;
}


.hero-text{
    color: white;

    max-width: 550px;
}


.hero-text h2{
    font-size: 30px;

    margin-bottom: 8px;

    text-shadow: 1px 2px 6px rgba(0,0,0,.5);
}


.hero-text p{
    font-size: 15px;

    margin-bottom: 18px;
}


.hero-text button{
    background: #8d6e63;

    color: white;

    border: none;

    padding: 9px 24px;

    border-radius: 20px;

    cursor: pointer;

    transition: .3s;
}


.hero-text button:hover{
    background: #5d4037;

    transform: translateY(-2px);
}


/* ================= GENERAL SECTIONS ================= */

section{
    padding: 60px 8%;
}


section h2{
    text-align: center;

    font-size: 28px;

    color: #4e342e;
}


.section-description{
    text-align: center;

    color: #795548;

    margin-top: 5px;

    margin-bottom: 30px;
}


/* ================= ABOUT ================= */

.about{
    display: flex;

    align-items: center;

    gap: 50px;

    background: white;
}


.about-image{
    flex: 1;
}


.about-image img{
    width: 100%;

    height: 330px;

    object-fit: cover;

    border-radius: 15px;
}


.about-text{
    flex: 1;
}


.about-text h2{
    text-align: left;

    margin-bottom: 20px;
}


.about-text p{
    margin-bottom: 15px;

    color: #6d4c41;
}


.about-text button{
    background: #6d4c41;

    color: white;

    border: none;

    padding: 10px 22px;

    border-radius: 20px;

    cursor: pointer;
}


/* ================= CATEGORIES ================= */

.category-container{
    display: flex;

    justify-content: center;

    gap: 15px;

    flex-wrap: wrap;
}


.category-btn{
    background: white;

    color: #4e342e;

    border: 1px solid #d7b899;

    padding: 10px 22px;

    border-radius: 25px;

    cursor: pointer;

    transition: .3s;
}


.category-btn:hover,
.category-btn.active{
    background: #6d4c41;

    color: white;
}


/* ================= SEARCH ================= */

.search-box{
    display: flex;

    justify-content: center;

    margin-bottom: 30px;
}


.search-box input{
    width: 400px;

    max-width: 90%;

    padding: 12px 20px;

    border: 1px solid #d7b899;

    border-radius: 25px;

    outline: none;

    font-size: 14px;
}


/* ================= PRODUCTS ================= */

.products{
    display: grid;

    grid-template-columns: repeat(4,1fr);

    gap: 25px;

    max-width: 1200px;

    margin: auto;
}


.card{
    background: white;

    border-radius: 12px;

    overflow: hidden;

    text-align: center;

    box-shadow: 0 5px 15px rgba(0,0,0,.12);

    transition: .3s;
}


.card:hover{
    transform: translateY(-7px);

    box-shadow: 0 10px 25px rgba(0,0,0,.2);
}


.image-container{
    position: relative;

    overflow: hidden;
}


.card img{
    width: 100%;

    height: 190px;

    object-fit: cover;

    display: block;

    transition: .4s;
}


.card:hover img{
    transform: scale(1.05);
}


.favorite{
    position: absolute;

    top: 10px;

    right: 10px;

    width: 35px;

    height: 35px;

    border: none;

    border-radius: 50%;

    background: white;

    color: #6d4c41;

    font-size: 20px;

    cursor: pointer;

    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}


.favorite.active{
    color: #c62828;
}


.card h3{
    margin-top: 15px;

    font-size: 19px;
}


.card .price{
    color: #6d4c41;

    font-weight: 600;

    font-size: 18px;

    margin: 7px;
}


.buy-btn{
    background: #6d4c41;

    color: white;

    border: none;

    padding: 9px 22px;

    margin-bottom: 18px;

    border-radius: 20px;

    cursor: pointer;

    transition: .3s;
}


.buy-btn:hover{
    background: #3e2723;

    transform: scale(1.05);
}


/* ================= OFFER ================= */

.offer{
    background:

        linear-gradient(
            rgba(50,30,20,.7),
            rgba(50,30,20,.7)
        ),

        url("coffee.jpg") center/cover;

    color: white;

    text-align: center;
}


.offer span{
    font-size: 15px;

    color: #d7b899;
}


.offer h2{
    color: white;

    margin: 10px 0;
}


.offer p{
    margin-bottom: 20px;
}


.offer button{
    background: #d7b899;

    color: #4e342e;

    border: none;

    padding: 10px 25px;

    border-radius: 25px;

    cursor: pointer;
}


/* ================= REVIEWS ================= */

.review-container{
    display: grid;

    grid-template-columns: repeat(3,1fr);

    gap: 25px;

    max-width: 1000px;

    margin: auto;
}


.review{
    background: white;

    padding: 25px;

    border-radius: 12px;

    text-align: center;

    box-shadow: 0 5px 15px rgba(0,0,0,.1);
}


.stars{
    color: #d7a84a;

    font-size: 20px;

    margin-bottom: 12px;
}


.review p{
    font-style: italic;

    color: #6d4c41;

    margin-bottom: 12px;
}


/* ================= CONTACT ================= */

.contact{
    background: white;
}


.contact-container{
    display: flex;

    gap: 50px;

    max-width: 1000px;

    margin: auto;
}


.contact-info{
    flex: 1;

    display: grid;

    grid-template-columns: repeat(2,1fr);

    gap: 25px;
}


.contact-info div{
    text-align: center;

    padding: 15px;
}


.contact-info span{
    font-size: 25px;
}


.contact-info h3{
    margin: 5px 0;

    font-size: 17px;
}


.contact-info p{
    color: #795548;

    font-size: 13px;
}


.contact-form{
    flex: 1;

    display: flex;

    flex-direction: column;

    gap: 15px;
}


.contact-form input,
.contact-form textarea{
    padding: 12px;

    border: 1px solid #d7b899;

    border-radius: 8px;

    outline: none;

    resize: none;
}


.contact-form textarea{
    height: 120px;
}


.contact-form button{
    background: #6d4c41;

    color: white;

    border: none;

    padding: 11px;

    border-radius: 20px;

    cursor: pointer;
}


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

.cart{
    position: fixed;

    top: 0;

    right: -400px;

    width: 360px;

    max-width: 90%;

    height: 100vh;

    background: white;

    z-index: 2000;

    box-shadow: -5px 0 20px rgba(0,0,0,.25);

    padding: 25px;

    transition: .4s;

    display: flex;

    flex-direction: column;
}


.cart.open{
    right: 0;
}


.cart-header{
    display: flex;

    justify-content: space-between;

    align-items: center;

    border-bottom: 1px solid #ddd;

    padding-bottom: 15px;
}


.cart-header button{
    border: none;

    background: none;

    font-size: 28px;

    cursor: pointer;
}


#cartItems{
    flex: 1;

    overflow-y: auto;

    padding-top: 15px;
}


.cart-item{
    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 15px;

    padding-bottom: 15px;

    border-bottom: 1px solid #eee;
}


.quantity{
    display: flex;

    align-items: center;

    gap: 8px;
}


.quantity button{
    width: 25px;

    height: 25px;

    border: none;

    background: #6d4c41;

    color: white;

    border-radius: 50%;

    cursor: pointer;
}


.cart-total{
    border-top: 1px solid #ddd;

    padding-top: 20px;
}


.cart-total h3{
    margin-bottom: 15px;
}


#checkoutBtn{
    width: 100%;

    background: #6d4c41;

    color: white;

    border: none;

    padding: 12px;

    border-radius: 25px;

    cursor: pointer;
}


.empty-cart{
    text-align: center;

    color: #795548;

    margin-top: 30px;
}


/* ================= FOOTER ================= */

footer{
    background: #4e342e;

    color: white;

    padding: 30px 8%;

    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 20px;
}


footer h2{
    color: white;

    font-size: 22px;
}


footer p{
    font-size: 13px;

    color: #d7b899;
}


.links{
    display: flex;

    gap: 20px;
}


.links a{
    color: #d7b899;

    text-decoration: none;
}


.links a:hover{
    color: white;
}


/* ================= DARK MODE ================= */

body.dark{
    background: #211815;

    color: #f5e9dc;
}


body.dark .about,
body.dark .contact,
body.dark .card,
body.dark .review,
body.dark .cart{
    background: #30231f;

    color: #f5e9dc;
}


body.dark section h2,
body.dark .card h3{
    color: #f5e9dc;
}


body.dark .about-text p,
body.dark .review p,
body.dark .contact-info p{
    color: #d7b899;
}


body.dark .search-box input{
    background: #30231f;

    color: white;
}


body.dark .category-btn{
    background: #30231f;

    color: #f5e9dc;
}


body.dark .category-btn.active{
    background: #8d6e63;

    color: white;
}


/* ================= ANIMATION ================= */

.card,
.review,
.about-image,
.about-text{
    animation: fadeUp .7s ease;
}


@keyframes fadeUp{

    from{
        opacity: 0;

        transform: translateY(20px);
    }

    to{
        opacity: 1;

        transform: translateY(0);
    }

}


/* ================= TABLET ================= */

@media(max-width: 992px){

    nav{
        padding: 15px 30px;
    }


    .products{
        grid-template-columns: repeat(2,1fr);
    }


    .about{
        gap: 30px;
    }


    .review-container{
        grid-template-columns: repeat(2,1fr);
    }

}


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

@media(max-width: 768px){

    nav{
        flex-direction: column;

        gap: 12px;

        padding: 15px;
    }


    nav ul{
        gap: 15px;
    }


    .hero{
        height: 42vh;

        min-height: 300px;
    }


    .hero-text h2{
        font-size: 24px;
    }


    .hero-text p{
        font-size: 13px;
    }


    .about{
        flex-direction: column;

        padding: 45px 7%;
    }


    .about-image,
    .about-text{
        width: 100%;
    }


    .about-image img{
        height: 250px;
    }


    .about-text h2{
        text-align: center;
    }


    .products{
        grid-template-columns: 1fr;
    }


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


    .contact-container{
        flex-direction: column;
    }


    .contact-info{
        grid-template-columns: 1fr 1fr;
    }


    footer{
        flex-direction: column;

        text-align: center;
    }

}


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

@media(max-width: 480px){

    nav h1{
        font-size: 22px;
    }


    nav ul{
        gap: 10px;
    }


    nav ul a{
        font-size: 13px;
    }


    .nav-buttons{
        margin-top: 3px;
    }


    .hero-text h2{
        font-size: 22px;
    }


    .hero-text p{
        font-size: 12px;
    }


    section{
        padding: 45px 6%;
    }


    .contact-info{
        grid-template-columns: 1fr;
    }


    .cart{
        width: 100%;
    }

}