@import url("https://fonts.googleapis.com/css2?family=Kumbh+Sans:wght@100..900&display=swap");

:root {
  /* Colors */
  --orange: hsl(26, 100%, 55%);
  --pale-orange: hsl(25, 89%, 72%);
  --very-dark-blue: hsl(220, 13%, 13%);
  --dark-grayish-blue: hsl(219, 9%, 45%);
  --grayish-blue: hsl(220, 14%, 75%);
  --light-grayish-blue: hsl(223, 64%, 98%);
  --white: hsl(0, 0%, 100%);
  --black-80: hsla(0, 0%, 0%, 0.8);

  /* Font weights */
  --fw-regular: 400;
  --fw-bold: 700;
}

/* Reset */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition: all 0.3s linear;
}

html {
  font-family: "Kumbh Sans", sans-serif;
  font-size: 16px;
  scroll-behavior: smooth;
}

/* Body */

body {
  min-height: 100vh;
  min-width: 100vw;
  background-color: var(--white);
  color: var(--dark-grayish-blue);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

a {
  all: unset;
  cursor: pointer;
}

.page {
  padding: 1rem 7rem;
}

.page.nonActive {
  height: 100vh;
  overflow: hidden;
}

/* Nav */
header {
  width: 100%;
}

nav {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1rem;
  width: 100%;
  border-bottom: 0.5px solid var(--grayish-blue);
  margin-bottom: 1em;
}

.nav-left {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4em;
}

.overlay {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  height: 100vh;
  width: 100vw;
  z-index: 12;
  background: var(--black-80);
}

.overlay.active {
  display: block;
}

.menu-button {
  display: none;
  left: 2%;
  top: 3%;
  width: 2.2em;
  height: 2.2em;
  background-image: url("/images/icon-menu.svg");
  background-repeat: no-repeat;
  background-position: center;
  cursor: pointer;
  z-index: 14;
}

.menu-button:hover {
  opacity: 0.7;
}

.nav-left.active .menu-button {
  background-image: url("/images/icon-close.svg");
  position: absolute;
}

.logo img {
  max-width: 100%;
  height: auto;
}

.navs {
  list-style-type: none;
  position: unset;
  width: max-content;
  height: auto;
  background: var(--white);
  display: flex;
  flex-direction: row;
  gap: 2rem;
  padding: 0;
}

.nav-left.active .navs {
  transform: translateX(0%);
}

.nav-links {
  color: var(--dark-grayish-blue);
  font-size: 0.9em;
  font-weight: var(--fw-regular);
  text-decoration: none;
  position: relative;
  cursor: pointer;
}

.nav-links:hover {
  color: var(--very-dark-blue);
}

.nav-links:hover::after {
  content: "";
  position: absolute;
  background-color: var(--orange);
  width: 100%;
  height: 0.25em;
  left: 0;
  bottom: 0;
  top: 240%;
}

.nav-right {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 3em;
}

.avatar {
  width: 2.8em;
  height: auto;
  cursor: pointer;
  border-radius: 50%;
}

.avatar:hover {
  box-shadow: 0px 0px 2px 2px var(--orange);
}

/* Cart */
.cart {
  position: relative;
}

.cart img {
  width: 1.2em;
  height: auto;
  cursor: pointer;
}

.cart-menu {
  display: none;
  position: absolute;
  top: 2.5em;
  right: -8.5em;
  border-radius: 1em;
  z-index: 11;
  width: 22rem;
  min-height: 15rem;
  background: white;
  box-shadow: 0px 2px 5px 0px var(--grayish-blue);
}

.cart-menu.active {
  display: flex;
  flex-direction: column;
}

.cart-title {
  padding: 1em;
  font-weight: var(--fw-bold);
  font-size: 1.1em;
  color: var(--very-dark-blue);
  border-bottom: 1px solid var(--light-grayish-blue);
}

.cart-items {
  padding: 1.2em 1em;
  display: flex;
  flex-direction: column;
  gap: 1.5em;
}

.cart-items.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 11em;
  font-weight: var(--fw-bold);
}

.cart .cart-items .cart-empty {
  display: none;
}

.cart .cart-items.empty .cart-empty {
  color: var(--dark-grayish-blue);
  display: inline-block;
}

.cart-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  color: var(--grayish-blue);
}

.cart-item img {
  width: 4em;
  height: auto;
  border-radius: 0.4em;
}

.cart-item-name {
  color: var(--dark-grayish-blue);
  font-size: 0.95em;
  margin-bottom: 0.3em;
  font-weight: var(--fw-bold);
}

.cart-item-details {
  color: var(--dark-grayish-blue);
  font-size: 0.95em;
}

.cart-item .total-price {
  color: var(--very-dark-blue);
  font-weight: var(--fw-bold);
  margin-left: 0.8em;
}

.checkout {
  margin: 1em 1em;
  padding: 1.2em 1em;
  border: none;
  color: var(--white);
  background-color: var(--orange);
  border-radius: 0.8em;
  font-weight: var(--fw-bold);
  cursor: pointer;
}

.checkout:hover {
  color: var(--very-dark-blue);
  opacity: 0.9;
}

.checkout.empty {
  display: none;
}

.cart-count {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: absolute;
  top: -0.6em;
  right: -0.7em;
  background-color: var(--orange);
  color: var(--white);
  width: 1.8em;
  height: 1.4em;
  border-radius: 0.8em;
  font-size: 0.7em;
  font-weight: var(--fw-bold);
}

.delete-item {
  border: none;
  cursor: pointer;
  width: 1em;
  height: 1em;
  background-image: url("/images/icon-delete.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 1em;
}

/* Main */
main {
  margin-top: 1rem;
  width: 100%;
}

.productPage {
  display: flex;
  flex-direction: row;
  padding: 4rem 4rem;
  gap: 8em;
}

/* Product Gallery */
.product-gallery {
  display: flex;
  flex-direction: column;
  gap: 1.5em;
}

.display-image img {
  display: none;
  width: 100%;
  height: auto;
  border-radius: 1rem;
  cursor: pointer;
}

.display-image .active {
  display: block;
}

.list-images {
  display: flex;
  flex-direction: row;
  justify-content: space-around;
}

.list-image-item {
  width: 5.5em;
  height: 5.5em;
  border-radius: 0.6rem;
  cursor: pointer;
}

.list-image-item img {
  width: 100%;
  height: 100%;
  border-radius: 0.6rem;
  cursor: pointer;
}

.list-images img:hover {
  opacity: 0.5;
}

.list-images .active img {
  opacity: 0.3;
}

.list-images .active {
  box-shadow: 0px 0px 2px 2px var(--orange);
}

/* Preview */
.preview {
  position: absolute;
  top: 0;
  left: 0;
  height: 100vh;
  width: 100vw;
  z-index: 15;
  background: var(--black-80);
  display: none;
  align-items: center;
  justify-content: center;
}

.preview.active {
  display: flex;
}

.preview .product-gallery {
  max-width: 28em;
  height: auto;
}

.preview .display-image {
  position: relative;
}

.preview .list-images {
  justify-content: center;
  gap: 1.8rem;
}

.preview .list-image-item {
  width: 4.5em;
  height: 4.5em;
}

.prev-button,
.next-button,
.close-button {
  position: absolute;
  height: 3em;
  width: 3em;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--white);
  border-radius: 50%;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 0.7em;
  cursor: pointer;
}

.prev-button {
  background-image: url("/images/icon-previous.svg");
  top: 50%;
  left: 0;
  transform: translate(-50%, -50%);
}

.next-button {
  background-image: url("/images/icon-next.svg");
  top: 50%;
  right: 0;
  transform: translate(50%, -50%);
}

.close-button {
  background-color: transparent;
  background-image: url("/images/icon-close-white.png");
  background-size: 1em;
  right: -1em;
  top: -3em;
}

.prev-button:hover,
.next-button:hover,
.close-button:hover {
  opacity: 0.8;
}

/* Product Content */
.product-content {
  display: flex;
  flex-direction: column;
}

.company-name {
  text-transform: uppercase;
  font-size: 0.8em;
  letter-spacing: 0.1em;
  color: var(--dark-grayish-blue);
  font-weight: var(--fw-bold);
  margin-top: 5rem;
  margin-bottom: 1.5rem;
}

.product-name {
  font-size: 2.8em;
  color: var(--very-dark-blue);
  font-weight: var(--fw-bold);
  line-height: 1em;
  margin-bottom: 2.5rem;
}

.product-description {
  font-size: 1em;
  color: var(--dark-grayish-blue);
  font-weight: var(--fw-regular);
  margin-bottom: 1.4rem;
}

.prices {
  display: flex;
  flex-direction: column;
}

.latest-prices {
  display: flex;
  flex-direction: row;
  align-items: center;
  margin-bottom: 0.6rem;
  gap: 1em;
}

.current-price {
  font-size: 1.8em;
  color: var(--very-dark-blue);
  font-weight: var(--fw-bold);
}

.current-discount {
  font-size: 1.05em;
  background-color: var(--very-dark-blue);
  padding: 2px 0.45em;
  border-radius: 0.4em;
  color: var(--white);
  font-weight: var(--fw-bold);
}

.prev-price {
  text-decoration: line-through;
  font-size: 1.05em;
  color: var(--dark-grayish-blue);
  font-weight: var(--fw-bold);
  margin-bottom: 1.8rem;
}

.add-to-cart {
  display: flex;
  flex-direction: row;
  gap: 1em;
}

.item-cart-count {
  background-color: var(--light-grayish-blue);
  padding: 1em;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 2.5em;
  border-radius: 1em;
}

.remove,
.add {
  border: none;
  background: transparent;
  cursor: pointer;
}

.remove:hover,
.add:hover {
  opacity: 0.7;
}

.item-counter {
  font-size: 1.05em;
  font-weight: var(--fw-bold);
  color: var(--very-dark-blue);
}

.add-cart-button {
  padding: 1rem 4rem;
  border-radius: 0.8em;
  color: var(--very-dark-blue);
  background-color: var(--orange);
  font-size: 0.95em;
  border: none;
  width: max-content;
  font-weight: var(--fw-bold);
  cursor: pointer;
}

.add-cart-button:hover {
  opacity: 0.7;
}

.add-cart-button img {
  width: 1.05em;
  height: auto;
  margin-right: 0.6em;
}

/* Media Queries */
@media (max-width: 1350px) {
  /* Body */
  .page {
    padding: 0 0 3rem 0;
  }

  /* Nav */
  nav {
    margin-bottom: 0;
  }
  .nav-left {
    gap: 2.5em;
  }

  /* Cart */
  .cart-menu {
    right: -4.6em;
  }

  /* Main */
  main {
    margin-top: 0;
  }

  /* Main */
  .productPage {
    gap: 4em;
    padding: 4rem;
  }

  /* Product Content */
  .product-name {
    font-size: 2.7em;
  }
}

@media (max-width: 1024px) {
  /* Product Gallery */
  .list-image-item {
    width: 4.5em;
    height: 4.5em;
  }

  /* Product Content */
  .product-content {
    padding: 0 2em;
  }

  .company-name {
    margin-top: 1rem;
  }
}

@media (max-width: 950px) {
  /* Nav */
  .logo img {
    max-width: 90%;
    height: auto;
  }

  /* Cart */
  .cart-menu {
    right: -4.6em;
    width: 19rem;
    min-height: 13rem;
  }

  /* Main */
  .productPage {
    gap: 2em;
    padding: 3rem;
  }

  /* Product Gallery */
  .list-image-item {
    width: 4em;
    height: 4em;
  }

  /* Product Content */
  .product-name {
    font-size: 1.9em;
    margin-bottom: 1.2rem;
  }

  .current-price {
    font-size: 1.5em;
  }

  .product-description {
    font-size: 0.95em;
    margin-bottom: 1.2rem;
  }
}

/* Mobile Layout */
@media screen and (max-width: 860px) {
  /* Nav */
  .nav-left {
    gap: 1em;
  }

  .menu-button {
    display: inline-block;
  }

  .navs {
    position: absolute;
    z-index: 13;
    top: 0;
    left: 0;
    max-width: 13em;
    width: 100%;
    height: 100vh;
    background: var(--white);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 7em 0 0 1.5rem;
    transform: translateX(-100%);
  }

  .nav-links {
    color: var(--very-dark-blue);
    font-size: 1em;
    font-weight: var(--fw-bold);
  }

  .nav-links:hover {
    color: var(--dark-grayish-blue);
  }

  .nav-links:hover::after {
    all: unset;
  }

  .nav-right {
    gap: 1.5em;
  }

  .avatar {
    width: 2.5em;
  }

  /* Cart */
  .cart-menu {
    right: -3.5em;
    width: 20rem;
  }

  /* Main*/
  .productPage {
    flex-direction: column;
    gap: 1em;
    padding: 0;
  }

  .productPage .displayImgs {
    display: none;
  }

  /* Product Gallery */
  .product-gallery {
    width: 100%;
  }

  .display-image img.active {
    width: 100%;
    height: auto;
    border-radius: 0;
  }

  /* Preview */
  .preview {
    display: flex;
    position: relative;
    height: auto;
    width: auto;
    background: none;
    z-index: 10;
  }

  .list-images {
    display: none;
  }

  .prev-button,
  .next-button {
    height: 2em;
    width: 2em;
    background-size: 0.6em;
  }

  .prev-button {
    left: 2.2em;
  }

  .next-button {
    right: 2.2em;
  }

  .close-button {
    display: none;
  }

  /* Product Content */
  .product-content {
    padding: 0 2em;
  }

  .company-name {
    margin: 1rem 0;
  }

  .product-name {
    font-size: 1.9em;
    margin-bottom: 1.2rem;
  }

  .product-description {
    font-size: 0.95em;
    margin-bottom: 1.2rem;
  }

  .prices {
    flex-direction: row;
    justify-content: flex-start;
    gap: 2.5em;
    align-items: center;
    margin-bottom: 0.8rem;
  }

  .current-price {
    font-size: 1.6em;
  }

  .current-discount {
    font-size: 0.9em;
    padding: 1.5px 0.4em;
  }

  .prev-price {
    font-size: 1em;
    margin-bottom: 0;
  }

  .add-to-cart {
    justify-content: flex-start;
    gap: 2em;
  }

  .item-counter {
    font-size: 1em;
  }

  .item-cart-count {
    padding: 0.9em;
  }

  .add-cart-button {
    padding: 1rem 3rem;
  }
}

@media screen and (max-width: 425px) {
  /* Cart */
  .cart-menu {
    width: 19rem;
  }

  /* Product Content */
  .prices {
    justify-content: space-between;
  }

  .add-to-cart {
    flex-direction: column;
    gap: 1em;
  }

  .item-cart-count {
    width: 100%;
    padding: 0.8em;
  }

  .item-cart-count button {
    width: 40%;
  }

  .add-cart-button {
    width: 100%;
    padding: 0.9rem 2.5rem;
  }
}

@media screen and (max-width: 320px) {
  /* Cart */
  .cart-menu {
    width: 17;
    right: -4.5em;
  }
}
