/* ===  FONTS === */

@font-face {
  font-display: swap;
  font-family: 'Kumbh Sans';
  font-style: normal;
  font-weight: 400;
  src: url('assets/fonts/kumbh-sans-v27-latin-regular.woff2') format('woff2'); 
}

@font-face {
  font-display: swap; 
  font-family: 'Kumbh Sans';
  font-style: normal;
  font-weight: 700;
  src: url('assets/fonts/kumbh-sans-v27-latin-700.woff2') format('woff2'); 
}


/* ===  CSS RESET === */

/* Box sizing rules */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Prevent font size inflation */
html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

/* Remove default margin in favour of better control in authored CSS */
body, h1, h2, h3, h4, p,
figure, blockquote, dl, dd {
  margin-block-end: 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 shorter line heights on headings and interactive elements */
h1, h2, h3, h4,
button, input, label {
  line-height: 1.1;
}

/* Balance text wrapping on headings */
h1, h2,
h3, h4 {
  text-wrap: balance;
}

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

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

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

/* Make sure textareas without a rows attribute are not tiny */
textarea:not([rows]) {
  min-height: 10em;
}

/* Anything that has been anchored to should have extra scroll margin */
:target {
  scroll-margin-block: 5ex;
}


:root {
  /* == COLOR PALLETTE == */

  /* Primary Color */
  --clr-orange: hsl(26, 100%, 55%);
  --clr-pale-orange: hsl(25, 100%, 94%);
  
  /* Neutral Colors */
  --clr-white: hsl(0, 0%, 100%);
  --clr-black: hsl(0, 0%, 0%);
  --clr-grayish-blue: hsl(220, 14%, 75%);
  --clr-light-grayish-blue: hsl(223, 64%, 98%);
  --clr-dark-grayish-blue: hsl(219, 9%, 45%);
  --clr-very-dark-blue: hsl(220, 13%, 13%);

  --clr-backdrop: rgba(0, 0, 0, 0.5);
  --clr-shadow: rgba(0, 0, 0, 0.07);
  --clr-overlay: rgba(255, 255, 255, 0.5);
  
  /* == TYPOGRAPHY == */

  /* font family */
  --ff-body: 'Kumbh Sans', sans-serif;

  /* font size */
  --fs-paragraph: 1rem;

  /* font weights */
  --fw-regular: 400;
  --fw-bold: 700;

  /* Spacing */
  --space-sr:  0.0625rem;
  --space-xxs: 0.15rem;
  --space-vs: 1.625rem;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xlg: 2.5rem;
  --space-xxlg: 3rem;
}


/* === Accessibility Checks  === */

@media (prefers-reduced-motion: reduce) {
  .nav__drawer,
  .backdrop,
  .cart__modal,
  .nav__toggle--bar,
  .nav__links--group li a,
  .lightbox {
    transition: none;
    animation: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}


/* ===  BASE STYLES === */

body {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100svh;
  font-family: var(--ff-body);
  line-height: 1.5;
}

.hidden {
  display: none;
}

.header {
  position: sticky;
  top: 0;
  height: 4rem;
  width: 100%;
  background: var(--clr-white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  box-shadow: 0 var(--space-sr) 0  var(--clr-shadow);
  z-index: 200;
}

.header__left--container, .header__right--container {
  display: flex;
  align-items: center;
}

.header__left--container {
  gap: 0.8rem;
  margin-inline-start: 0.7rem;
}

.header__right--container {
  margin-inline-end: 1.6rem;
  gap: 1.5rem;
}

button {
  background: none;
  border: none;
  outline: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.nav__toggle {
  top: 1.2rem;
  left: 1.2rem;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.25rem;
}

.nav__toggle--bar {
  display: block;
  width: 1.2rem;
  height: 0.1875rem;
  background: var(--clr-dark-grayish-blue);
  border-radius: 0.125rem;
  transition: transform 0.35s ease;
  transform-origin: center;
  z-index: 500;
}

body.menu-open {
  overflow: hidden;
}

body.menu-open .nav__toggle {
  padding-inline-start: 0.8rem;
}

body.menu-open .nav__toggle .nav__toggle--bar:nth-child(1) {
  transform: translateY(0.4375rem) rotate(45deg);
}

body.menu-open .nav__toggle .nav__toggle--bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

body.menu-open .nav__toggle .nav__toggle--bar:nth-child(3) {
  transform: translateY(-0.4375rem) rotate(-45deg);
}

.nav__drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 65%;
  height: 100%;
  min-height: 100svh;
  translate: -100% 0;
  transition: translate 0.3s ease;
  z-index: 400;
}

body.menu-open .nav__drawer {
  translate: 0 0;
}

.nav__links {
  background: var(--clr-white);
  height: 100%;
  padding: 6rem 1.5rem;
}

.nav__links--group {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.nav__links--group li a {
  position: relative;
  color: var(--clr-very-dark-blue);
  font-size: clamp(1rem, 1vw, 1.8rem);
  font-weight: var(--fw-bold);
  text-decoration: none;
}

.nav__links--group li a:hover::after {
  opacity: 1;
  transform: scaleX(1); 
}

.backdrop {
  position: fixed;
  inset: 0;
  background: var(--clr-backdrop);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 300;
}

.backdrop.mobile-menu-active {
  opacity: 1;
  pointer-events: all;
}

.header__logo--container img {
  height: 1.2rem;
  width: clamp(6.5rem, 8vw, 8rem);
  margin-block-end: 0.35rem;
}

.header__cart--btn {
  position: relative;
  display: flex;
  align-items: center;
}

.header__cart--icon {
  display: flex;
  align-items: center;
}

.header__cart--icon svg {
  display: block;
}

.header__cart--badge {
  position: absolute;
  top: -0.5rem;
  left: 0.7rem;
  background: var(--clr-orange);
  border-radius: 40%;
  padding: 0.1rem 0.5rem;
  color: var(--clr-white);
  font-size: clamp(0.8rem, 1vw, 2rem);
}

.user__avatar--btn {
  padding-inline-end: 0.8rem;
}

.user__avatar--btn img {
  height: clamp(1.8rem, 2.5vw, 5rem);
  width: clamp(1.8rem, 2.5vw, 5rem);
}

.cart__modal {
  position: absolute;
  top: 4.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(-20%);
  width: calc(100% - var(--space-sm));
  background: var(--clr-white);
  border-radius: var(--space-xs);
  padding: var(--space-xs) 0;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
  box-shadow: 0.3125rem 0.3125rem 0.3125rem var(--clr-shadow);
  z-index: 100;
}

body.cart-open .cart__modal {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: all;
}

.cart__modal--title {
  display: block;
  width: 100%;
  color: var(--clr-very-dark-blue);
  font-weight: var(--fw-bold);
  border-block-end: 1px solid var(--clr-grayish-blue);
  padding-inline: var(--space-sm);
  padding-block:  var(--space-xs) var(--space-sm);
}

.cart__modal--body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-inline: var(--space-sm);
  padding-block: 1.8rem 0.8rem;
}

.cart__item {
  display: flex;
  gap: 1.5rem;
}

.cart__item--info {
  display: flex;
  flex-direction: column;
}

.cart__empty {
  text-align: center;
  color: var(--clr-dark-grayish-blue);
  font-weight: var(--fw-bold);
  padding-block: 2rem;
}

@media screen and (max-width: 20rem) {
  .cart__item {
    gap: 0.8rem;
  }
}

@media screen and (max-width: 22.5rem) {
  .cart__item--name {
    font-size: 0.85rem;
    gap: 1.5rem;
  }
}

.cart__item--name, .cart__quantity {
  color: var(--clr-dark-grayish-blue);
}

.cart__item--pricing {
  display: flex;
  gap: 0.5rem;
}

.cart__total {
  font-weight: var(--fw-bold);
}

.cart__item--img {
  width: 3rem;
  height: 3rem;
  border-radius: 10%;
}

.checkout__btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--clr-orange);
  color: var(--clr-black);
  font-weight: var(--fw-bold);
  padding: 0.8rem 1rem;
  border-radius: 0.5rem;
}

main {
  width: 100%;
}

.gallery {
  width: 100%;
  height: 50vh;
}

.gallery__main {
  position: relative;
}

.gallery__active--image {
  max-width: 100%;
  height: 45vh;
  object-fit: cover;
  cursor: pointer;
  pointer-events: all;
}

.gallery__btn--prev, .gallery__btn--next, .lightbox__btn--prev, .lightbox__btn--next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--clr-white);
  border: none;
  cursor: pointer;
  border-radius: 50%;
  padding: 0.5rem;
  z-index: 5;
}

.gallery__btn--prev img, .gallery__btn--next img {
  height: 0.7rem;
  width: 0.7rem;
}

.gallery__btn--prev {
  left: 1rem;
}

.gallery__btn--next {
  right: 1rem;
}

.gallery__thumbnails, .lightbox__thumbnails {
  display: none;
}

.lightbox {
  display: none;
}

.product__info {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-block-start: -1.5rem;
  padding: 1rem 1.5rem;
}

.brand {
  font-size: clamp(0.8rem, 1vw, 2rem);
  color: var(--clr-dark-grayish-blue);
  font-weight: var(--fw-bold);
}

.product__title {
  width: 100%;
  font-size: clamp(1.65rem, 2.5vw, 3.5rem);
  text-wrap: pretty; 
}

.description {
  width: 100%;
  font-size: clamp(0.9rem, 2vw, 2.5rem);
  color: var(--clr-dark-grayish-blue);
}

.pricing, .promo {
  display: flex;
  align-items: center;
}

.pricing {
  justify-content: space-between;
  margin-block-end: 1rem;
}

.promo {
  gap: 1rem;
}

.sales__price {
  color: var(--clr-very-dark-blue);
  font-size: clamp(1.5rem, 2vw, 2.5rem);
  font-weight: var(--fw-bold);
}

.discount__badge {
  color: var(--clr-white);
  background: var(--clr-very-dark-blue);
  padding: 0.1rem 0.5rem;
  border-radius: 0.3rem;
  margin-block-start: 0.5rem;
}

.original__price {
  color: var(--clr-dark-grayish-blue);
  font-size: clamp(1rem, 1vw, 1.5rem);
  font-weight: var(--fw-bold);
  text-decoration: line-through;
  margin-inline-end: 0.8rem;
}

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

.stepper {
  width: 100%;
  background: var(--clr-light-grayish-blue);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.2rem;
  margin-block-end: 0.5rem;
  border-radius: 0.5rem;
}

.stepper__count {
  font-size: clamp(1.2rem, 1.5vw, 2rem);
  font-weight: var(--fw-bold);
}

.stepper__minus, .stepper__plus {
  border: none;
  cursor: pointer;
}

.quantity__cart .cart__btn {
  width: 100%;
  background: var(--clr-orange);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: var(--fw-bold);
  padding: 0.6em 1.2em;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
}

.cart__btn--icon {
  width: 2rem;       
  height: 2rem;
  display: flex;
  align-items: center;
  color: var(--clr-very-dark-blue); 
}

@media screen and (min-width:48rem) {
  body {
    padding-inline: 4rem;
  }

  .header__left--container {
    gap: 3rem;
  }

  .header__right--container {
    gap: 3rem;
  }

  .gallery {
    height: 70vh;
    margin-block-start: 2rem;
  }

  .gallery__active--image {
    height:60vh;
    object-fit: cover;
  }

  .nav__drawer {
    width: 40%;
  }

  body.menu-open .nav__toggle {
    margin-inline-start: -4rem;
  }

}


@media screen and (min-width:65.125rem) {

  body {
    align-items: center;
    justify-content: center;
    padding-inline: 10rem;
  }

  .header {
    background: var(--clr-white);
    height: 5rem;
  }

  .header__left--container {
    gap: 3rem;
  }

  .header__right--container {
    gap: 3rem;
    right: 0;
  }

  .user__avatar--btn {
    padding-inline-end: 0;
  }

  .nav__toggle {
    display: none;
  }

  .nav__links {
    display: block;
    padding: 0;
  }

  .nav__links--group {
    background: var(--clr-white);
    flex-direction: row;
    gap: 2rem;
  }

  .nav__links--group li a {
    color: var(--clr-dark-grayish-blue);
    font-weight: var(--fw-regular);
  }

  .nav__links--group li a::after {
    content: '';
    position: absolute;
    bottom: -2rem;
    left: 0;
    width: 100%;
    height: 0.1875rem;
    background: var(--clr-orange);
    border-radius: 0.125rem 0.125rem 0 0;
    opacity: 0;
    transform: scaleX(0);
    transform-origin: center;
    transition: opacity 0.2s, transform 0.25s;
  }

  .nav__drawer {
    position: static;
    width: auto;
    height: auto;
    background: none;
    translate: 0 0;
    padding: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
  }

  .backdrop {
    z-index: 700;
  }

  .backdrop.mobile-menu-active {
    opacity: 0;
    pointer-events: none;
  }

  .backdrop.lightbox-active {
    opacity: 1;
    pointer-events: all;
  }

  .cart__modal {
    position: fixed;
    top: auto;
    left: auto;
    transform: none;
    opacity: 0;
    pointer-events: none;
    width: 22.5rem;
    z-index: 400;
  }

  body.cart-open .cart__modal {
    opacity: 1;
    pointer-events: all;
  }

  .main__product--page {
    display: grid;
    place-items: center;
    grid-template-columns: 1fr 1.2fr;
    gap: 6rem;
    margin-block-start: 5rem;
    padding-inline: 3rem;
  }

  .gallery {
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
    height: 100%;
  }

  .gallery__active--image {
    height: 60vh;
    border-radius: 3%;
  }

  .gallery__btn--prev, .gallery__btn--next {
    display: none;
  }

  .gallery__thumbnails, .lightbox__thumbnails {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 1rem;
  }

  .gallery__thumbnails li, .lightbox__thumbnails li {
    list-style: none;
    flex: 1;
  }

  .gallery__thumb, .lightbox__thumb {
    width: 100%;
    position: relative;
    border-radius: 15%;
    overflow: hidden;
    outline: 2px solid transparent;
    outline-offset: 2px;
  }

  .gallery__thumb:hover, .lightbox__thumb:hover {
    opacity: 0.8;
    cursor: pointer;
  }

  .gallery__thumb.active, .lightbox__thumb.active {
    outline-color: var(--clr-orange);
  }

  .gallery__thumb.active::after, .lightbox__thumb.active::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--clr-overlay);
    border-radius: 15%;
  }

  .gallery__thumb img, .lightbox__thumb img {
    display: block;
    width: 100%;
    height: 5rem;
    object-fit: cover;
    border-radius: 15%;
  }

  .product__info {
    margin-block-start: 0;
    padding-block: 0;
    gap: 1rem;
  }

  .description {
    font-size: clamp(0.9rem, 1vw, 2rem);
    text-wrap: pretty;
  }

  .pricing {
    flex-direction: column;
    align-items: start;
    margin-block-end: 0;
  }

  .promo {
    gap: 1.5rem;
  }

  .quantity__cart {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
  }

  .stepper {
    padding-block: -0.1rem;
    margin-block-end: 0;
  }

  body.lightbox-open {
    overflow: hidden;
  }

  body.lightbox-open .lightbox {
    height: 100%;
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 1.6rem;
    padding-block: 3rem;
    z-index: 600;
    overflow-y: auto;
  }

  .lightbox__inner {
    position: relative;
    width: min(90%, 35rem);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
  }

  .lightbox__image--wrapper {
    position: relative;
  }

  .lightbox__active--image {
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    border-radius: 3%;
  }

  .lightbox__thumbnails {
    padding-inline: 2.5rem;
  }

  .lightbox__thumb img {
    width: 100%;
    height: 6rem;
  }

  .lightbox__btn--prev img, .lightbox__btn--next img {
    height: 2rem;
    width: 1.8rem;
  }

  .lightbox__close--btn {
    position: absolute;
    top: -2.8rem;
    right: -0.3rem;

    width: 2.5rem;
    height: 2.5rem;

    display: flex;
    align-items: center;
    justify-content: center;

    background: transparent;
    border: none;
    cursor: pointer;

    z-index: 9999;
  }

  .lightbox__close--icon {
    height: 2rem;
    width: 2rem;
  }

  .lightbox__btn--prev {
    left: -2rem;
    padding: 1rem;
  }

  .lightbox__btn--next {
    right: -2rem;
    padding: 1rem;
  }
}