/* ============================================================
   SMART KIRANA — Zepto-Grade Premium Design System
   ============================================================ */

/* ---- GOOGLE FONT IMPORT ---- */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

/* ---- CSS VARIABLES ---- */
:root {
  --font: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Brand — Green */
  --primary:       #198754;
  --primary-dark:  #146c43;
  --primary-light: #d1e7dd;
  --primary-glow:  rgba(25, 135, 84, 0.18);

  /* Keep green for ADD buttons / prices (Zepto keeps green for food/price) */
  --green:        #1BAD66;
  --green-dark:   #138a50;
  --green-light:  #e6f9f0;
  --green-glow:   rgba(27, 173, 102, 0.2);
  --yellow:       #f5c518;
  --red:          #e53935;

  /* Neutrals — slightly warmer */
  --bg:           #ffffff;
  --surface:      #ffffff;
  --surface-2:    #f5f6f7;
  --border:       #eeeeee;
  --text-1:       #1c1c1e;
  --text-2:       #48484a;
  --text-3:       #aeaeb2;

  /* Shadows */
  --shadow-sm:    0 1px 4px rgba(0,0,0,0.06);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg:    0 8px 32px rgba(0,0,0,0.10);
  --shadow-green: 0 6px 20px rgba(27,173,102,0.28);
  --shadow-purple:0 6px 20px rgba(25,135,84,0.22);

  /* Radii */
  --r-sm:  8px;
  --r-md:  12px;
  --r-lg:  18px;
  --r-xl:  24px;
  --r-pill:50px;
}

/* ---- BASE RESET ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* Apply our font globally — but NOT to icon fonts */
body, input, button, select, textarea, a, span, p, h1, h2, h3, h4, h5, h6, div, li, td, th, label {
  font-family: var(--font);
}

/* Ensure RemixIcon fonts are not overridden by global rules */
[class^="ri-"], [class*=" ri-"] {
  font-family: 'remixicon' !important;
}


html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-1);
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; }

/* Ionic content background */
ion-content {
  --background: var(--bg);
}

ion-app {
  background: var(--bg);
}

/* ============================================================
   SCROLLBAR HIDE
   ============================================================ */
.scrollbar-none {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.scrollbar-none::-webkit-scrollbar { display: none; }

/* ============================================================
   LOCATION HEADER — Zepto style
   ============================================================ */
.location-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 8px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.location-left  { display: flex; align-items: center; gap: 8px; }
.location-icon-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.location-text  { display: flex; flex-direction: column; }
.location-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1;
}
.location-desc {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-1);
  max-width: 210px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 2px;
}

/* ============================================================
   SEARCH BAR — Zepto style grey pill
   ============================================================ */
.search-container {
  background: #f1f1f3;
  border-radius: var(--r-pill);
  display: flex;
  align-items: center;
  padding: 10px 16px;
  border: none;
  gap: 10px;
  transition: box-shadow 0.2s;
}
.search-container:focus-within {
  box-shadow: 0 0 0 2px var(--primary-glow);
}
.search-container i, .search-container .bx {
  color: var(--text-3);
  font-size: 18px;
  flex-shrink: 0;
}
.search-container input {
  border: none;
  outline: none;
  font-size: 14px;
  width: 100%;
  color: var(--text-1);
  background: transparent;
  font-weight: 500;
}
.search-container input::placeholder { color: var(--text-3); font-weight: 400; }

/* ============================================================
   GLASS HEADER (Ionic toolbar override)
   ============================================================ */
.glass-header {
  --background: rgba(255,255,255,0.9);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid rgba(255,255,255,0.5) !important;
}
ion-toolbar {
  --background: transparent;
  --border-width: 0;
}
ion-title {
  font-weight: 700 !important;
  font-size: 17px !important;
  color: var(--text-1) !important;
}

/* ============================================================
   BANNER SLIDER
   ============================================================ */
.banners-scroll {
  display: flex;
  align-items: flex-start !important;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 4px;
}
.banners-scroll::-webkit-scrollbar { display: none; }

.banner-card {
  flex-shrink: 0;
  width: 86vw;
  max-width: 380px;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  border-radius: var(--r-lg);
  overflow: hidden;
  position: relative;
  scroll-snap-align: start;
  cursor: default;
  display: inline-block;
}
.banner-card img {
  width: 100%;
  height: auto !important;
  max-height: none !important;
  display: block;
  object-fit: contain;
}
.banner-card .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0) 55%);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.banner-card .overlay h5 {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 2px;
  line-height: 1.2;
}
.banner-card .overlay span {
  font-size: 11px;
  color: rgba(255,255,255,0.85);
}

/* ============================================================
   SECTION HEADING — Zepto style
   ============================================================ */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.section-head h6 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-1);
  margin: 0;
  letter-spacing: -0.3px;
}
.section-head a {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 3px 10px;
  border-radius: var(--r-pill);
}

/* ============================================================
   CATEGORY CHIPS (horizontal scroll row)
   ============================================================ */
.category-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.category-scroll::-webkit-scrollbar { display: none; }

.category-chip {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  width: 72px;
}
.category-chip .img-wrap {
  width: 64px;
  height: 64px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}
.category-chip:active .img-wrap {
  transform: scale(0.93);
}
.category-chip .img-wrap img {
  width: 46px;
  height: 46px;
  object-fit: contain;
}
.category-chip .label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  text-align: center;
  line-height: 1.2;
}

/* Category card (grid view on category page) */
.category-card {
  text-align: center;
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 10px 6px;
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: transform 0.15s;
}
.category-card:active { transform: scale(0.94); }
.category-card img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  margin-bottom: 6px;
}
.category-card .title {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-2);
  line-height: 1.2;
}

/* ============================================================
   PRODUCT CARD — Blinkit / Zepto style
   ============================================================ */
.products-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.products-scroll::-webkit-scrollbar { display: none; }

/* Card outer element is product-card web component itself */
product-card {
  display: block;
  flex-shrink: 0;
  width: 158px;            /* fixed width in horizontal scroll */
}

/* Grid mode overrides (page-products grid layout) */
.products-grid product-card,
#products-grid product-card,
#products-grid-container product-card,
.row product-card {
  width: 100% !important;
  flex-shrink: unset !important;
}

.product-card {
    background: var(--surface);
    border-radius: 10px;
    border: 1.5px solid var(--border);
    padding: 7px 8px 12px;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.2s;
    overflow: hidden;
}
.product-card:active {
  transform: scale(0.97);
}

/* Discount badge */
.product-card .badge-offer {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--green);
  color: #fff;
  font-size: 9.5px;
  font-weight: 800;
  padding: 3px 6px;
  border-radius: 6px;
  z-index: 3;
  letter-spacing: 0.2px;
  line-height: 1.3;
}

/* Wishlist heart */
.product-card .wishlist-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255,255,255,0.95);
  border: none;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 6px rgba(0,0,0,0.12);
  cursor: pointer;
  z-index: 3;
  transition: transform 0.1s;
  padding: 0;
}
.product-card .wishlist-btn:active { transform: scale(0.82); }
.product-card .wishlist-btn i { font-size: 12px; }

/* Image area */
.product-card .img-container {
  height: 110px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 8px;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--surface-2);
}
.product-card .img-container img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

/* Product name */
.product-card .name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-1);
    line-height: 1.35;
    margin-bottom: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 20px;
}

/* Weight/unit tag */
.product-card .weight {
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: 8px;
  font-weight: 500;
}

/* Price row */
.product-card .price-row {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 4px;
}
.product-card .price-col {
  display: flex;
  flex-direction: column;
}
.product-card .price {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-1);
  line-height: 1;
}
.product-card .mrp {
  font-size: 10.5px;
  text-decoration: line-through;
  color: var(--text-3);
  font-weight: 400;
  margin-top: 2px;
}

/* ADD / quantity controls */
.add-btn-container { min-width: 64px; }

.btn-add-item {
  background: var(--surface);
  color: var(--green);
  border: 1.5px solid var(--green);
  border-radius: var(--r-sm);
  font-weight: 800;
  font-size: 13px;
  padding: 6px 12px;
  text-align: center;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: all 0.14s ease;
  white-space: nowrap;
}
.btn-add-item:active {
  background: var(--green);
  color: #fff;
  transform: scale(0.95);
}

.quantity-selector {
  background: var(--green);
  color: #fff;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 800;
  font-size: 13px;
  min-width: 72px;
  box-shadow: var(--shadow-green);
}
.quantity-selector span {
  padding: 5px 8px;
  cursor: pointer;
  user-select: none;
  line-height: 1;
}
.quantity-selector .qty {
  cursor: default;
  font-size: 14px;
}

/* ============================================================
   MINI PROMO BANNER (Zepto style colored tiles)
   ============================================================ */
.promo-tiles {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.promo-tiles::-webkit-scrollbar { display: none; }
.promo-tile {
  flex-shrink: 0;
  border-radius: var(--r-md);
  padding: 14px;
  min-width: 140px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: default;
}
.promo-tile .p-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}
.promo-tile .p-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.85);
}
.promo-tile i, .promo-tile .bx {
  font-size: 26px;
  color: rgba(255,255,255,0.9);
}

/* ============================================================
   FLOATING CART BAR
   ============================================================ */
.cart-floating-bar {
  position: fixed;
  bottom: 74px;
  left: 14px;
  right: 14px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--r-xl);
  padding: 13px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-purple);
  z-index: 999;
  animation: slideUp 0.28s cubic-bezier(0.16,1,0.3,1);
}
.cart-floating-bar .left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cart-floating-bar .qty-bag {
  background: rgba(255,255,255,0.2);
  border-radius: 8px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 700;
}
.cart-floating-bar .price-info {
  display: flex;
  flex-direction: column;
}
.cart-floating-bar .price {
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
}
.cart-floating-bar .desc {
  font-size: 10px;
  opacity: 0.8;
  margin-top: 1px;
}
.cart-floating-bar .view-btn {
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 5px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ============================================================
   FLOATING ACTIVE ORDER BAR
   ============================================================ */
.order-floating-bar {
  position: fixed;
  bottom: 74px;
  left: 14px;
  right: 14px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  border-radius: var(--r-xl);
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
  z-index: 998;
  animation: slideUp 0.28s cubic-bezier(0.16,1,0.3,1);
  cursor: pointer;
  transition: transform 0.2s, bottom 0.3s cubic-bezier(0.16,1,0.3,1);
}
.order-floating-bar:active {
  transform: scale(0.97);
}
.order-floating-bar .left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.order-floating-bar .order-icon {
  font-size: 16px;
  background: rgba(255, 255, 255, 0.2);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.order-floating-bar .order-icon i {
  animation: truckBounce 1.5s infinite ease-in-out;
}
@keyframes truckBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
.order-floating-bar .order-info {
  display: flex;
  flex-direction: column;
}
.order-floating-bar .order-title {
  font-weight: 700;
  font-size: 12.5px;
  line-height: 1.2;
}
.order-floating-bar .order-status {
  font-size: 10.5px;
  opacity: 0.9;
  margin-top: 1px;
  font-weight: 500;
}
.order-floating-bar .right {
  display: flex;
  align-items: center;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  gap: 4px;
}

/* ============================================================
   FLOATING RATING & REVIEW BAR
   ============================================================ */
.review-floating-bar {
  position: fixed;
  bottom: 74px;
  left: 14px;
  right: 14px;
  background: linear-gradient(135deg, #ffb300 0%, #ff8f00 100%);
  color: #fff;
  border-radius: var(--r-xl);
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 8px 24px rgba(255, 179, 0, 0.35);
  z-index: 997;
  animation: slideUp 0.28s cubic-bezier(0.16,1,0.3,1);
  cursor: pointer;
  transition: transform 0.2s, bottom 0.3s cubic-bezier(0.16,1,0.3,1);
}
.review-floating-bar:active {
  transform: scale(0.97);
}
.review-floating-bar .left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.review-floating-bar .order-icon {
  font-size: 16px;
  background: rgba(255, 255, 255, 0.25);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.review-floating-bar .order-icon i {
  animation: starRotate 2s infinite ease-in-out;
}
@keyframes starRotate {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(15deg) scale(1.15); }
}
.review-floating-bar .order-info {
  display: flex;
  flex-direction: column;
}
.review-floating-bar .order-title {
  font-weight: 700;
  font-size: 12.5px;
  line-height: 1.2;
}
.review-floating-bar .order-status {
  font-size: 10.5px;
  opacity: 0.95;
  margin-top: 1px;
  font-weight: 600;
  color: #fff !important;
}
.review-floating-bar .right {
  display: flex;
  align-items: center;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  gap: 4px;
}

/* ============================================================
   BOTTOM TAB BAR
   ============================================================ */
.tab-bar-custom {
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: calc(66px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tab-item-custom {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  text-decoration: none;
  font-size: 10.5px;
  font-weight: 500;
  flex: 1;
  gap: 3px;
  position: relative;
  transition: color 0.15s;
  padding-top: 6px;
  padding-bottom: 2px;
}
.tab-item-custom i, .tab-item-custom .bx {
  font-size: 22px;
  transition: transform 0.15s;
  margin-top: 2px;
}
.tab-item-custom.active {
  color: var(--primary);
  font-weight: 700;
}
.tab-item-custom.active i {
  transform: scale(1.08);
}
/* Active underline indicator — purple */
.tab-item-custom.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 2.5px;
  background: var(--primary);
  border-radius: 0 0 4px 4px;
}

/* ============================================================
   PAGE CONTAINER
   ============================================================ */
.page-container {
  padding: 10px 10px 90px;
}

/* ============================================================
   SKELETON LOADERS
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e6e6e6 50%, #f0f0f0 75%);
  background-size: 300% 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: 6px;
}
@keyframes shimmer {
  0%   { background-position: 300% 0; }
  100% { background-position: -300% 0; }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes slideUp {
  from { transform: translateY(80px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
@keyframes logoPop {
  0%   { transform: scale(0.4); opacity: 0; }
  70%  { transform: scale(1.06); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.3s ease forwards; }

/* ============================================================
   SPLASH SCREEN
   ============================================================ */
.splash-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: radial-gradient(ellipse at center, #ffffff 0%, #d1e7dd 100%);
  text-align: center;
  position: relative;
}
.splash-logo-container {
  animation: logoPop 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* ============================================================
   OTP INPUTS
   ============================================================ */
.otp-input-box {
  width: 46px;
  height: 52px;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  outline: none;
  margin: 0 4px;
  background: var(--surface-2);
  transition: border-color 0.15s, box-shadow 0.15s;
  color: var(--text-1);
}
.otp-input-box:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: var(--surface);
}

/* ============================================================
   PREMIUM BUTTONS
   ============================================================ */
.btn-premium {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  border-radius: var(--r-pill);
  border: none;
  padding: 13px 20px;
  transition: all 0.18s ease;
  box-shadow: var(--shadow-purple);
  font-size: 15px;
  letter-spacing: 0.2px;
}
.btn-premium:hover  { background: var(--primary-dark); }
.btn-premium:active { transform: scale(0.97); background: var(--primary-dark); }

.btn-secondary-premium {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  border-radius: var(--r-pill);
  border: 1.5px solid rgba(25,135,84,0.15);
  padding: 13px 20px;
  font-size: 15px;
  transition: all 0.18s ease;
}
.btn-secondary-premium:active { transform: scale(0.97); }

/* ============================================================
   CATEGORY PAGE LAYOUT  (sidebar + subcategory grid)
   ============================================================ */
.category-layout {
  display: flex;
  height: 100%;
  background: var(--surface);
}
.sidebar-categories {
  width: 82px;
  background: var(--surface-2);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  height: 100%;
  flex-shrink: 0;
}
.sidebar-categories::-webkit-scrollbar { display: none; }
.sidebar-item {
  padding: 14px 6px;
  text-align: center;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background 0.15s;
}
.sidebar-item img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  margin-bottom: 5px;
}
.sidebar-item .title {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--text-2);
  line-height: 1.3;
}
.sidebar-item.active {
  background: var(--surface);
  border-left: 3px solid var(--primary);
}
.sidebar-item.active .title { color: var(--primary); font-weight: 800; }
.subcategories-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  height: 100%;
}
.subcategories-content::-webkit-scrollbar { display: none; }

/* ============================================================
   ORDER TRACKING TIMELINE
   ============================================================ */
.track-timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
}
.track-timeline::before {
  content: '';
  position: absolute;
  top: 12px; bottom: 12px; left: 12px;
  width: 2px;
  background: var(--border);
  border-radius: 2px;
}
.track-timeline-item {
  position: relative;
  padding-left: 40px;
  margin-bottom: 22px;
}
.track-timeline-item::before {
  content: '';
  position: absolute;
  left: 5px; top: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--border);
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 1.5px var(--border);
  z-index: 1;
}
.track-timeline-item.completed::before {
  background: var(--green);
  box-shadow: 0 0 0 1.5px var(--green);
}
.track-timeline-item.active::before {
  background: var(--yellow);
  box-shadow: 0 0 0 3px rgba(245,197,24,0.25);
}
.track-timeline-item .title {
  font-size: 14px; font-weight: 600; color: var(--text-2);
}
.track-timeline-item.completed .title { color: var(--green); }
.track-timeline-item.active .title    { color: var(--text-1); font-weight: 700; }
.track-timeline-item .time {
  font-size: 11px; color: var(--text-3); margin-top: 2px;
}

/* ============================================================
   CARD UTILITY
   ============================================================ */
.sk-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

/* ============================================================
   DARK MODE
   ============================================================ */
body.dark-theme {
  --bg:         #0f0f0f;
  --surface:    #1c1c1e;
  --surface-2:  #252527;
  --border:     #2e2e30;
  --text-1:     #f2f2f2;
  --text-2:     #c0c0c0;
  --text-3:     #6e6e6e;
  --green-light:#0e3519;
  --shadow-sm:  0 1px 4px rgba(0,0,0,0.3);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.35);
  color: var(--text-1);
}
body.dark-theme ion-content { --background: var(--bg); }
body.dark-theme .glass-header { --background: rgba(28,28,30,0.9); }
body.dark-theme .otp-input-box { background: var(--surface-2); color: var(--text-1); }
body.dark-theme .btn-add-item  { background: var(--surface); }

/* --- Dark Mode Comprehensive Page & Component Overrides --- */

/* Skeleton Loader */
body.dark-theme .skeleton {
  background: linear-gradient(90deg, #252527 25%, #2e2e30 50%, #252527 75%) !important;
  background-size: 300% 100% !important;
}

/* Header & Toolbars */
body.dark-theme ion-header,
body.dark-theme ion-toolbar,
body.dark-theme .co-header,
body.dark-theme .cart-header-bar {
  background: var(--surface) !important;
  --background: var(--surface) !important;
  border-color: var(--border) !important;
  color: var(--text-1) !important;
}
body.dark-theme ion-title,
body.dark-theme .cart-header-title,
body.dark-theme .co-header h4,
body.dark-theme .co-section-title {
  color: var(--text-1) !important;
}
body.dark-theme .cart-back-btn,
body.dark-theme .co-back-btn,
body.dark-theme .cat-view-back-btn,
body.dark-theme ion-header button,
body.dark-theme ion-buttons button {
  background: var(--surface-2) !important;
  color: var(--text-1) !important;
}
body.dark-theme .custom-detail-header {
  --background: var(--surface) !important;
  --border-color: var(--border) !important;
}

/* Generic Layout / Background overrides for dark-theme pages */
body.dark-theme .bg-white,
body.dark-theme .bg-light,
body.dark-theme ion-content.bg-light {
  background-color: var(--bg) !important;
  --background: var(--bg) !important;
}

/* Card and container elements */
body.dark-theme page-profile div[style*="background:#fff"],
body.dark-theme page-profile div[style*="background: #fff"],
body.dark-theme page-profile a[style*="background:#fff"],
body.dark-theme page-profile a[style*="background: #fff"],
body.dark-theme page-profile div[style*="background: white"],
body.dark-theme page-profile div[style*="background:white"],
body.dark-theme page-profile #logout-btn,
body.dark-theme .cart-section,
body.dark-theme .co-section,
body.dark-theme .sk-card,
body.dark-theme .category-block,
body.dark-theme .premium-card {
  background: var(--surface) !important;
  background-color: var(--surface) !important;
  border-color: var(--border) !important;
  color: var(--text-1) !important;
  box-shadow: var(--shadow-sm) !important;
}

/* Checkout Page Specifics */
body.dark-theme .addr-card {
  border-color: var(--border) !important;
  background: var(--surface) !important;
}
body.dark-theme .addr-card.selected {
  background: var(--green-light) !important;
  border-color: var(--primary) !important;
}
body.dark-theme .addr-text {
  color: var(--text-2) !important;
}
body.dark-theme .pay-option-card {
  border-color: var(--border) !important;
  background: var(--surface) !important;
}
body.dark-theme .pay-option-card.selected {
  background: var(--green-light) !important;
  border-color: var(--primary) !important;
}

/* Location / GPS Alert Card Overrides in Cart Page */
body.dark-theme #location-status-container div[style*="background: #fff3cd"],
body.dark-theme #location-status-container div[style*="background:#fff3cd"],
body.dark-theme div[style*="background: #fff3cd"],
body.dark-theme div[style*="background:#fff3cd"] {
  background: #2b220c !important;
  border-color: #f5c518 !important;
  color: #ffe89e !important;
}
body.dark-theme #location-status-container div[style*="background: #f8f9fa"],
body.dark-theme #location-status-container div[style*="background:#f8f9fa"] {
  background: var(--surface-2) !important;
  border-color: var(--border) !important;
  color: var(--text-2) !important;
}
body.dark-theme #location-status-container div[style*="background: #fdecea"],
body.dark-theme #location-status-container div[style*="background:#fdecea"] {
  background: #3a1515 !important;
  border-color: var(--red) !important;
  color: #ffcccc !important;
}
body.dark-theme #location-status-container div[style*="background: #e8f5e9"],
body.dark-theme #location-status-container div[style*="background:#e8f5e9"] {
  background: var(--green-light) !important;
  border-color: var(--primary) !important;
  color: #c7eed8 !important;
}

/* Bill rows on Cart / Checkout */
body.dark-theme .bill-row .label {
  color: var(--text-2) !important;
}
body.dark-theme .bill-row .val {
  color: var(--text-1) !important;
}
body.dark-theme .bill-row.total-row {
  border-top-color: var(--border) !important;
}
body.dark-theme .bill-row.total-row .label {
  color: var(--text-1) !important;
}
body.dark-theme .bill-row.total-row .val {
  color: var(--primary) !important;
}

/* Action Footers */
body.dark-theme .checkout-bar,
body.dark-theme #detail-action-container {
  background: var(--surface) !important;
  border-top: 1px solid var(--border) !important;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.3) !important;
}
body.dark-theme .checkout-bar-amount {
  color: var(--text-1) !important;
}
body.dark-theme .checkout-bar-label {
  color: var(--text-3) !important;
}

/* Modals, Sheets, and Dialog Overlays */
body.dark-theme .address-sheet,
body.dark-theme .coupons-sheet,
body.dark-theme .variant-sheet,
body.dark-theme .logout-modal-sheet,
body.dark-theme .confirm-sheet,
body.dark-theme .confirm-dialog-content {
  background: var(--surface) !important;
  color: var(--text-1) !important;
  border-top: 1px solid var(--border) !important;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.4) !important;
}
body.dark-theme .address-sheet input {
  background: var(--surface-2) !important;
  border-color: var(--border) !important;
  color: var(--text-1) !important;
}
body.dark-theme .address-sheet label {
  color: var(--text-2) !important;
}
body.dark-theme .addr-type-pill {
  background: var(--surface) !important;
  border-color: var(--border) !important;
  color: var(--text-2) !important;
}
body.dark-theme .addr-type-pill.selected {
  background: var(--green-light) !important;
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}
body.dark-theme #fetch-gps-btn {
  background: var(--green-light) !important;
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}
body.dark-theme .address-sheet div[style*="background:#f9f9f9"],
body.dark-theme .address-sheet div[style*="background: #f9f9f9"] {
  background: var(--surface-2) !important;
  border-color: var(--border) !important;
}
body.dark-theme .switch-slider {
  background-color: var(--border) !important;
}
body.dark-theme .switch-input:checked + .switch-slider {
  background-color: var(--primary) !important;
}

/* Product Variant Selector Overrides */
body.dark-theme .variant-selection-row {
  border-bottom-color: var(--border) !important;
}
body.dark-theme .variant-selection-row div[style*="color:#222"],
body.dark-theme .variant-selection-row div[style*="color: #222"] {
  color: var(--text-1) !important;
}
body.dark-theme .variant-selection-row span[style*="color:#999"],
body.dark-theme .variant-selection-row span[style*="color: #999"] {
  color: var(--text-3) !important;
}
body.dark-theme .variant-selection-row span[style*="background:#e8f5e9"],
body.dark-theme .variant-selection-row span[style*="background: #e8f5e9"] {
  background: var(--green-light) !important;
  color: var(--primary) !important;
}
body.dark-theme .v-add-btn {
  background: var(--surface) !important;
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}
body.dark-theme .v-qty-container div[style*="background:#f0faf4"],
body.dark-theme .v-qty-container div[style*="background: #f0faf4"] {
  background: var(--green-light) !important;
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}
body.dark-theme .v-qty-container button {
  color: var(--primary) !important;
}
body.dark-theme .variant-sheet h3 {
  color: var(--text-1) !important;
}
body.dark-theme .variant-sheet p {
  color: var(--text-2) !important;
}
body.dark-theme #close-variant-btn {
  background: var(--surface-2) !important;
  color: var(--text-1) !important;
}

/* Coupon Modal Specifics */
body.dark-theme .coupons-sheet div[style*="background: #f9fefb"] {
  background: var(--green-light) !important;
}
body.dark-theme .coupons-sheet div[style*="background: #fafafa"] {
  background: var(--surface-2) !important;
  border-color: var(--border) !important;
}
body.dark-theme .coupons-sheet div[style*="color: #222"] {
  color: var(--text-1) !important;
}
body.dark-theme #close-coupons-modal {
  background: var(--surface-2) !important;
  color: var(--text-1) !important;
}

/* Confirmation Dialog Overrides */
body.dark-theme .confirm-sheet h4,
body.dark-theme .confirm-dialog-content h4 {
  color: var(--text-1) !important;
}
body.dark-theme .confirm-sheet p,
body.dark-theme .confirm-dialog-content p {
  color: var(--text-2) !important;
}
body.dark-theme .confirm-sheet div[style*="background:#f7f7f7"],
body.dark-theme .confirm-sheet div[style*="background: #f7f7f7"] {
  background: var(--surface-2) !important;
  border-color: var(--border) !important;
}
body.dark-theme .confirm-sheet div[style*="background:#f7f7f7"] div,
body.dark-theme .confirm-sheet div[style*="background: #f7f7f7"] div {
  color: var(--text-1) !important;
}
body.dark-theme #btn-cancel-order,
body.dark-theme #dlg-btn-cancel,
body.dark-theme #cancel-logout,
body.dark-theme #cancel-address-btn {
  background: var(--surface-2) !important;
  color: var(--text-1) !important;
  border-color: var(--border) !important;
}
body.dark-theme .logout-modal-sheet h3 {
  color: var(--text-1) !important;
}
body.dark-theme .logout-modal-sheet p {
  color: var(--text-2) !important;
}
body.dark-theme .logout-modal-sheet div[style*="background:#fff0f0"] {
  background: #3e1616 !important;
}

/* Contrast & Typography corrections */
body.dark-theme .product-card .mrp,
body.dark-theme .mrp,
body.dark-theme #detail-mrp {
  color: #a0a0a5 !important;
}
body.dark-theme h4[style*="color:#1a1a1a"],
body.dark-theme h4[style*="color: #1a1a1a"],
body.dark-theme .premium-card h4[style*="color:#0f172a"] {
  color: var(--text-1) !important;
}
body.dark-theme page-profile div[style*="color:#aaa"],
body.dark-theme page-profile div[style*="color: #aaa"],
body.dark-theme page-profile div[style*="color:#1a1a1a"],
body.dark-theme page-profile div[style*="color: #1a1a1a"],
body.dark-theme page-profile span[style*="color:#e53935"] {
  color: var(--text-1) !important;
}
body.dark-theme page-profile div[style*="color:#aaa"],
body.dark-theme page-profile div[style*="color: #aaa"] {
  color: var(--text-2) !important;
}
body.dark-theme p[style*="color:#888"],
body.dark-theme p[style*="color: #888"],
body.dark-theme span[style*="color:#888"],
body.dark-theme span[style*="color: #888"] {
  color: var(--text-2) !important;
}
body.dark-theme .premium-card div[style*="background: #fafaf9"] {
  background: var(--surface-2) !important;
  border-color: var(--border) !important;
}
body.dark-theme .premium-card div[style*="background:#f0faf4"] {
  background: var(--green-light) !important;
  border-color: var(--border) !important;
}
body.dark-theme .premium-card div[style*="color:#334155"] {
  color: var(--text-1) !important;
}

/* Invert default placeholder icons for proper contrast */
body.dark-theme img[src*="placeholder"],
body.dark-theme img[src*="grocery_thumbnail"],
body.dark-theme img[onerror*="placeholder"] {
  filter: invert(0.8) brightness(1.2) !important;
}

/* ============================================================
   HOME PAGE CUSTOM LAYOUTS
   ============================================================ */

/* Hide scrollbars for sliders */
.reviews-scroll-row, .brands-scroll-row, .products-scroll, .categories-scroll-row, .banners-scroll {
  display: flex;
  align-items: flex-start !important;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 4px;
}
.reviews-scroll-row::-webkit-scrollbar, .brands-scroll-row::-webkit-scrollbar, .products-scroll::-webkit-scrollbar, .categories-scroll-row::-webkit-scrollbar, .banners-scroll::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}
/* Each chip: rounded square box + name outside below */
.home-category-grid .cat-chip, .all-category-grid .cat-chip {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  cursor: pointer !important;
  transition: transform 0.15s !important;
  width: 100% !important;
}
.home-category-grid .cat-chip:active, .all-category-grid .cat-chip:active { transform: scale(0.94); }
.home-category-grid .cat-chip .cat-img-box, .all-category-grid .cat-chip .cat-img-box {
    width: 100% !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    padding: 2px !important;
    border: 1px solid #eaeaea !important;
    transition: border-color 0.15s, background 0.15s !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03) !important;
}
.home-category-grid .cat-chip:active .cat-img-box, .all-category-grid .cat-chip:active .cat-img-box {
  border-color: var(--primary) !important;
  background: var(--primary-light) !important;
}
.home-category-grid .cat-chip .cat-img-box img, .all-category-grid .cat-chip .cat-img-box img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    border-radius: 10px !important;
}
.home-category-grid .cat-chip .cat-img-box i {
  font-size: 28px;
  color: var(--primary);
}
/* Name sits OUTSIDE the box */
.home-category-grid .cat-chip .cat-name, .all-category-grid .cat-chip .cat-name, .categories-scroll-row .cat-chip .cat-name {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-top: 6px;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}
    margin-bottom: 4px;
}
/* Show More special chip */
.home-category-grid .cat-chip-more .cat-img-box {
    background: #d1e7dd5c;
    border: 1px solid rgba(0, 0, 0, 0.02);
}
.home-category-grid .cat-chip-more .cat-name {
  color: var(--primary);
  font-weight: 700;
}
.show-more-btn {
    width: 40px;
    height: 39px;
    border-radius: 50%;
    background: var(--primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0px 0px 0px rgba(25, 135, 84, 0.22);
    transition: transform 0.15s, background-color 0.15s;
}
.show-more-btn i {
    color: #ffffff !important;
    font-size: 24px !important;
}

/* Category & Subcategory section block */
.category-block {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 12px 12px 8px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.category-block-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -0.2px;
}
/* Home subcategory 4-col grid — Zepto pill style */
.home-subcategory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px 6px;
}
.home-subcategory-grid .sub-chip-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  padding: 6px 2px;
  transition: transform 0.15s;
}
.home-subcategory-grid .sub-chip-grid:active { transform: scale(0.92); }
.home-subcategory-grid .sub-chip-grid .img-wrap-sub {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.home-subcategory-grid .sub-chip-grid .img-wrap-sub img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}
.home-subcategory-grid .sub-chip-grid .label-sub {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-2);
  text-align: center;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-height: 28px;
  width: 100%;
}

/* Latest Products Pagination Grid */
.latest-products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}
.latest-products-grid product-card {
  width: 100%;
}
.loading-more-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px;
}

/* ============================================================
   RESPONSIVE GRIDS FOR TABLET AND DESKTOP VIEWS
   ============================================================ */
@media (min-width: 576px) {
  .home-category-grid {
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 16px 12px;
  }
  .home-subcategory-grid {
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 8px 10px;
  }
  .latest-products-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px;
  }
}
@media (min-width: 768px) {
  .home-category-grid {
    grid-template-columns: repeat(8, 1fr) !important;
    gap: 20px 14px;
  }
  .home-subcategory-grid {
    grid-template-columns: repeat(8, 1fr) !important;
    gap: 10px 12px;
  }
  .latest-products-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 10px;
  }
}
@media (min-width: 992px) {
  .latest-products-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 12px;
  }
}
@media (min-width: 1200px) {
  .home-category-grid {
    grid-template-columns: repeat(10, 1fr) !important;
    gap: 24px 16px;
  }
  .home-subcategory-grid {
    grid-template-columns: repeat(10, 1fr) !important;
    gap: 12px 14px;
  }
  .latest-products-grid {
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 12px;
  }
}

/* ============================================================
   SPLIT CATEGORY VIEW LAYOUT (Subcategories + Products Split)
   ============================================================ */
.split-category-layout {
  display: flex;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
}

/* Left Subcategory Sidebar */
.sidebar-subcategories {
  width: 90px;
  background: var(--surface-2);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  height: 100%;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  padding-bottom: 80px;
  -webkit-overflow-scrolling: touch;
}

.sub-sidebar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 12px 6px;
  cursor: pointer;
  border-left: 3.5px solid transparent;
  transition: all 0.2s ease-in-out;
  background: transparent;
}

.sub-sidebar-item img, 
.sub-sidebar-item .img-box {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: contain;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
  color: var(--text-2);
  padding: 4px;
}

.sub-sidebar-item .title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-2);
  line-height: 1.25;
  margin-top: 6px;
  width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Active State */
.sub-sidebar-item.active {
  background: var(--bg);
  border-left-color: var(--primary);
}

.sub-sidebar-item.active img,
.sub-sidebar-item.active .img-box {
  transform: scale(1.04);
  border-color: var(--primary);
  box-shadow: 0 4px 10px rgba(25, 135, 84, 0.12);
  background: #f4faf6;
}

.sub-sidebar-item.active .title {
  color: var(--primary);
  font-weight: 800;
}

/* Right Products Panel */
.products-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg);
  overflow: hidden;
}

/* Flex Scrollable container for products */
.products-scroll-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
  padding-bottom: 80px;
  -webkit-overflow-scrolling: touch;
}

/* Enforce uniform card heights and responsive stretching in Bootstrap grids */
.row product-card,
#products-grid-container .row product-card {
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  flex-shrink: unset !important;
}

.row product-card > .product-card,
#products-grid-container .row product-card > .product-card {
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  flex: 1 !important;
}

/* Lock text element heights to maintain absolute row alignment */
.row product-card .name,
#products-grid-container product-card .name {
  min-height: 20px !important;
}
.row product-card .img-container,
#products-grid-container product-card .img-container {
  height: 100px !important;
}

/* Filter & Sort Bar */
.filter-sort-bar {
  flex-shrink: 0;
  background: var(--bg);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 8px;
  align-items: center;
}

.sort-chip {
  padding: 6px 12px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sort-chip:active {
  transform: scale(0.95);
}

.sort-chip.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

/* Floating Cart Bar Style Adjustments */
.cart-floating-bar {
  position: absolute;
  left: 16px;
  right: 16px;
  background: var(--green);
  border-radius: var(--r-md);
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-green);
  color: #ffffff;
  z-index: 1000;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

/* Shine ribbon sweep animation from right to left */
.cart-floating-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 150%;
  width: 40%;
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.35) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: skewX(-20deg);
  animation: shineRibbon 4.5s infinite ease-in-out;
}

@keyframes shineRibbon {
  0% {
    left: 150%;
  }
  20% {
    left: -150%;
  }
  100% {
    left: -150%;
  }
}

.cart-floating-bar .left {
  display: flex;
  align-items: center;
}

.cart-floating-bar .price-info {
  display: flex;
  flex-direction: column;
}

.cart-floating-bar .qty-bag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 2px 8px;
  height: fit-content;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.cart-floating-bar .price {
  font-size: 16px;
  font-weight: 900;
  line-height: 1.2;
}

.cart-floating-bar .desc {
  font-size: 10px;
  opacity: 0.85;
  margin-top: 1px;
}

.cart-floating-bar .view-btn {
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 4px;
}

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Page padding when floating cart bar is active to prevent hiding content */
page-category:has(.cart-floating-bar) ion-content {
  --padding-bottom: 90px !important;
}
page-home:has(.cart-floating-bar) ion-content {
  --padding-bottom: 90px !important;
}
page-products:has(.cart-floating-bar) ion-content {
  --padding-bottom: 90px !important;
}
page-category-view:has(.cart-floating-bar) .products-scroll-container {
  padding-bottom: 90px !important;
}

page-product-detail ion-content {
  --padding-bottom: 100px !important;
}
page-product-detail:has(.cart-floating-bar) ion-content {
  --padding-bottom: 170px !important;
}

/* Fix Fancybox zoom collapsing body width on Ionic mobile viewports */
html.with-fancybox body.hide-scrollbar {
  width: 100% !important;
}

/* ============================================================
   RECENT SEARCH CHIPS
   ============================================================ */
.recent-chip {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-pill);
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
.recent-chip:hover {
  background: var(--surface-2);
  border-color: var(--text-3);
  color: var(--text-1);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.recent-chip:active {
  transform: translateY(0);
}
.recent-chip .chip-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 13px;
  color: var(--text-3);
  transition: all 0.15s ease;
}
.recent-chip .chip-close:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--red);
}

/* Dark mode adjustments for chips */
body.dark-theme .recent-chip .chip-close:hover {
  background: rgba(255, 255, 255, 0.12);
}


/* ============================================================
   DESKTOP & TABLET VIEWPORT LAYOUT OPTIMIZATIONS
   ============================================================ */

/* Elegant horizontal scrollbar indicator for mouse pointer users (desktops/laptops) */
@media (hover: hover) and (pointer: fine) {
  .banners-scroll,
  .products-scroll,
  .brands-scroll-row,
  .reviews-scroll-row {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
  }
  .banners-scroll::-webkit-scrollbar,
  .products-scroll::-webkit-scrollbar,
  .brands-scroll-row::-webkit-scrollbar,
  .reviews-scroll-row::-webkit-scrollbar {
    display: block !important;
    height: 6px;
  }
  .banners-scroll::-webkit-scrollbar-track,
  .products-scroll::-webkit-scrollbar-track,
  .brands-scroll-row::-webkit-scrollbar-track,
  .reviews-scroll-row::-webkit-scrollbar-track {
    background: transparent;
  }
  .banners-scroll::-webkit-scrollbar-thumb,
  .products-scroll::-webkit-scrollbar-thumb,
  .brands-scroll-row::-webkit-scrollbar-thumb,
  .reviews-scroll-row::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.12);
    border-radius: 10px;
  }
  .banners-scroll:hover::-webkit-scrollbar-thumb,
  .products-scroll:hover::-webkit-scrollbar-thumb,
  .brands-scroll-row:hover::-webkit-scrollbar-thumb,
  .reviews-scroll-row:hover::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.28);
  }
  
  /* Dark mode scrollbars */
  body.dark-theme .banners-scroll::-webkit-scrollbar-thumb,
  body.dark-theme .products-scroll::-webkit-scrollbar-thumb,
  body.dark-theme .brands-scroll-row::-webkit-scrollbar-thumb,
  body.dark-theme .reviews-scroll-row::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.15);
  }
  body.dark-theme .banners-scroll:hover::-webkit-scrollbar-thumb,
  body.dark-theme .products-scroll:hover::-webkit-scrollbar-thumb,
  body.dark-theme .brands-scroll-row:hover::-webkit-scrollbar-thumb,
  body.dark-theme .reviews-scroll-row:hover::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.32);
  }
}

/* Center main containers and add margins on left/right for screen sizes >= 768px (Tablet view) */
@media (min-width: 768px) {
  /* Constrain the absolute root view container to prevent full-screen stretching */
  ion-app {
    width: 100% !important;
    max-width: 768px !important;
    margin: 0 auto !important;
    left: 0 !important;
    right: 0 !important;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    box-shadow: 0 0 40px rgba(0,0,0,0.06);
    background: var(--bg);
  }

  /* Make sure the browser background around the centered app is premium */
  body {
    background-color: #f6f8fa !important;
  }
  body.dark-theme {
    background-color: #0b0b0c !important;
  }

  /* Keep the sticky bottom nav bar confined and centered in the viewport */
  .tab-bar-custom,
  .checkout-bar {
    max-width: 768px !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    width: 100% !important;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }

  /* Center the floating cart indicator nicely in the viewport */
  .cart-floating-bar {
    max-width: 720px !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    width: calc(100% - 48px) !important;
  }

  /* Constrain layouts on inner pages */
  .page-container {
    max-width: 768px;
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
  }
  
  .delivery-banner,
  .cart-section,
  #location-status-container {
    max-width: 720px;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .split-category-layout {
    max-width: 768px;
    margin: 0 auto;
  }

  /* Center overlay bottom-sheets on desktop */
  .address-sheet,
  .coupons-sheet,
  .variant-sheet,
  .logout-modal-sheet,
  .confirm-sheet {
    max-width: 480px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    right: auto !important;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    border-radius: 24px 24px 0 0 !important;
  }

  /* Center the homepage promotional sliders */
  .banners-scroll {
  display: flex;
  align-items: flex-start !important;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 4px;
}

  /* Enlarge banners on tablet viewports */
  .banner-card {
  flex-shrink: 0;
  width: 86vw;
  max-width: 380px;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  border-radius: var(--r-lg);
  overflow: hidden;
  position: relative;
  scroll-snap-align: start;
  cursor: default;
  display: inline-block;
}
  .banner-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  }
}

/* Upgrade centering and scale constraints for screen sizes >= 1200px (Desktop view) */
@media (min-width: 1200px) {
  ion-app {
    max-width: 1200px !important;
  }

  .tab-bar-custom,
  .checkout-bar {
    max-width: 1200px !important;
  }

  .cart-floating-bar {
    max-width: 1152px !important;
  }

  .page-container,
  .split-category-layout {
    max-width: 1200px;
  }
  
  .delivery-banner,
  .cart-section,
  #location-status-container {
    max-width: 1152px;
  }

  .banner-card {
  flex-shrink: 0;
  width: 86vw;
  max-width: 380px;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  border-radius: var(--r-lg);
  overflow: hidden;
  position: relative;
  scroll-snap-align: start;
  cursor: default;
  display: inline-block;
}
}

/* Toast high z-index overlay fix */
ion-toast {
  --z-index: 9999999 !important;
  z-index: 9999999 !important;
}

/* Custom Category Grid Layout */
.home-category-grid, /* ============================================================
   USER SPECIFIED EXACT ALL-CATEGORY-GRID CSS
   ============================================================ */
.all-category-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 10px 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    padding-bottom: 20px !important;
}


/* ── USER DEFINED CATEGORY GRID CSS ── */
.home-category-grid, /* ============================================================
   USER SPECIFIED EXACT ALL-CATEGORY-GRID CSS
   ============================================================ */
.all-category-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 10px 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    padding-bottom: 20px !important;
}

/* ── HIDE CATEGORY SLIDER SCROLLBAR ── */
.shop-by-cat-slider-container::-webkit-scrollbar,
.shop-by-cat-slider-container *::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
}
.shop-by-cat-slider-container {
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
}

/* ── SMOOTH GPU ACCELERATED CATEGORY HINT ANIMATION ── */
@keyframes catSliderHintBounce {
  0% { transform: translateX(0); }
  35% { transform: translateX(-48px); }
  65% { transform: translateX(-48px); }
  100% { transform: translateX(0); }
}

.shop-by-cat-slider-container.hint-bounce {
  animation: catSliderHintBounce 1.1s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: transform;
}
/* --- Custom Home Category Grid Styles --- */
.kirana-cat-img-box {
    width: 100% !important;
    aspect-ratio: 1 / 1 !important;
    background: #ffffff !important;
    border-radius: 18px !important;
    border: 1px solid #eef2f6 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 5px !important;
    transition: transform 0.15s ease !important;
}
.kirana-cat-img-box img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
}
.kirana-cat-name {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    line-height: 1.25 !important;
    margin-top: 6px !important;
    font-family: 'Outfit', sans-serif !important;
    text-align: center !important;
    word-break: break-word !important;
}


.cart-floating-bar {
  position: fixed !important;
  left: 12px !important;
  right: 12px !important;
  z-index: 9999 !important;
  box-shadow: 0 8px 24px rgba(22, 163, 74, 0.35) !important;
  margin: 0 !important;
}

.order-floating-bar {
  position: fixed !important;
  left: 12px !important;
  right: 12px !important;
  z-index: 9998 !important;
  box-shadow: 0 8px 24px rgba(13, 148, 136, 0.35) !important;
  margin: 0 !important;
}

.review-floating-bar {
  position: fixed !important;
  left: 12px !important;
  right: 12px !important;
  z-index: 9997 !important;
  box-shadow: 0 8px 24px rgba(234, 88, 12, 0.35) !important;
  margin: 0 !important;
}

/* PWA Guide Modal Overlay */
.pwa-guide-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 99999 !important;
  display: none;
  align-items: center;
  justify-content: center;
}


.cart-floating-bar,
.order-floating-bar,
.review-floating-bar {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  max-width: 480px !important;
  width: calc(100% - 24px) !important;
  margin: 0 auto !important;
  box-sizing: border-box !important;
  border-radius: 16px !important;
}

.cart-floating-bar {
  z-index: 9999 !important;
  box-shadow: 0 8px 24px rgba(22, 163, 74, 0.35) !important;
}

.order-floating-bar {
  z-index: 9998 !important;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35) !important;
}

.review-floating-bar {
  z-index: 9997 !important;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.35) !important;
}

/* ============================================================
   BULLETPROOF FLOATING BARS CENTERING SYSTEM
   ============================================================ */
.cart-floating-bar,
.order-floating-bar,
.review-floating-bar {
  position: fixed !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: calc(100% - 28px) !important;
  max-width: 480px !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  border-radius: 16px !important;
}

.cart-floating-bar {
  z-index: 9999 !important;
  background: var(--primary, #16a34a) !important;
  color: #ffffff !important;
  box-shadow: 0 8px 24px rgba(22, 163, 74, 0.35) !important;
}

.order-floating-bar {
  z-index: 9998 !important;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35) !important;
}

.review-floating-bar {
  z-index: 9997 !important;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.35) !important;
}

/* ============================================================
   RESPONSIVE & FIXED HEIGHT CATEGORY GRID (4 COL MOBILE / 6 COL DESKTOP)
   ============================================================ */
/* ============================================================
   USER SPECIFIED EXACT ALL-CATEGORY-GRID CSS
   ============================================================ */
.all-category-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 10px 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    padding-bottom: 20px !important;
}

@media (min-width: 576px) {
  .all-category-grid {
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 20px 14px !important;
  }
}

.all-category-grid .kirana-cat-card {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  cursor: pointer !important;
  height: 115px !important;
}

.all-category-grid .kirana-cat-img-box {
  width: 100% !important;
  height: 76px !important;
  max-height: 76px !important;
  aspect-ratio: 1 / 1 !important;
  background: #ffffff !important;
  border-radius: 18px !important;
  border: 1px solid #eef2f6 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 8px !important;
  flex-shrink: 0 !important;
  overflow: hidden !important;
}

.all-category-grid .kirana-cat-img-box img {
  width: 85% !important;
  height: 85% !important;
  object-fit: contain !important;
}

.all-category-grid .kirana-cat-name {
  font-size: 11.5px !important;
  font-weight: 700 !important;
  color: #1e293b !important;
  line-height: 1.25 !important;
  margin-top: 6px !important;
  font-family: 'Outfit', sans-serif !important;
  text-align: center !important;
  word-break: break-word !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  height: 29px !important;
}

/* ============================================================
   EXACT MATCH CATEGORY GRID (HOME & CATEGORY PAGE UNIFIED)
   ============================================================ */
.all-category-grid,
.kirana-cat-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 18px 10px !important;
  width: 100% !important;
}

@media (min-width: 576px) {
  .all-category-grid,
  .kirana-cat-grid {
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 24px 14px !important;
  }
}

.all-category-grid .kirana-cat-card,
.kirana-cat-grid .kirana-cat-card {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  cursor: pointer !important;
}

.all-category-grid .kirana-cat-img-box,
.kirana-cat-grid .kirana-cat-img-box {
  width: 100% !important;
  aspect-ratio: 1 / 1 !important;
  background: #ffffff !important;
  border-radius: 20px !important;
  border: 1px solid #f1f5f9 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 8px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.all-category-grid .kirana-cat-img-box img,
.kirana-cat-grid .kirana-cat-img-box img {
  width: 85% !important;
  height: 85% !important;
  object-fit: contain !important;
}

.all-category-grid .kirana-cat-name,
.kirana-cat-grid .kirana-cat-name {
  font-size: 14.5px !important;
  font-weight: 700 !important;
  color: #1e293b !important;
  line-height: 1.25 !important;
  margin-top: 6px !important;
  font-family: 'Outfit', sans-serif !important;
  text-align: center !important;
  word-break: break-word !important;
}

/* ============================================================
   PERFECT CATEGORY GRID (LARGER IMAGES & UNCUT TEXT FIX)
   ============================================================ */
.all-category-grid,
.kirana-cat-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 18px 10px !important;
  width: 100% !important;
}

@media (min-width: 576px) {
  .all-category-grid,
  .kirana-cat-grid {
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 24px 14px !important;
  }
}

.all-category-grid .kirana-cat-card,
.kirana-cat-grid .kirana-cat-card {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  cursor: pointer !important;
}

.all-category-grid .kirana-cat-img-box,
.kirana-cat-grid .kirana-cat-img-box {
  width: 100% !important;
  aspect-ratio: 1 / 1 !important;
  background: #ffffff !important;
  border-radius: 18px !important;
  border: 1px solid #f1f5f9 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 4px !important; /* Reduced padding for larger image display */
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.all-category-grid .kirana-cat-img-box img,
.kirana-cat-grid .kirana-cat-img-box img {
  width: 92% !important; /* Much larger image */
  height: 92% !important;
  object-fit: contain !important;
}

.all-category-grid .kirana-cat-name,
.kirana-cat-grid .kirana-cat-name {
  font-size: 12.5px !important;
  font-weight: 700 !important;
  color: #1e293b !important;
  line-height: 1.2 !important;
  margin-top: 6px !important;
  font-family: 'Outfit', sans-serif !important;
  text-align: center !important;
  word-break: break-word !important;
  display: block !important;
  overflow: visible !important;
  min-height: 32px !important;
}

/* ============================================================
   USER REQUESTED CATEGORY GRID & IMAGE BOX CSS
   ============================================================ */
.all-category-grid,
.kirana-cat-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 18px 10px !important;
  width: 100% !important;
}

@media (min-width: 576px) {
  .all-category-grid,
  .kirana-cat-grid {
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 24px 14px !important;
  }
}

.all-category-grid .kirana-cat-card,
.kirana-cat-grid .kirana-cat-card {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  cursor: pointer !important;
}

.all-category-grid .kirana-cat-img-box,
.kirana-cat-grid .kirana-cat-img-box {
  width: 100% !important;
  min-height: 95px !important;
  aspect-ratio: 1 / 1 !important;
  background: #ffffff !important;
  border-radius: 18px !important;
  border: 1px solid #f1f5f9 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 4px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.all-category-grid .kirana-cat-img-box img,
.kirana-cat-grid .kirana-cat-img-box img {
  width: 95% !important;
  height: 100% !important;
  object-fit: contain !important;
}

.all-category-grid .kirana-cat-name,
.kirana-cat-grid .kirana-cat-name {
  font-size: 12.5px !important;
  font-weight: 700 !important;
  color: #1e293b !important;
  line-height: 1.2 !important;
  margin-top: 6px !important;
  font-family: 'Outfit', sans-serif !important;
  text-align: center !important;
  word-break: break-word !important;
  display: block !important;
  overflow: visible !important;
  min-height: 32px !important;
}

/* ============================================================
   PERFECT PROPORTIONAL 4-COLUMN & 6-COLUMN CATEGORY GRID
   ============================================================ */
.all-category-grid,
.kirana-cat-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 14px 8px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

@media (min-width: 576px) {
  .all-category-grid,
  .kirana-cat-grid {
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 20px 12px !important;
  }
}

.all-category-grid .kirana-cat-card,
.kirana-cat-grid .kirana-cat-card {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  cursor: pointer !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.all-category-grid .kirana-cat-img-box,
.kirana-cat-grid .kirana-cat-img-box {
  width: 100% !important;
  aspect-ratio: 1 / 1 !important;
  background: #ffffff !important;
  border-radius: 16px !important;
  border: 1px solid #f1f5f9 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 4px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.all-category-grid .kirana-cat-img-box img,
.kirana-cat-grid .kirana-cat-img-box img {
  width: 90% !important;
  height: 90% !important;
  object-fit: contain !important;
}

.all-category-grid .kirana-cat-name,
.kirana-cat-grid .kirana-cat-name {
  font-size: 12px !important;
  font-weight: 700 !important;
  color: #1e293b !important;
  line-height: 1.2 !important;
  margin-top: 5px !important;
  font-family: 'Outfit', sans-serif !important;
  text-align: center !important;
  word-break: break-word !important;
  display: block !important;
  overflow: visible !important;
  width: 100% !important;
}

/* ============================================================
   STRICT WINDOW CONTAINMENT CATEGORY GRID
   ============================================================ */
page-category ion-content {
  --background: #ffffff !important;
  background: #ffffff !important;
}

/* ============================================================
   USER SPECIFIED EXACT ALL-CATEGORY-GRID CSS
   ============================================================ */
.all-category-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 10px 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    padding-bottom: 20px !important;
}

@media (min-width: 576px) {
  .all-category-grid {
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 18px 12px !important;
  }
}

.all-category-grid .kirana-cat-card {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  cursor: pointer !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.all-category-grid .kirana-cat-img-box {
  width: 100% !important;
  max-width: 100% !important;
  aspect-ratio: 1 / 1 !important;
  background: #ffffff !important;
  border-radius: 16px !important;
  border: 1px solid #f1f5f9 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 4px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.all-category-grid .kirana-cat-img-box img {
  width: 90% !important;
  height: 90% !important;
  object-fit: contain !important;
}

.all-category-grid .kirana-cat-name {
  font-size: 12px !important;
  font-weight: 700 !important;
  color: #1e293b !important;
  line-height: 1.2 !important;
  margin-top: 5px !important;
  font-family: 'Outfit', sans-serif !important;
  text-align: center !important;
  word-break: break-word !important;
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow: hidden !important;
}

/* ============================================================
   MASTER UNIFIED CATEGORY GRID (HOME & ALL CATEGORIES PAGE)
   ============================================================ */
.all-category-grid,
.kirana-cat-grid,
.home-category-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 14px 8px !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

@media (min-width: 576px) {
  .all-category-grid,
  .kirana-cat-grid,
  .home-category-grid {
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 20px 12px !important;
  }
}

.all-category-grid .kirana-cat-card,
.kirana-cat-grid .kirana-cat-card,
.home-category-grid .kirana-cat-card,
.kirana-cat-card {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  cursor: pointer !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.all-category-grid .kirana-cat-img-box,
.kirana-cat-grid .kirana-cat-img-box,
.home-category-grid .kirana-cat-img-box,
.kirana-cat-img-box {
  width: 100% !important;
  max-width: 100% !important;
  aspect-ratio: 1 / 1 !important;
  background: #ffffff !important;
  border-radius: 16px !important;
  border: 1px solid #f1f5f9 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 4px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.all-category-grid .kirana-cat-img-box img,
.kirana-cat-grid .kirana-cat-img-box img,
.home-category-grid .kirana-cat-img-box img,
.kirana-cat-img-box img {
  width: 90% !important;
  height: 90% !important;
  object-fit: contain !important;
}

.all-category-grid .kirana-cat-name,
.kirana-cat-grid .kirana-cat-name,
.home-category-grid .kirana-cat-name,
.kirana-cat-name {
  font-size: 12px !important;
  font-weight: 700 !important;
  color: #1e293b !important;
  line-height: 1.2 !important;
  margin-top: 5px !important;
  font-family: 'Outfit', sans-serif !important;
  text-align: center !important;
  word-break: break-word !important;
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow: hidden !important;
}

/* ============================================================
   PAGE-CATEGORY ONLY FONT SIZE (15px) & UNIFIED GRID
   ============================================================ */
page-category .all-category-grid .kirana-cat-name, 
page-category .kirana-cat-grid .kirana-cat-name, 
page-category .home-category-grid .kirana-cat-name, 
page-category .kirana-cat-name {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #111827 !important;
    line-height: 1.3 !important;
    margin-top: 5px !important;
    font-family: 'Outfit', sans-serif !important;
    text-align: center !important;
    word-break: break-word !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
}

/* iOS Safari Share Pointer Arrow Animation */
.ios-share-pointer-overlay {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  top: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(6px);
  z-index: 999999 !important;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 20px;
  animation: fadeIn 0.25s ease-out;
}

.ios-pointer-box {
  background: #ffffff;
  border-radius: 20px;
  padding: 18px 20px;
  max-width: 320px;
  width: 90%;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  font-family: 'Outfit', sans-serif;
  margin-bottom: 12px;
  animation: bounceUp 1.5s infinite ease-in-out;
}

@keyframes bounceUp {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.ios-down-arrow {
  font-size: 38px;
  color: #16a34a;
  animation: arrowPulse 1.2s infinite ease-in-out;
}

@keyframes arrowPulse {
  0%, 100% { transform: translateY(0) scale(1); opacity: 1; }
  50% { transform: translateY(6px) scale(1.15); opacity: 0.8; }
}

/* ============================================================
   EXACT USER REQUESTED CATEGORY IMAGE BOX STYLES
   ============================================================ */
.all-category-grid .kirana-cat-img-box, 
.kirana-cat-grid .kirana-cat-img-box, 
.home-category-grid .kirana-cat-img-box, 
.kirana-cat-img-box {
    width: 100% !important;
    max-width: 100% !important;
    aspect-ratio: 1 / 1 !important;
    background: #ffffff !important;
    border-radius: 16px !important;
    border: 1px solid #f1f5f9 !important;
    box-shadow: 0 0px 0px rgba(0, 0, 0, 0.05) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 4px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

.all-category-grid .kirana-cat-img-box img, 
.kirana-cat-grid .kirana-cat-img-box img, 
.home-category-grid .kirana-cat-img-box img, 
.kirana-cat-img-box img {
    width: 90% !important;
    height: 90% !important;
    object-fit: contain !important;
}

/* ============================================================
   UNIVERSAL 15px CATEGORY NAME TYPOGRAPHY (HOME & CATEGORY PAGES)
   ============================================================ */
.all-category-grid .kirana-cat-name, 
.kirana-cat-grid .kirana-cat-name, 
.home-category-grid .kirana-cat-name, 
.kirana-cat-name {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #111827 !important;
    line-height: 1.3 !important;
    margin-top: 5px !important;
    font-family: 'Outfit', sans-serif !important;
    text-align: center !important;
    word-break: break-word !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
}

/* ============================================================
   USER SPECIFIED HEADER CSS
   ============================================================ */
ion-header, .location-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0px 0px 0px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}


/* ============================================================
   USER SPECIFIED EXACT CATEGORY TITLE CLAMP CSS
   ============================================================ */
.kirana-cat-title, .cat-name, .cat-chip .cat-name, .category-item-title {
    font-family: 'Outfit', sans-serif !important;
    font-size: clamp(14px, 3.1vw, 12px) !important;
    font-weight: 700 !important;
    color: #111827 !important;
    line-height: 1.2 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-align: center !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 0 1px !important;
}


/* ============================================================
   KIRANA EXPRESS 3-ROW HORIZONTAL CATEGORY SLIDER
   ============================================================ */
.shop-by-cat-3row-slider {
    display: grid !important;
    grid-template-rows: repeat(3, auto) !important;
    grid-auto-flow: column !important;
    grid-auto-columns: min(84px, 22.5vw) !important;
    gap: 12px 10px !important;
    width: 100% !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 4px 2px 12px !important;
    margin: 0 -2px !important;
    box-sizing: border-box !important;
}

.shop-by-cat-3row-slider::-webkit-scrollbar {
    display: none !important;
}

.shop-by-cat-3row-slider .kirana-cat-item {
    scroll-snap-align: start !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    cursor: pointer !important;
    text-align: center !important;
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

.shop-by-cat-3row-slider .kirana-cat-img-box {
    width: 100% !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    border: 1px solid #eef2f5 !important;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.03) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 6px !important;
    margin-bottom: 5px !important;
    box-sizing: border-box !important;
}

.shop-by-cat-3row-slider .kirana-cat-img-box img {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
}

/* ============================================================
   USER SPECIFIED 3-ROW CATEGORY SLIDER TITLE FONT
   ============================================================ */
.shop-by-cat-3row-slider .kirana-cat-title {
    font-family: 'Outfit', sans-serif !important;
    font-size: clamp(14.5px, 2.9vw, 12px) !important;
    font-weight: 700 !important;
    color: #111827 !important;
    line-height: 1.2 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-align: center !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    width: 100% !important;
}


/* ============================================================
   USER SPECIFIED CATEGORY GRID & PAGE CATEGORY BOTTOM PADDING
   ============================================================ */
.all-category-grid, .kirana-cat-grid, .home-category-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 10px 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

page-category ion-content,
page-category .px-2,
page-category .all-category-grid {
    --padding-bottom: 140px !important;
    padding-bottom: 140px !important;
}


/* ============================================================
   PERFECT BULLETPROOF CATEGORY GRID & NO TEXT CUT OFF
   ============================================================ */
/* ============================================================
   USER SPECIFIED EXACT ALL-CATEGORY-GRID CSS
   ============================================================ */
.all-category-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 10px 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    padding-bottom: 20px !important;
}

.all-category-grid .kirana-cat-card,
.kirana-cat-card {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    overflow: visible !important;
    box-sizing: border-box !important;
}

.all-category-grid .kirana-cat-name, 
.kirana-cat-grid .kirana-cat-name, 
.home-category-grid .kirana-cat-name, 
.kirana-cat-name,
page-category .all-category-grid .kirana-cat-name,
page-category .kirana-cat-name {
    font-family: 'Outfit', sans-serif !important;
    font-size: clamp(12px, 3.2vw, 13px) !important;
    font-weight: 700 !important;
    color: #111827 !important;
    line-height: 1.2 !important;
    display: block !important;
    -webkit-line-clamp: none !important;
    -webkit-box-orient: unset !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
    text-align: center !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    width: 100% !important;
    margin-top: 5px !important;
    min-height: 32px !important;
    box-sizing: border-box !important;
}


/* ============================================================
   USER SPECIFIED PRODUCT CARD IMAGE CONTAINER HEIGHT FIX (150px)
   ============================================================ */
.row product-card .img-container, 
#products-grid-container product-card .img-container,
product-card .img-container,
.product-card .img-container {
    height: 150px !important;
}

.row product-card .img-container img, 
#products-grid-container product-card .img-container img,
product-card .img-container img,
.product-card .img-container img {
    max-height: 100% !important;
    object-fit: contain !important;
}
