/* ==========================================================================
   FreshKirana Express - Custom Styling & Design System
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --primary: #064e3b;
  --primary-light: #059669;
  --primary-accent: #10b981;
  --primary-soft: #d1fae5;
  --secondary: #0f172a;
  --accent-gold: #d97706;
  --accent-gold-soft: #fef3c7;
  --accent-red: #dc2626;
  --bg-light: #f8fafc;
  --card-bg: #ffffff;
  --border-color: #e2e8f0;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 10px 25px -5px rgba(6, 78, 59, 0.08);
  --shadow-lg: 0 20px 35px -10px rgba(0, 0, 0, 0.12);
  --font-family: 'Plus Jakarta Sans', sans-serif;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-light);
  color: var(--text-main);
  overflow-x: hidden;
  padding-top: 76px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary-light);
}

/* ==========================================================================
   Header & Navbar (Glassmorphism)
   ========================================================================== */
.navbar-custom {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  transition: var(--transition);
  z-index: 1040;
}

.brand-logo {
  font-weight: 800;
  font-size: 1.45rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.brand-logo .badge-express {
  font-size: 0.65rem;
  background: linear-gradient(135deg, #d97706, #b45309);
  color: #fff;
  padding: 4px 8px;
  border-radius: var(--radius-full);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.delivery-pill {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(16, 185, 129, 0.3);
  cursor: pointer;
  transition: var(--transition);
}

.delivery-pill:hover {
  background: #a7f3d0;
  transform: translateY(-1px);
}

.gps-live-btn {
  background: linear-gradient(135deg, #059669, #047857);
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  cursor: pointer;
}

.gps-live-btn:hover {
  background: #064e3b;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.nav-cart-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.nav-cart-btn:hover {
  background: var(--primary-light);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.cart-count-badge {
  background: var(--accent-gold);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  position: relative;
  background: linear-gradient(135deg, #064e3b 0%, #022c22 100%);
  color: #fff;
  border-radius: 28px;
  overflow: hidden;
  margin-top: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-lg);
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 80% 20%, rgba(16, 185, 129, 0.25) 0%, transparent 60%);
  pointer-events: none;
}

.hero-bg-img {
  position: absolute;
  right: -5%;
  bottom: -10%;
  width: 55%;
  height: 120%;
  object-fit: cover;
  opacity: 0.35;
  mask-image: linear-gradient(to left, rgba(0,0,0,1) 30%, rgba(0,0,0,0) 100%);
  -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,1) 30%, rgba(0,0,0,0) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 4rem 3rem;
}

.hero-tagline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  color: #a7f3d0;
  margin-bottom: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-title {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.18;
  margin-bottom: 1.25rem;
}

.hero-title span {
  color: #fde047;
}

.hero-desc {
  font-size: 1.1rem;
  color: #e2e8f0;
  max-width: 520px;
  margin-bottom: 2rem;
}

/* Quick Delivery Search in Hero */
.hero-search-box {
  background: #ffffff;
  padding: 8px;
  border-radius: var(--radius-full);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  max-width: 540px;
}

.hero-search-input {
  border: none;
  outline: none;
  padding: 10px 20px;
  font-size: 1rem;
  width: 100%;
  color: var(--text-main);
  background: transparent;
}

.hero-search-btn {
  background: var(--primary-light);
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  white-space: nowrap;
}

.hero-search-btn:hover {
  background: var(--primary);
}

/* Features Bar Below Hero */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 3rem;
}

.feature-card {
  background: #ffffff;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-soft);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  justify-content: center;
}

.feature-info h6 {
  font-weight: 700;
  margin-bottom: 2px;
  font-size: 0.95rem;
}

.feature-info p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
}

/* ==========================================================================
   Category Filter Section
   ========================================================================== */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-title {
  font-weight: 800;
  font-size: 1.75rem;
  color: var(--secondary);
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 45px;
  height: 4px;
  background: var(--primary-accent);
  border-radius: 2px;
}

.category-scroll-wrapper {
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 2rem;
  -webkit-overflow-scrolling: touch;
}

.category-nav {
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
}

.cat-btn {
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}

.cat-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.cat-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

/* ==========================================================================
   Product Grid & Weight Variant Selection
   ========================================================================== */
.product-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: var(--shadow-sm);
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-soft);
}

.product-img-wrapper {
  position: relative;
  width: 100%;
  padding-top: 75%; /* 4:3 Aspect Ratio */
  background: #f8fafc;
  overflow: hidden;
}

.product-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.product-card:hover .product-img {
  transform: scale(1.06);
}

.badge-discount {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--accent-red);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  z-index: 2;
}

.veg-icon {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 20px;
  height: 20px;
  border: 2px solid #16a34a;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  z-index: 2;
}

.veg-icon::after {
  content: '';
  width: 10px;
  height: 10px;
  background: #16a34a;
  border-radius: 50%;
}

.product-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-cat {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.product-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 8px;
  line-height: 1.3;
}

/* Weight Selector Element */
.weight-selector-box {
  margin-bottom: 12px;
}

.weight-select {
  width: 100%;
  padding: 6px 12px;
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--primary);
  background-color: #ecfdf5;
  border: 1px solid var(--primary-light);
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}

.weight-select:hover, .weight-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.product-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px dashed var(--border-color);
}

.price-wrapper {
  display: flex;
  flex-direction: column;
}

.current-price {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
}

.mrp-price {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

/* Quantity Control in Product Card */
.add-btn {
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid var(--primary-light);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.add-btn:hover {
  background: var(--primary);
  color: #ffffff;
}

.qty-control {
  display: flex;
  align-items: center;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-full);
  padding: 4px;
}

.qty-btn {
  background: transparent;
  border: none;
  color: #fff;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.qty-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.qty-val {
  padding: 0 10px;
  font-weight: 700;
  font-size: 0.9rem;
}

/* ==========================================================================
   3KM Distance Checker Banner & Modal
   ========================================================================== */
.distance-banner {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #f59e0b;
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.75rem;
  margin-bottom: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.distance-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.distance-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #d97706;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.distance-text h6 {
  font-weight: 800;
  color: #78350f;
  margin-bottom: 2px;
}

.distance-text p {
  margin: 0;
  font-size: 0.85rem;
  color: #92400e;
}

.check-loc-btn {
  background: #78350f;
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.85rem;
  transition: var(--transition);
}

.check-loc-btn:hover {
  background: #451a03;
}

/* Meter Bar in Modal */
.distance-meter {
  height: 12px;
  background: #e2e8f0;
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
  margin: 1.25rem 0;
}

.distance-progress {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #d97706);
  width: 0%;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Offcanvas Cart Drawer & Security Checkout Modal
   ========================================================================== */
.cart-drawer-header {
  background: var(--primary);
  color: #fff;
}

.cart-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.cart-item-img {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: #f1f5f9;
}

.cart-item-details {
  flex-grow: 1;
}

.cart-item-title {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 2px;
  color: var(--secondary);
}

.cart-item-price {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 800;
}

.cart-summary-box {
  background: #f8fafc;
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-top: 1rem;
  border: 1px solid var(--border-color);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  margin-bottom: 6px;
  color: var(--text-muted);
}

.summary-row.total {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--secondary);
  border-top: 1px dashed #cbd5e1;
  padding-top: 8px;
  margin-top: 8px;
}

.checkout-btn {
  background: #25d366; /* WhatsApp Green */
  color: #ffffff;
  border: none;
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: var(--transition);
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
}

.checkout-btn:hover {
  background: #1eb956;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45);
}

/* Security CAPTCHA Box */
.captcha-container {
  background: #ecfdf5;
  border: 1px solid var(--primary-light);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin: 1rem 0;
}

.captcha-question {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--primary);
  letter-spacing: 1px;
}

.honeypot-field {
  display: none !important;
  visibility: hidden;
}

/* ==========================================================================
   Store Admin Weight Configurator Modal
   ========================================================================== */
.admin-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1rem;
}

.admin-weight-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  margin: 3px;
}

.admin-weight-tag.enabled {
  background: #d1fae5;
  border-color: #10b981;
  color: #064e3b;
}

/* ==========================================================================
   Scroll to Top & Floating Elements
   ========================================================================== */
.scroll-top-btn {
  position: fixed;
  bottom: 90px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  border: 2px solid #ffffff;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 1030;
}

.scroll-top-btn.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-top-btn:hover {
  background: var(--primary-light);
  transform: translateY(-3px) rotate(360deg);
}

/* Floating Sticky Mobile Cart Bar */
.mobile-cart-float {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  background: var(--secondary);
  color: #ffffff;
  border-radius: var(--radius-full);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1030;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  transition: var(--transition);
}

.mobile-cart-float:hover {
  transform: translateY(-2px);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer-custom {
  background: var(--secondary);
  color: #94a3b8;
  padding: 4rem 0 2rem;
  margin-top: 5rem;
}

.footer-title {
  color: #ffffff;
  font-weight: 700;
  margin-bottom: 1.2rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 8px;
}

.footer-links a {
  color: #94a3b8;
  text-decoration: none;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--primary-accent);
}

/* Security & Anti-Spam Badge Pill */
.security-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
  }
  .hero-content {
    padding: 2.5rem 1.5rem;
  }
  .hero-bg-img {
    display: none;
  }
  body {
    padding-top: 66px;
  }
}
