/*
author: Zowie Beha
license: Copyright © 2024 Zowie Beha
*/


/* ===========
Product detail content
============== */

/* i want to make main flex overall, but I would need more time to
figure out how that impacts the pages */
main {
    display: flex;
    justify-content: center;
}
main > article {
    gap: 60px;
    flex-direction: row;
    justify-content: flex-start;
    align-items: flex-start;
    width: 95%;
}

main > article .info {
    order: 2;
    align-self: flex-start;
    margin-top: 1em;
    
    display: flex;
    flex-direction: column;
}

main > article div > img {
    height: 25em;
    width: 25em;
}

main > article img {
    /* max-height: 500%; not respected. use media query with flexbox instead */
    max-width: 100%;
    object-fit: cover;
    border: 1px solid rgb(161, 160, 160);
    background-color: rgb(236, 236, 236);
    border-radius: 1em;
    /* padding: 0.6em; */
}

main > article div.sale {
    position: relative;
    display: inline-block;
}

/* in the future, clip the sales banner to the div so it doesn't overflow
   at super duper small sizes */
/* can't set a background-image on a replaced element,
so we do this instead to make it work */
main > article div.sale::after {
    content: '';
    display: inline-block;
    position: absolute;

    right: 0;
    /* I could calculate this exactly instead of estimating.
    maybe after the project.*/
    bottom: 0.3em;
    width: 10em;
    height: 10em;
    /* i could also put this in a div that wraps the image so
    that I can use the image position technique instead. */
    background: url("../images/sale-img.png") no-repeat;
    background-size: contain;
}


main h1 {
    font-size: xx-large;
}

main p {
    font-size: large;
}

/* why does margin-top not work, but margin-bottom works? */
main article .info p br {
    margin-bottom: 0.7em;
}

main article .info form {
    margin-top: 1em;
}
/* messy and slightly spaghetti */
main article .info form input {
    background-color: rgb(244, 200, 58);
    border: 2px solid rgb(183, 152, 51);
    padding: 0.8em 1em;
    font-size: large;
    font-family: "Rubik", sans-serif;
    border-radius: 0.5em;
    cursor: pointer;
}

main article .info form input:hover {
    background-color: rgb(222, 178, 33);
}

main article .info form label {
    display: none;
}

main .flex-row {
    display: flex;
    gap: 10px;
}

main > article .flex-row.stars {
    gap: 5px;
}
main > article .flex-row.stars span {
    font-weight: 900;
    font-size: x-large;
    /* color: transparent;  */
    text-shadow: 0 0 1px rgb(0, 0, 0);
    
    color: gold;
}

main > article .flex-row.stars span.unfilled {
    font-weight: 900;
    font-size: x-large;
    color: rgb(233, 230, 230);
}




main > article .flex-row .price {
    font-size: x-large;
    line-height: 1.1em;
    color: rgb(64, 154, 64);
}

main > article .flex-row .old-price {
    line-height: 1.8em;
    color: rgb(154, 64, 64);
    text-decoration: line-through;
}

/* ===========
Responsive product detail content
============== */


@media screen and (max-width: 61.125em) {
    main > article {
        flex-direction: column;
        gap: 2.5em;
    }
}

@media screen and (max-width: 31.125em) {
    main article .info form {
        align-self: center;
    }
    
    main > article {
        gap:1em;
    }
}