*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-size: 16px;
  font-family: "Kumbh Sans", sans-serif;
  font-weight: 700;
}

:root {
  --grey: hsl(219, 9%, 45%);
  --light-grey: hsl(223, 64%, 98%);
  --orange: hsl(26, 100%, 55%);
  --transparent-orange: hsla(26, 100%, 55%, 0.7);
  --light-orange: hsl(25, 100%, 94%);
}

/* overlay */

.overlay {
    position: fixed;
    inset: 0;
    opacity: 0;
    z-index: 2;
    pointer-events: none;
}

/* menu in mobile layout */

@media (max-width: 850px) {
  /* nav in mobile */
  .logo-nav nav.show {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: fixed;
    z-index: 3;
    height: 100vh;
    width: 80%;
    background-color: white;
    left: 0;
    top: -1px;
    padding: 15% 5%;
  }
  /* nav buttons */
  .logo-nav nav.show button:hover {
    color: var(--grey);
  }
  .logo-nav nav.show button {
    padding: 5%;
    font-size: 1.5rem;
  }
  /* styling close button */
  #menu-btn.show {
    z-index: 4;
    position: fixed;
    left: 6%;
    top: 3.5%;
  }
  .overlay {
    background-color: hsla(180, 0%, 0%, 0.5);
  }
  .overlay.show {
    opacity: 1;
    pointer-events: auto;
  }
  /* hiding lightbox in mobile layout */
  .clone {
    display: none;
  }
}

/* header layout */

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 1rem 2rem;
}

/* menu button styling */

#menu-btn {
  position: static;
  margin-right: 15px;
}

/* cart and avatar wrapper */

.btn-wrapper {
  display: flex;
  align-items: center;
  gap: 15px;
  position: relative;
}

/* cart icon color change */

#cart-icon {
  color: var(--grey);
}

.cart-badge {
  display: none;
}

.cart-badge.fill {
  display: block;
  position: absolute;
  width: 15px;
  height: 11px;
  top: 0;
  right: 40px;
  border-radius: 15px;
  background-color: var(--orange);
}

.cart-badge span {
  color: white;
  font-size: 0.5rem;
  position: absolute;
  top: 46%;
  left: 55%;
  transform: translate(-50%, -50%);
}

/* cart window */

#cart-tray {
  display: none;
}

#cart-tray.open {
  display: block;
  position: absolute;
  height: 35%;
  width: 96%;
  top: 10%;
  right: 2%;
  background-color: white;
  box-shadow: 10px 10px 10px hsla(180, 0%, 0%, 0.1), -10px 10px 50px hsla(180, 0%, 0%, 0.1);
  border-radius: 10px;
  z-index: 2;
}

#cart-tray p:first-child {
  margin: 20px 30px;
}

#cart-tray .border {
  border: 1px solid var(--grey);
  opacity: 0.1;
}

#cart-tray .cart-empty {
  display: none;
}

#cart-tray .cart-empty.empty {
  display: block;
  color: var(--grey);
  font-size: 0.8rem;
  position: absolute;
  top: 55%;
  left: 50%;
  transform: translate(-50%, -50%);
}

#cart-tray .filled {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#cart-tray .filled .product {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 25px;
  gap: 10px;
}

.product div:first-child {
  display: flex;
  gap: 5%;
  align-items: center;
}

.product span {
  font-size: 1rem;
  font-weight: 400;
  color: var(--grey);
}

.product span:first-child {
  display: block;
}

#total {
  font-weight: 700;
  color: black;
  margin-left: 10px;
}

#cart-tray .filled .img {
  width: 20%;
  height: 20%;
  border-radius: 5px;
}

#del-cart-btn img {
  width: auto;
}

#checkout {
  width: 90%;
  margin: 0 auto;
  box-shadow: none;
}

#checkout:hover {
  background-color: var(--transparent-orange);
}

/* profile pic hover state */

.btn-wrapper button:nth-of-type(2) img:hover {
  outline: 3px solid var(--orange);
  border-radius: 50%;
}

.text {
  margin: 2rem;
}

.product-image {
  width: 100%;
  max-width: 900px;
  height: auto;
  display: block;
}

.image-wrapper {
  position: relative;
}

/* positioning previous and next buttons */
/* setting % for height and width to make buttons scale with screen size */

.prev-next-btns {
  position: absolute;
  background-color: var(--light-grey);
  border: 1px solid var(--light-grey);
  border-radius: 50%;
  height: 7%;
  width: 7%;
  z-index: 1;
  top: 50%;
}

/* setting % for height to make image within button to scale with screen size */

.prev-next-btns img {
  height: 40%;
  margin: 0 auto;
  display: block;
}

/* centering img within button */

.prev-next-btns.prev img {
  transform: translateX(-1px);
}

.prev-next-btns.next img {
  transform: translateX(1px);
}

.prev {
  left: 1rem;
  display: block;    /* to show and hide when nav is opened and closed */
}

.next {
  right: 1rem;
}

/* hiding nav, close button and thumbnails in mobile layout */

.logo-nav nav {
  display: none;
}

.thumbnails-wrapper {
  display: none;
}

/* styling buttons and font */

button {
  border: none;
  background: none;
  cursor: pointer;
}

h1 {
  line-height: 2rem;
  margin-bottom: 1.5rem;
}

.text > :first-child {
  text-transform: uppercase;
  margin-bottom: 1rem;
}

/* product description */

.text p:nth-of-type(2) {
  font-weight: 400;
  line-height: 1.5rem;
  color: var(--grey);
  margin-bottom: 1.5rem;
}

.prices-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.org-prices-wrapper {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* discount */

#discount {
  background-color: black;
  color: white;
  padding: 0.2rem 0.5em;
  border-radius: 5px;
}

/* hiding sr-only */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* for h1 and price */

.bigger-font {
  font-size: 2rem;
}

.counter {
  display: flex;
  justify-content: space-between;
  background-color: var(--light-grey);
  padding: 0.8rem;
  margin: 1.2rem 0;
  border-radius: 5px;
}

.counter button:first-child img {
  vertical-align: middle;
}

.counter button:first-child img:hover {
  opacity: 0.7;
}

.counter button:nth-of-type(2) img:hover {
  opacity: 0.7;
}

.orange-btn {
  background-color: var(--orange);
  width: 100%;
  padding: 0.8rem;
  border-radius: 5px;
  display: flex;
  justify-content: center;
  gap: 10px;
  box-shadow: 20px 20px 20px var(--light-orange);
}

#cart-btn span {
  font-size: 0.8rem;
}

#cart-btn:hover {
  background-color: var(--transparent-orange);
}

.grey-font {
  color: var(--grey);
}

/* cart sizing for wider screens */ 

@media (min-width: 510px) {
  #cart-tray.open {
    display: block;
    position: absolute;
    height: 30%;
    width: 20%;
    min-width: 300px;
    top: 4rem;
    right: 4rem;
  }
  #cart-tray p:last-child.empty {
    top: 60%;
  }
  #cart-tray .filled .product {
    display: flex;
    margin: 20px;
    gap: 10px;
  }
  .product div span {
    font-size: 0.8rem;
  }
  #cart-tray .filled .img {
    width: 50px;
    height: 50px;
    border-radius: 5px;
  }
}

/* desktop layout */

@media (min-width: 850px) {
  body {
    overflow: clip;
  }
  /* hiding menu button in desktop layout */
  #menu-btn {
    display: none;
  }
  header {
    border-bottom: 1px solid hsla(219, 9%, 45%, 0.3);
    width: 80%;
    margin: 0 auto;
    padding: 1.5rem 0;
  }
  .logo-nav {
    display: flex;
    align-items: center;
    gap: 50px;
  }
  .logo-nav nav {
    display: flex;
  }
  .logo-nav nav button {
    font-weight: 400;
    font-size: 0.9rem;
    color: var(--grey);
    position: relative;
    padding: 0 2%;
  }
  .logo-nav nav button::after {
    content: "";
    position: absolute;
    bottom: -2rem;
    left: 0;
    right: 0;
    width: 100%;
    height: 5px;
    background-color: var(--orange);
    transform: scaleX(0);
    transform-origin: center;
     transition: transform 0.1s ease-in-out;
  }
  .logo-nav nav button:hover {
    color: black;
  }
  .logo-nav nav button:hover::after {
    transform: scaleX(1);
  }
  main {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5%;
    width: 80%;
    padding-top: 4.8rem;
    margin: 0 5% 0 12%;
  }
  .image-wrapper {
    max-height: 80%;
  }
  /* lightbox styling */
  .clone {
    position: fixed;
    z-index: 5;
    top: 53%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 100vw;
    max-height: 100vh;
    pointer-events: none;
    opacity: 0;
    display: none;
  }
  .clone.zoom {
    pointer-events: auto;
    opacity: 1;
    display: block;
  }
  #close {
    cursor: pointer;
    z-index: 5;
    position: fixed;
    top: -25px;
    right: 0;
  }
  #close svg {
    color: var(--light-grey);
  }
  #close svg:hover {
    color: var(--orange);
  }
  .overlay {
    background-color: hsla(180, 0%, 0%, 0.8);
  }
  .overlay.zoom {
    opacity: 1;
    pointer-events: auto;
  }
  .product-image.zoom {
    pointer-events: none;
    width: 100%;
    max-width: 500px;
    margin-bottom: 7%;
  }
  .clone.zoom .thumbnails-wrapper {
    justify-content: space-around;
  }
  .prev-next-btns.zoom {
    display: block;
    z-index: 6;
    width: 12%;
    height: 10%;
    position: fixed;
    top: 36%;
  }
  .prev.zoom {
    left: -25px;
  }
  .next.zoom {
    right: -25px;
  }
  /* thumbnails wrapper default layout */
  .thumbnails-wrapper {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
  }
  .thumbnail {
    position: relative;
    width: fit-content;
    height: fit-content;
  }
  .thumbnail img {
    width: 100%;
    max-width: 75px;
    border-radius: 15px;
    display: block;
  }
  .thumbnail::after {
    content: "";
    position: absolute;
    inset: 0;
    background-color: white;
    opacity: 0;
    border-radius: 15px;
    cursor: pointer;
  }
  .thumbnail:hover::after {
    opacity: 0.5;
  }
  .thumbnail:focus {
    border-radius: 17px;
  }
  .selected {
    pointer-events: none;
    border: 3px solid var(--orange);
    border-radius: 17px;
  }
  .selected::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 15px;
    opacity: 0.6;
  }
  /* hiding prev and next buttons in desktop layout */
  .prev-next-btns {
    display: none;
  }
  /* product image default style */
  .product-image {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: 15px;
    cursor: pointer;
  }
  .text {
    max-width: 40%;
    margin: 0;
  }
  .prices-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .counter-cart-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    min-height: 120px;
  }
  #cart-btn {
    flex: 2 1 15px;
    box-shadow: none;
  }
  .counter {
    flex: 1 2 15px;
  }
}

/* credits */

.attribution 
{ 
  font-size: 11px; 
  text-align: center; 
  font-weight: 400;
  margin-top: 50px;
  margin-bottom: 5px;
}
    
.attribution a { 
  color: hsl(228, 45%, 44%); 
  text-decoration: none;
}
