* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  margin: 0 auto;
  width: 72%;
}

body {
  font-family: "Josefin Sans", serif;
  font-optical-sizing: auto;
  font-style: normal;
}

header {
  display: flex;
  justify-content: space-between;
  margin-top: 1.5em;
}

nav {
  display: flex;
  justify-content: space-between;
  gap: 3em;
  height: 3.5em;
}

#side-menu {
  display: none;
}

nav ul,
aside ul {
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 2em;
  font-size: 1em;
  color: hsl(219, 9%, 45%);
  height: 100%;
}

nav ul li a,
aside ul li a {
  display: flex;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  outline: none;
}

nav ul li a {
  height: 100%;
  padding-top: 0.3rem;
}

nav ul li a:hover {
  border-bottom: 2px solid hsl(26, 100%, 55%);
  color: hsl(220, 13%, 13%);
}

i {
  color: hsl(219, 9%, 45%);
  padding-top: 0.3rem;
}

i:hover {
  color: hsl(220, 13%, 13%);
}

aside img {
  width: 100%;
  height: 1.5rem;
  border-radius: 50%;
  border: 1px solid hsl(220, 14%, 75%);
}

aside img:hover {
  border: 1.5px solid hsl(26, 100%, 55%);
}

aside ul > li {
  position: relative;
}

#count-badge {
  display: none;
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: hsl(26, 100%, 55%);
  color: white;
  border-radius: 10px;
  padding: 2px 5px;
  font-size: 12px;
  font-weight: 700;
}

#cart-modal {
  display: none;
  position: absolute;
  top: 5rem;
  right: 5rem;
  width: 25%;
  height: max-content;
  background-color: white;
  z-index: 1;
  border-radius: 10px;
  box-shadow: hsl(219, 9%, 45%) 0px 0px 5px;
}

#cart-content {
  margin: 1em;
}

#empty-cart {
  margin-top: 1em;
  color: hsl(219, 9%, 45%);
}

#cart-content h2 {
  color: hsl(220, 13%, 13%);
  font-size: 1em;
  margin-bottom: 1em;
}

#cart-content button {
  width: 100%;
}

#cart-details {
  display: none;
}

.cart-details {
  margin: 1em 0;
  display: grid;
  grid-template-columns: 5em 1fr 1em;
  gap: 1em;
  align-items: center;
}

.cart-details figure {
  width: 4rem;
  height: 4rem;
}

.cart-details figure img {
  width: 100%;
  border-radius: 10px;
}

.cart-details button {
  border: none;
  background-color: transparent;
  cursor: pointer;
}

.cart-product-details {
  color: hsl(219, 9%, 45%);
}

.cart-product-details p:first-of-type {
  margin-bottom: 5px;
}

.cart-product-details p:last-of-type {
  display: inline-block;
}

.cart-product-details span {
  margin-left: 0.7rem;
  color: hsl(220, 13%, 13%);
  font-weight: 700;
}

#check-out {
  display: none;
  margin-top: 10px;
}

hr {
  opacity: 0.3;
}

main {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2em;
}

.images {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1em;
  padding: 5em;
  max-width: 660px;
}

.product-image img {
  border-radius: 10px;
  width: 100%;
}

.product-thumbnail-main {
  display: flex;
  justify-content: space-between;
  gap: 1em;
}

.product-thumbnail-main img {
  border-radius: 5px;
  cursor: pointer;
  width: 110px;
}

.product-thumbnail-main img:hover {
  opacity: 0.5;
  border: 1px solid hsl(26, 100%, 55%);
}

.product-detail {
  display: flex;
  flex-direction: column;
  gap: 2em;
  justify-content: center;
  padding: 1.25em;
}

.product-detail h5 {
  font-weight: 400;
  text-transform: uppercase;
  color: hsl(219, 9%, 45%);
}

.product-detail h1 {
  font-size: 2.5em;
  color: hsl(220, 13%, 13%);
}

.product-detail p {
  color: hsl(219, 9%, 45%);
  line-height: 1.5;
}

.product-price {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 3.5em;
}

.product-price article {
  display: flex;
  align-items: center;
  gap: 1.2em;
}

.product-price article h2 {
  padding-top: 3px;
}

.product-price article p {
  color: white;
  background-color: hsl(220, 13%, 13%);
  font-size: 14px;
  padding: 1px 2px;
  border-radius: 2px;
}

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

.product-cart {
  display: flex;
  gap: 0.8em;
  height: 3em;
  align-items: stretch;
}

.light-box {
  display: none;
  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.8);
}

.light-box-display {
  position: relative;
  width: 450px;
  margin: 4em auto;
}

.close-button {
  font-size: 2em;
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  left: 95%;
}

.close-button i {
  color: white;
}

.close-button i:hover {
  color: hsl(26, 100%, 60%);
}

.product-image-lightbox img {
  border-radius: 10px;
  width: 100%;
  margin-bottom: 1em;
}

.product-thumbnail-lightbox {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1em;
}

.product-image-lightbox button {
  position: absolute;
  top: 40%;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
}

#previous-thumbnail {
  left: -4%;
}

#next-thumbnail {
  right: -4%;
}

.product-image-lightbox i {
  color: hsl(220, 13%, 13%);
}

.product-image-lightbox button:hover {
  border: 1px solid hsl(26, 100%, 55%);
}

.product-thumbnail-lightbox img {
  width: 100%;
  border-radius: 10px;
}

.product-thumbnail-lightbox img:hover {
  opacity: 0.8;
  border: 2px solid hsl(26, 100%, 55%);
}

.primary-button {
  font-family: "Josefin Sans", serif;
  font-optical-sizing: auto;
  font-size: 1rem;
  font-weight: 700;
  background-color: hsl(26, 100%, 55%);
  border: none;
  color: hsl(220, 13%, 13%);
  padding: 0.5rem 3rem;
  border-radius: 5px;
  cursor: pointer;
}

.primary-button i {
  font-size: 12px;
  color: hsl(220, 13%, 13%);
  margin-right: 0.5rem;
}

.primary-button:hover {
  background-color: hsl(26, 100%, 60%);
}

.product-count {
  height: 100%;
  display: grid;
  grid-template-columns: 3em 3em 3em;
}

.product-count button {
  font-family: "Josefin Sans", serif;
  font-optical-sizing: auto;
  font-weight: 700;
  font-size: 1rem;
  background-color: hsl(223, 64%, 98%);
  color: hsl(26, 100%, 60%);
  border: none;
  cursor: pointer;
  font-weight: 700;
}

.product-count button:first-child {
  border-top-left-radius: 5px;
  border-bottom-left-radius: 5px;
}

.product-count button:last-child {
  border-top-right-radius: 5px;
  border-bottom-right-radius: 5px;
}

.product-count button:hover {
  opacity: 0.5;
}

.product-count button:disabled {
  opacity: 1;
  cursor: not-allowed;
}

input[type="number"] {
  font-family: "Josefin Sans", serif;
  font-optical-sizing: auto;
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  border: none;
  padding: 0.8rem 0;
  background-color: hsl(223, 64%, 98%);
  color: hsl(220, 13%, 13%);
}

input[type="number"]:focus {
  outline: none;
  cursor: none;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
  border: none;
}

.mobile-menu {
  position: absolute;
  top: 0;
  z-index: 1;
  width: 70vw;
  height: 100vh;
  background-color: white;
  box-shadow: 10px 10px 100px;
  padding: 1em;
}

.mobile-menu-sidebar {
  padding: 1em;
}

.mobile-icon {
  font-size: 1.25em;
}

.mobile-menu-display {
  font-size: 1.25em;
  list-style: none;
  margin-top: 3.5em;
}

.mobile-menu-display li {
  margin-top: 1.25em;
}

.mobile-menu-display li a {
  text-decoration: none;
  color: black;
  font-weight: 600;
}

@media (max-width: 1440px) and (min-width: 1024px) {
  html {
    width: 80%;
  }

  #cart-modal {
    width: 35%;
  }

  .images {
    padding: 1.25em;
    max-width: 480px;
  }

  .product-thumbnail-main img {
    width: 90px;
  }

  main {
    gap: 1em;
  }
}

@media (max-width: 1023px) and (min-width: 768px) {
  html {
    width: 90%;
  }

  main {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  #cart-modal {
    width: 45%;
  }

  .images {
    width: 100%;
    height: 50vh;
    justify-content: center;
    align-items: center;
    padding: 1.25em;
  }

  .product-image figure {
    width: 400px;
    height: 400px;
  }

  #main-image {
    width: 40%;
    display: flex;
    margin: 0 auto;
  }

  img.product-thumbnail-m {
    width: 90px;
  }
}

@media (max-width: 767px) {
  html {
    width: 100%;
    margin: 0;
  }

  header {
    margin-top: 0;
    padding: 1em;
    align-items: center;
  }

  nav {
    height: 100%;
  }

  nav figure {
    display: flex;
    align-items: center;
    gap: 1em;
  }

  #side-menu {
    display: block;
  }

  nav > ul {
    display: none;
  }

  main {
    grid-template-columns: 1fr;
    gap: .25em;
  }

  #cart-modal {
    top: 5em;
    left: 0.5em;
    width: 96%;
  }

  section.images {
    display: none;
  }

  .light-box {
    display: block;
    position: relative;
  }

  .light-box-display {
    margin: 0;
    position: relative;
    width: 100%;
    height: 35vh;
  }

  .close-button {
    display: none;
  }

  .product-thumbnail-lightbox {
    display: none;
  }

  .product-image-lightbox img {
    margin: 0;
    border-radius: 0;
    display: flex;
    height: 35vh;
    object-fit: cover;
    object-position: 70% 23%;
  }

  #previous-thumbnail {
    left: 4%;
  }

  #next-thumbnail {
    right: 4%;
  }

  .product-detail h1 {
    font-size: 1.75em;
  }

  .product-price {
    flex-direction: row;
    align-items: center;
  }

  .product-price article h2 {
    font-size: 1.75em;
  }

  .original-price {
    font-size: 1.25em;
  }

  .product-cart {
    flex-direction: column;
    width: 100%;
  }

  .product-count {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .product-count button:first-child,
  .product-count button:last-child,
  input[type="number"] {
    font-size: 1.5rem;
  }

  .primary-button {
    padding: 1rem 2rem;
  }
}
