/*
filename: index.css
author: Kameron D./ Evan L.
student id last four: 3646/ 8804
cs username:
*/

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Nunito', sans-serif;
  background-color: #1a3a16;
  color: #1a3a16;
  padding-top: 50px;
}

/* =========================================
   BACK TO TOP BUTTON
   Button that takes the user to the top
   of the page
   ========================================= */
#goUP {
display: none;
  position: fixed;
  bottom: 20px;
  right: 30px;
  z-index: 99;
  font-size: 14px;
  border: 2px solid #1a3a16;
  background: #c2deba;
  box-shadow: 0 6px 6px rgba(0, 0, 0, 0.6);
  color: #1a3a16;
  cursor: pointer;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* BACK TO TOP BUTTON HOVER EFFECT */
#goUP:hover {
  background-color: #678f62;
  color: #eef5ea;
}

.grid-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
}

/* HERO */
.hero {
  display: grid;
  gap: 20px;
  border-bottom: 2px solid #1a3a16;
  border-radius: 25px;
  padding: 40px 20px;
  background-color: #c0dd97;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.hero-text {
  display: grid;
  gap: 15px;
  justify-items: center;
  text-align: center;
}

.hero h1 {
  font-size: 3rem;
  text-transform: uppercase;
}

.hero p {
  font-size: 1.2rem;
  max-width: 800px;
}

.search {
  display: grid;
  grid-template-columns: 1fr 90px;
  width: 80%;
  max-width: 500px;
  border: 2px solid #1a3a16;
  border-radius: 25px;
  overflow: hidden;
}

.search input {
  border: none;
  padding: 12px;
  font-size: 1rem;
  outline: none;
}

.search button {
  border: none;
  background-color: #dce8d4;
  cursor: pointer;
}

/* =========================================
   LOGO IMAGE BOX
   Container for the Green Thumb
   header image
   ========================================= */
.plantImg {
  height: 100%;
  width: 100%;
  border: 2px solid #1a3a16;
  border-radius: 25px;
  background-color: #eef5ea;
  overflow: hidden;
}

/* HEADER IMAGE STYLING */
.plantImg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 23px;
}

/* BEST SELLERS */
.best-sellers {
  border-top: 2px solid #1a3a16;
  border-bottom: 2px solid #1a3a16;
  border-radius: 25px;
  padding: 20px;
  background-color: #c0dd97;
  display: grid;
  gap: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.best-sellers h2 {
  text-align: center;
  font-size: 2rem;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* Updated for dynamically injected product cards from Search.js */
.product-cards {
  border: 2px solid #1a3a16;
  border-radius: 25px;
  min-height: 350px;
  padding: 15px;
  display: flex; /* changed from grid for cleaner image/text/button stacking */
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  background-color: #eef5ea;
}

/* Added image styling for JSON-driven best seller cards */
.product-cards img {
  width: 100%;
  max-width: 200px;
  height: 200px;
  object-fit: cover;
  display: block;
  margin-bottom: 10px;
  border: 2px solid #1a3a16;
  border-radius: 25px;
  overflow: hidden;
}

/* Added text styling to match new <p> tag in Search.js */
.product-cards p {
  text-align: center;
  margin-bottom: 10px;
  font-size: 1rem;
}

.product-cards button {
  padding: 10px 16px;
  border: none;
  background-color: #7aa874;
  color: white;
  cursor: pointer;
}

/* Added hover state for new best seller buttons */
.product-cards button:hover {
  background-color: #678f62;
}

/* BOTTOM */
.bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.info-box {
  border-top: 2px solid #1a3a16;
  border-radius: 25px;
  background-color: #c0dd97;
  padding: 20px;
  min-height: 550px; /* Adjusted number until the jumping stopped */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .navbar {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 10px;
  }

  .navLinks {
    justify-content: center;
  }

  .nav-icons {
    justify-content: center;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .bottom-grid {
    grid-template-columns: 1fr;
  }
}

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

  .navLinks {
    flex-direction: column;
    gap: 10px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .search {
    width: 100%;
  }
}
