@import url(variables.css);

/* UNIVERSAL */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  text-decoration: none;
  list-style-type: none;
}

button, input {
  border: none;
  outline: none;
  cursor: pointer;
  background-color: transparent;
}

body {
  font-family: "inter";
}

header, main {
  margin: 2rem 1rem;
}

@media screen and (min-width: 701px) {
  header, main {
    margin: 2rem 3rem;
  }
}

main {
  max-width: 1104px;
}

@media screen and (min-width: 1200px) {
  main {
    margin: 2rem auto;
  }
}

img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

main section {
  margin: 2rem 0;
}


/* TYPOGRAPHY */
h1, h2 {
  font-family: "roboto";
}

h1 {
  font-size: 2.5rem;
  text-transform: uppercase;
}

label {
  font-size: 1.1rem;
}

input, textarea {
  font-size: 1rem;
  font-family: "inter";
}


/* HEADER */
header {
  color: var(--primary-color);
}

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

.header-logo {
  font-family: "roboto";
  font-weight: 600;
  font-size: 1.5rem;
  text-transform: uppercase;
  color: var(--primary-color);
}

.header-start .fa-bag-shopping {
  padding-right: 1.5rem;
}

#cart-btn {
  position: relative;
  color: var(--primary-color)
}

#cart-count {
  position: absolute;
  background-color: var(--secondary-color);
  color: var(--primary-color);
  padding: 0.1rem 0.3rem;
  border-radius: 50%;
  top: 0;
  right: 1rem;
  display: none;
}

.header-end {
  display: flex;
}

.fa-bars,
.fa-magnifying-glass {
  padding: 1rem 1.5rem;
}

.fa-bars {
  color: white;
  background-color: var(--primary-color);
}

.fa-magnifying-glass {
  color: var(--primary-color);
  background-color: var(--secondary-color);
}

#header-search {
  background-color: var(--tertiary-color);
  width: 100%;
  padding-right: 1rem;
  text-align: right;
  font-size: 1.2rem;
  border-radius: 0;
}

.menu {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  background-color: var(--primary-color);
  color: white;
  width: 300px;
  z-index: 1;
  transform: translateX(-100%);
  transition: transform 0.3s ease-in-out;
}

.menu-active {
  transform: translateX(0);
}

.menu ul {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  padding: 3rem 5rem;
}

.menu li {
  font-size: 1.5rem;
}

.menu a {
  color: white;
}

#menu-exit {
  color: white;
  padding: 1rem 1rem 0 84%;
}


/* FOOTER */
footer {
  background-color: var(--primary-color);
  color: white;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

footer img {
max-width: 300px;
}

.footer-nav p {
font-weight: 700;
margin-bottom: 1rem;
}

.footer-nav ul {
display: flex;
flex-wrap: wrap;
gap: 2rem;
}

.footer-nav a {
text-transform: capitalize;
}

footer a {
color: white;
}

.fa-check {
background-color: var(--secondary-color);
padding: .5rem .8rem;
color: var(--primary-color);
}

.footer-newsletter-flex {
display: flex;
margin-top: 1rem;
max-width: 720px;
}

#footer-newsletter-input {
padding-left: 1rem;
width: 100%;
background-color: white;
border-radius: 0;
}


/* BUTTONS */
.primary-btn,
.secondary-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  font-size: 1.5rem;
  width: 100%;
}

.primary-btn {
  background-color: var(--primary-color);
  color: white;
  text-transform: uppercase;
}

.primary-btn:hover {
  background-color: rgb(26, 44, 60);
  transition: .3s;
}

.secondary-btn {
  background-color: var(--secondary-color);
  color: var(--primary-color);
  text-transform: capitalize;
  gap: 1rem;
}


/* BREADCRUMBS */
.breadcrumb {
  display: flex;
  padding: 0;
  margin-bottom: 2rem;
}

.breadcrumb li {
  margin-right: 0.5rem;
  color: var(--primary-color);
}

.breadcrumb li a {
  text-decoration: none;
  color: var(--primary-color);
  font-weight: bold;
}

.breadcrumb li::after {
  content: ">";
  margin-left: 0.5rem;
}

.breadcrumb li:last-child::after {
  content: "";
}

/* Loading spinner */
.spinner {
  width: 48px;
  height: 48px;
  border: 5px solid var(--primary-color);
  border-bottom-color: transparent;
  border-radius: 50%;
  animation: rotation 1s linear infinite;
  margin: 0 auto;
  }

  @keyframes rotation {
  0% {
      transform: rotate(0deg);
  }
  100% {
      transform: rotate(360deg);
  }
  } 

  .hidden {
    display: none;
  }

  /* Message overlay */
  .overlay-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 4;  
  }

  .overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    color: var(--primary-color);
    padding: 1rem;
    border-radius: 6px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 5;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2rem;  
  }

  @media screen and (min-width: 500px) {
    .overlay {
      padding: 3rem;
    }
  }

/* Back to top btn */
.top-btn {
  position: fixed;
  width: auto;
  bottom: 20px;
  right: 20px;
  display: none;
  text-align: center;
  background-color: var(--secondary-color);
  color: var(--primary-color);
  border: none;
  padding: 1rem;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
  transition: opacity 0.3s ease-in-out;
  z-index: 3;
}

.top-btn:hover {
  background-color: var(--primary-color);
  color: var(--secondary-color);
}
