:root{
  --brand: #1b4332;
  --brand-2: #2d6a4f;
  --accent: #40916c;
  --bg: #f6fbf7;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;

  --gap: 1rem;
  --radius: 0.75rem;
  font-size: 16px; /* 1rem = 16px */
}

/* Reset */
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  line-height:1.4;
  font-size:1rem;
}

/* Layout */
.site{min-height:100vh;display:flex;flex-direction:column}
.topbar{
  display:flex;
  align-items:center;
  gap:1rem;
  padding:1rem 1.5rem;
  background: #eafaf1;
  border-bottom: 0.0625rem solid rgba(0,0,0,0.04);
}
.brand{
  color:var(--brand);
  font-weight:800;
  font-size:1.375rem; /* ~22px */
  letter-spacing:0.02rem;
}

/* Search */
.search{margin-left:auto;display:flex;gap:0.5rem;align-items:center}
.search input{
  padding:0.5rem 0.75rem;
  border-radius:0.5rem;
  border:0.0625rem solid #e5e7eb;
  width:20rem; /* use rem-friendly widths */
  font-size:0.9375rem;
}
.btn{
  background:var(--accent);
  color:white;
  border:none;
  padding:0.48rem 0.9rem;
  border-radius:0.5rem;
  cursor:pointer;
  font-weight:600;
  font-size:0.9375rem;
}
.btn.secondary{background:var(--brand-2)}

/* Main container */
.container{
  max-width:72rem; /* ~1152px */
  margin:1rem auto;
  padding:0 1rem;
  width:100%;
}

/* Map */
#map{
  width:100%;
  height:18.75rem; /* 300px -> 18.75rem */
  border-radius:var(--radius);
  box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,0.06);
}

/* Section title */
.section-title{
  color:var(--brand-2);
  margin:1rem 0 0.5rem;
  font-size:1.125rem;
  font-weight:700;
}

/* Product grid */
.productGrid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap:1rem;
  margin-top:0.75rem;
}

/* Card */
.product-card{
  background:var(--card);
  border:0.0625rem solid #eef2f7;
  border-radius:0.875rem;
  box-shadow: 0 0.125rem 0.5rem rgba(0,0,0,0.04);
  padding:1rem;
  display:flex;
  flex-direction:column;
  gap:0.5rem;
  transition: transform 150ms ease, box-shadow 150ms ease;
}
.product-card:hover{
  transform:translateY(-0.25rem);
  box-shadow:0 0.5rem 1rem rgba(64,145,108,0.12);
}
.main-img{
  width:100%;
  height:11.25rem; /* 180px -> 11.25rem */
  object-fit:contain;
  border-radius:0.5rem;
  background:#f8f8f8;
  padding:0.4rem;
}
.product-card h5{
  margin:0;
  color:var(--brand-2);
  font-size:1rem;
  font-weight:700;
}
.meta{color:var(--muted);font-size:0.875rem}
.price{font-weight:700;color:var(--brand);font-size:0.9375rem}
.badge {
  display: inline-block;
  width: auto;                  /* ensures it stays short */
  padding: 0.25rem 0.6rem;      /* balanced padding */
  border-radius: 0.5rem;
  background: var(--accent);    /* teal or brand color */
  color: #fff;
  font-weight: 700;
  font-size: 0.75rem;
  margin-top: 0.3rem;
  align-self: flex-start;       /* keeps it on the left */
  text-align: left;
  white-space: nowrap;          /* prevents it from breaking */
}

/* Actions */
.product-actions{display:flex;gap:0.5rem;margin-top:auto}
.product-actions .view{background:var(--accent);color:#fff;padding:0.5rem;border-radius:0.5rem;flex:1;text-align:center;text-decoration:none;display:inline-block}
.product-actions .track{background:var(--brand-2);color:#fff;padding:0.5rem;border-radius:0.5rem;flex:1;text-align:center;display:inline-block}

/* No products */
.noProducts{color:var(--muted);font-size:1rem;margin-top:1rem;text-align:center}

/* Fix image modal cropping */
#storePreviewModal {
  display: none;
  align-items: center;
  justify-content: center;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 9999;
}

#storePreviewModal img {
  max-width: 90vw;       /* limit within screen width */
  max-height: 90vh;      /* limit within screen height */
  width: auto;            /* maintain natural width */
  height: auto;           /* maintain natural height */
  object-fit: contain;    /* show entire image */
  border-radius: 0.5rem;
  background: white;
  box-shadow: 0 0 15px rgba(0,0,0,0.4);
}

/* Responsive */
@media (max-width:48rem){
  .search input{width:12rem}
  #map{height:15rem}
  .productGrid{grid-template-columns:repeat(auto-fill,minmax(13rem,1fr))}
}
/* 🩺 Top Navbar */
.navbar {
  background-color: #edf9f4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid #cce3db;
}

.navbar-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.brand {
  font-weight: 800;
  color: #004d40;
  text-decoration: none;
  font-size: 1.5rem;
}

.nav-links {
  display: flex;
  gap: 1rem;
}

.nav-link {
  color: #004d40;
  font-weight: 500;
  text-decoration: none;
}

.nav-link.active {
  font-weight: 700;
  text-decoration: underline;
}

.search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search input {
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  width: 240px;
}

.btn {
  background-color: transparent;
  color: #004d40;
  font-weight: 600;
  border: none;
  cursor: pointer;
}


/* Responsive layout */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
  }
  .navbar-left {
    justify-content: space-between;
    width: 100%;
  }
  .search {
    width: 100%;
    margin-top: 0.5rem;
  }
  .search input {
    flex: 1;
    width: 100%;
  }
}
/* 🏪 Store Info Card */
.store-info-card {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.store-card {
  background: var(--card);
  border: 0.0625rem solid #e5e7eb;
  border-radius: var(--radius);
  box-shadow: 0 0.25rem 1rem rgba(0,0,0,0.06);
  padding: 1.5rem;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 2rem;
  max-width: 64rem; /* ~1024px */
  width: 100%;
}

.store-image {
  width: 20rem;
  height: 15rem;
  object-fit: cover;
  border-radius: var(--radius);
  cursor: pointer;
}

.store-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.store-details h2 {
  font-size: 1.75rem;
  color: var(--brand-2);
  margin: 0 0 0.5rem 0;
}

.store-details p {
  font-size: 1rem;
  color: var(--text);
  margin: 0.25rem 0;
}

@media (max-width: 48rem) {
  .store-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .store-image {
    width: 100%;
    height: auto;
  }

  .store-details {
    align-items: center;
  }
}
/* 📱 Compact Product & Store Cards for Mobile */
@media (max-width: 600px) {

  /* Reduce grid gap and card width */
  .productGrid {
    grid-template-columns: repeat(2, 1fr); /* 2 cards per row */
    gap: 0.6rem;
  }

  /* Product card */
  .product-card {
    padding: 0.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  }

  /* Product image smaller */
  .main-img {
    height: 7rem; /* smaller images like in Shopee */
    padding: 0.25rem;
  }

  /* Text smaller */
  .product-card h5 {
    font-size: 0.8rem;
  }

  .meta {
    font-size: 0.7rem;
  }

  .price {
    font-size: 0.8rem;
  }

  .badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
  }

  .product-actions a {
    font-size: 0.75rem;
    padding: 0.4rem;
  }

  /* Store cards compact too */
  .store-card {
    flex-direction: column;
    padding: 0.75rem;
    gap: 0.75rem;
  }

  .store-image {
    width: 100%;
    height: 8rem;
    border-radius: 0.5rem;
    object-fit: cover;
  }

  .store-details h2 {
    font-size: 1rem;
  }

  .store-details p {
    font-size: 0.8rem;
  }
}
/* 🧭 PAGINATION STYLES — visible on all devices */
.pagination-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem auto;
  padding: 0.75rem 0;
  width: 100%;
  text-align: center;
  background: transparent;
}

.pagination-controls button {
  background-color: var(--accent);
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 2.5rem;
}

.pagination-controls button:hover {
  background-color: var(--brand-2);
  transform: translateY(-2px);
}

.pagination-controls button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.pagination-controls span {
  color: var(--brand);
  font-weight: 600;
  font-size: 0.95rem;
}

/* 🧠 Store Product Search */
.store-search {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.store-search input {
  width: 100%;
  max-width: 22rem;
  padding: 0.6rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid #ccc;
  font-size: 1rem;
  background: #fff;
  color: #1f2937;
}

.store-search button {
  background-color: var(--accent);
  color: #fff;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}

.store-search button:hover {
  background-color: var(--brand-2);
}

/* Responsive layout */
@media (max-width: 600px) {
  .store-search {
    flex-direction: column;
    align-items: stretch;
    padding: 0 1rem;
  }

  .store-search input,
  .store-search button {
    width: 100%;
  }
}


/* 📱 Responsive pagination on mobile devices */
@media (max-width: 768px) {
  .pagination-controls {
    flex-direction: row;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    position: relative;
  }

  .pagination-controls button {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
  }

  section {
    overflow: visible !important;
    padding-bottom: 5rem; /* keeps space below product grid */
  }
}

/* 📱 Even smaller screens (mobile ~400px) */
@media (max-width: 420px) {
  .pagination-controls {
    flex-direction: column;
    gap: 0.5rem;
  }

  .pagination-controls button {
    width: 80%;
  }

  .pagination-controls span {
    font-size: 0.85rem;
  }
}

