html:has(#nm-home-shimmer) { overflow: hidden; }
/* Homepage loading placeholder follows the storefront header and content. */
.nm-home-page .preloader-wrapper { display: none !important; }
.nm-home-shimmer {
  position: fixed;
  inset: 0;
  z-index: 4000;
  overflow-y: auto;
  background: #fff;
  padding-bottom: 40px;
}
.nm-home-shimmer i,
.nm-home-shimmer b,
.nm-home-shimmer span,
.nm-shimmer-heading,
.nm-shimmer-hero {
  display: block;
  background: linear-gradient(100deg, #edf0ed 20%, #f8faf8 38%, #edf0ed 56%);
  background-size: 220% 100%;
  animation: nm-shimmer-wave 1.35s ease-in-out infinite;
}
.nm-shimmer-header { background: #fff; border-bottom: 1px solid #ececec; }
.nm-shimmer-topbar {
  display: grid;
  grid-template-columns: 42px 1fr 1fr auto auto;
  grid-template-areas: "logo location location location location" "search search search account cart";
  gap: 8px 10px;
  align-items: center;
  padding: 10px 12px 8px;
}
.nm-shimmer-logo { grid-area: logo; width: 38px; height: 30px; border-radius: 6px; }
.nm-shimmer-location { grid-area: location; justify-self: end; width: 58%; height: 18px; border-radius: 6px; }
.nm-shimmer-search { grid-area: search; height: 38px; border-radius: 10px; }
.nm-shimmer-action { width: 42px; height: 24px; border-radius: 6px; }
.nm-shimmer-action:nth-of-type(4) { grid-area: account; }
.nm-shimmer-action:nth-of-type(5) { grid-area: cart; }
.nm-shimmer-menu {
  display: flex;
  gap: 4px;
  overflow: hidden;
  padding: 0 8px;
  border-top: 1px solid #e4e4e4;
  scrollbar-width: none;
}
.nm-shimmer-menu i {
  position: relative;
  box-sizing: border-box;
  flex: 0 0 68px;
  height: 56px;
  padding: 8px 10px 7px;
  border-radius: 0;
  background: transparent;
  animation: none;
}
.nm-shimmer-menu i::before,
.nm-shimmer-menu i::after {
  content: "";
  position: absolute;
  left: 50%;
  display: block;
  background: linear-gradient(100deg, #edf0ed 20%, #f8faf8 38%, #edf0ed 56%);
  background-size: 220% 100%;
  animation: nm-shimmer-wave 1.35s ease-in-out infinite;
  transform: translateX(-50%);
}
.nm-shimmer-menu i::before { top: 8px; width: 22px; height: 22px; border-radius: 5px; }
.nm-shimmer-menu i::after { bottom: 11px; width: 40px; height: 12px; border-radius: 6px; }
.nm-shimmer-hero { height: 168px; margin: 12px 12px 0; border-radius: 8px; }
.nm-shimmer-container { width: min(1280px, calc(100% - 40px)); margin: 30px auto 0; }
.nm-shimmer-heading { width: 190px; height: 25px; border-radius: 7px; margin-bottom: 24px; }
.nm-shimmer-categories { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 22px; }
.nm-shimmer-category { display: grid; justify-items: center; gap: 12px; }
.nm-shimmer-category i { width: min(100%, 100px); aspect-ratio: 1; border-radius: 50%; }
.nm-shimmer-category b { width: 72%; height: 12px; border-radius: 6px; }
.nm-shimmer-heading-products { margin-top: 42px; width: 230px; }
.nm-shimmer-products { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; }
.nm-shimmer-product { min-width: 0; padding: 16px; border: 1px solid #edf0ed; border-radius: 14px; }
.nm-shimmer-product i { width: 100%; aspect-ratio: 1.15; border-radius: 10px; margin-bottom: 17px; }
.nm-shimmer-product b { width: 80%; height: 14px; border-radius: 7px; margin-bottom: 13px; }
.nm-shimmer-product span { width: 48%; height: 11px; border-radius: 6px; margin-top: 9px; }
@keyframes nm-shimmer-wave { to { background-position-x: -220%; } }
@media (min-width: 768px) {
  .nm-shimmer-topbar { grid-template-areas: "logo location search account cart"; padding: 14px 20px 8px; max-width: 1280px; margin: auto; }
  .nm-shimmer-location { justify-self: start; width: 100%; }
  .nm-shimmer-search { height: 42px; }
  .nm-shimmer-menu { max-width: 1280px; margin: auto; justify-content: space-between; gap: 8px; padding: 0 12px; }
  .nm-shimmer-menu i { flex: 1 1 0; min-width: 0; height: 70px; padding: 10px 6px 8px; }
  .nm-shimmer-menu i::before { top: 10px; }
  .nm-shimmer-menu i::after { bottom: 12px; }
  .nm-shimmer-hero { height: 280px; margin: 16px 16px 0; }
}
@media (min-width: 992px) {
  .nm-shimmer-hero { max-width: 1240px; height: 360px; margin: 18px auto 0; }
}
@media (max-width: 767px) {
  .nm-shimmer-container { width: calc(100% - 28px); margin-top: 22px; }
  .nm-shimmer-categories { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px 12px; }
  .nm-shimmer-category i { width: min(100%, 72px); }
  .nm-shimmer-heading-products { margin-top: 32px; }
  .nm-shimmer-products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .nm-shimmer-product { padding: 11px; }
  .nm-shimmer-product:nth-child(n+5) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .nm-home-shimmer i, .nm-home-shimmer b, .nm-home-shimmer span,
  .nm-shimmer-heading, .nm-shimmer-hero { animation: none; }
}
