/* Babyfood V61 — Chimart-inspired mobile storefront. Mobile customer pages only. */
:root{
  --bf-v61-green:#176b46;
  --bf-v61-green-dark:#0f5135;
  --bf-v61-orange:#f59e0b;
  --bf-v61-bg:#f6f7f6;
  --bf-v61-border:#e4e8e5;
  --bf-v61-text:#183128;
}

#bf-v61-popular-categories,
#bf-v61-footer-nav,
#bf-v61-mobile-search{display:none}

@media (max-width:767px){
  body.bf-v61-storefront{background:var(--bf-v61-bg)!important;padding-bottom:64px!important}
  body.bf-v61-storefront .bf-site-shell{background:var(--bf-v61-bg)!important}

  /* Compact app header: menu, centred brand and cart. */
  body.bf-v61-storefront .bf-app-header{
    background:#fff!important;
    border-bottom:1px solid var(--bf-v61-border)!important;
    box-shadow:0 2px 10px rgba(15,23,42,.07)!important;
  }
  body.bf-v61-storefront .bf-main-header-row{
    position:relative!important;
    display:grid!important;
    grid-template-columns:40px minmax(0,1fr) 40px!important;
    align-items:center!important;
    gap:4px!important;
    height:56px!important;
    padding:0 10px!important;
  }
  body.bf-v61-storefront .bf-main-header-row .bf-v61-header-menu{
    position:absolute!important;
    left:10px!important;
    top:9px!important;
    z-index:2!important;
    width:38px!important;
    min-width:38px!important;
    height:38px!important;
    padding:0!important;
    border:0!important;
    border-radius:8px!important;
    color:var(--bf-v61-green-dark)!important;
    background:transparent!important;
  }
  body.bf-v61-storefront .bf-main-header-row>a:first-of-type{
    grid-column:2!important;
    justify-self:center!important;
    min-width:0!important;
    max-width:216px!important;
    gap:7px!important;
  }
  body.bf-v61-storefront .bf-main-header-row>a:first-of-type img{
    width:36px!important;
    height:36px!important;
    flex:0 0 36px!important;
    border:1px solid #dce7e0!important;
  }
  body.bf-v61-storefront .bf-main-header-row>a:first-of-type>div>div:first-child{
    max-width:164px!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
    font-size:13px!important;
    color:var(--bf-v61-green-dark)!important;
  }
  body.bf-v61-storefront .bf-main-header-row>div:last-child{
    grid-column:3!important;
    justify-self:end!important;
    width:40px!important;
    gap:0!important;
  }
  body.bf-v61-storefront .bf-main-header-row>div:last-child>a[href="/cart"]{
    display:flex!important;
    width:38px!important;
    height:38px!important;
    min-width:38px!important;
    padding:0!important;
    color:var(--bf-v61-green-dark)!important;
  }
  body.bf-v61-storefront .bf-main-header-row>div:last-child>button:not(.bf-v61-header-menu){display:none!important}

  /* Full-width mobile search directly below the brand row. */
  #bf-v61-mobile-search{
    display:block!important;
    position:relative!important;
    padding:6px 10px 9px!important;
    background:#fff!important;
    border-top:1px solid #f0f2f1!important;
    border-bottom:0!important;
  }
  #bf-v61-mobile-search .bf-v61-search-box{position:relative;display:flex;align-items:center;max-width:none!important}
  #bf-v61-mobile-search input{
    width:100%!important;
    height:40px!important;
    padding:0 48px 0 40px!important;
    border:1px solid #cbd8d0!important;
    border-radius:7px!important;
    background:#fff!important;
    color:#1f2937!important;
    font-family:inherit!important;
    font-size:13px!important;
    outline:0!important;
    box-shadow:none!important;
  }
  #bf-v61-mobile-search input:focus{border-color:var(--bf-v61-green)!important;box-shadow:0 0 0 2px rgba(23,107,70,.10)!important}
  #bf-v61-mobile-search .bf-v61-search-icon{
    position:absolute!important;
    left:14px!important;
    top:50%!important;
    width:18px!important;
    height:18px!important;
    transform:translateY(-50%)!important;
    color:#6b7c73!important;
    pointer-events:none!important;
  }
  #bf-v61-mobile-search button{
    position:absolute!important;
    top:4px!important;
    right:4px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    width:34px!important;
    height:32px!important;
    min-height:32px!important;
    padding:0!important;
    border:0!important;
    border-radius:6px!important;
    background:var(--bf-v61-green)!important;
    color:#fff!important;
  }
  #bf-v61-mobile-search button svg{position:static!important;width:17px!important;height:17px!important;transform:none!important;color:#fff!important}

  /* Chimart-style horizontal image category rail. */
  #bf-v61-popular-categories{
    display:block!important;
    background:#fff!important;
    padding:12px 0 10px!important;
    border-bottom:1px solid var(--bf-v61-border)!important;
  }
  #bf-v61-popular-categories .bf-v61-heading{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    gap:9px!important;
    padding:0 12px 10px!important;
    color:var(--bf-v61-text)!important;
    font-size:15px!important;
    font-weight:800!important;
  }
  #bf-v61-popular-categories .bf-v61-heading b{height:2px!important;width:38px!important;background:var(--bf-v61-orange)!important;border-radius:4px!important}
  #bf-v61-popular-categories .bf-v61-category-rail{
    display:flex!important;
    gap:8px!important;
    overflow-x:auto!important;
    overscroll-behavior-x:contain!important;
    scroll-snap-type:x proximity!important;
    scrollbar-width:none!important;
    padding:0 10px 3px!important;
  }
  #bf-v61-popular-categories .bf-v61-category-rail::-webkit-scrollbar{display:none!important}
  #bf-v61-popular-categories .bf-v61-category-card{
    flex:0 0 76px!important;
    min-width:76px!important;
    color:#263b31!important;
    text-decoration:none!important;
    text-align:center!important;
    scroll-snap-align:start!important;
  }
  #bf-v61-popular-categories .bf-v61-category-card img{
    width:68px!important;
    height:68px!important;
    margin:0 auto 5px!important;
    display:block!important;
    object-fit:cover!important;
    border-radius:7px!important;
    background:#f7f8f7!important;
    border:1px solid #e0e5e2!important;
    box-shadow:2px 3px 7px rgba(15,23,42,.13)!important;
  }
  #bf-v61-popular-categories .bf-v61-category-card span{
    display:-webkit-box!important;
    min-height:28px!important;
    overflow:hidden!important;
    -webkit-box-orient:vertical!important;
    -webkit-line-clamp:2!important;
    font-size:10.5px!important;
    font-weight:700!important;
    line-height:1.25!important;
  }

  /* The live home currently renders the product-list view. Keep the useful list, remove desktop hero/filter bulk. */
  body.bf-v61-home .products-hero-compact{display:none!important}
  body.bf-v61-home main[role="main"]>.bg-background{padding-bottom:12px!important}
  body.bf-v61-home main[role="main"]>.bg-background>div.container{padding-top:0!important;padding-bottom:4px!important}
  body.bf-v61-home main[role="main"]>.bg-background>div.container>button.md\:hidden.w-full.h-14,
  body.bf-v61-home main[role="main"]>.bg-background>div.container>.hidden.md\:flex{display:none!important}
  body.bf-v61-home .bf-v57-duplicate-search{display:none!important}
  body.bf-v61-home main.container{padding:10px 8px 18px!important}

  .bf-v61-products-heading{
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    gap:12px!important;
    margin:0 1px 9px!important;
    padding:0 2px 7px!important;
    border-bottom:2px solid #e1e5e2!important;
  }
  .bf-v61-products-heading h2{margin:0!important;font-size:17px!important;font-weight:800!important;color:var(--bf-v61-text)!important}
  .bf-v61-products-heading a{font-size:11px!important;font-weight:800!important;color:var(--bf-v61-green)!important;text-decoration:none!important}

  /* Two-column cards with a full-width order button, matching the reference density. */
  body.bf-v61-storefront .bf-product-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
  body.bf-v61-storefront .product-card{
    padding:0!important;
    border:1px solid #e2e5e3!important;
    border-radius:8px!important;
    background:#fff!important;
    box-shadow:0 2px 9px rgba(15,23,42,.10)!important;
    overflow:hidden!important;
  }
  body.bf-v61-storefront .product-card>div:first-of-type{
    border-radius:7px 7px 0 0!important;
    background:#fafafa!important;
    border-bottom:1px solid #edf0ee!important;
  }
  body.bf-v61-storefront .product-card img{object-fit:cover!important;object-position:center!important}
  body.bf-v61-storefront .product-card .pt-3{
    padding:7px!important;
    gap:3px!important;
    text-align:center!important;
  }
  body.bf-v61-storefront .product-card .text-amber-400{justify-content:center!important;font-size:8px!important;line-height:1!important;padding:0!important}
  body.bf-v61-storefront .product-card h3{
    display:block!important;
    min-height:18px!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
    font-size:12px!important;
    line-height:18px!important;
    text-align:center!important;
  }
  body.bf-v61-storefront .product-card p{display:none!important}
  body.bf-v61-storefront .product-card .flex.items-baseline{justify-content:center!important;padding-top:1px!important}
  body.bf-v61-storefront .product-card .font-bold.text-primary{font-size:14px!important;color:var(--bf-v61-green-dark)!important}
  body.bf-v61-storefront .product-card button{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    width:100%!important;
    min-height:34px!important;
    margin-top:4px!important;
    padding:6px!important;
    border:0!important;
    border-radius:5px!important;
    background:var(--bf-v61-green)!important;
    color:#fff!important;
    font-size:0!important;
    box-shadow:none!important;
  }
  body.bf-v61-storefront .product-card button:after{content:"অর্ডার করুন";font-family:inherit;font-size:11px;font-weight:800;line-height:1}

  /* Reference-style four-item bottom navigation. Existing menu is reused, not duplicated. */
  body.bf-v61-storefront .bf-mobile-nav{display:none!important}
  #bf-v61-footer-nav{
    position:fixed!important;
    left:0!important;
    right:0!important;
    bottom:0!important;
    z-index:120!important;
    display:grid!important;
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    height:calc(61px + env(safe-area-inset-bottom))!important;
    padding-bottom:env(safe-area-inset-bottom)!important;
    background:rgba(255,255,255,.985)!important;
    border-top:1px solid #dfe4e1!important;
    box-shadow:0 -5px 18px rgba(15,23,42,.10)!important;
    backdrop-filter:blur(14px)!important;
  }
  #bf-v61-footer-nav a,#bf-v61-footer-nav button{
    appearance:none!important;
    border:0!important;
    border-radius:0!important;
    background:transparent!important;
    color:#5e7167!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:center!important;
    gap:3px!important;
    min-width:0!important;
    padding:5px 2px 4px!important;
    font-family:inherit!important;
    font-size:10px!important;
    font-weight:700!important;
    text-decoration:none!important;
  }
  #bf-v61-footer-nav a svg,#bf-v61-footer-nav button svg{width:21px!important;height:21px!important;stroke-width:2!important}
  #bf-v61-footer-nav .is-active{color:var(--bf-v61-green)!important;font-weight:800!important}

  body.bf-v61-storefront .bf-site-shell [aria-label="Open live chat"],
  body.bf-v61-storefront .bf-site-shell [aria-label="Close live chat"]{bottom:72px!important;right:10px!important;transform:scale(.78)!important;transform-origin:bottom right!important}
}

@media (max-width:350px){
  #bf-v61-popular-categories .bf-v61-category-card{flex-basis:71px!important;min-width:71px!important}
  #bf-v61-popular-categories .bf-v61-category-card img{width:63px!important;height:63px!important}
  body.bf-v61-storefront .bf-main-header-row>a:first-of-type>div>div:first-child{max-width:136px!important;font-size:12px!important}
}

@media (prefers-reduced-motion:reduce){
  #bf-v61-popular-categories .bf-v61-category-rail{scroll-behavior:auto!important}
}
