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

:root {
  --Orange: hsl(26, 100%, 55%);
  --light-orange: hsl(26, 100%, 71%);
  --Pale-orange: hsl(25, 100%, 94%);
  --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%);
  /* (with 75% opacity for lightbox background) */
  --Black: hsl(0, 0%, 0%);
}

* {
  font-family: 'Kumbh Sans', sans-serif;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

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

.visually-hidden {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

.container {
  max-width: 1110px;
}

.hidden {
  display: none;
}

.invisible {
  display: none !important;
}

/* Navbar styles - Desktop min-width:1024px */

nav {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  flex: 1;
  margin: 0 auto;
}

.nav_container {
  display: flex;
  width: 100%;
  justify-content: space-between;
  box-shadow: 0 2px 2px -2px hsla(0, 0%, 0%, 0.2);
}

.nav_left-section {
  display: flex;
  align-items: center;
}

.nav_links {
  margin-left: 3rem;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 2rem;
  color: var(--Dark-grayish-blue);
}

.nav_link {
  cursor: pointer;
  height: 100%;
  position: relative;
}

.nav_link:hover {
  color: var(--Black);
}

.nav_link:hover::after {
  content: '';
  position: absolute;
  bottom: -35px;
  border-radius: 10px;
  display: block;
  background-color: var(--Orange);
  width: 100%;
  height: 5px;
}

.nav_right-section {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.avatar {
  width: 50px;
  margin: 1rem 0;
  outline: 2px solid var(--Orange);
  border-radius: 50%;
}

.cart {
  cursor: pointer;
}

.cart:hover {
  filter: brightness(0%);
}

.cart-btn {
  background-color: transparent;
  border: none;
}

.indicator {
  background-color: var(--Orange);
  padding: 0.2rem 0.5rem;
  border-radius: 50%;
  color: var(--White);
  position: absolute;
  top: -15px;
  right: -10px;
}

/* Cart styles */
.cart-container {
  position: relative;
}

.cart-wrp {
  position: absolute;
  left: -282px;
  top: 50px;
  z-index: 30;
  width: 360px;
  height: 250px;
  background-color: var(--White);
  box-shadow: 0px 0px 15px 0px hsla(0, 0%, 0%, 0.05);
  border-radius: 10px;
}

.cart-heading {
  font-size: 1.1rem;
  font-weight: 700;
  padding: 1rem;
}

.divider {
  width: 100%;
  height: 1px;
  background-color: var(--Grayish-blue);
}

.empty {
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-content {
  height: 200px;
}

.product {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  height: 100%;
  justify-content: space-around;
}

.cart-content .product div {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.product-title {
  color: var(--Dark-grayish-blue);
}

.product-info {
  gap: 1rem;
  display: flex;
  flex-direction: column;
  text-align: start;
}

.product-info p:last-child {
  margin-right: auto;
  color: var(--Dark-grayish-blue);
}

.product-info b {
  color: var(--Black);
}

.cart-content img {
  width: 60px;
  border-radius: 6px;
}

.delete-btn {
  background-color: transparent;
  border: none;
  width: 18px;
  cursor: pointer;
}

.checkout-btn {
  background-color: var(--Orange);
  border-radius: 8px;
  border: none;
  color: var(--Very-dark-blue);
  font-weight: 700;
  font-size: 1rem;
  font-family: inherit;
  padding: 1rem;
  cursor: pointer;
  transition: backgroud-color 0.3s ease-in-out;
}

.checkout-btn:hover {
  background-color: var(--light-orange);
}

/* Main section */
main {
  display: flex;
  height: calc(100vh - 150px);
  align-items: center;
  justify-content: space-between;
  margin-inline: 2rem;
}

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

.main-thumbnail {
  border-radius: 10px;
  cursor: pointer;
}

.preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin-top: 2rem;
}

.preview img {
  width: 90px;
  border-radius: 10px;
  cursor: pointer;
}

.preview img:hover {
  opacity: 60%;
}

.selected {
  border: 2px solid var(--Orange);
  opacity: 50%;
}

.content {
  margin-left: 3rem;
}

.company {
  display: block;
  font-size: 0.75rem;
  font-size: clamp(0.75rem, 0.72rem + 0.14vw, 0.8125rem);
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--Dark-grayish-blue);
  margin-bottom: clamp(1rem, 0.74rem + 1.09vw, 1.5rem);
}

h1 {
  font-size: 1.75rem;
  font-size: clamp(1.75rem, 1.24rem + 2.18vw, 2.75rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--Very-dark-blue);
  margin-bottom: clamp(1rem, 0.49rem + 2.18vw, 2rem);
}

.info {
  font-size: 0.9375rem;
  font-size: clamp(0.9375rem, 0.91rem + 0.14vw, 1rem);
  line-height: 1.7;
  font-weight: 400;
  color: var(--Dark-grayish-blue);
  margin-bottom: 2rem;
}

.price {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 2rem;
}

.new-price {
  display: flex;
  align-items: center;
}

.new-price p {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--Very-dark-blue);
}

.new-price span {
  margin-left: 1rem;
  background-color: var(--Very-dark-blue);
  padding: 0.3rem;
  border-radius: 6px;
  color: var(--White);
  font-weight: 700;
}

.old-price {
  color: var(--Dark-grayish-blue);
  text-decoration: line-through;
}

.buttons {
  display: flex;
  align-items: center;
  width: 100%;
}

.amount-btn {
  background-color: var(--Light-grayish-blue);
  display: flex;
  align-items: center;
  padding: 1rem;
  width: 35%;
  border-radius: 7px;
  justify-content: space-between;
}

.amount-btn button {
  background-color: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.amount {
  font-weight: 700;
}

.add_btn {
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  width: 65%;
  margin-left: 1rem;
  background-color: var(--Orange);
  color: var(--Very-dark-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  font-family: inherit;
  border: none;
  border-radius: 10px;
  padding: 1rem;
}

.add_btn:hover,
.add_btn:focus-visible {
  background: linear-gradient(-90deg, var(--light-orange), var(--Orange));
  position: relative;
}

.add_btn:hover::after,
.add_btn:focus-visible::after {
  content: '';
  position: absolute;
  inset: 0;
  background: inherit;
  border-radius: inherit;
  translate: 0 1.5rem;
  filter: blur(1rem);
  opacity: 0.25;
  z-index: -1;
}

/* Lightbox styles */
.lightbox {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: hsla(0, 0%, 0%, 0.75);
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
}

.lightbox-container {
  position: relative;
}

.close-lightbox {
  position: absolute;
  top: -40px;
  right: 0;
  color: var(--Orange);
  background-color: transparent;
  border: none;
  cursor: pointer;
}

.close-lightbox:hover svg path {
  fill: var(--Orange);
}

.lightbox-btn-wrapper {
  width: 590px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: absolute;
  top: 40%;
  transform: translateY(-40%);
  left: -4%;
}

#nextBtn,
#prevBtn {
  border: none;
  background-color: var(--White);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;

  &:hover {
    svg path {
      stroke: var(--Orange);
    }
  }
}

.lightbox .main-thumbnail {
  width: 550px;
}

@media screen and (max-width: 1023px) {
  .hidden {
    display: flex;
  }

  .invisible-mobile {
    display: none;
  }

  body {
    position: relative;
    min-height: 100vh;
  }

  .nav_container {
    max-width: 608px;
  }

  .nav_left-section {
    align-items: center;
    gap: 1rem;
  }

  .menu,
  .close-btn {
    cursor: pointer;
    background: none;
    border: none;
  }

  .overlay {
    position: absolute;
    z-index: 999;
    inset: 0;
    background-color: hsla(0, 0%, 0%, 0.75);

    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0s 0.3s;
  }

  .nav-links-wrapper {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 60%;
    z-index: 999;
    padding: 2rem;
    margin: 0;
    background-color: var(--White);

    display: flex;
    flex-direction: column;
    gap: 3rem;
    margin-left: 0;

    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
  }

  .nav_links {
    flex-direction: column;
    align-items: flex-start;
    gap: 2rem;
    margin-left: 0;
  }

  .active {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease-in-out, visibility 0s 0s;
  }

  .nav_link {
    height: fit-content;
    font-weight: 700;
    color: var(--Very-dark-blue);
  }

  .nav_link:hover::after {
    bottom: -15px;
  }

  .nav_right-section {
    gap: 1.5rem;
  }

  .avatar {
    width: 24px;
  }

  main {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: clamp(1.5rem, 0.07rem + 6.11vw, 3rem);
    margin-inline: 0;
    height: 100%;
    margin-bottom: 4rem;
  }

  .thumbnails {
    height: 40%;
  }

  .content {
    margin-inline: 2rem;
    height: 50%;

    max-width: 608px;
  }

  .preview {
    display: none;
  }

  .mobile-thumb {
    position: relative;
    display: flex;
    overflow-x: hidden;
    z-index: 1;

    max-width: 608px;
    border-radius: 15px;
    margin-top: 3rem;
  }

  .mobile-thumb img {
    object-fit: cover;
    width: 100%;
    z-index: 1;
  }

  .price {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .amount-btn {
    width: 100%;
  }

  .add_btn {
    width: 100%;
    margin-left: 0;
  }

  #next,
  #previous {
    position: absolute;
    top: 40%;
    border: none;
    background-color: var(--White);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;

    &:hover {
      svg path {
        stroke: var(--Orange);
      }
    }
  }

  #next {
    right: 3%;
  }

  #previous {
    left: 3%;
  }
}

@media screen and (max-width: 600px) {
  .nav_container {
    padding-inline: 1rem;
    max-width: 608px;
  }

  .mobile-thumb {
    position: relative;
    display: flex;
    overflow-x: hidden;
    min-width: 95vw;
    margin-top: -0.65rem;
    z-index: 1;
    border-radius: 0;
  }

  .buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
}
