/* CSS RESETS */

/* Box sizing rules */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Prevent font size inflation */
html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

/* Set shorter line heights on headings and interactive elements */
h1, h2,
button {
  line-height: 1;
}

/* Balance text wrapping on headings */
h1, h2 {
  text-wrap: balance;
}

/* Make images easier to work with */
img,
picture {
  max-width: 100%;
  display: block;
}

/* Inherit fonts for inputs and buttons */
button {
  font-family: inherit;
  font-size: inherit;
}

/* Hiding class, making content visible only to screen readers but not visually */
/* "sr" meaning "screen-reader" */
.sr-only:not(:focus):not(:active) {
  clip: rect(0 0 0 0); 
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap; 
  width: 1px;
}

/* FONTS */

/* montserrat-500 - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 500;
  src: url('../assets/fonts/montserrat-v31-latin-500.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}
/* montserrat-700 - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 700;
  src: url('../assets/fonts/montserrat-v31-latin-700.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}
/* fraunces-700 - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 700;
  src: url('../assets/fonts/fraunces-v38-latin-700.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* CUSTOM VARIABLES */

:root {

    /* COLORS */

    --clr-green-700: hsl(158, 42%, 18%);
    --clr-green-500: hsl(158, 36%, 37%);
    --clr-cream: hsl(30, 38%, 92%);
    --clr-grey: hsl(228, 12%, 48%);
    --clr-white: hsl(0, 0%, 100%);
    --clr-black: hsl(212, 21%, 14%);
    --clr-transparent: transparent;

    /* TYPOGRAPHY */

    --ff-body: "Montserrat", sans-serif;
    --ff-highlight: "Fraunces", serif;
    --fs-body: .875rem;

    /* SPACINGS */

    --space-500: 2.5rem;
    --space-400: 2rem;
    --space-300: 1.5rem;
    --space-200: 1rem;
    --space-100: .5rem;
    --space-50: .25rem;

    /* BORDER RADIUS */

    --rounded-sm: 8px;

}

body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100dvh;
  padding: .75rem;
  background-color: var(--clr-cream);
  font-family: var(--ff-body);
  font-size: var(--fs-body);
  font-weight: 500;
  line-height: 1.6;
  color: var(--clr-grey);
}

h1, h2 {
  font-family: var(--ff-highlight);
}

.product {
  background-color: var(--clr-white);
  border-radius: var(--rounded-sm);
  max-width: 37.5rem;
  width: 100%;
  margin: 0 auto;
  overflow: hidden;
}

.product__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product__details {
  display: flex;
  flex-direction: column;
  gap: clamp(var(--space-300), 1.0229rem + 2.0356vw, var(--space-400));
  padding: var(--space-400);
}

.product__overview {
  display: flex;
  flex-direction: column;
  gap: var(--space-300);
}

.product__category {
  font-size: .75rem;
  line-height: 1.2;
  letter-spacing: 0.42em;
  text-transform: uppercase;
}

.product__title {
  font-size: 2rem;
  color: var(--clr-black);
}

.product__price {
  display: flex;
  align-items: center;
  gap: var(--space-200);
}

.product__current-price {
  font-family: var(--ff-highlight);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--clr-green-500);
}

.product__old-price {
  font-size: .8125rem;
  line-height: 1.2;
}

.product__action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-100);
  padding: var(--space-200);
  border-radius: var(--rounded-sm);
  background-color: var(--clr-green-500);
  border: var(--clr-transparent);
  font-weight: 700;
  line-height: 1.1;
  color: var(--clr-white);
  cursor: pointer;
  transition: background-color 300ms;
}

.product__action:hover {
  background-color: var(--clr-green-700);
}

.product__action:focus-visible {
  outline: 2px solid var(--clr-green-500);
  outline-offset: 2px;
}

@media screen and (min-width: 48em) {
  
  .product {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

}