/* General */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;900&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --mainWhite: #FBF8FF;
  --mainBlack: #3C393F;
  --mainBlue: #4a69bd;  
  --mainSpacing: 1.6px;
}

body {
  background-color: var(--mainWhite);
  color: var(--mainBlack);
  font-family: 'Nunito', sans-serif;
}

.container {
  margin: 0 auto;
  max-width: 1110px;
}

/* Navbar */
nav {
  position: fixed;
  top:0;
  left:0;
  right: 0;
  z-index: 5;
  height: 60px;
  background-color: inherit;
  box-shadow: 0 2px 2px -2px rgba(0,0,0,.3);      
}

.navbar-container{
  margin: 0 auto;
  max-width: 1110px;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  align-items: center;  
}

.logo {
  font-size: 20px;
  letter-spacing: var(--mainSpacing);
}

.navbar-links {
  display: flex;
  justify-self: flex-end;
}

nav ul{
  list-style: none;
  display: flex;
  align-items: center;
}

nav li {
  padding: 0 20px;
}

nav li a {
  text-decoration: none;
  color: var(--mainBlack);
  font-size: 18px;
}

/* Cart button */
.cart-btn {
  margin: 0 30px;  
  position: relative;
  cursor: pointer;
  font-size: 24px;
}

.cart-items {
  position: absolute;
  top: -10px;
  right: -10px;
  background-color: var(--mainBlue);
  color: var(--mainWhite);
  font-size: initial;
  padding: 0 5px;
  border-radius: 30%;
}

/* Showcase section */
.showcase {
  height: 80vh;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* .showcase div {
   width: 60%;
} */

.showcase-title {
  font-size: 4.5vmax;
  margin: 20px 0;
}

.showcase p {
  margin-bottom: 40px;
}

.btn {  
  display: inline-block;
  background-color: var(--mainBlue);
  color: var(--mainWhite);
  padding: 14px 28px;
  border-radius: 30px;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: var(--mainSpacing);
}

/* Banner */
#products-banner{
  height: 50vh;
  background: url('./images/product-section-bcg.jpg') center/cover no-repeat;
  background-attachment: fixed;
}

#products-banner h1 { 
  position: relative;
  top: 50%; 
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--mainWhite);
  font-size: 5vmax;
  letter-spacing: 2px;
  text-align: center;  
}

/* Products section */
.products {
  padding: 64px 0;
}

#products-container {
  max-width: 1220px;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  column-gap: 28px;
  row-gap: 32px;
}

/* Product */
.product {  
  border-radius: 15px;
  box-shadow: 0 4px 8px 0 rgba(0,0,0,.2);
}

.img-container {
  position: relative;
  overflow: hidden;
  height: 200px;
  width: 100%;
}

.bag-btn {
  position: absolute;
  top: 70%;
  right: 0;
  padding: 8px 28px;
  border: none;
  background-color: var(--mainBlue);
  color: var(--mainWhite);
  text-transform: uppercase;
  letter-spacing: var(--mainSpacing);
  transition: all .3s linear;
  transform: translateX(101%);
  cursor: pointer;
}

.img-container:hover .bag-btn{
  transform: translateX(0);
}

.img-container:hover img{
  opacity: .5;
  transform: scale(1.1);
  transition: all .3s linear;
}

.product img {
  display: block;
  width: 100%;
  height: 100%;  
  object-fit: cover;
}

.product h3 {
  text-transform: capitalize;
  text-align: center;
  margin-top: 20px;
  font-weight: bold;
  letter-spacing: var(--mainSpacing);
}

.product h4 {
  text-align: center;
  margin: 16px 0;
  letter-spacing: 1px;
  color: var(--mainBlue);
}

/* Cart */
.cart-overlay {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 100%;
  background-color: rgba(255,255,255,.3);
  z-index: 6;
  visibility: hidden;
}

.overlayed {
  visibility: visible;
}

.cart {
  position: fixed;
  top: 0;
  right: 0;
  width: 510px;  
  height: 100%;
  padding: 20px 40px;
  background-color: var(--mainBlack);
  color: var(--mainWhite);
  z-index: 7;    
  overflow-y: scroll;
  transform: translateX(100%);
  transition: all .3s ease-in;
}

.open {
  transform: translateX(0);
} 

.close-cart{
  display: block;
  cursor: pointer;
  font-size: 28px;
}

.cart h2{  
  text-align: center;
  font-size: 36px;
  margin-bottom: 10px;
}

.cart-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  column-gap: 15px;
  align-items: center;
  margin: 24px 0;
}

.cart-item img {
  width: 75px;
  height: 75px;
}

.cart-item h3 {
  letter-spacing: var(--mainSpacing);
}

.cart-item h4 {
  margin: 8px 0;
}

.remove-item {
  color: lightgray;
  cursor: pointer;
}

.item-amount {
  text-align: center;
}

.fa-chevron-up,
.fa-chevron-down {
  color: var(--mainBlue);
  cursor: pointer;
}

.cart-footer {
  margin-top: 48px;
  text-align: center;  
}

.cart-footer h3 {
  margin-bottom: 16px;
}


/* Footer section */
footer{
  background-color: var(--mainBlack);
  color: var(--mainWhite); 
  padding: 20px 0;
  position: relative;
}

.back-to-top{
  width: 80px;
  height: 80px;
  background-color: inherit;
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 50%;
}

.back-to-top a{
  text-decoration: none;
}

.back-to-top i{
  display: block;
  color: #fff;
  font-size: 32px;
  padding: 18px 25px;  
}

footer .container{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 30px;
}

footer h1{
  padding-bottom: 15px;
}

.social a{
  color: #d3d3d3;
  font-size: 30px;
  margin-right: 10px;
}

.social a:hover{
  color: #ffffff;
}

.company-info li{
  list-style: none;
  padding-bottom: 10px;
  font-size: 19px;
}

.company-info li a{
  color: #d3d3d3;
  text-decoration: none;
}

.company-info li a:hover{
  color: #ffffff;
}

.email-form{
  margin: 20px 0;
  display: flex;
}

.form-control-input{
  flex: .85;
  height: 40px;
  padding: 0 8px;
  outline: none;
  border: none;
  font-family: inherit;
}

.submit-btn{
  flex: .15;
  background-color: #ffffff;
  border: none;
  border-left: 1px solid black;
  font-size: 18px;
  cursor: pointer;
}

/* Media queries */
@media (max-width: 760px){
  .showcase img{
    width: 35%;
  }
}

@media (max-width: 630px) {
  footer .container{
    grid-template-columns: 1fr;
    text-align: center;
    padding: 10px 30px;
  }

  .company-info{
    display: none;
  }
  
  .subscribe{
    order: 1;
  }

  .social{
    order: 2;
  }

}

@media (max-width: 585px) {
  .showcase img{
    display: none;
  }

  .showcase div{
    width: 100%;
    text-align: center;
    padding: 0 20px;
  }

  #products-container{
    width: 85%;
  }
}

@media (max-width: 480px) {
  .navbar-links ul{
    display: none;
  }

  .cart-btn{
    margin: 0 10px;
  }
  .showcase{
    height: 70vh;
  }

  .showcase p{
    font-size: 14px;
  }

  .btn{
    display: block;
    font-size: 15px;
    padding: 10px 0;
  }

  .cart{
    width: 100%;
  }

  .clear-cart{
    width: 100%;
    padding: 8px 0px;
  }
}

@media (max-width: 420px) {
  #products-container{
    padding: 0;
  }
}

@media (max-width: 370px) {
  .cart-item img{
    display: none;
  }

  .cart-item{
    grid-template-columns: 15fr 1fr;
  }

  .showcase div p{
    display: none;
  }
}