@import url('https://fonts.googleapis.com/css2?family=League+Spartan:wght@100..900&display=swap');

*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
}

body {
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
}

input,
button,
textarea,
select {
    font: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
    overflow-wrap: break-word;
}

:root {
    --bg-color-pc: hsl(0, 0%, 94%);
    --bg-color-phone: hsl(0, 0%, 100%);
    --bg-card-color: hsl(0, 0%, 100%);
    --bg-reviews: hsl(301, 45%, 22%);
    --bg-rating: hsl(300, 24%, 96%);

    --hd-color: hsl(299, 49%, 22%);
    --p-color: hsl(312, 4%, 52%);
    --p-rating-color: hsl(306, 21%, 26%);
    --p-review-color: hsl(300, 100%, 98%);
    --span-review-color: hsl(319, 48%, 64%);

    --fm: "League Spartan", sans-serif;

    --fs: 15px;

    --fs-sm: 0.875rem;
    --fs-md: 1rem;
    --fs-lg: 1.25rem;
    --fs-xl: 1.5rem;
    --fs-2xl: 2rem;
    --fs-3xl: 3rem;
}

body {
    background: url(../images/bg-pattern-bottom-mobile.svg), url(../images/bg-pattern-top-mobile.svg);
    background-repeat: no-repeat, no-repeat;
    background-size: contain, contain;
    background-position: bottom right, top left;

    color: var(--p-color);
    background-color: var(--bg-color);
    font: var(--fm);
    height: 100dvh;
    font-size: var(--fs);
    font-family: var(--fm);

    display: flex;
    flex-direction: column;

    h1 {
        color: var(--hd-color);
    }
}

.container {
    flex-grow: 1;

    display: flex;
    align-items: center;
    justify-content: center;
}

.card {
    padding: 1rem;
    padding-block: 4rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2rem;

}

.products-info,
.products-rating,
.products-reviews {
    display: flex;
    flex-direction: column;
}

.products-info {
    gap: 1.2rem;
    align-items: center;

    h1 {
        width: 200px;
    }

    p {
        width: 275px;
        line-height: 1.4;
    }
}

.products-rating {
    gap: 1rem;


    .rating {
        background-color: var(--bg-rating);
        padding: 1rem;
        border-radius: 8px;

        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    p {
        color: var(--p-rating-color);
        font-weight: bold;
        font-size: var(--fs-md);
    }
}

.products-reviews {
    gap: 1.5rem;
}

.reviews {
    background-color: var(--bg-reviews);
    padding: 1.5rem;
    padding-bottom: 2rem;
    border-radius: 8px;
    width: 280px;

    display: flex;
    flex-direction: column;
    gap: 1rem;

    .reviews-user {
        display: flex;
        align-items: center;
        gap: 1rem;
    }

    .user-info {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    img {
        border-radius: 50%;
        height: 2.5rem;
    }

    h2,
    span {
        font-size: var(--fs-md);
    }

    h2 {
        color: var(--p-review-color);
    }

    span {
        color: var(--span-review-color);
        font-weight: 500;
    }


    p {
        color: var(--p-review-color);
        text-align: left;
        line-height: 1.4;
    }
}

footer {
    font-size: 0.6875rem;
    text-align: center;
}

footer a {
    color: hsl(228, 45%, 44%);
}

@media (width>=900px) {

    body {
        background: url(../images/bg-pattern-bottom-desktop.svg), url(../images/bg-pattern-top-desktop.svg);
        background-repeat: no-repeat, no-repeat;
        background-position: bottom right, top left;
    }

    .card {
        padding: 5rem;

        display: grid;
        grid-template-rows: auto;
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "info rating"
            "reviews reviews";
    }

    .products-info {
        grid-area: info;
        justify-content: start;
        align-items: start;
        text-align: left;

        h1 {
            width: 310px;
            font-size: 3rem;
        }

        p {
            width: 350px;
        }
    }

    .products-rating {
        grid-area: rating;
        width: 500px;
        justify-content: center;

        .rating {
            flex-direction: row;
            align-items: baseline;
            padding-left: 2rem;
            width: 400px;
            align-self: center;
        }

        .rating:first-child {
            align-self: flex-start;
        }

        .rating:nth-child(2) {
            align-self: center;
        }

        .rating:nth-child(3) {
            align-self: flex-end;
        }
    }



    .products-reviews {
        grid-area: reviews;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;

        height: 250px;

        .reviews {
            width: 325px;
            padding: 2rem;
        }

        .reviews:first-child {
            align-self: flex-start;
        }

        .reviews:nth-child(2) {
            align-self: center;
        }

        .reviews:last-child {
            align-self: flex-end;
        }
    }

}