/* FIX177 — Mobile Home Recovery
   Scope: HOME mobile only. Designed to override FIX174/175/176 conflicts safely. */

@media (max-width:699px){
  body.sp-ios-home{
    --sp177-bg:#ffffff;
    --sp177-ink:#111827;
    --sp177-muted:#6b7280;
    --sp177-line:#eceef2;
    --sp177-brand:#f36b2d;
    --sp177-nav-h:62px;
    background:var(--sp177-bg)!important;
    padding-bottom:calc(82px + env(safe-area-inset-bottom,0px))!important;
    overflow-x:hidden!important;
  }

  /* HEADER: compact single-row mobile bar */
  body.sp-ios-home .sl-online-header{
    position:sticky!important;
    top:0!important;
    z-index:180!important;
    padding:6px 0 7px!important;
    border:0!important;
    background:rgba(255,255,255,.96)!important;
    box-shadow:0 1px 0 rgba(15,23,42,.06)!important;
    -webkit-backdrop-filter:blur(18px)!important;
    backdrop-filter:blur(18px)!important;
  }
  body.sp-ios-home .sl-online-header-inner{
    width:calc(100% - 14px)!important;
    max-width:none!important;
    min-height:58px!important;
    margin-inline:auto!important;
    padding:5px!important;
    display:grid!important;
    grid-template-columns:44px minmax(0,1fr) 42px 42px!important;
    gap:6px!important;
    align-items:center!important;
    border:1px solid rgba(15,23,42,.055)!important;
    border-radius:18px!important;
    background:#fff!important;
    box-shadow:0 5px 18px rgba(15,23,42,.055)!important;
  }
  body.sp-ios-home .sl-header-logo-link{
    min-width:44px!important;
    min-height:44px!important;
    width:44px!important;
    height:44px!important;
    padding:3px!important;
    border:0!important;
    border-radius:14px!important;
    background:#fff7ef!important;
    box-shadow:none!important;
  }
  body.sp-ios-home .sl-header-logo{
    width:38px!important;
    height:38px!important;
    object-fit:contain!important;
    filter:none!important;
  }
  body.sp-ios-home .sl-header-search{
    min-width:0!important;
    width:100%!important;
    height:44px!important;
    padding:0 8px!important;
    display:flex!important;
    align-items:center!important;
    border:1px solid #eef0f4!important;
    border-radius:14px!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:16px!important;
    height:16px!important;
    flex:0 0 16px!important;
    margin:0 3px!important;
    border:0!important;
    border-radius:0!important;
    background:transparent!important;
    box-shadow:none!important;
    opacity:.72!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' 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:16px 16px!important;
    background-repeat:no-repeat!important;
    background-position:center!important;
  }
  body.sp-ios-home .sl-header-search-input{
    min-width:0!important;
    width:100%!important;
    height:42px!important;
    padding:0 5px!important;
    border:0!important;
    background:transparent!important;
    color:#334155!important;
    font-size:12px!important;
    font-weight:700!important;
    line-height:42px!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
    overflow:hidden!important;
  }
  body.sp-ios-home .sl-header-search-input::placeholder{
    color:#94a3b8!important;
    font-size:12px!important;
    font-weight:650!important;
  }
  body.sp-ios-home .sl-header-scan,
  body.sp-ios-home .sl-header-cart{
    width:42px!important;
    min-width:42px!important;
    height:42px!important;
    padding:0!important;
    border:0!important;
    border-radius:14px!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:20px!important;
    height:20px!important;
  }
  body.sp-ios-home .sl-header-cart .cart-badge,
  body.sp-ios-home .sl-header-cart .badge,
  body.sp-ios-home .sl-header-cart .count,
  body.sp-ios-home .sl-header-cart .cart-count,
  body.sp-ios-home .sl-header-cart .sl-cart-badge,
  body.sp-ios-home .sl-header-cart .sl-header-badge,
  body.sp-ios-home .sl-header-cart > span:not(:only-child){
    top:-5px!important;
    left:-5px!important;
    min-width:19px!important;
    height:19px!important;
    padding:0 5px!important;
    border:2px solid #fff!important;
    border-radius:999px!important;
    font-size:9px!important;
  }

  /* PAGE WIDTH */
  body.sp-ios-home .shell{
    width:100%!important;
    max-width:none!important;
    padding:10px 10px 24px!important;
    margin:0!important;
    box-sizing:border-box!important;
  }
  body.sp-ios-home .sp-ios-discovery{
    width:100%!important;
    display:flex!important;
    flex-direction:column!important;
    gap:18px!important;
  }

  /* INSTAGRAM HIGHLIGHTS: smaller + cleaner */
  body.sp-ios-home .sp-ios-block--highlights{
    width:100%!important;
    padding:2px 0 0!important;
  }
  body.sp-ios-home .sp-ios-highlights{
    width:auto!important;
    display:flex!important;
    gap:10px!important;
    margin:0 -10px!important;
    padding:4px 10px 7px!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    scroll-snap-type:x proximity!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 62px!important;
    width:62px!important;
    min-width:62px!important;
    gap:5px!important;
  }
  body.sp-ios-home .sp-ios-highlight-ring{
    width:56px!important;
    height:56px!important;
    padding:2.5px!important;
  }
  body.sp-ios-home .sp-ios-highlight-ring::after{
    inset:2.5px!important;
    border-width:1.5px!important;
  }
  body.sp-ios-home .sp-ios-highlight-core{
    width:51px!important;
    height:51px!important;
    font-size:19px!important;
    box-shadow:none!important;
  }
  body.sp-ios-home .sp-ios-highlight strong{
    width:62px!important;
    max-width:62px!important;
    min-height:24px!important;
    font-size:8.5px!important;
    line-height:1.3!important;
    font-weight:750!important;
  }

  /* HERO: keep premium but compact */
  body.sp-ios-home .sp174-hero{
    width:100%!important;
    min-height:166px!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 126px!important;
    gap:6px!important;
    padding:15px 13px!important;
    border-radius:18px!important;
    box-shadow:0 6px 18px rgba(159,91,35,.07)!important;
  }
  body.sp-ios-home .sp174-hero-copy small{
    margin-bottom:5px!important;
    padding:3px 6px!important;
    font-size:7.5px!important;
  }
  body.sp-ios-home .sp174-hero-copy h1{
    font-size:19px!important;
    line-height:1.17!important;
    letter-spacing:-.35px!important;
  }
  body.sp-ios-home .sp174-hero-copy p{
    margin:6px 0 9px!important;
    font-size:9px!important;
    line-height:1.45!important;
  }
  body.sp-ios-home .sp174-hero-cta{
    min-height:32px!important;
    padding:0 11px!important;
    border-radius:9px!important;
    font-size:9px!important;
  }
  body.sp-ios-home .sp174-hero-books{height:118px!important}
  body.sp-ios-home .sp174-book{width:52px!important;height:78px!important;border-width:3px!important}
  body.sp-ios-home .sp174-book:nth-child(1){right:0!important}
  body.sp-ios-home .sp174-book:nth-child(2){right:38px!important}
  body.sp-ios-home .sp174-book:nth-child(3){right:72px!important}
  body.sp-ios-home .sp174-book:nth-child(4){display:none!important}
  body.sp-ios-home .sp174-hero-dots{bottom:6px!important;gap:5px!important}
  body.sp-ios-home .sp174-hero-dots i{width:5px!important;height:5px!important}

  /* SECTION HEADS */
  body.sp-ios-home .sp-ios-block-head{
    margin-bottom:9px!important;
    align-items:center!important;
  }
  body.sp-ios-home .sp-ios-block-head h2{
    font-size:18px!important;
    line-height:1.2!important;
  }
  body.sp-ios-home .sp-ios-block-head p{display:none!important}
  body.sp-ios-home .sp-ios-block-head > a{
    min-height:28px!important;
    padding:0 9px!important;
    font-size:9px!important;
  }

  /* FEATURED PRODUCTS: mobile carousel, not giant cards */
  body.sp-ios-home .sp-ios-block--featured{
    width:100%!important;
  }
  body.sp-ios-home .sp-ios-block--featured .sp-ios-rail{
    width:auto!important;
    display:flex!important;
    gap:8px!important;
    margin:0 -10px!important;
    padding:1px 10px 8px!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    scroll-snap-type:x mandatory!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{
    flex:0 0 124px!important;
    width:124px!important;
    min-width:124px!important;
    border-radius:14px!important;
    box-shadow:0 3px 12px rgba(15,23,42,.045)!important;
  }
  body.sp-ios-home .sp-ios-featured-media{
    width:100%!important;
    aspect-ratio:4/5!important;
  }
  body.sp-ios-home .sp-ios-featured-media img{padding:7px!important}
  body.sp-ios-home .sp-ios-featured-copy{
    padding:7px 7px 8px!important;
  }
  body.sp-ios-home .sp-ios-featured-copy strong{
    min-height:31px!important;
    font-size:9.4px!important;
    line-height:1.38!important;
  }
  body.sp-ios-home .sp-ios-featured-price{
    padding-top:5px!important;
    font-size:10px!important;
  }
  body.sp-ios-home .sp174-carousel-btn{display:none!important}

  /* SOCIAL RAILS */
  body.sp-ios-home .sp-ios-block--reels,
  body.sp-ios-home .sp-ios-block--offers,
  body.sp-ios-home .sp-ios-block--posts,
  body.sp-ios-home .sp-ios-block--audio{
    width:100%!important;
    padding:0!important;
    border:0!important;
    background:transparent!important;
    box-shadow:none!important;
  }
  body.sp-ios-home .sp-ios-block--reels .sp-ios-rail,
  body.sp-ios-home .sp-ios-block--offers .sp-ios-rail,
  body.sp-ios-home .sp-ios-block--posts .sp-ios-rail,
  body.sp-ios-home .sp-ios-block--audio .sp-ios-rail{
    display:flex!important;
    gap:8px!important;
    margin:0 -10px!important;
    padding:0 10px 5px!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    scrollbar-width:none!important;
  }

  /* WhatsApp: small and above nav, never over product text */
  body.sp-ios-home .sp-floating-whatsapp{
    position:fixed!important;
    right:12px!important;
    left:auto!important;
    bottom:calc(74px + env(safe-area-inset-bottom,0px))!important;
    width:42px!important;
    min-width:42px!important;
    height:42px!important;
    padding:0!important;
    border-radius:50%!important;
    z-index:170!important;
    box-shadow:0 10px 24px rgba(18,181,117,.22)!important;
  }
  body.sp-ios-home .sp-floating-whatsapp-text{display:none!important}
  body.sp-ios-home .sp-floating-whatsapp-icon{margin:0!important}

  /* BOTTOM NAV: one cohesive iOS-style bar, not five floating boxes */
  body.sp-ios-home .bottom-nav{
    position:fixed!important;
    right:8px!important;
    left:8px!important;
    bottom:calc(7px + env(safe-area-inset-bottom,0px))!important;
    z-index:175!important;
    width:auto!important;
    height:58px!important;
    display:grid!important;
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
    gap:0!important;
    padding:4px!important;
    margin:0!important;
    overflow:hidden!important;
    border:1px solid rgba(15,23,42,.08)!important;
    border-radius:19px!important;
    background:rgba(255,255,255,.96)!important;
    box-shadow:0 12px 30px rgba(15,23,42,.12)!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{
    position:relative!important;
    display:flex!important;
    width:100%!important;
    min-width:0!important;
    height:50px!important;
    min-height:50px!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:center!important;
    gap:2px!important;
    padding:2px!important;
    margin:0!important;
    border:0!important;
    border-radius:14px!important;
    background:transparent!important;
    color:#6b7280!important;
    box-shadow:none!important;
    transform: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;
    margin:0!important;
    font-size:7.6px!important;
    line-height:1.05!important;
    font-weight:750!important;
    white-space:nowrap!important;
  }
  body.sp-ios-home .bottom-nav .nav-btn.active{
    background:#fff4ed!important;
    color:#f36b2d!important;
    box-shadow:none!important;
  }
  body.sp-ios-home .bottom-nav .nav-btn em,
  body.sp-ios-home .bottom-nav .nav-btn #cartCountBottom{
    position:absolute!important;
    top:2px!important;
    right:50%!important;
    transform:translateX(15px)!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    min-width:16px!important;
    height:16px!important;
    padding:0 4px!important;
    border:2px solid #fff!important;
    border-radius:999px!important;
    background:#ef2f2a!important;
    color:#fff!important;
    font-size:8px!important;
    font-weight:900!important;
    line-height:1!important;
  }

  /* Latest product grid remains two columns but tighter */
  body.sp-ios-home #products{margin-top:20px!important}
  body.sp-ios-home .products{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
  }
  body.sp-ios-home .product-card{
    min-width:0!important;
    border-radius:14px!important;
    box-shadow:0 3px 12px rgba(15,23,42,.04)!important;
  }
}

@media (max-width:390px){
  body.sp-ios-home .sl-online-header-inner{
    grid-template-columns:40px minmax(0,1fr) 38px 38px!important;
    gap:5px!important;
  }
  body.sp-ios-home .sl-header-logo-link{width:40px!important;height:40px!important;min-width:40px!important;min-height:40px!important}
  body.sp-ios-home .sl-header-logo{width:34px!important;height:34px!important}
  body.sp-ios-home .sl-header-search{height:40px!important;border-radius:13px!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:38px!important;min-width:38px!important;height:38px!important;border-radius:13px!important}
  body.sp-ios-home .sp-ios-highlight{flex-basis:58px!important;width:58px!important;min-width:58px!important}
  body.sp-ios-home .sp-ios-highlight-ring{width:52px!important;height:52px!important}
  body.sp-ios-home .sp-ios-highlight-core{width:47px!important;height:47px!important}
  body.sp-ios-home .sp174-hero{grid-template-columns:minmax(0,1fr) 112px!important}
  body.sp-ios-home .sp174-hero-copy h1{font-size:17px!important}
  body.sp-ios-home .sp-ios-featured-card{flex-basis:116px!important;width:116px!important;min-width:116px!important}
}
