@import url("./reset.css");
@import url("./variables.css");

.homepage {
    background-image: url(../assets/twomen.webp);
    background-size: cover;
    background-repeat: no-repeat;
    min-height: 430px;
    background-position-x: center;
    background-position-y: center;
    position: relative;
    box-shadow: 2px 2px 5px lightgrey;
    margin-top: 20px;
    padding: 20px;
    z-index: 1;
}
.homepage::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: inherit;
    filter: brightness(60%);
    z-index: 0;
}

.welcome-content {
    position: relative;
    top: 50px;
    left: 70px;
    color: white;
    z-index: 1;
}
.welcome-content h1 {
    color: white;
    font-size: 3em;
    max-width: 600px;
    max-height: 200px;
    margin: 0;
    padding: 0;
}
.welcome-content p {
    font-size: 1.5em;
    color: white;
    max-width: 500px;
    margin-bottom: 40px;
}

#bestseller-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#loading {
    border: 8px solid lightgray;
    border-top: 8px solid #545F71;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 2s linear infinite;
    display: block;
    margin: 0 auto;
  }

#bestseller-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    justify-content: center;
    gap: 20px;
    padding-bottom: 20px;
}

.product-link {
    display: block;
    color: inherit;
    text-decoration: none;
    height: 100%;
}

.product {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    background-color: white;
    border: 1px solid lightgrey;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    margin-top: 10px;
}

.product:hover {
    transform: translateY(-5px);
    border: 1px solid rgb(175, 158, 0);
}

.product img {
    width: auto;
    height: 200px;
}

.product h3 {
    margin: 1rem;
    font-size: 1.2rem;
}

.product p {
    font-size: 1rem;
    color: #555;
    margin: 0.5rem;
}

.original-price {
    text-decoration: line-through;
    color: grey;
    margin-right: 5px;
}

.current-price {
    font-weight: bold;
}

.content{
    display: flex;
    flex-direction: column;
    max-width: 1200px;
    margin: 50px auto;
    grid-gap: 30px;
}
.content h2 {
    font-size: 2em;
    margin: 0;
    padding: 0;
}
.content p {
    width: 100%;
    grid-column: 1;
}
.content img {
    width: 100%;
    grid-column: 2;
}

/* Tablet */
@media (max-width: 1000px) {
    .product {
        padding: 0.5em;
    }

    .product img {
        height: 120px;
    }

    .welcome-content {
        max-width: 500px;
    }

    .welcome-content h1 {
        font-size: 2.5em;
        max-width: 400px;
    }

    .welcome-content p {
        font-size: 1.2em;
        max-width: 400px;
        margin-bottom: 30px;
    }
}


/* Mobile */
@media (max-width:600px) {
    .homepage {
        min-height: 280px;
        background-position: center;
    }
    .welcome-content {
        left: 20px;
        top: 20px;
    }

    .welcome-content h1 {
        font-size: 2em;
        max-width: 250px;
    }

    .welcome-content p {
        font-size: 1em;
        max-width: 250px;
        margin-bottom: 20px;
    }

    #bestseller-list {
        grid-template-columns: repeat(2, 1fr);
    }

    .product {
        padding: 0.5em;
    }

    .product img {
        height: 100px;
    }

    .product h3 {
        font-size: 0.8rem;
        margin: 0.5rem;
    }

    .product p {
        font-size: 0.7rem;
    }
}

@media (min-width: 600px) {
    .content {
    display: grid;
    grid-template-columns: repeat(2,1fr);
    }
}
