/* RESET & BASE */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Poppins", sans-serif;
  background: #f8f9fa;
  color: #333;
  line-height: 1.6;
  overflow-x: hidden;
}

/* HERO SECTION */
.hero {
  position: relative;
  height: 100vh;
  background: url('https://images.unsplash.com/photo-1711743266323-5badf42d4797?auto=format&fit=crop&w=1600&q=80')
    center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.overlay {
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
}

.hero-content {
  position: relative;
  color: #fff;
  z-index: 2;
  padding: 20px;
  border-radius: 10px;
  backdrop-filter: blur(3px);
}

.hero-content h1 {
  font-size: clamp(1.8rem, 5vw, 3rem);
  margin-bottom: 20px;
}

/* SEARCH FORM */
#searchForm {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

#searchForm input,
#searchForm button {
  padding: 12px 15px;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  outline: none;
  transition: all 0.3s ease;
}

#searchForm input {
  width: 220px;
  max-width: 90%;
}

#searchForm button {
  background-color: #0a5c36;
  color: #fff;
  cursor: pointer;
}

#searchForm button:hover {
  background-color: #097a45;
  transform: translateY(-2px);
}

/* SECTION WRAPPER */
.section {
  padding: 70px 5%;
}

.section h2 {
  text-align: center;
  color: #0a5c36;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  margin-bottom: 40px;
}

/* CARD GRID */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 25px;
  justify-items: center;
}

.card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  max-width: 320px;
  width: 100%;
}

.card:hover {
  transform: scale(1.04);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

.card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.card h3 {
  text-align: center;
  padding: 15px 10px;
  color: #222;
  font-weight: 600;
}

/* FOOTER */
footer {
  background-color: #0a5c36;
  color: white;
  text-align: center;
  padding: 20px 10px;
  font-size: 0.95rem;
}

/* ---------------- MEDIA QUERIES ---------------- */

/* Tablets */
@media (max-width: 992px) {
  .hero {
    height: 80vh;
  }
  .hero-content h1 {
    font-size: 2rem;
  }
  #searchForm input {
    width: 180px;
  }
}

/* Mobiles */
@media (max-width: 600px) {
  .hero {
    height: 70vh;
    background-position: center top;
  }

  .hero-content {
    padding: 10px;
  }

  .hero-content h1 {
    font-size: 1.6rem;
  }

  #searchForm {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  #searchForm input,
  #searchForm button {
    width: 90%;
    font-size: 0.9rem;
  }

  .section {
    padding: 50px 20px;
  }

  .card img {
    height: 160px;
  }
}

/* --- MOBILE & TABLET HORIZONTAL SCROLL --- */

/* Tablets and below */
@media (max-width: 992px) {
  /* Override the grid layout */
  .card-grid {
    display: flex !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 15px;
    padding: 10px;
    -webkit-overflow-scrolling: touch;
  }

  .card {
    flex: 0 0 85%;
    scroll-snap-align: start;
    border-radius: 12px;
    max-width: none; /* important override for mobile width */
  }

  .card img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    border-radius: 12px 12px 0 0;
  }

  /* Hide scrollbar */
  .card-grid::-webkit-scrollbar {
    display: none;
  }

  .card h3 {
    font-size: 1rem;
    text-align: left;
    padding-left: 10px;
  }
}

/* Smaller mobiles */
@media (max-width: 600px) {
  .card {
    flex: 0 0 92%;
  }

  .card img {
    height: 200px;
  }
}

