/* Custom Properties*/
:root {
  --clr-primary-400: hsl(30, 38%, 92%);
  --clr-primary-500: hsl(158, 36%, 37%);

  --clr-neutral-100: hsl(0, 0%, 100%);
  --clr-neutral-200: hsl(228, 12%, 48%);
  --clr-neutral-300: hsl(212, 21%, 14%);

  --ff-heading: "Fraunces", serif;
  --ff-body: "Montserrat", sans-serif;

  --fs-300: 0.875rem;
  --fs-400: 1rem;
  --fs-500: 1.5rem;
  --fs-600: 1.75rem;
  --fs-700: 2rem;
  --fs-800: 2.5rem;

  --fw-400: 400;
  --fw-500: 500;
  --fw-700: 700;
}

/* CSS Reset  */
/* Box sizing rules */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Remove default margin */
body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
ul[role="list"],
ol[role="list"] {
  list-style: none;
}

/* Set core root defaults */
html:focus-within {
  scroll-behavior: smooth;
}

/* Set core body defaults */
body {
  min-height: 100vh;
  text-rendering: optimizeSpeed;
  line-height: 1.5;
}

/* A elements that don't have a class get default styles */
a:not([class]) {
  text-decoration-skip-ink: auto;
}

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

/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
  font: inherit;
}

/* Remove all animations, transitions and smooth scroll for people that prefer not to see them */
@media (prefers-reduced-motion: reduce) {
  html:focus-within {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* General Styling  */
body {
  display: grid;
  place-content: center;
  font-weight: var(--fw-500);
  font-family: var(--ff-body);
  animation: opacity 3s ease;
  background-color: var(--clr-primary-400);
}
/* Body Animation  */
@keyframes opacity {
  from {
    background-color: transparent;
  }
  to {
    background-color: var(--clr-primary-400);
  }
}
/* Container  */
.container {
  max-width: 40rem;
  margin: 2rem 1rem;
  border-radius: 0.7rem;
  animation: transform 2s ease;
  box-shadow: 0 30px 45px hsl(0, 0%, 9%, 0.1);
}

/* Main Animation  */
@keyframes transform {
  0% {
    opacity: 0;
    transform: translateY(300px);
  }
  50% {
    /* opacity: 0.5; */
    transform: translateY(-15px);
  }
  100% {
    opacity: 1;
    transform: translateY(0px);
  }
}

/* Animation Media Qurie */
@media (max-width: 50em) {
  @keyframes transform {
    0% {
      opacity: 0;
      transform: translateY(100px);
    }
    50% {
      /* opacity: 0.5; */
      transform: translateY(-5px);
    }
    100% {
      opacity: 1;
      transform: translateY(0px);
    }
  }
}
/* Hero-img  */
.product-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0.7rem 0.7rem 0 0;
}
/* Main-content  */
.content {
  padding: 2rem 1.5rem;
  background-color: var(--clr-neutral-100);
  border-radius: 0 0 0.7rem 0.7rem;
}
.head-text {
  font-size: var(--fs-300);
  letter-spacing: 10px;
  color: var(--clr-neutral-200);
  text-transform: uppercase;
}
.content h1 {
  line-height: 1;
  padding-block: 0.5rem 1rem;
  color: var(--clr-neutral-300);
  font-size: var(--fs-800);
  font-weight: var(--fw-700);
  font-family: var(--ff-heading);
}
.content p {
  line-height: 1.5;
  font-size: var(--fs-400);
  color: var(--clr-neutral-200);
}
.content h2 {
  display: flex;
  color: var(--clr-primary-500);
  font-size: var(--fs-700);
  margin-block: 0.5rem;
  font-family: var(--ff-heading);
}
/* Pricing Span  */
span[data-price] {
  text-decoration: line-through;
  align-self: center;
  font-weight: var(--fw-500);
  font-family: var(--ff-body);
  color: var(--clr-neutral-200);
  font-size: var(--fs-300);
  padding-left: 0.5rem;
}
/* Button And Cart Svg*/
svg {
  fill: #fff;
}
.btn {
  display: flex;
  gap: 0.5rem;
  cursor: pointer;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-top: 1rem;
  border: 2px solid var(--clr-primary-500);
  border-radius: 0.4rem;
  background-color: var(--clr-primary-500);
  color: var(--clr-neutral-100);
  padding: 0.5rem 2rem;
  transition: all 0.4s ease;
}
.btn:is(:hover, :focus-within) {
  transform: translateY(-5px);
  border-color: var(--clr-primary-500);
  color: var(--clr-primary-500);
  background-color: transparent;
  box-shadow: 0 30px 45px hsl(0, 0%, 9%, 0.1);
}

/* Svg Hover   */
.btn:hover svg {
  fill: var(--clr-primary-500);
  animation: rotate 1s ease;
}

/* Cart Animation */
@keyframes rotate {
  0% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(390deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Media Quires  */
@media (min-width: 50em) {
  .container {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    align-items: center;
    margin: 0;
  }
  .product-img img {
    border-radius: 0.7rem 0 0 0.7rem;
  }
  picture {
    border-radius: 0.7rem 0 0.7rem 0;
  }
  .content {
    height: 100%;
    padding-block: 2.6rem;
    border-radius: 0 0.7rem 0.7rem 0;
  }
  .content p {
    padding-block: 0.5rem;
  }
  .attribution {
    margin-block: 2rem;
  }
}
/* Attribution  */
.attribution {
  font-size: 11px;
  text-align: center;
  margin-bottom: 1rem;
  color: var(--clr-neutral-300);
  animation: transform 2s ease;
  animation-delay: 100ms;
}
.attribution a {
  text-decoration: none;
  border-bottom: 2px solid transparent;
  color: var(--clr-neutral-300);
  transition: all 0.4s ease;
}
.attribution a:is(:hover, :focus-within) {
  color: var(--clr-primary-500);
  border-color: var(--clr-primary-500);
}
