/* 🌿 RESET */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", sans-serif;
}

body {
  background: #fff;
  color: #333;
}

/* 🔹 NAVBAR */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 8%;
  background: #19a34a;
  color: white;
  flex-wrap: wrap; 
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo img {
  width: 45px;
  height: 45px;
  border-radius: 50%;
}

nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

nav a {
  color: white;
  margin: 0 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.15rem;
  padding: 6px 14px;
  border-radius: 6px;
  transition: background 0.3s, color 0.3s;
}

nav a:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

/* Container for Cart and Menu Icon */
.nav-controls {
  display: flex;
  align-items: center;
  gap: 15px;
}

.cart-btn {
  background: white;
  color: #19a34a;
  border: none;
  padding: 8px 18px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

/* Menu Icon: Hidden by default (desktop/web view) */
.menu-icon {
  display: none; 
  font-size: 1.5rem;
  cursor: pointer;
  padding: 5px 10px;
}

/* 🔹 HERO */
.hero {
  position: relative;
  text-align: center;
  padding: 100px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  color: white;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: url('images/hero-bg.png') center/cover no-repeat;
  opacity: 0.35; 
  z-index: -1;
}

.hero-content h2 {
  font-size: 2.2rem;
  color: #19a34a;
  margin-bottom: 15px;
}

.hero-content p {
  max-width: 600px;
  margin: auto;
  margin-bottom: 25px;
  line-height: 1.5;
  color: #333333;
}

.shop-now {
  background: #19a34a;
  color: white;
  text-decoration: none;
  padding: 12px 28px;
  border-radius: 8px;
  font-weight: bold;
  display: inline-block;
  transition: background 0.3s;
}

.shop-now:hover {
  background: #138b3f;
}

/* 🔹 ABOUT */
.about {
  text-align: center;
  padding: 50px 10%;
}

.about h2 {
  font-size: 2rem;
  margin-bottom: 20px;
}

.about p {
  max-width: 700px;
  margin: auto;
  line-height: 1.6;
  color: #444;
}

/* 🔹 PRODUCTS */
.products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  padding: 50px 10%;
}

.product {
  background: white;
  border-radius: 15px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  text-align: center;
  padding: 15px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative; 
}

.product:hover {
  transform: translateY(-6px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.product img {
  width: 100%;
  height: 200px;
  /* FIX: Change object-fit from 'cover' to 'contain' to ensure the full image is visible without cropping */
  object-fit: contain; 
  border-radius: 10px;
  margin-bottom: 12px;
  transition: opacity 0.4s ease;
}

.product-info {
  background: #f7f7f7;
  border-radius: 10px;
  padding: 20px;
  margin: 20px 10%;
  text-align: center;
  font-size: 1rem;
  color: #555;
  line-height: 1.5;
}

.product-info strong {
  color: #19a34a;
}

.qty-control {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 10px;
  gap: 10px;
}

.qty-control button {
  background: #19a34a;
  color: white;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 1.1rem;
  cursor: pointer;
}

.qty-control span {
  font-weight: bold;
}

/* Buy Now Button Style - Increased specificity for stability */
.product .buy-now-btn {
  background: #19a34a;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
  transition: background 0.3s;
  width: 100%; 
}

.product .buy-now-btn:hover {
  background: #138b3f;
}

/* 🔹 CART PANEL */
.cart-panel {
  position: fixed;
  right: -400px;
  top: 0;
  height: 100%;
  width: 350px;
  background: white;
  box-shadow: -3px 0 10px rgba(0,0,0,0.1);
  padding: 20px;
  transition: right 0.3s ease;
  overflow-y: auto;
  z-index: 9999;
}

.cart-panel.active {
  right: 0;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hide-cart-btn {
  background: #19a34a;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.cart-item img {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  object-fit: cover;
}

.checkout-btn {
  background: #19a34a;
  color: white;
  border: none;
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  margin-top: 15px;
  font-weight: 600;
  cursor: pointer;
}

/* 🔹 BUYER POPUP */
.buyer-popup {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.popup-content {
  background: white;
  border-radius: 12px;
  padding: 25px;
  width: 90%;
  max-width: 420px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
  position: relative;
}

.close-popup {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 1.8rem;
  color: #666;
  cursor: pointer;
}

#buyerForm {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#buyerForm input {
  padding: 9px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.9rem;
}

#buyerForm button {
  background: #19a34a;
  color: white;
  border: none;
  padding: 10px;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 8px;
}

/* 🔹 BENEFITS */
.benefits {
  padding: 50px 10%;
  text-align: center;
}

.benefits h2 {
  font-size: 2rem;
  margin-bottom: 25px;
}

.benefit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.benefit-card {
  background: #f7f7f7;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}

/* 🔹 CONTACT */
.contact {
  padding: 50px 10%;
  text-align: center;
}

.contact a {
  color: #19a34a;
  text-decoration: none;
}

.contact a:hover {
  text-decoration: underline;
}

/* 🔹 FOOTER */
footer {
  text-align: center;
  padding: 20px 10%;
  background: #19a34a;
  color: white;
}

/* NEW: Notification/Toast Style */
.notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
    z-index: 10001;
    font-size: 0.95rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.notification.show {
    opacity: 1;
}

/* 🔹 RESPONSIVE */
@media (max-width: 992px) {
  .navbar {
    padding: 15px 5%;
  }

  /* Show menu icon on mobile/tablet */
  .menu-icon {
    display: block; 
  }
  
  /* STACK CONTROLS VERTICALLY, REVERSE ORDER: Icon on top, Cart button below */
  .nav-controls {
    flex-direction: column-reverse; /* Puts menu-icon (last in HTML) on top */
    align-items: flex-end; /* Aligns both elements to the right */
    gap: 8px; 
    /* Give nav-controls a fixed width to ensure the elements stack properly on the right */
    width: 100px;
  }
  
  /* Ensures the cart button stacks correctly */
  .cart-btn {
      width: 100px; 
      padding: 6px 10px;
  }

  /* Make nav collapsible for tablets */
  nav {
    display: none;
    flex-direction: column;
    width: 100%;
    order: 3; /* Push below logo and controls */
    padding-top: 10px;
  }

  nav.active {
    display: flex;
  }
  
  nav a {
    margin: 5px 0;
    text-align: center;
    border-radius: 4px;
    padding: 10px 14px;
  }
}

@media (max-width: 768px) {
  .hero {
    padding: 60px 20px;
  }

  .hero-content h2 {
    font-size: 1.8rem;
  }

  .products {
    gap: 15px;
    padding: 40px 5%;
  }

  .product img {
    height: 180px;
    object-fit: contain; /* Ensure it stays contained on smaller screens */
  }
  
  /* Full width cart panel on smaller screens */
  .cart-panel {
    width: 100%; 
    right: -100%;
  }
}

@media (max-width: 480px) {
  .hero-content h2 {
    font-size: 1.5rem;
  }

  .products {
    padding: 30px 5%;
  }

  .product img {
    height: 150px;
    object-fit: contain; /* Ensure it stays contained on smallest screens */
  }

  .navbar {
    justify-content: space-between;
  }
}