:root {
  --primary: #3a7d44;
  --secondary: #8db38b;
  --accent: #f5cb5c;
  --light: #f8f9fa;
  --dark: #212529;
}

body {
  font-family: "Poppins", sans-serif;
  background-color: #f5f5f5;
}

/* Navbar */
.navbar {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
  font-weight: 700;
  color: var(--primary);
}

.search-bar {
  border-radius: 20px;
  border: 1px solid var(--secondary);
}

.search-btn-mobile {
  border-radius: 50%;
  background-color: var(--primary);
  color: var(--light);
}

.tail {
  width: 0;
  height: 0;
  border-left: 1rem solid transparent;
  border-right: 1rem solid transparent;
  border-bottom: 1.73rem solid var(--light);
  position: absolute;
  top: 100%;
  right: 5rem;
  z-index: 998;
}

#popupRefer {
  transition: all 0.3s ease-in-out;
  opacity: 0;
  pointer-events: none;
  z-index: 999;
}

#popupRefer.show {
  opacity: 1;
  pointer-events: auto;
}

.search-btn {
  border-radius: 20px;
  background-color: var(--primary);
  color: white;
}

.search-popup {
  width: 90%;
  margin: 1rem 0.99rem;
  padding: 1rem;
  background: var(--light);
  border-radius: 5px;
}

/* Hero Section */
.hero-section {
  background: linear-gradient(rgba(58, 125, 68, 0.8), rgba(58, 125, 68, 0.8)),
    url("../assets/background-sawah.jpg") center/cover no-repeat;
  height: 400px;
  color: white;
}

.hero-title {
  font-weight: 700;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Product Section */
.product-img {
  height: 200px;
  object-fit: cover;
}

.product-title {
  font-weight: 600;
  color: var(--dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-price {
  color: var(--primary);
  font-weight: 700;
}

.product-location {
  font-size: 0.85rem;
  color: #6c757d;
  display: flex;
  gap: 8px;
  align-items: center;
}

.product-rating {
  color: var(--accent);
  font-size: 0.9rem;
}

.text-sm {
  font-size: 0.75rem;
}

/* Category Section */
.category-item {
  text-align: center;
  padding: 15px;
  border-radius: 10px;
  transition: all 0.3s;
}

.category-item:hover {
  background-color: var(--secondary);
  color: white;
  cursor: pointer;
}

.category-icon {
  font-size: 2rem;
  margin-bottom: 10px;
  color: var(--primary);
}

/* Footer */
.footer {
  background-color: var(--primary);
  color: white;
  padding: 40px 0;
}

.footer-title {
  font-weight: 600;
  margin-bottom: 20px;
}

.footer-link {
  color: #adb5bd;
  text-decoration: none;
  display: block;
  margin-bottom: 8px;
  transition: color 0.3s;
}

.footer-link:hover {
  color: white;
}

/* Handle Scroll */
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

.scroll-container {
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  position: relative;
}

.scroll-container > .card {
  scroll-snap-align: start;
}

.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.wrapper-promo {
  position: relative;
}

.wrapper-promo::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 60px;
  height: 100%;
  background: linear-gradient(to left, #d1e7dd, rgba(209, 231, 221, 0));
  z-index: 10;
  pointer-events: none;
}

/* Related Product */
.related-produk {
  height: 150px;
  object-fit: contain;
}

/* Others */
.image-utama {
  object-fit: contain;
  max-height: 400px;
}

.image-thumbnail-container {
  left: 9px;
  bottom: 0;
}

.image-thumbnail {
  width: 80px;
  height: 80px;
  object-fit: cover;
}

.text-size-1 {
  font-size: 1rem;
}

.badge-diskon {
  background: linear-gradient(to right, #ff416c, #ff4b2b);
  color: white;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 10px;
  font-weight: 500;
}

.text-gray {
  color: gray;
}

.star {
  cursor: pointer;
  color: #ccc;
  transition: 0.2s;
}
.star.hover,
.star.selected {
  color: var(--accent);
}

/* Cart */
.cartContainer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--light);
  box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.2);
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  transform: translateY(100%);
  transition: transform 0.4s ease;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  height: 60vh;
}

.cartContainer.show {
  transform: translateY(0);
}

.cartContainer.fullScreen {
  height: 100vh;
  border-radius: 0;
}

.cart-product img {
  width: 60px;
  height: 60px;
  object-fit: cover;
}

.product-item img {
  height: 200px;
  object-fit: cover;
}

.cursor-pointer {
  cursor: pointer;
}

/* Search Suggest */
#saranSearchDesktop,
#saranSearchMobile {
  max-height: 200px;
  overflow-y: auto;
  width: 100%;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  background: var(--light);
  animation: fastDisplay 0.2s ease-in-out;
  z-index: 9999;
}

#saranSearchDesktop {
  top: 100%;
  left: 0;
  right: 0;
  border-radius: 8px;
  margin-top: 4px; 
}

#saranSearchMobile {
  margin-top: 4px;
}

#saranSearchDesktop li,
#saranSearchMobile li {
  cursor: pointer;
  padding: 10px 15px;
  transition: background 0.2s;
}

#saranSearchMobile li:hover,
#saranSearchMobile li:hover {
  background: #f1f1f1;
}

@keyframes fastDisplay {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Media Query */
@media screen and (max-width: 768px) {
  .md\:fs-80 {
    font-size: 90%;
  }
  .hero-section {
    height: 300px;
  }

  .product-img {
    height: 150px;
  }
}

@media screen and (max-width: 1080px) {
  .lg\:fs-normal {
    font-size: 100%;
  }
}

@media screen and (max-width: 450px) {
  .sm\:fs-70 {
    font-size: 80%;
  }
}
