/* Reset */
:root {
  --primary-color: #01684B;
  --primary-soft: #EDF4F2;
  --surface: #fff;
  --surface-muted: #F3F5F4;
  --text-muted: #C3CAD9;
  --shimmer-base: #EEF1F0;
  --shimmer-shine: #F9FAF9;
}
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background-color: var(--surface);
}
.theme-dark {
  --surface: #111;
  --surface-muted: #1b1b1b;
  --shimmer-base: rgba(255, 255, 255, 0.06);
  --shimmer-shine: rgba(255, 255, 255, 0.14);
}

/* ===================== Preloader (center splash) ===================== */
.preloader {
  position: fixed;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  background-color: var(--surface);
  display: grid;
  place-items: center;
  z-index: 10;
}
.preloader-img {
  animation: pulseLogo 1400ms ease-in-out infinite;
  border-radius: 1rem;
}
.preloader-container {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  align-items: center;
}
.preloader-bar {
  inline-size: 7.5rem;
  block-size: 5px;
  border-radius: 999px;
  background: var(--shimmer-base);
  overflow: hidden;
  position: relative;
}
.preloader-bar span {
  position: absolute;
  inset-block: 0;
  inline-size: 45%;
  border-radius: 999px;
  background: var(--primary-color);
  animation: barSlide 1100ms ease-in-out infinite;
}
@keyframes pulseLogo {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.9); opacity: 0.6; }
}
@keyframes barSlide {
  0% { inset-inline-start: -45%; }
  100% { inset-inline-start: 100%; }
}

/* ===================== Shimmer (Blinkit/Zomato style) ===================== */
.shimmer {
  position: relative;
  overflow: hidden;
  background-color: var(--shimmer-base);
  border-radius: 0.5rem;
}
.shimmer::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--shimmer-shine), transparent);
  animation: shimmerSweep 1400ms ease-in-out infinite;
}
@keyframes shimmerSweep {
  100% { transform: translateX(100%); }
}
.sh-line { display: inline-block; block-size: 0.7rem; inline-size: 100%; border-radius: 0.3rem; }
.sh-xs { block-size: 0.55rem; }
.sh-sm { block-size: 0.7rem; }
.sh-md { block-size: 0.95rem; }
.sh-circle { display: block; inline-size: 3rem; block-size: 3rem; border-radius: 50%; margin-block-end: 0.4rem; }

/* ===================== App shell skeleton ===================== */
.skeleton {
  position: relative;
  min-block-size: 100vh;
  background-color: var(--surface);
  padding-block-end: 4.5rem; /* room for bottom nav on mobile */
}

/* Top App Bar */
.app-bar {
  position: fixed;
  inset-block-start: 0;
  inset-inline-start: 0;
  inline-size: 100%;
  background-color: var(--surface);
  box-shadow: 0 4px 14px -4px rgba(4, 97, 165, 0.12);
  z-index: 2;
}
.app-bar-row {
  max-inline-size: 1290px;
  margin-inline: auto;
  padding: 0.9rem 1.25rem 0.6rem;
}
.header .logo,
.app-bar .logo {
  max-block-size: 2.1rem;
}
.location-pill { line-height: 1.1; }
.app-bar-actions .icon-btn {
  inline-size: 2.3rem;
  block-size: 2.3rem;
  border-radius: 50%;
}
.icon-btn-real {
  inline-size: 1.35rem;
  block-size: 1.35rem;
  opacity: 0.85;
}
.search-bar-wrap {
  max-inline-size: 1290px;
  margin-inline: auto;
  padding: 0 1.25rem 0.9rem;
}
.search-bar {
  inline-size: 100%;
  block-size: 2.6rem;
  border-radius: 0.75rem;
  background-color: var(--surface-muted) !important;
}

/* Body content */
.skeleton-body {
  max-inline-size: 1290px;
  margin-inline: auto;
  padding: 6.6rem 1.25rem 1.5rem;
}

/* Category chips (horizontal scroll pills) */
.chip-row {
  display: flex;
  gap: 0.6rem;
  overflow: hidden;
  margin-block-end: 1.1rem;
}
.chip {
  flex: none;
  block-size: 2.1rem;
  border-radius: 999px;
}

/* Banner */
.banner {
  inline-size: 100%;
  block-size: 8rem;
  border-radius: 1rem;
  margin-block-end: 1.3rem;
}

/* Round category icon row */
.icon-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-block-end: 1.5rem;
}
.icon-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}
.icon-tile .sh-line {
  inline-size: 2.6rem;
}

/* Section title */
.section-title-row {
  margin-block-end: 0.9rem;
}

/* Product grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem;
}
.product-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.6rem;
  border-radius: 0.9rem;
  background-color: var(--surface);
  box-shadow: 0 2px 10px -6px rgba(4, 97, 165, 0.18);
}
.product-img {
  inline-size: 100%;
  block-size: 6.2rem;
  border-radius: 0.7rem;
}

/* Bottom tab bar (Blinkit/Zomato style persistent mobile nav) */
.bottom-nav {
  position: fixed;
  inset-block-end: 0;
  inset-inline-start: 0;
  inline-size: 100%;
  background-color: var(--surface);
  box-shadow: 0 -4px 14px -6px rgba(4, 97, 165, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding-block: 0.55rem;
  z-index: 2;
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  color: var(--text-muted);
}
.bottom-nav-item svg {
  inline-size: 1.35rem;
  block-size: 1.35rem;
}
.bottom-nav-item.active {
  color: var(--primary-color);
}

/* ===================== Responsive visibility ===================== */
.only-mobile { display: none; }
.only-desktop { display: flex; }

@media (max-width: 1024px) {
  .only-desktop { display: none !important; }
  .only-mobile { display: flex; }
  .skeleton-body { padding-block-start: 8.6rem; }
}

@media (max-width: 640px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .icon-grid { grid-template-columns: repeat(4, 1fr); }
  .banner { block-size: 6.5rem; }
}

/* ===================== Common utility classes ===================== */
.d-flex { display: flex; }
.flex-column { display: flex; flex-direction: column; }
.align-items-center { align-items: center; }
.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.text-center { text-align: center; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }
.gap-5 { gap: 3rem; }
.svg { display: block; }
