/* FIX178 — Mobile runtime cleanup + search-mode presentation
   Loaded last. Explicitly normalizes previous FIX170–177 cascade. */

html{
  overflow-x:clip;
}
@supports not (overflow:clip){
  html{overflow-x:hidden}
}
body.sp-ios-home{
  overflow-x:clip!important;
}
@supports not (overflow:clip){
  body.sp-ios-home{overflow-x:hidden!important}
}

/* Search mode: discovery should never precede results. Server also suppresses the discovery DOM. */
body.sp-ios-home.sp-search-mode .sp-ios-discovery,
body.sp-ios-home.sp-search-mode .sp174-hero,
body.sp-ios-home.sp-search-mode .sp174-services,
body.sp-ios-home.sp-search-mode #categories,
body.sp-ios-home.sp-search-mode .banners,
body.sp-ios-home.sp-search-mode .sp-ios-reel-modal{
  display:none!important;
}
body.sp-ios-home .sp178-search-intro{
  display:none;
}
body.sp-ios-home.sp-search-mode .sp178-search-intro{
  display:flex;
  align-items:center;
  gap:10px;
  margin:8px 0 12px;
  padding:12px 14px;
  border:1px solid #eceef3;
  border-radius:16px;
  background:#fff;
  box-shadow:0 5px 18px rgba(15,23,42,.04);
}
body.sp-ios-home.sp-search-mode .sp178-search-kicker{
  display:inline-flex;
  align-items:center;
  min-height:25px;
  padding:0 9px;
  border-radius:999px;
  background:#fff2ea;
  color:#e85d1f;
  font-size:9px;
  font-weight:900;
}
body.sp-ios-home.sp-search-mode .sp178-search-intro strong{
  min-width:0;
  flex:1;
  overflow:hidden;
  color:#111827;
  font-size:15px;
  font-weight:900;
  white-space:nowrap;
  text-overflow:ellipsis;
}
body.sp-ios-home.sp-search-mode .sp178-search-intro small{
  color:#7b8190;
  font-size:10px;
  font-weight:750;
  white-space:nowrap;
}

/* ===================================================================
   PHONE — hard normalization. Do not allow tablet rules to leak here.
   =================================================================== */
@media (max-width:599px){
  body.sp-ios-home{
    padding-bottom:calc(94px + env(safe-area-inset-bottom,0px))!important;
  }

  /* Header geometry */
  body.sp-ios-home .sl-online-header{
    position:sticky!important;
    top:0!important;
    z-index:190!important;
    padding:5px 0 6px!important;
    border:0!important;
    background:rgba(255,255,255,.97)!important;
    box-shadow:0 1px 0 rgba(15,23,42,.055)!important;
    transform:none!important;
  }
  body.sp-ios-home .sl-online-header-inner{
    box-sizing:border-box!important;
    width:calc(100% - 12px)!important;
    max-width:none!important;
    min-width:0!important;
    min-height:54px!important;
    margin:0 6px!important;
    padding:5px!important;
    display:grid!important;
    grid-template-columns:40px minmax(0,1fr) 39px 39px!important;
    gap:5px!important;
    align-items:center!important;
    border:1px solid rgba(15,23,42,.055)!important;
    border-radius:17px!important;
    background:#fff!important;
    box-shadow:0 4px 14px rgba(15,23,42,.045)!important;
    transform:none!important;
  }
  body.sp-ios-home .sl-header-logo-link{
    box-sizing:border-box!important;
    width:40px!important;
    min-width:40px!important;
    height:40px!important;
    min-height:40px!important;
    padding:3px!important;
    margin:0!important;
    border:0!important;
    border-radius:13px!important;
    background:#fff5ed!important;
    box-shadow:none!important;
    transform:none!important;
  }
  body.sp-ios-home .sl-header-logo{
    width:34px!important;
    height:34px!important;
    object-fit:contain!important;
    filter:none!important;
  }
  body.sp-ios-home .sl-header-search{
    box-sizing:border-box!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    height:40px!important;
    margin:0!important;
    padding:0 7px!important;
    display:flex!important;
    align-items:center!important;
    border:1px solid #edf0f4!important;
    border-radius:13px!important;
    background:#f7f8fa!important;
    box-shadow:none!important;
    transform:none!important;
    overflow:hidden!important;
  }
  body.sp-ios-home .sl-header-search::before{
    content:""!important;
    width:15px!important;
    min-width:15px!important;
    height:15px!important;
    margin:0 2px!important;
    border:0!important;
    border-radius:0!important;
    background-color:transparent!important;
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364758b' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.8-3.8'/%3E%3C/svg%3E")!important;
    background-size:15px 15px!important;
    background-repeat:no-repeat!important;
    background-position:center!important;
    box-shadow:none!important;
    flex:0 0 15px!important;
  }
  body.sp-ios-home .sl-header-search-input{
    box-sizing:border-box!important;
    width:100%!important;
    min-width:0!important;
    height:38px!important;
    padding:0 5px!important;
    border:0!important;
    background:transparent!important;
    color:#263244!important;
    font-size:12px!important;
    font-weight:750!important;
    line-height:38px!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }
  body.sp-ios-home .sl-header-search-input::placeholder{
    color:#9aa3b2!important;
    font-size:11px!important;
    font-weight:650!important;
  }
  body.sp-ios-home .sl-header-scan,
  body.sp-ios-home .sl-header-cart{
    box-sizing:border-box!important;
    width:39px!important;
    min-width:39px!important;
    max-width:39px!important;
    height:39px!important;
    min-height:39px!important;
    margin:0!important;
    padding:0!important;
    border:0!important;
    border-radius:13px!important;
    background:#111827!important;
    color:#fff!important;
    box-shadow:none!important;
    transform:none!important;
  }
  body.sp-ios-home .sl-header-scan svg,
  body.sp-ios-home .sl-header-cart svg{
    width:19px!important;
    height:19px!important;
  }

  /* Mobile shell */
  body.sp-ios-home .shell{
    box-sizing:border-box!important;
    width:100%!important;
    max-width:none!important;
    min-width:0!important;
    margin:0!important;
    padding:9px 9px 26px!important;
    overflow:visible!important;
  }

  /* Instagram Stories */
  body.sp-ios-home .sp-ios-highlights{
    box-sizing:border-box!important;
    width:auto!important;
    max-width:none!important;
    min-width:0!important;
    margin:0 -9px!important;
    padding:4px 9px 7px!important;
    display:flex!important;
    gap:9px!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    scroll-snap-type:x proximity!important;
    overscroll-behavior-inline:contain!important;
    scrollbar-width:none!important;
  }
  body.sp-ios-home .sp-ios-highlights::-webkit-scrollbar{display:none!important}
  body.sp-ios-home .sp-ios-highlight{
    flex:0 0 64px!important;
    width:64px!important;
    min-width:64px!important;
    max-width:64px!important;
  }
  body.sp-ios-home .sp-ios-highlight-ring{
    width:56px!important;
    height:56px!important;
    min-width:56px!important;
    padding:2.5px!important;
  }
  body.sp-ios-home .sp-ios-highlight-core{
    width:51px!important;
    height:51px!important;
    font-size:19px!important;
  }
  body.sp-ios-home .sp-ios-highlight strong{
    display:-webkit-box!important;
    width:64px!important;
    max-width:64px!important;
    min-height:24px!important;
    margin:0!important;
    overflow:hidden!important;
    color:#25272c!important;
    font-size:8.6px!important;
    font-weight:760!important;
    line-height:1.3!important;
    white-space:normal!important;
    text-overflow:clip!important;
    -webkit-box-orient:vertical!important;
    -webkit-line-clamp:2!important;
  }

  /* Keep the current hero; only guard its mobile geometry. */
  body.sp-ios-home .sp174-hero{
    box-sizing:border-box!important;
    width:100%!important;
    max-width:100%!important;
    min-height:160px!important;
    grid-template-columns:minmax(0,1fr) minmax(108px,38%)!important;
    gap:5px!important;
    padding:14px 12px!important;
    overflow:hidden!important;
  }
  body.sp-ios-home .sp174-hero-copy{min-width:0!important}
  body.sp-ios-home .sp174-hero-copy h1{
    font-size:18px!important;
    line-height:1.18!important;
  }
  body.sp-ios-home .sp174-hero-copy p{
    margin:5px 0 8px!important;
    font-size:8.8px!important;
  }
  body.sp-ios-home .sp174-hero-cta{
    min-height:30px!important;
    padding:0 10px!important;
    font-size:8.8px!important;
    white-space:nowrap!important;
  }
  body.sp-ios-home .sp174-hero-books{
    width:100%!important;
    min-width:0!important;
    height:108px!important;
  }

  /* Featured: approximately 2.3–2.5 cards visible. */
  body.sp-ios-home .sp-ios-block--featured .sp-ios-rail{
    box-sizing:border-box!important;
    width:auto!important;
    max-width:none!important;
    min-width:0!important;
    margin:0 -9px!important;
    padding:1px 9px 8px!important;
    display:flex!important;
    grid-template-columns:none!important;
    gap:8px!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    scroll-snap-type:x mandatory!important;
    overscroll-behavior-inline:contain!important;
    scrollbar-width:none!important;
  }
  body.sp-ios-home .sp-ios-block--featured .sp-ios-rail::-webkit-scrollbar{display:none!important}
  body.sp-ios-home .sp-ios-featured-card{
    box-sizing:border-box!important;
    flex:0 0 clamp(142px,40vw,154px)!important;
    width:clamp(142px,40vw,154px)!important;
    min-width:clamp(142px,40vw,154px)!important;
    max-width:154px!important;
    min-height:0!important;
    display:flex!important;
    flex-direction:column!important;
    border-radius:14px!important;
    scroll-snap-align:start!important;
  }
  body.sp-ios-home .sp-ios-featured-media{
    box-sizing:border-box!important;
    width:100%!important;
    aspect-ratio:4/5!important;
    overflow:hidden!important;
  }
  body.sp-ios-home .sp-ios-featured-media img{
    width:100%!important;
    height:100%!important;
    object-fit:contain!important;
    padding:7px!important;
    box-sizing:border-box!important;
  }
  body.sp-ios-home .sp-ios-featured-copy{
    box-sizing:border-box!important;
    min-width:0!important;
    flex:1!important;
    display:flex!important;
    flex-direction:column!important;
    padding:7px 8px 9px!important;
  }
  body.sp-ios-home .sp-ios-featured-copy strong{
    display:-webkit-box!important;
    min-height:32px!important;
    overflow:hidden!important;
    font-size:9.6px!important;
    line-height:1.4!important;
    -webkit-box-orient:vertical!important;
    -webkit-line-clamp:2!important;
  }
  body.sp-ios-home .sp-ios-featured-price{
    margin-top:auto!important;
    padding-top:6px!important;
    font-size:10.5px!important;
    white-space:nowrap!important;
  }

  /* Search mode results should start immediately after header. */
  body.sp-ios-home.sp-search-mode .shell{
    padding-top:8px!important;
  }
  body.sp-ios-home.sp-search-mode .sp178-search-intro{
    margin-top:0!important;
  }
  body.sp-ios-home.sp-search-mode #products{
    margin-top:0!important;
  }
  body.sp-ios-home.sp-search-mode #products .section-head{
    margin-top:0!important;
  }

  /* Bottom nav final reset: kills FIX172 tablet centered transform and all width caps. */
  body.sp-ios-home .bottom-nav{
    box-sizing:border-box!important;
    position:fixed!important;
    top:auto!important;
    right:8px!important;
    left:8px!important;
    inset-inline:8px!important;
    bottom:calc(7px + env(safe-area-inset-bottom,0px))!important;
    width:auto!important;
    min-width:0!important;
    max-width:none!important;
    height:58px!important;
    margin:0!important;
    padding:4px!important;
    display:grid!important;
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
    grid-auto-flow:column!important;
    gap:0!important;
    overflow:hidden!important;
    border:1px solid rgba(15,23,42,.08)!important;
    border-radius:19px!important;
    background:rgba(255,255,255,.97)!important;
    box-shadow:0 12px 30px rgba(15,23,42,.12)!important;
    transform:none!important;
    translate:none!important;
    direction:rtl!important;
    -webkit-backdrop-filter:blur(18px)!important;
    backdrop-filter:blur(18px)!important;
  }
  body.sp-ios-home .bottom-nav .nav-btn,
  body.sp-ios-home .bottom-nav .sp174-nav-created{
    box-sizing:border-box!important;
    position:relative!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    height:50px!important;
    min-height:50px!important;
    margin:0!important;
    padding:2px!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:center!important;
    gap:2px!important;
    border:0!important;
    border-radius:14px!important;
    background:transparent!important;
    color:#697180!important;
    box-shadow:none!important;
    transform:none!important;
    translate:none!important;
    text-decoration:none!important;
  }
  body.sp-ios-home .bottom-nav .nav-btn svg{
    width:18px!important;
    height:18px!important;
    flex:0 0 18px!important;
  }
  body.sp-ios-home .bottom-nav .nav-btn span{
    display:block!important;
    max-width:100%!important;
    overflow:hidden!important;
    font-size:8px!important;
    font-weight:780!important;
    line-height:1.05!important;
    white-space:nowrap!important;
    text-overflow:ellipsis!important;
  }
  body.sp-ios-home .bottom-nav .nav-btn.active{
    background:#fff3eb!important;
    color:#ef6526!important;
    box-shadow:none!important;
  }

  /* WhatsApp clear of navigation and reduced visual footprint. */
  body.sp-ios-home .sp-floating-whatsapp{
    box-sizing:border-box!important;
    position:fixed!important;
    right:11px!important;
    left:auto!important;
    bottom:calc(80px + env(safe-area-inset-bottom,0px))!important;
    width:40px!important;
    min-width:40px!important;
    max-width:40px!important;
    height:40px!important;
    min-height:40px!important;
    margin:0!important;
    padding:0!important;
    border-radius:50%!important;
    transform:none!important;
    z-index:185!important;
    box-shadow:0 8px 20px rgba(18,181,117,.18)!important;
  }
  body.sp-ios-home .sp-floating-whatsapp-text{display:none!important}

  /* Product results always clear fixed UI. */
  body.sp-ios-home #products{
    scroll-margin-top:72px!important;
    padding-bottom:16px!important;
  }
}

/* Compact phones */
@media (max-width:390px){
  body.sp-ios-home .sl-online-header-inner{
    grid-template-columns:38px minmax(0,1fr) 37px 37px!important;
    gap:4px!important;
  }
  body.sp-ios-home .sl-header-logo-link{
    width:38px!important;min-width:38px!important;height:38px!important;min-height:38px!important
  }
  body.sp-ios-home .sl-header-logo{width:32px!important;height:32px!important}
  body.sp-ios-home .sl-header-search{height:38px!important;padding-inline:6px!important}
  body.sp-ios-home .sl-header-search-input,
  body.sp-ios-home .sl-header-search-input::placeholder{font-size:11px!important}
  body.sp-ios-home .sl-header-scan,
  body.sp-ios-home .sl-header-cart{
    width:37px!important;min-width:37px!important;max-width:37px!important;height:37px!important;min-height:37px!important
  }
  body.sp-ios-home .sp-ios-featured-card{
    flex-basis:142px!important;
    width:142px!important;
    min-width:142px!important;
  }
}

/* Small tablet gets its own clean layout; no phone nav transforms inherited. */
@media (min-width:600px) and (max-width:899px){
  body.sp-ios-home .bottom-nav{
    box-sizing:border-box!important;
    position:fixed!important;
    top:auto!important;
    right:50%!important;
    left:auto!important;
    bottom:calc(10px + env(safe-area-inset-bottom,0px))!important;
    width:min(calc(100% - 24px),560px)!important;
    max-width:560px!important;
    min-width:0!important;
    height:62px!important;
    margin:0!important;
    padding:4px!important;
    display:grid!important;
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
    gap:0!important;
    border-radius:21px!important;
    transform:translateX(50%)!important;
  }
}

/* Search mode on all viewport sizes. */
body.sp-ios-home.sp-search-mode .sp178-search-intro + #products{
  margin-top:0!important;
}
