:root {
    --cream: hsl(30, 38%, 92%);
    --white: hsl(0, 0%, 100%);
    --green: hsl(158, 36%, 37%);
    --grey:  hsl(228, 12%, 48%);
    --dark-blue: hsl(212, 21%, 14%);
}

body {
    display: flex;
    flex-direction: column;
    justify-content: center; /* Centre on the y axis when flex dir is column */
    align-items: center; /* Centre on the x axis when flex dir is column */
    font-family:'Montserrat'; /* paragraph font */
    font-size: 14px;
    font-weight: 500;
    color: var(--dark-blue);
    background-color: var(--cream);
    margin: 0;
    height: 100vh;
    overflow:hidden;
}

h1, #current-price {
    font-family: 'Fraunces';
    font-weight: 700;
    font-size:xx-large;
    margin: 0; /*To override the margins given with h1 */
}

.centre-container{
    display: flex;
    height: 500px;
    width: 700px;
    background-color: var(--white);
    border-style: double;
    border-color: var(--cream);
    border-radius: 16px;
    margin-bottom: 0.5rem;
}

.product-image {
    border-style: double;
    border-color: var(--cream);
    border-top-left-radius: 12px; /* To soften the left side border on the img */
    border-bottom-left-radius: 12px; /* To soften the left side border on the img */
    object-fit: cover; 
    height: 100%;
}

.product-information-container {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

p {
    line-height: 1.8;
    margin: 0;
}

.pricing {
    display: flex;
    gap: 25px;
}

#was-price {
    text-decoration: line-through;
    align-self: center;
}

#current-price{
    color: var(--green);
}

.button-container {
    display: flex;
    justify-content: left;
}

button {
    display: flex;
    background-color: var(--green);
    border-color: var(--green);
    border-style: hidden; /* Removed the button shadow effect */
    color: var(--white);
    border-radius: 8px;
    font-weight: 700;
    padding: 4% 27%;
    align-items: center;
    flex-grow: 1;
    justify-content: space-evenly;
}

button:hover {
    background-color: hsl(158, 36%, 27%);
    cursor: pointer;
}

#perfume, #was-price, #description {
    color: var(--grey);
}

.attribution { font-size: 11px; text-align: center; }
.attribution a { color: hsl(228, 45%, 44%); }

@media (max-width: 767px) {
    body {
        overflow: auto;
        width: 100%;
    }
    .centre-container {
        display: grid;
        grid-template-columns: 1fr;
        height: 95vh;
        width: 90%;
        max-width: 400px;
        max-height:fit-content;
    }
    .product-image-container {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
    }
    .product-image {
        max-width: 100%;
        border-top-left-radius: 12px; 
        border-bottom-left-radius: 0px;
        border-top-right-radius: 12px;
        display: block;
    }
    .product-information-container {
        display: flex;
        padding: 1rem;
        justify-content: center;
        gap: 0.75rem;
        background-color: var(--white);
        border-bottom-left-radius: 12px;
        border-bottom-right-radius: 12px;
    }
    .button-container {
        justify-content: center;
    }
    button {
        flex-grow: 1;
    }
}

@media (max-height: 721px) {
    .centre-container {
        transform: scale(0.875);
        transform-origin: top; 
    }
    .product-image-container {
        max-height: 400px;
    }
}
