/* Homepage redesign based on approved mobile mockup */
:root {
  --home-header-bg: #061a3b;
  --home-header-line: #18345d;
  --home-header-gold: #f8c944;
  --home-green: #15935f;
}

body:not(.secondary-tab-active) #appHeader {
  padding: 10px 16px 7px;
  background: var(--home-header-bg);
  border: 0;
  box-shadow: none;
}

body:not(.secondary-tab-active) #appHeader .location-btn {
  max-width: calc(100% - 62px);
  gap: 9px;
  padding-block: 3px;
}

body:not(.secondary-tab-active) #appHeader .location-pin {
  width: 40px;
  height: 40px;
  color: var(--home-header-gold);
  background: rgba(255,255,255,.11);
}

body:not(.secondary-tab-active) #appHeader .location-pin svg { width: 20px; height: 20px; }
body:not(.secondary-tab-active) #appHeader .location-label { color: rgba(255,255,255,.62); font-size: 10px; letter-spacing: .02em; }
body:not(.secondary-tab-active) #appHeader .location-address { margin-top: 2px; color: #fff; font-size: 14.5px; }
body:not(.secondary-tab-active) #appHeader .cart-btn { width: 43px; height: 43px; color: #071a3b; background: var(--home-header-gold); box-shadow: 0 5px 14px rgba(0,0,0,.18); }
body:not(.secondary-tab-active) #appHeader .cart-btn > svg { width: 21px; height: 21px; }

body:not(.secondary-tab-active) #searchWrap {
  padding: 4px 16px 11px;
  background: var(--home-header-bg);
  border-bottom: 1px solid var(--home-header-line);
}

body:not(.secondary-tab-active) #searchWrap .search-bar {
  height: 46px;
  padding: 0 14px;
  gap: 10px;
  border: 0;
  border-radius: 17px;
  background: #f5f6f7;
  box-shadow: none;
}
body:not(.secondary-tab-active) #searchWrap .search-bar > svg { width: 19px; height: 19px; color: #68766f; }
body:not(.secondary-tab-active) #searchWrap .search-bar input { font-size: 15px; color: #39413d; }

body:not(.secondary-tab-active) #appMain { padding: 0 0 84px; background: #fff; }
.home-view { min-height: 100%; }

.home-category-strip {
  padding: 10px 12px 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(70px, 1fr));
  gap: 8px;
  overflow-x: auto;
  background: #061a3b;
  scrollbar-width: none;
}
.home-category-strip::-webkit-scrollbar { display: none; }
.home-category {
  min-width: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  white-space: nowrap;
}
.home-category-icon {
  width: 53px !important;
  height: 53px !important;
  min-width: 53px;
  flex: 0 0 53px;
  display: grid !important;
  place-items: center;
  overflow: hidden !important;
  border-radius: 999px !important;
  background: #e9f2c9;
  color: #207c46;
  font-size: 22px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.22);
}
.home-category-icon img {
  width: 100% !important;
  height: 100% !important;
  min-width: 100%;
  display: block !important;
  border-radius: 999px !important;
  object-fit: cover !important;
  object-position: center !important;
  transform: scale(1.82);
  transform-origin: center;
}
.home-category.active { color: var(--home-header-gold); }
.home-category.active .home-category-icon { box-shadow: 0 0 0 2px var(--home-header-gold); }
.category-4 .home-category-icon { background: #ffd9bf; color: #ee7940; }

.home-section { padding: 20px 16px 0; }
.home-section-head { margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; }
.home-section-head h2 { color: #111; font-size: 18px; font-weight: 800; }
.home-section-head button { color: var(--home-green); font-size: 13px; font-weight: 700; }

.featured-store-row,
.best-product-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 145px;
  gap: 11px;
  overflow-x: auto;
  padding: 1px 1px 9px;
  scrollbar-width: none;
}
.featured-store-row::-webkit-scrollbar,
.best-product-row::-webkit-scrollbar { display: none; }

.featured-store-card {
  overflow: hidden;
  border: 1px solid #edf0ee;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 5px 14px rgba(20,35,27,.08);
  text-align: left;
}
.featured-store-card img { width: 100%; height: 92px; object-fit: cover; }
.featured-store-info { padding: 10px 9px 11px; display: flex; flex-direction: column; gap: 5px; }
.featured-store-info strong { overflow: hidden; color: #111; font-size: 13px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.featured-store-info span { font-size: 10.5px; font-weight: 600; }
.store-clock { color: #56645d; }
.free-delivery { color: var(--home-green); }

.products-section { padding-top: 22px; }
.best-product-card {
  min-height: 205px;
  padding: 10px 10px 11px;
  border: 1px solid #edf0ee;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 4px 13px rgba(20,35,27,.07);
}
.best-product-image { height: 112px; display: grid; place-items: center; }
.best-product-image img { max-width: 94%; max-height: 104px; object-fit: contain; }
.best-product-card > strong { display: block; overflow: hidden; color: #161616; font-size: 12.5px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.best-product-card > span { display: block; margin-top: 4px; color: #68736e; font-size: 10.5px; }
.best-product-foot { margin-top: 9px; display: flex; align-items: center; justify-content: space-between; }
.best-product-foot b { color: #111; font-size: 14px; }
.best-product-foot button { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 10px; background: var(--home-green); color: #fff; font-size: 22px; line-height: 1; }
.home-no-result { grid-column: 1 / -1; padding: 28px 4px; color: #78827d; font-size: 13px; }

body:not(.secondary-tab-active) .bottom-nav {
  min-height: 68px;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  border-top: 1px solid #e5e9e6;
  box-shadow: 0 -3px 12px rgba(20,35,27,.04);
}
body:not(.secondary-tab-active) .nav-item {
  min-height: 54px;
  padding: 4px 0;
  gap: 2px;
  color: #64736c;
}
body:not(.secondary-tab-active) .nav-icon {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
}
body:not(.secondary-tab-active) .nav-icon svg { width: 23px; height: 23px; stroke-width: 2; }
body:not(.secondary-tab-active) .nav-label { font-size: 10.5px; font-weight: 750; line-height: 1.1; }
body:not(.secondary-tab-active) .nav-dot { display: none; }
body:not(.secondary-tab-active) .nav-item.active { color: var(--home-green); }

.product-thumb img { width: 100%; height: 100%; object-fit: contain; }

@media (max-width: 390px) {
  body:not(.secondary-tab-active) #appHeader { padding-inline: 14px; }
  body:not(.secondary-tab-active) #searchWrap { padding-inline: 14px; }
  .home-category-strip { gap: 6px; padding-inline: 9px; grid-template-columns: repeat(4, minmax(64px, 1fr)); }
  .home-category { min-width: 64px; font-size: 9px; }
  .home-category-icon { width: 50px !important; height: 50px !important; min-width: 50px; flex-basis: 50px; }
  .featured-store-row, .best-product-row { grid-auto-columns: 132px; }
  body:not(.secondary-tab-active) .bottom-nav { min-height: 64px; padding-top: 5px; }
  body:not(.secondary-tab-active) .nav-item { min-height: 50px; }
  body:not(.secondary-tab-active) .nav-icon { width: 24px; height: 24px; }
  body:not(.secondary-tab-active) .nav-icon svg { width: 22px; height: 22px; }
  body:not(.secondary-tab-active) .nav-label { font-size: 10px; }
}