/* ============================================================
   FreshMart Frontend Styles
   ============================================================ */

:root {
  --primary: #2E7D32;
  --secondary: #4CAF50;
  --accent: #FF9800;
  --bg: #F8FAF7;
  --text: #222222;
  --card-bg: #ffffff;
  --radius: 18px;
  --shadow: 0 6px 24px rgba(46,125,50,0.08);
}

[data-bs-theme="dark"] {
  --bg: #12181a;
  --text: #eaeaea;
  --card-bg: #1b2224;
  --shadow: 0 6px 24px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

a { text-decoration: none; }

/* ---- Top Info Bar ---- */
.top-bar {
  background: var(--primary);
  color: #fff;
  font-size: 0.82rem;
  padding: 6px 0;
}
.top-bar a { color: #fff; opacity: 0.9; }
.top-bar a:hover { opacity: 1; }

/* ---- Main Navbar ---- */
.main-navbar {
  background: var(--card-bg);
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}
.brand-logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
}
.brand-logo i { color: var(--accent); }

.search-bar { position: relative; }
.search-bar input {
  border-radius: 30px;
  padding: 10px 44px 10px 18px;
  border: 1px solid rgba(0,0,0,0.1);
  width: 100%;
}
.search-bar button {
  position: absolute; right: 4px; top: 4px; bottom: 4px;
  border-radius: 30px; border: none; background: var(--primary); color: #fff; padding: 0 16px;
}
.search-suggestions {
  position: absolute; top: 105%; left: 0; right: 0; background: var(--card-bg);
  border-radius: 12px; box-shadow: var(--shadow); z-index: 1001; max-height: 400px; overflow-y: auto; display: none;
}
.search-suggestions .suggestion-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.search-suggestions .suggestion-item:hover { background: rgba(46,125,50,0.06); }
.search-suggestions img { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; }

.nav-icon-btn {
  position: relative;
  color: var(--text);
  font-size: 1.3rem;
}
.nav-icon-btn .badge {
  position: absolute; top: -6px; right: -8px; background: var(--accent);
  font-size: 0.65rem; border-radius: 50%; padding: 2px 6px;
}

/* Category strip */
.category-strip {
  background: var(--card-bg);
  border-top: 1px solid rgba(0,0,0,0.05);
  overflow-x: auto;
  white-space: nowrap;
}
.category-strip a {
  display: inline-block; padding: 10px 16px; color: var(--text); font-size: 0.88rem;
  border-bottom: 3px solid transparent;
}
.category-strip a:hover, .category-strip a.active { color: var(--primary); border-bottom-color: var(--accent); }

/* ---- Cards ---- */
.card, .product-card, .glass-card {
  border-radius: var(--radius);
  border: none;
  box-shadow: var(--shadow);
  background: var(--card-bg);
}

.product-card { overflow: hidden; transition: transform 0.25s ease, box-shadow 0.25s ease; height: 100%; }
.product-card:hover { transform: translateY(-6px); box-shadow: 0 14px 34px rgba(46,125,50,0.16); }
.product-card .img-wrap { position: relative; aspect-ratio: 1/1; overflow: hidden; background: #f2f4f2; }
.product-card .img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.product-card:hover .img-wrap img { transform: scale(1.08); }
.product-card .discount-badge {
  position: absolute; top: 10px; left: 10px; background: var(--accent); color: #fff;
  font-size: 0.72rem; font-weight: 700; padding: 3px 9px; border-radius: 20px;
}
.product-card .wish-btn {
  position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.9); display: flex; align-items: center; justify-content: center; border: none;
  color: #999; transition: color 0.2s;
}
.product-card .wish-btn.active, .product-card .wish-btn:hover { color: #e53935; }
.product-card .body { padding: 14px; }
.product-card .title { font-size: 0.9rem; font-weight: 600; height: 2.6em; overflow: hidden; }
.product-card .price-row { display: flex; align-items: baseline; gap: 8px; }
.product-card .price { font-weight: 700; color: var(--primary); font-size: 1.05rem; }
.product-card .mrp { text-decoration: line-through; color: #999; font-size: 0.82rem; }

.btn-add-cart {
  background: var(--primary); border-color: var(--primary); border-radius: 30px; color: #fff; font-size: 0.85rem;
}
.btn-add-cart:hover { background: var(--secondary); border-color: var(--secondary); color: #fff; }

/* ---- Glass effect (hero overlays, offer popups) ---- */
.glass-effect {
  background: rgba(255,255,255,0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.4);
}

/* ---- Hero Slider ---- */
.hero-slide { border-radius: var(--radius); overflow: hidden; position: relative; height: 380px; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; animation: kenburns 12s ease-in-out infinite alternate; }
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.12); } }
.hero-caption { position: absolute; left: 40px; bottom: 40px; max-width: 420px; padding: 20px 26px; }

/* ---- Section headers ---- */
.section-title { font-weight: 800; font-size: 1.5rem; margin-bottom: 4px; }
.section-subtitle { color: #888; font-size: 0.9rem; }

/* ---- Category pill grid ---- */
.category-pill {
  border-radius: var(--radius);
  text-align: center;
  padding: 18px 10px;
  transition: transform 0.2s ease;
}
.category-pill:hover { transform: translateY(-4px); }
.category-pill img { width: 56px; height: 56px; object-fit: contain; margin-bottom: 8px; }
.category-pill i { font-size: 2rem; color: var(--primary); margin-bottom: 8px; }

/* ---- Countdown timer ---- */
.countdown-box { display: flex; gap: 10px; }
.countdown-box .unit { background: rgba(255,255,255,0.2); border-radius: 10px; padding: 8px 12px; text-align: center; min-width: 56px; }
.countdown-box .unit .num { font-size: 1.3rem; font-weight: 800; }
.countdown-box .unit .label { font-size: 0.65rem; opacity: 0.85; }

/* ---- Filters sidebar ---- */
.filter-card { border-radius: var(--radius); padding: 18px; background: var(--card-bg); box-shadow: var(--shadow); }
.filter-card h6 { font-weight: 700; margin-bottom: 12px; }

/* ---- WhatsApp / Back-to-top FABs ---- */
.fab-btn {
  position: fixed; right: 22px; width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 18px rgba(0,0,0,0.2);
  color: #fff; font-size: 1.4rem; z-index: 999; transition: transform 0.2s;
}
.fab-btn:hover { transform: scale(1.08); color: #fff; }
.fab-whatsapp { bottom: 90px; background: #25D366; }
.fab-top { bottom: 24px; background: var(--primary); display: none; }

/* ---- Footer ---- */
.site-footer { background: #1B3A1F; color: #d7e8d9; margin-top: 60px; }
.site-footer h6 { color: #fff; font-weight: 700; }
.site-footer a { color: #b9d3bc; }
.site-footer a:hover { color: #fff; }
.site-footer .social-icons a {
  width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,0.08);
  display: inline-flex; align-items: center; justify-content: center; margin-right: 8px;
}

/* ---- Scroll reveal ---- */
[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
[data-reveal].revealed { opacity: 1; transform: translateY(0); }

/* ---- Testimonial card ---- */
.testimonial-card { border-radius: var(--radius); padding: 24px; }
.testimonial-card .stars { color: var(--accent); }

@media (max-width: 767px) {
  .hero-slide { height: 220px; }
  .hero-caption { left: 16px; bottom: 16px; padding: 14px 16px; max-width: 260px; }
}
