﻿.sc-homepage .home-shell {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding-bottom: 160px;
  margin-bottom: 80px;
}
.sc-homepage .home-tab-panel {
  display: grid;
  gap: 24px;
  align-content: start;
  min-width: 0;
}
.sc-homepage .home-section {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin: 0;
}
.sc-homepage .home-daily-essentials,
.sc-homepage .home-category-section {
  margin: 0;
}
.sc-homepage .home-rail-shell {
  position: relative;
  min-width: 0;
}
.sc-homepage .promo-strip {
  overflow: hidden;
}
.sc-homepage .promo-track {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x pinch-zoom;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
}
.sc-homepage .promo-track::-webkit-scrollbar {
  display: none;
}
.sc-homepage .promo-card {
  flex: 0 0 min(86vw, 340px);
  border-radius: 18px;
  padding: 0;
  overflow: hidden;
  background: #f3f4f6;
  min-height: 118px;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
.sc-homepage .promo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sc-homepage .sc-nav-home-tabs {
  padding: 6px 0 2px;
}

.sc-homepage .sc-nav-home-tabs .home-tab-strip {
  display: block;
  min-height: 40px;
  padding: 4px 0;
  margin: 0;
  background: transparent;
  border: 0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  position: relative;
  z-index: 2;
}

.sc-homepage .sc-nav-home-tabs .home-tab-strip::-webkit-scrollbar {
  display: none;
}

.sc-homepage .sc-nav-home-tabs .home-tab-row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  width: max-content;
  min-width: 100%;
  min-height: 38px;
  margin: 0 auto;
  padding: 0 14px 2px;
  overflow: visible;
  scrollbar-width: none;
  scroll-padding-inline: 14px;
}

.sc-homepage .sc-nav-home-tabs .home-tab-row::-webkit-scrollbar {
  display: none;
}

.sc-homepage .sc-nav-home-tabs .home-tab-pill {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  padding: 7px 14px;
  min-height: 32px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.96);
  font-size: 12px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: none;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.sc-homepage .sc-nav-home-tabs .home-tab-pill.is-active {
  background: #fff;
  color: #1f2937;
  border-color: rgba(255, 255, 255, 0.9);
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
}

.sc-homepage .sc-nav-home-tabs .home-tab-pill:active {
  transform: scale(0.98);
}

.sc-homepage .sc-nav-home-tabs .home-tab-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  line-height: 1.35;
  padding: 0 1px 0;
}

.sc-homepage .sc-nav-home-tabs .home-tab-summary strong {
  font-size: 13px;
  line-height: 1.2;
  font-weight: 800;
}

.sc-homepage .home-shell section[hidden] {
  display: none !important;
}

@media (max-width: 768px) {
  .sc-homepage .sc-nav-home-tabs {
    padding-top: 4px;
  }

  .sc-homepage .sc-nav-home-tabs .home-tab-pill {
    padding: 7px 13px;
    min-height: 32px;
    font-size: 12px;
  }

  .sc-homepage .sc-nav-home-tabs .home-tab-summary {
    display: none;
  }

  .sc-homepage .sc-nav-home-tabs .home-tab-summary strong {
    font-size: 13px;
  }
}

@media (max-width: 899.98px) {
  .sc-homepage .sc-nav--home .sc-nav-home-tabs {
    grid-area: tabs;
    display: block;
    width: 100%;
    min-height: 42px;
    align-self: start;
    padding: 0;
    margin-top: 2px;
    position: relative;
    z-index: 2;
  }

  .sc-homepage .sc-nav--home .sc-nav-home-tabs .home-tab-strip {
    display: block;
    min-height: 38px;
    padding: 4px 0;
    margin: 0;
    background: transparent;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .sc-homepage .sc-nav--home .sc-nav-home-tabs .home-tab-row {
    justify-content: center;
    gap: 4px;
    width: max-content;
    min-width: 100%;
    margin: 0 auto;
    padding: 0 16px 2px;
    min-height: 38px;
    overflow: visible;
    scroll-padding-inline: 16px;
  }

  .sc-homepage .sc-nav.is-collapsed .sc-nav-home-tabs {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
  }
}

@media (min-width: 900px) {
  .sc-homepage .sc-nav--home .sc-nav-home-tabs {
    display: none !important;
  }

  .sc-homepage .home-daily-essentials {
    display: none !important;
  }
}

.sc-homepage .home-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}
.sc-homepage .home-section-head h2 {
  margin: 0;
  font-size: 16px;
}
.sc-homepage .home-section-head a {
  font-size: 12px;
  color: #0d6e5f;
  text-decoration: none;
  font-weight: 600;
}

.sc-homepage .home-category-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.sc-homepage .home-category-section-head h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.02em;
}

.sc-homepage .home-category-subgrid {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.sc-homepage .home-subcat-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: inherit;
  background: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  transition:
    transform 0.15s ease,
    opacity 0.15s ease;
}

.sc-homepage .home-subcat-card:active {
  transform: scale(0.98);
}

.sc-homepage .home-subcat-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  background: #eef0f2;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 6px;
  color: #16a34a;
  font-weight: 800;
  font-size: 16px;
}

.sc-homepage .home-subcat-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.sc-homepage .home-subcat-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 30px;
  font-size: 11px;
  line-height: 1.25;
  font-weight: 700;
  color: #111827;
}

.sc-homepage .home-product-rail {
  display: grid;
  width: 100%;
  max-width: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  overflow: visible;
  padding: 0;
}

.sc-homepage .home-product-rail::-webkit-scrollbar {
  display: none;
}
.sc-homepage .home-product-rail.is-dragging {
  cursor: grabbing;
}

.sc-homepage .home-skeleton-rail {
  display: grid;
  width: 100%;
  max-width: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 0;
}
.sc-homepage .home-skel-card {
  height: 190px;
  border-radius: 10px;
  background: linear-gradient(90deg, #eef2f7 25%, #f6f7f9 37%, #eef2f7 63%);
  background-size: 400% 100%;
  animation: home-skel 1.2s ease-in-out infinite;
}
@keyframes home-skel {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: 0 0;
  }
}

.sc-homepage .home-product-rail > .home-product-card,
.sc-homepage .home-product-rail > .card {
  min-width: 0;
  max-width: 100%;
}

.sc-homepage .home-empty-state {
  padding: 14px 16px;
  border-radius: 16px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.4;
}

/* Home now fetches exactly 6 items per section (no CSS hiding). */

.sc-homepage .home-product-card {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.sc-homepage .home-product-link {
  text-decoration: none;
  color: inherit;
}
.sc-homepage .home-product-link img {
  width: 100%;
  height: 120px;
  object-fit: contain;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #eef2f7;
}
.sc-homepage .home-product-card h4 {
  margin: 0;
  font-size: inherit;
  min-height: 0;
  line-height: inherit;
}
.sc-homepage .home-price-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.sc-homepage .home-price-row strong {
  color: #0d6e5f;
}
.sc-homepage .home-price-row span {
  font-size: 11px;
  color: #98a2b3;
  text-decoration: line-through;
}
.sc-homepage .home-card-actions {
  margin-top: auto;
}
.sc-homepage .home-product-card .btn {
  width: 100%;
}
.sc-homepage .home-add-btn {
  border-radius: 10px;
}
.sc-homepage .home-qty-wrap {
  grid-template-columns: 32px 1fr 32px;
}
.sc-homepage .home-qty-wrap .qty-btn {
  width: 32px;
  height: 32px;
}
.sc-homepage .home-product-image-wrap {
  position: relative;
  border: 1px solid #eef2f7;
  border-radius: 10px;
  background: #f8fafc;
  height: 120px;
  overflow: hidden;
}

/* Home card media: keep product images perfectly centered + contained (Blinkit-like). */
.sc-homepage .home-shell .gp-product-image-wrap {
  display: grid;
  place-items: center;
}
.sc-homepage .home-shell .gp-product-image-wrap .sc-image-slider {
  width: 100%;
  height: 100%;
  align-items: center;
}
.sc-homepage .home-shell .gp-product-image-wrap .sc-image-slide {
  display: block;
  margin: 0;
}
.sc-homepage .home-shell .gp-product-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.sc-homepage .home-product-link img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.sc-homepage .home-card-slider {
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  touch-action: pan-y;
  cursor: grab;
}
.sc-homepage .home-card-slider::-webkit-scrollbar {
  display: none;
}
.sc-homepage .home-card-slider.is-dragging {
  cursor: grabbing;
}
.sc-homepage .home-card-slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
  scroll-snap-align: start;
  user-select: none;
  -webkit-user-drag: none;
}
.sc-homepage .home-card-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  min-height: 10px;
}
.sc-homepage .home-card-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  border: 0;
  padding: 0;
  background: #cbd5e1;
}
.sc-homepage .home-card-dot.is-active {
  background: #0d6e5f;
}
.sc-homepage .sc-card-media {
  position: relative;
}
.sc-homepage .gp-wishlist-heart {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #ffffff;
  font-size: 16px;
  line-height: 1;
  display: grid;
  place-items: center;
  box-shadow: none;
  cursor: pointer;
  padding: 0;
}
.sc-homepage .gp-wishlist-heart.saved {
  color: #ef4444;
  background: transparent;
}
.sc-homepage .gp-wishlist-heart.gp-wishlist-heart-left {
  right: auto;
  left: 8px;
}
.sc-homepage .sc-float-cart.is-busy {
  opacity: 0.72;
}

.sc-homepage .home-rail-nav {
  display: none;
  position: absolute;
  top: 40%;
  transform: translateY(-50%);
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid #d9e2ec;
  background: rgba(255, 255, 255, 0.95);
  color: #0d6e5f;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 12px rgba(17, 24, 39, 0.12);
}
.sc-homepage .home-rail-nav img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  display: block;
}
.sc-homepage .home-rail-nav[data-dir="left"] {
  left: -8px;
}
.sc-homepage .home-rail-nav[data-dir="right"] {
  right: -8px;
}

@media (min-width: 640px) {
  .sc-homepage .container {
    padding: 16px;
  }
}

@media (min-width: 900px) {
  .sc-homepage .promo-card {
    flex-basis: min(31vw, 320px);
  }

  .sc-homepage .home-category-section {
    margin-top: 18px;
  }

  .sc-homepage .home-category-subgrid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
  }

  .sc-homepage .home-subcat-card:hover {
    transform: translateY(-1px);
    opacity: 0.96;
  }

  .sc-homepage .home-subcat-thumb {
    border-radius: 16px;
  }

  /* Home uses grid everywhere; keep rail nav hidden on desktop too. */
  .sc-homepage .home-rail-nav {
    display: none;
  }
  .sc-homepage .home-product-rail {
    padding: 0;
  }
}

@media (min-width: 1200px) {
  .sc-homepage .home-category-subgrid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

/* Desktop tuning: keep mobile 3x2 grid unchanged, but avoid oversized cards on wide screens. */
@media (min-width: 900px) {
  .sc-homepage .home-product-rail {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
  }

  .sc-homepage .home-shell .gp-product-image-wrap {
    height: 140px;
  }

  .sc-homepage .home-shell .gp-product-image-wrap .sc-image-slider {
    height: 100%;
  }
}
