/* ========== GLOBAL STYLES ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  color: #1e1e1e;
  background-color: #ffffff;
  scroll-behavior: smooth;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

img {
  width: 100%;
  border-radius: 12px;
  object-fit: cover;
}

/* ========== NAVBAR ========== */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 10%;
  background-color: #ffffff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 999;
}

.navbar .logo {
  font-size: 1.8rem;
  font-weight: 700;
  color: #2d6a4f;
  text-decoration: none;
}

.navbar nav ul {
  display: flex;
  gap: 2rem;
}

.navbar nav a {
  color: #333;
  font-weight: 500;
  transition: 0.3s ease;
}

.navbar nav a:hover {
  color: #2d6a4f;
}

/* ========== HERO SECTION ========== */
.hero {
  height: 90vh;
  background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('../images/hero-bg.jpg') center/cover no-repeat;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  text-align: center;
  padding: 0 20px;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
}

.cta-btn {
  background-color: #2d6a4f;
  color: #fff;
  padding: 12px 28px;
  border-radius: 30px;
  font-weight: 600;
  transition: 0.3s;
}

.cta-btn:hover {
  background-color: #40916c;
}

/* ========== ABOUT PREVIEW ========== */
.about-preview {
  padding: 60px 10%;
  background-color: #f7fdf9;
  text-align: center;
}

.about-preview h2 {
  font-size: 2.2rem;
  margin-bottom: 1rem;
  color: #2d6a4f;
}

.about-preview p {
  font-size: 1.1rem;
  max-width: 700px;
  margin: 0 auto 1.5rem;
  line-height: 1.6;
}

.learn-more {
  color: #2d6a4f;
  font-weight: 600;
  font-size: 1rem;
}

/* ========== PRODUCT HIGHLIGHT ========== */
.product-highlight {
  padding: 60px 10%;
  background-color: #ffffff;
  text-align: center;
}

.product-highlight h2 {
  font-size: 2.2rem;
  margin-bottom: 2rem;
  color: #2d6a4f;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 2rem;
}

.product-card {
  background-color: #f1fdf3;
  padding: 20px;
  border-radius: 16px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.product-card h3 {
  margin-top: 15px;
  color: #1e5128;
}

.view-all-btn {
  display: inline-block;
  margin-top: 30px;
  background-color: #2d6a4f;
  color: #fff;
  padding: 10px 22px;
  border-radius: 25px;
  font-weight: 500;
  transition: 0.3s ease;
}

.view-all-btn:hover {
  background-color: #40916c;
}

/* ========== CLIENT LOGOS ========== */
.clients {
  padding: 60px 10%;
  background-color: #f0f0f0;
  text-align: center;
}

.clients h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
  color: #2d6a4f;
}

.logo-grid {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
}

.logo-grid img {
  width: 120px;
  opacity: 0.8;
  transition: 0.3s;
}

.logo-grid img:hover {
  opacity: 1;
}

/* ========== FOOTER ========== */
footer {
  background-color: #2d6a4f;
  color: #ffffff;
  text-align: center;
  padding: 20px 10%;
}

.app-note {
  margin-top: 6px;
  font-style: italic;
  color: #d8f3dc;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .navbar nav ul {
    flex-direction: column;
    gap: 1rem;
    background-color: #ffffff;
    padding: 1rem;
    position: absolute;
    top: 70px;
    right: 10%;
    display: none; /* Can be toggled with JS */
  }
}

.product-catalogue {
  padding: 60px 10%;
  background-color: #f9fff9;
  text-align: center;
}

.product-catalogue h1 {
  font-size: 2.5rem;
  color: #2d6a4f;
}

.subtitle {
  font-size: 1.1rem;
  margin: 10px auto 40px;
  color: #555;
}

.main-products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.main-product {
  background: #e9fce9;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.main-product h2 {
  color: #1b4332;
  margin-bottom: 12px;
}

.sub-products li {
  color: #333;
  padding: 6px 0;
  font-size: 0.95rem;
}


.about-us {
  padding: 60px 10%;
  background-color: #fff;
}

.about-container {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  align-items: center;
  justify-content: space-between;
}

.about-text {
  flex: 1;
}

.about-text h1 {
  font-size: 2.2rem;
  margin-bottom: 20px;
  color: #2d6a4f;
}

.about-text p {
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 12px;
}

.about-img {
  flex: 1;
}

.about-img img {
  width: 100%;
  border-radius: 16px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* Vision */
.vision {
  background-color: #f0fff4;
  padding: 50px 10%;
  text-align: center;
}

.vision h2 {
  color: #2d6a4f;
  font-size: 2rem;
  margin-bottom: 16px;
}

.vision p {
  max-width: 700px;
  margin: auto;
  font-size: 1.05rem;
  color: #444;
}

/* Timeline / Journey */
.journey {
  padding: 50px 10%;
  background-color: #f7fdf9;
  text-align: center;
}

.journey h2 {
  font-size: 2rem;
  color: #2d6a4f;
  margin-bottom: 20px;
}

.timeline {
  list-style: none;
  max-width: 700px;
  margin: auto;
  padding-left: 0;
  text-align: left;
}

.timeline li {
  position: relative;
  padding: 10px 0 10px 25px;
  border-left: 3px solid #2d6a4f;
  margin-bottom: 12px;
}

.timeline li span {
  font-weight: bold;
  color: #2d6a4f;
  margin-right: 10px;
}

.contact-section {
  padding: 60px 10%;
  background-color: #f9fff9;
  text-align: center;
}

.contact-section h1 {
  font-size: 2.5rem;
  color: #2d6a4f;
  margin-bottom: 8px;
}

.contact-container {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  justify-content: space-between;
  margin-top: 40px;
}

.contact-details, .contact-form {
  flex: 1;
  min-width: 300px;
  text-align: left;
}

.contact-details h2 {
  color: #1b4332;
  margin-bottom: 16px;
}

.contact-details p {
  margin-bottom: 10px;
}

.whatsapp-btn {
  display: inline-block;
  margin-top: 12px;
  background-color: #25d366;
  color: white;
  padding: 10px 20px;
  border-radius: 25px;
  font-weight: 600;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 12px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-family: 'Poppins', sans-serif;
}

.contact-form button {
  background-color: #2d6a4f;
  color: white;
  padding: 12px 28px;
  border: none;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
}

.contact-form button:hover {
  background-color: #40916c;
}

.map-container {
  margin-top: 50px;
  border-radius: 12px;
  overflow: hidden;
}



/* Mobile navbar styles */
/* Mobile Navigation (default hidden) */
#nav-menu {
  display: flex;
  gap: 2rem;
}

@media (max-width: 768px) {
  .navbar {
    position: relative;
  }

  #nav-menu {
    position: fixed;
    top: 70px;
    right: -100%;
    background-color: white;
    height: calc(100% - 70px);
    width: 220px;
    flex-direction: column;
    align-items: flex-start;
    padding: 30px 20px;
    gap: 1.5rem;
    box-shadow: -4px 0 10px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    z-index: 1000;
  }

  #nav-menu.active {
    right: 0;
  }

  .hamburger {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 21px;
    cursor: pointer;
  }

  .hamburger span {
    height: 3px;
    background: #2d6a4f;
    border-radius: 2px;
  }
}


/* css for clients */

.clients {
  text-align: center;
  padding: 60px 20px;
}

.clients h2 {
  font-size: 2em;
  margin-bottom: 30px;
}

.carousel-container {
  position: relative;
  max-width: 900px;
  margin: auto;
  overflow: hidden;
}

.carousel-track {
  display: flex;
  transition: transform 0.4s ease-in-out;
}

.client {
  flex: 0 0 calc(100% / 3); /* Default: 3 per view */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.client p {
  font-size: 0.85em;
  color: #444;
  margin: 0;
  line-height: 1.3em;
}

.client img {
  max-width: 150px;
  height: auto;
  margin-bottom: 8px;
}

.arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: #ffffffcc;
  border: none;
  padding: 10px;
  cursor: pointer;
  font-size: 2em;
  z-index: 10;
}

.arrow.left {
  left: 0;
}

.arrow.right {
  right: 0;
}

/* Tablet */
@media (max-width: 768px) {
  .client {
    flex: 0 0 calc(100% / 2); /* 2 per view */
  }
}

/* Mobile */
@media (max-width: 480px) {
  .client {
    flex: 0 0 100%; /* 1 per view */
  }
}


/* ========== MODAL STYLES ========== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* MODIFIED FOR SCROLLING */
.modal-content {
  background-color: #ffffff;
  padding: 30px;
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  position: relative;
  transform: translateY(-30px);
  transition: transform 0.3s ease;
  max-height: 85vh; /* Prevents the modal from being taller than the screen */
  display: flex; /* Helps organize the content inside */
  flex-direction: column; /* Stacks title, list, and button vertically */
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  font-size: 2rem;
  color: #888;
  cursor: pointer;
}

.modal-content h2 {
  color: #2d6a4f;
  margin-bottom: 15px;
}

/* MODIFIED FOR SCROLLING */
#modal-items-list {
  list-style: none;
  padding: 0;
  margin: 20px 0;
  text-align: left;
  overflow-y: auto; /* This is the key part that adds the scrollbar */
  padding-right: 15px; /* Adds some space for the scrollbar */
  border-top: 1px solid #eee; /* Adds a nice visual separator */
  border-bottom: 1px solid #eee; /* Adds a nice visual separator */
}

#modal-items-list li {
  padding: 8px 0;
  font-size: 1.1rem;
}

#modal-items-list input[type="checkbox"] {
  margin-right: 12px;
  transform: scale(1.2);
}

#modal-items-list label {
  cursor: pointer;
}

/* Make product cards on products.html clickable */
.main-product {
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.main-product:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.main-product p {
  color: #555;
  font-size: 0.9rem;
}

/* Quote form specific styles */
.quote-form input, .quote-form textarea {
  width: 100%;
  padding: 12px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-family: 'Poppins', sans-serif;
}

.quote-form button {
  width: 100%;
  background-color: #2d6a4f;
  color: white;
  padding: 12px 28px;
  border: none;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.quote-form button:hover {
  background-color: #40916c;
}

.selected-items-display {
  background-color: #f7fdf9;
  border-left: 4px solid #2d6a4f;
  padding: 10px 15px;
  margin-bottom: 20px;
  text-align: left;
}

.selected-items-display strong {
    color: #1b4332;
}

/* Homepage product card link style */
.product-card-link {
  text-decoration: none;
  color: inherit;
}


/* ========== SEARCH BAR STYLES ========== */
.search-container {
    margin: 30px auto 40px;
    max-width: 600px;
}

#productSearch {
    width: 100%;
    padding: 15px 20px;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 30px;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: border-color 0.3s, box-shadow 0.3s;
}

#productSearch:focus {
    outline: none;
    border-color: #2d6a4f;
    box-shadow: 0 4px 12px rgba(45, 106, 79, 0.2);
}

/* ========== QUOTE CART STYLES ========== */
.quote-cart-container {
  position: relative;
}

.quote-cart-btn {
  background-color: #e9fce9;
  color: #1b4332;
  border: 1px solid #2d6a4f;
  padding: 8px 16px;
  border-radius: 20px;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.quote-cart-btn:hover {
  background-color: #2d6a4f;
  color: #fff;
}

.quote-cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background-color: #d00000;
  color: white;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.8rem;
  font-weight: bold;
  transform: scale(0); /* Hidden by default */
  transition: transform 0.2s ease;
}

.quote-cart-count.visible {
  transform: scale(1); /* Visible when items are in cart */
}

/* ========== PRODUCTS: DYNAMIC CATEGORY CARDS ========== */
.main-product.coming-soon {
  cursor: default;
  opacity: 0.55;
}

.main-product.coming-soon:hover {
  transform: none;
  box-shadow: none;
}

.category-icon {
  width: 100px;
  height: 100px;
  margin: 0 auto 12px;
}

.category-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
}

.category-icon-fallback {
  font-size: 2.4rem;
  line-height: 100px;
  height: 100px;
  margin: 0 auto 12px;
  text-align: center;
}

/* ========== MODAL: clickable breadcrumb ========== */
.breadcrumb-link {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color 0.2s ease;
}

.breadcrumb-link:hover {
  text-decoration-color: currentColor;
}

.breadcrumb-sep {
  color: #999;
  font-weight: 400;
}

/* ========== SEARCH AUTOCOMPLETE (main products page search) ========== */
.search-container {
  position: relative;
  /* z-index here (not just on the dropdown) forces this whole block into its
     own stacking context, so it always paints above the category cards below
     it — even though AOS applies a transform to those cards that would
     otherwise let them win against a dropdown z-index set on its own. */
  z-index: 100;
}

.autocomplete-box {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #e2e2e2;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  max-height: 340px;
  overflow-y: auto;
  z-index: 100;
  text-align: left;
}

.autocomplete-box.active {
  display: block;
}

.autocomplete-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  cursor: pointer;
  border-bottom: 1px solid #f1f1f1;
  transition: background-color 0.15s ease;
}

.autocomplete-row:last-child {
  border-bottom: none;
}

.autocomplete-row:hover {
  background-color: #f1fdf3;
}

.autocomplete-item-name {
  font-weight: 600;
  color: #1e1e1e;
}

.autocomplete-breadcrumb {
  font-size: 0.8rem;
  color: #2d6a4f;
  white-space: nowrap;
  flex-shrink: 0;
}

.autocomplete-empty {
  padding: 14px 18px;
  color: #777;
  font-size: 0.95rem;
}

/* ========== MODAL: back button + in-modal search ========== */
.modal-back {
  display: none;
  background: none;
  border: none;
  color: #2d6a4f;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0 0 10px 0;
  align-self: flex-start;
}

.modal-search-container {
  margin-bottom: 10px;
}

.modal-search-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 20px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
}

.modal-search-input:focus {
  outline: none;
  border-color: #2d6a4f;
}

/* Subcategory list (level 1, shown for categories like Rice) */
.modal-subcat-list {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow-y: auto;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
}

.subcat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 4px;
  border-bottom: 1px solid #f1f1f1;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.15s ease;
}

.subcat-item:last-child {
  border-bottom: none;
}

.subcat-item:hover {
  background-color: #f7fdf9;
}

.subcat-count {
  font-size: 0.85rem;
  color: #2d6a4f;
  font-weight: 400;
}

.no-results {
  padding: 20px 4px;
  color: #888;
  text-align: center;
  list-style: none;
}

/* Highlighted item when arriving from the main search autocomplete */
.highlight-item {
  background-color: #d8f3dc;
  border-radius: 8px;
  padding: 4px 8px;
  display: block;
}

/* ========== LOGO FALLBACK (shown when a brand/partner image isn't uploaded yet) ========== */
.logo-fallback {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background-color: #2d6a4f;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.4rem;
  margin: 0 auto 8px;
}

.dealer-card .logo-fallback,
.dealer-card img {
  width: 110px;
  height: 110px;
}

/* ========== AUTHORISED DEALER PAGE ========== */
.dealer-section {
  padding: 60px 10%;
  background-color: #f9fff9;
  text-align: center;
}

.dealer-section h1 {
  font-size: 2.4rem;
  color: #2d6a4f;
  margin-bottom: 10px;
}

.dealer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  margin-top: 40px;
}

.dealer-card {
  background-color: #ffffff;
  padding: 30px 20px;
  border-radius: 16px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dealer-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.1);
}

.dealer-card img {
  width: 110px;
  height: 110px;
  object-fit: contain;
  border-radius: 12px;
  margin: 0 auto 14px;
  display: block;
}

.dealer-card h3 {
  color: #1b4332;
  font-size: 1.05rem;
}
