@import url("https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,100..900;1,9..144,100..900&family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap");

/* ==========================
CSS Reset by Josh Comeau
============================= */

/* 1. Use a more-intuitive box-sizing model */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* 2. Remove default margin */
* {
  margin: 0;
}

/* 3. Enable keyword animations */
@media (prefers-reduced-motion: no-preference) {
  html {
    interpolate-size: allow-keywords;
  }
}

body {
  /* 4. Add accessible line-height */
  line-height: 1.5;
  /* 5. Improve text rendering */
  -webkit-font-smoothing: antialiased;
}

/* 6. Improve media defaults */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

/* 7. Inherit fonts for form controls */
input,
button,
textarea,
select {
  font: inherit;
}

/* 8. Avoid text overflows */
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* 9. Improve line wrapping */
/* p {
  text-wrap: pretty;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  text-wrap: balance;
} */

/*
  10. Create a root stacking context
*/
#root,
#__next {
  isolation: isolate;
}

/* ==========================
Main Styles
============================= */

:root {
  --green-500: hsl(158, 36%, 37%);
  --green-700: hsl(158, 42%, 18%);

  --grey: hsl(228, 12%, 48%);
  --cream: hsl(30, 38%, 92%);

  --fw-bold: 700;

  --serif: "Fraunces", serif;
  --sans-serif: "Montserrat", sans-serif;

  --border-radius: 10px;
}

body {
  font-size: 14px;
  font-weight: 500;
  font-family: var(--sans-serif);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--grey);
  background-color: var(--cream);
}

main {
  display: flex;
  flex-direction: column;
  background-color: white;
  margin: 1rem;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
}

div {
  display: flex;
  flex-direction: column;
}

h1 {
  font-family: var(--serif);
  font-weight: var(--fw-bold);
  color: black;
  line-height: 2rem;
  font-size: clamp(2rem, 5vw, 2.25rem);
}

.item-img {
  background-image: url(images/image-product-mobile.jpg);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  height: 250px;
}

.main-contents {
  padding: 1.5rem;
  gap: 1rem;
  justify-content: center;
}

.title {
  gap: 0.5rem;
}

.tag {
  text-transform: uppercase;
  letter-spacing: 5px;
}

.price-container {
  flex-direction: row;
  gap: 1rem;
  align-items: center;
}

.price {
  font-family: var(--serif);
  color: var(--green-500);
  font-size: 2rem;
  font-weight: var(--fw-bold);
}

.line-through {
  text-decoration: line-through;
}

.add-to-cart-btn {
  border: transparent;
  background-color: var(--green-500);
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 1rem;
  border-radius: var(--border-radius);
  cursor: pointer;
  box-shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px inset;
}

.add-to-cart-btn:hover {
  background-color: var(--green-700);
  transition: 0.25s ease;
}

@media only screen and (min-width: 500px) {
  main {
    flex-direction: row;
    align-items: center;
    height: 450px;
    width: 650px;
  }

  main > * {
    flex: 1;
    height: 100%;
  }

  .item-img {
    background-image: url(images/image-product-desktop.jpg);
    height: 100%;
  }

  .title,
  .main-contents {
    gap: 1.25rem;
  }

  .item-img,
  .main-contents {
    padding: 1rem 2rem;
  }
}
