/*=======================
 * CUSTOM PROPERTIES
 *========================**/
:root {
  /*colors */
  --clr-grey: 228 12% 48%;
  --clr-black: 212 21% 14%;

  --clr-white: 0 0% 100%;
  --clr-cream: 30 38% 92%;

  --clr-green-500: 158 36% 37%;
  --clr-green-700: 158 42% 18%;

  /* font-size */
  --fs-800: 2rem; /*32px*/
  --fs-300: 0.875rem; /*14px*/
  --fs-200: 0.8125rem; /*13px*/
  --fs-100: 0.75rem; /*12px*/

  /* font-family */
  --ff-primary: "Montserrat", sans-serif;
  --ff-accent: "Fraunces", serif;

  /* line-height */
  --lh-100: 1; /* 100% */
  --lh-110: 1.1; /* 110% */
  --lh-120: 1.2; /* 120% */
  --lh-160: 1.6; /* 160% */
}

/*=======================
 * RESET
 * ref: https://www.joshwcomeau.com/css/custom-css-reset/
 *========================**/

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

* {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--ff-primary);
  font-size: var(--fs-300);
  color: hsl(var(--clr-grey));
  font-weight: 500;
  background-color: hsl(var(--clr-cream));

  align-items: center;
  line-height: var(--lh-160);
  min-height: 100dvh;

  /* centers the card horizontally */
  grid-template-rows: 1fr;
  justify-content: center;
}

img {
  /* https://www.youtube.com/watch?v=345V2MU3E_w */
  font-style: italic;

  display: block;
  max-width: 100%;
  height: auto;
}

/* avoid text overflows */
p,
h1 {
  overflow-wrap: break-word;
}

/*=======================
 * UTILITY CLASSES
 *========================**/

/* general */
.grid {
  display: grid;
}

.flex {
  display: flex;
  gap: 0.5rem;
}

/* bg-color */
.bg-cream {
  background-color: hsl(var(--clr-cream));
}
.bg-white {
  background-color: hsl(var(--clr-white));
}
.bg-green-500 {
  background-color: hsl(var(--clr-green-500));
}
.bg-green-700 {
  background-color: hsl(var(--clr-green-700));
}

/* text-color */
.black {
  color: hsl(var(--clr-black));
}

.white {
  color: hsl(var(--clr-white));
}

.green-500 {
  color: hsl(var(--clr-green-500));
}

/* font */
.ff-accent {
  font-family: var(--ff-accent);
}

.fs-100,
.fs-200 {
  line-height: 1.2;
}

.fs-100 {
  font-size: var(--fs-100);
}

.fs-200 {
  font-size: var(--fs-200);
  letter-spacing: 5px;
}

.fs-300,
.fs-300-bold {
  font-size: var(--fs-300);
}

.fs-300-bold,
.fs-800-bold {
  font-weight: bold;
}

.fs-300-bold {
  line-height: 1.1;
}

.fs-800-bold {
  font-size: var(--fs-800);
}

/*=======================
 * COMPONENTS
 *========================**/
.product-card {
  max-width: 21.875rem;
  background-color: hsl(var(--clr-white));
  border-radius: 0.5rem;
  margin-block: 5rem;
  margin-inline: 0.5rem;
  overflow: hidden;
}

.product-info {
  --gap: 1.5rem;
  row-gap: var(--gap);
  padding: 2rem;
}

.product-details {
  row-gap: var(--gap);
}

.product-title {
  line-height: 1;
}

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

.price-original {
  padding-inline-start: 1rem;
  text-decoration: line-through;
}

.price {
  align-items: center;
  width: fit-content;
}

.add-to-cart {
  height: 3.125rem;
  padding-block: 1rem;
  border-radius: 0.5rem;

  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: background-color 300ms ease-in-out;
}

.add-to-cart:hover {
  background-color: hsl(var(--clr-green-700));
}

.icon-cart {
  height: 1rem;
  width: 1rem;
}

/* media queries */
@media (min-width: 23.43753em) {
  .product-image img {
    height: 21.375rem;
    width: 100%;
    /* center 10% downwards */
    object-position: center 10%;
    object-fit: cover;
  }
}

@media (min-width: 48em) {
  .product-card {
    max-width: 37.5rem;
    grid-template-columns: 1fr 1fr;
    align-self: center;
  }

  .product-image img {
    width: auto;
    height: 100%;
  }
}
