.main {
  margin-top: 60px;
}

.products-grid {
  display: grid;

  /* - In CSS Grid, 1fr means a column will take up the
       remaining space in the grid.
     - If we write 1fr 1fr ... 1fr; 8 times, this will
       divide the grid into 8 columns, each taking up an
       equal amount of the space.
     - repeat(8, 1fr); is a shortcut for repeating "1fr"
       8 times (instead of typing out "1fr" 8 times).
       repeat(...) is a special property that works with
       display: grid; */
  grid-template-columns: repeat(8, 1fr);
}

/* @media is used to create responsive design (making the
   website look good on any screen size). This @media
   means when the screen width is 2000px or less, we
   will divide the grid into 7 columns instead of 8. */
@media (max-width: 2000px) {
  .products-grid {
    grid-template-columns: repeat(7, 1fr);
  }
}

/* This @media means when the screen width is 1600px or
   less, we will divide the grid into 6 columns. */
@media (max-width: 1600px) {
  .products-grid {
    grid-template-columns: repeat(6, 1fr);

  }
}

@media (max-width: 1300px) {
  .products-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 1000px) {
  .products-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 800px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 575px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 450px) {
  .products-grid {
    grid-template-columns: 1fr;
  }
}

.product-container {
  padding-top: 40px;
  padding-bottom: 25px;
  padding-left: 25px;
  padding-right: 25px;

  border-right: 1px solid rgb(231, 231, 231);
  border-bottom: 1px solid rgb(231, 231, 231);

  display: flex;
  flex-direction: column;
}

.product-image-container {
  display: flex;
  justify-content: center;
  align-items: center;
  
  height: 180px;
  margin-bottom: 20px;
}

.product-image {
  /* Images will overflow their container by default. To
    prevent this, we set max-width and max-height to 100%
    so they stay inside their container. */
  max-width: 100%;
  max-height: 100%;
  cursor: pointer;
}

.product-name {
  height: 40px;
  margin-bottom: 5px;
}

.product-rating-container {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.product-rating-stars {
  width: 100px;
  margin-right: 6px;
}

.product-rating-count {
  color: rgb(1, 124, 182);
  cursor: pointer;
  margin-top: 3px;
}

.product-price {
  font-weight: 700;
  margin-bottom: 10px;
}

.product-quantity-container {
  margin-bottom: 17px;
}

.product-spacer {
  flex: 1;
}

.added-to-cart {
  color: rgb(6, 125, 98);
  font-size: 16px;

  display: flex;
  align-items: center;
  margin-bottom: 8px;

  /* At first, the "Added to cart" message will
     be invisible. Use JavaScript to change the
     opacity and make it visible. */
  opacity: 0;
}
.added-to-cart.display-message{
  opacity: 1;
}

.added-to-cart img {
  height: 20px;
  margin-right: 5px;
}

.add-to-cart-button {
  width: 100%;
  padding: 8px;
  border-radius: 50px;
}



.image-background {
  background-color: rgba(0, 0, 0, 0.8); /* darker backdrop */
  position: fixed; 
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(4px); /*  nice blur effect */
  cursor: pointer;
}

.product-pic-container {
display: flex;
justify-content: center;
align-items: center;
max-width: 45vw;
height: 55vh;
/* border-radius: 20px; */
}

.js-image-full-view {
  max-width: 100%;
  max-height: 100%;
  border-radius: 20px; 
  cursor: zoom-in;
}

@media (orientation: portrait){
  .product-pic-container {
display: flex;
justify-content: center;
align-items: center;
max-width: 80vw;
height: 60vh;
}
}

.products-grid.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 80vh; 
  min-height: 70vh;         
  overflow: hidden;
}

/* empty-state box */
.no-results {
  text-align: center;
  color: #444;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.no-results-img { 
  width: 16em;
   opacity: 1; 
}

.no-results-text { 
  font-size: 1.2rem;
   font-weight: 500;
}

.no-results-btn {
  padding: .6rem 1.1rem;
  border: 0;
  border-radius: 6px;
  background: #0073e6;
  color: #fff;
  cursor: pointer;
}

.no-results-btn:hover { 
  background: #005bb5; 
}


/* FAKE PAGE REFRESH EFFECT */
.refresh-effect {
  animation: refreshFade 0.6s ease;
  position:relative;
  z-index: -2;
  will-change: transform, opacity;  /* hint browser for smoother animation */
}


@keyframes refreshFade {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  40% {
    opacity: 0.3;
    transform: translateY(5px); 
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
