@import url('https://fonts.googleapis.com/css2?family=Kumbh+Sans:wght,YOPQ@100..900,40..300&display=swap');

:root {
    --Orange: hsl(26, 100%, 55%);
    --Pale-orange: hsl(25, 100%, 94%);
    --Very-dark-blue: hsl(220, 13%, 13%);
    --Dark-grayish-blue: hsl(219, 9%, 45%);
    --Grayish-blue: hsl(220, 14%, 75%);
    --Light-grayish-blue: hsl(223, 64%, 98%);
    --White: hsl(0, 0%, 100%);
    --Black: hsl(0, 0%, 0%);
    --Black-with-opacity: hsla(0, 0%, 0%, 0.75);
    --paragraph: 16px
}

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

html {
    font-family: "Kumbh Sans", sans-serif;
    font-size: var(--paragraph);
}

body {
    min-height: 100vh;
}

.container {
    max-width: 1120px;
    min-height: 100vh;
    padding: 0 1rem;
    margin: auto;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--Grayish-blue);
    padding: 1.5rem 0;
    margin-bottom: 4rem;
}

.nav-first .menu-icon,
.backdrop,
.nav-links .close-icon {
    display: none;
}

.nav-first {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--Dark-grayish-blue);
    position: relative;
}

.nav-links a:hover {
    color: var(--Black);
}

.nav-links a::after {
    content: '';
    position: absolute;
    background-color: var(--Orange);
    width: 0;
    height: 0.25rem;
    left: 0;
    bottom: -2.5rem;
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-second {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.nav-second .avatar img {
    width: 3rem;
    height: 3rem;
    cursor: pointer;
}

/* Main */
.main {
    display: flex;
    align-items: center;
    gap: 7rem;
    padding: 0 3rem;
    margin-bottom: 5rem;
}

/* Image Gallery */
.gallery {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.gallery .main-image img {
    display: none;
}

.gallery .main-image img.active {
    display: inline-block;
    max-width: 450px;
    max-height: 450px;
    width: 100%;
    border-radius: 1rem;
    cursor: pointer;
}

.gallery .thumb-list {
    display: flex;
    justify-content: space-between;
    max-width: 450px;
    width: 100%;
}

.gallery .thumb-list button {
    border: none;
    background: none;
    max-width: 90px;
    max-height: 90px;
    margin: 0 2px;
}

.gallery .thumb-list button img {
    width: 100%;
    height: 100%;
    border-radius: 0.5rem;
    cursor: pointer;
}

.gallery .thumb-list button img:hover {
    opacity: 50%;
}

.gallery .thumb-list .active img {
    opacity: 30%;
}

.gallery .thumb-list .active {
    border: 2px solid var(--Orange);
    border-radius: 0.5rem;
    margin: 0;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 100%;
    z-index: 5;
    background-color: var(--Black-with-opacity);
    align-items: center;
    justify-content: center;
}

.lightbox.active {
    display: flex;
}

.lightbox .gallery {
    max-width: 400px;
}

.lightbox .main-image {
    position: relative;
}

.lightbox .icon-prev,
.lightbox .icon-next {
    border: none;
    background: none;
    position: absolute;
    background-color: var(--White);
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    cursor: pointer;
}

.lightbox .icon-prev {
    top: 50%;
    transform: translate(-50%, -50%);
}

.lightbox .icon-next {
    top: 50%;
    right: 0;
    transform: translate(50%, -50%);
}

.lightbox .icon-prev:hover,
.lightbox .icon-next:hover {
    fill: var(--Orange);
}

.lightbox .icon-close {
    border: none;
    background: none;
    position: absolute;
    right: 0;
    top: -2.5rem;
}

.lightbox .icon-close {
    fill: var(--White);
    cursor: pointer;
}

.lightbox .icon-close:hover {
    fill: var(--Orange);
}

/* Content */
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.content .company-name {
    text-transform: uppercase;
    color: var(--Dark-grayish-blue);
    font-size: 14px;
    letter-spacing: 2px;
    margin-bottom: 1rem;
}

.content .product-name {
    font-size: 2.9rem;
    line-height: 3.2rem;
    color: var(--Very-dark-blue);
    margin-bottom: 2rem;
}

.content .product-description {
    color: var(--Dark-grayish-blue);
    line-height: 1.5rem;
    margin-bottom: 1.5rem;
}

.price-info {
    display: flex;
    flex-direction: column;
    margin-bottom: 2rem;
}

.price-info .current-price {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--Very-dark-blue);
    font-weight: 800;
    font-size: 1.7rem;
    margin-bottom: 1rem;
}

.price-info .current-price .discount {
    background-color: var(--Very-dark-blue);
    color: var(--White);
    font-size: 1rem;
    padding: 0.2rem 0.5rem;
    border-radius: 0.4rem;
    font-weight: 500;
}

.price-info .prev-price {
    color: var(--Dark-grayish-blue);
    font-weight: 600;
    text-decoration: line-through;
}

.add-to-cart-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.add-to-cart-container .counter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--Light-grayish-blue);
    max-width: 150px;
    height: 3.5rem;
    width: 100%;
    padding: 0 1rem;
    border-radius: 0.5rem;
}

.add-to-cart-container .counter button {
    border: none;
    background: none;
    display: flex;
    align-items: center;
    height: 50%;
    cursor: pointer;
}

.add-to-cart-container .counter button:hover {
    opacity: 50%;
}

.add-to-cart-container .counter .count {
    font-weight: 700;
}

.add-to-cart-container .add-to-cart-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    width: 100%;
    height: 3.5rem;
    background-color: var(--Orange);
    color: var(--Very-dark-blue);
    border: none;
    border-radius: 0.5rem;
    font-weight: 800;
    font-size: 1rem;
    font-family: 'Kumbh Sans', sans-serif;
    cursor: pointer;
}

.add-to-cart-container .add-to-cart-btn:hover {
    opacity: 50%;
}

/* Cart */
.cart {
    position: relative;
}

.cart-btn {
    border: none;
    background: none;
    cursor: pointer;
}

.cart-container {
    position: absolute;
    background-color: var(--White);
    width: 360px;
    min-height: 250px;
    box-shadow: 0 7px 30px 0 rgba(100, 100, 111, 0.2);
    border-radius: 1rem;
    top: 3rem;
    right: -6rem;
    z-index: 20;
    display: none;
}

.cart-container.active {
    display: flex;
    flex-direction: column;
}

.cart-title {
    padding: 1.5rem;
    font-weight: 700;
    border-bottom: 1px solid var(--Grayish-blue);
}

.cart .cart-items {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem;
}

.cart .cart-items.empty {
    align-items: center;
    justify-content: center;
    height: 170px;
    font-weight: 700;
}

.cart .cart-items .cart-empty {
    display: none;
}

.cart .cart-items.empty .cart-empty {
    color: var(--Grayish-blue);
    display: inline-block;
}

.checkout {
    height: 3rem;
    margin: 1.5rem;
    border: none;
    border-radius: 0.5rem;
    background-color: var(--Orange);
    color: var(--Very-dark-blue);
    font-weight: 800;
    font-size: 1rem;
    font-family: 'Kumbh Sans', sans-serif;
    cursor: pointer;
}

.checkout:hover {
    opacity: 50%;
}

.checkout.empty {
    display: none;
}

.cart-count {
    position: absolute;
    background-color: var(--Orange);
    color: var(--White);
    min-width: 1.2rem;
    min-height: 1rem;
    border-radius: 0.5rem;
    top: -8px;
    right: -10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--Dark-grayish-blue);
}

.cart-item .product-img {
    height: 50px;
    border-radius: 0.3rem;
}

.cart-item .total-price {
    color: var(--Black);
    font-weight: 700;
}

.delete-item {
    border: none;
    background: none;
    cursor: pointer;
}

.delete-item:hover {
    opacity: 50%;
}


/* ---------- Tablet Responsive ---------- */
@media screen and (max-width: 1024px) {
    .main {
        gap: 3rem;
        padding: 0 1rem;
    }
}

/* ---------- Mobile Responsive ---------- */
@media screen and (max-width: 768px) {
    .container {
        padding: 0;
    }


    /* Navbar */
    .navbar {
        border-bottom: none;
        padding: 0.7rem 1rem;
        margin-bottom: 0;
    }

    .nav-first .menu-icon,
    .backdrop,
    .nav-links .close-icon {
        display: inline-block;
    }

    .nav-first {
        gap: 1rem;
    }

    .nav-links {
        display: flex;
        flex-direction: column;
        align-items: start;
        gap: 1.5rem;
        padding: 1.5rem;
        background-color: var(--White);
        position: fixed;
        width: 200px;
        height: 100vh;
        top: 0;
        left: -200px;
        opacity: 0;
        z-index: 10;
        transition: left 0.5s ease, opacity 0.3s ease;
    }

    .nav-links.active {
        left: 0;
        opacity: 1;
    }
    
    .open-menu {
        border: none;
        background: none;
        cursor: pointer;
    }
    
    .close-menu {
        border: none;
        background: none;
        margin-bottom: 2rem;
        cursor: pointer;
    }

    .backdrop.active {
        background-color: var(--Black-with-opacity);
        width: 100vw;
        height: 100vh;
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 9;
    }

    .nav-links a {
        font-weight: 700;
        color: var(--Black);
    }

    .nav-links a::after {
        transition: none;
    }

    .nav-links a:hover::after {
        bottom: -0.3rem;
    }

    .nav-second {
        gap: 1rem;
    }

    .nav-second .avatar img {
        width: 30px;
        height: 30px;
    }

    /* Main */
    .main {
        flex-direction: column;
        gap: 1rem;
        padding: 0;
    }

    .main .default {
        display: none;
    }

    .lightbox {
        display: flex;
        position: relative;
        height: auto;
        width: 100vw;
        background: none;
    }

    .lightbox .gallery {
        max-width: 100%;
    }

    .lightbox .icon-close {
        display: none;
    }

    .main .thumb-list {
        display: none;
    }

    .main .icon-prev {
        left: 35px;
        width: 45px;
        height: 45px;
    }

    .main .icon-next {
        right: 35px;
        width: 45px;
        height: 45px;
    }

    .gallery .main-image img.active {
        max-width: none;
        max-height: none;
        width: 100vw;
        height: auto;
        border-radius: 0;
    }

    .content {
        padding: 0 1rem;
    }

    .content .company-name {
        margin-bottom: 0.5rem;
    }

    .content .product-name {
        font-size: 2rem;
        line-height: 2.3rem;
        margin-bottom: 1.5rem;
    }

    .content .product-description {
        line-height: 1.5rem;
    }

    .price-info {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 2rem;
    }

    .price-info .current-price {
        margin-bottom: 0;
    }

    .add-to-cart-container {
        flex-direction: column;
    }

    .add-to-cart-container .counter {
        max-width: 100%;
    }

    .add-to-cart-container .add-to-cart-btn {
        box-shadow: 0 10px 30px -6px rgba(250, 100, 0, 0.5);
    }

    .cart-container {
        top: 3rem;
        right: -3.5rem;
    }
}