/* 16Bazar Mobile Theme – final approved five-item navigation + responsive search.
   Scoped below 768px so desktop layout is unaffected. */
@media (max-width: 767.98px) {
    html, body { max-width:100%; overflow-x:clip; }

    /* Header: logo/menu on first row, search on its own second row. */
    #headerNavWrap .top-header.pet-main-header,
    #headerNavWrap .pet-main-header.top-header { width:100% !important; max-width:100% !important; padding:10px 12px 12px !important; box-sizing:border-box !important; }
    #headerNavWrap .pet-header-container.header-container {
        display:flex !important; flex-wrap:wrap !important; align-items:center !important;
        gap:10px 8px !important; width:100% !important; max-width:100% !important;
        padding:0 !important; margin:0 !important; min-height:0 !important;
        box-sizing:border-box !important; overflow:visible !important;
    }
    #headerNavWrap .mobile-menu-btn { flex:0 0 32px !important; margin:0 !important; }
    #headerNavWrap .pet-logo-group.logo-brand-group,
    #headerNavWrap .logo-brand-group.pet-logo-group {
        flex:1 1 auto !important; min-width:0 !important; width:auto !important;
        max-width:calc(100% - 54px) !important; margin:0 !important;
    }
    #headerNavWrap .pet-logo.logo img { width:auto !important; max-width:145px !important; max-height:49px !important; height:auto !important; transform:none !important; }
    #headerNavWrap .pet-action-buttons.action-buttons {
        display:none !important; /* Mobile account/cart remain accessible in bottom nav. */
    }
    #headerNavWrap .pet-search-section.search-section {
        order:30 !important; flex:0 0 100% !important; width:100% !important;
        min-width:0 !important; max-width:100% !important; margin:0 !important;
        padding:0 !important; position:relative !important; inset:auto !important;
        left:auto !important; top:auto !important; transform:none !important;
        justify-self:stretch !important; overflow:visible !important;
        box-sizing:border-box !important;
    }
    #headerNavWrap .pet-search-section.search-section .search-form {
        width:100% !important; max-width:100% !important; margin:0 !important;
    }
    #headerNavWrap .pet-search-bar.search-bar {
        display:flex !important; align-items:center !important; gap:0 !important;
        width:100% !important; min-width:0 !important; max-width:100% !important;
        height:48px !important; min-height:48px !important;
        padding:4px 4px 4px 12px !important;
        border:1px solid #cfe5d8 !important; border-radius:15px !important;
        background:#f8fcfa !important; overflow:hidden !important;
        box-shadow:0 5px 16px rgba(7,83,51,.07) !important;
        box-sizing:border-box !important;
    }
    #headerNavWrap .pet-search-category,
    #headerNavWrap .pet-search-divider { display:none !important; }
    #headerNavWrap .pet-search-bar.search-bar input.search_keyword {
        display:block !important; flex:1 1 0% !important; width:0 !important;
        min-width:0 !important; max-width:100% !important; height:38px !important;
        padding:0 10px 0 2px !important; border:0 !important; outline:0 !important;
        background:transparent !important; box-shadow:none !important;
        font-size:13px !important; text-overflow:ellipsis !important;
    }
    #headerNavWrap .pet-search-btn.search-icon-btn {
        position:static !important; display:flex !important; align-items:center !important;
        justify-content:center !important; flex:0 0 42px !important;
        width:42px !important; min-width:42px !important; max-width:42px !important;
        height:40px !important; min-height:40px !important; margin:0 !important;
        padding:0 !important; border-radius:12px !important;
        background:linear-gradient(145deg,#0bb45d,#00763a) !important;
        color:white !important; transform:none !important;
    }
    #headerNavWrap .pet-search-section .search_result {
        left:0 !important; right:0 !important; width:100% !important; max-width:100% !important;
        box-sizing:border-box !important;
    }

    /* Fixed, bottom-safe navigation, matches approved mockup order. */
    body .mobile-bottom-nav.bazar-bottom-nav {
        position:fixed !important; display:grid !important; grid-template-columns:repeat(5,minmax(0,1fr)) !important;
        align-items:end !important; justify-items:stretch !important;
        left:0 !important; right:0 !important; bottom:0 !important; top:auto !important;
        width:100% !important; max-width:100% !important;
        padding:10px max(5px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(5px, env(safe-area-inset-left)) !important;
        border:1px solid rgba(8,89,54,.25) !important; border-bottom:none !important;
        border-radius:25px 25px 0 0 !important;
        background:linear-gradient(135deg,#005635 0%,#007344 50%,#003f2b 100%) !important;
        box-shadow:0 -10px 28px rgba(4,61,41,.24) !important;
        z-index:9990 !important; box-sizing:border-box !important;
        overflow:visible !important;
    }
    body .mobile-bottom-nav.bazar-bottom-nav .bottom-nav-item {
        display:flex !important; position:relative !important; flex-direction:column !important;
        align-items:center !important; justify-content:center !important;
        min-width:0 !important; min-height:52px !important; gap:4px !important;
        padding:5px 1px 2px !important; text-decoration:none !important;
        font-family:inherit !important; font-weight:600 !important; font-size:10px !important;
        line-height:1.1 !important; text-transform:none !important;
        color:#edfdf5 !important; background:transparent !important; border:0 !important;
    }
    body .mobile-bottom-nav.bazar-bottom-nav .bottom-nav-item > svg,
    body .mobile-bottom-nav.bazar-bottom-nav .bazar-cart-icon > svg {
        width:23px !important; height:23px !important; flex:0 0 auto !important;
        stroke:currentColor !important;
    }
    body .mobile-bottom-nav.bazar-bottom-nav .bottom-nav-item.active:not(.bazar-home-nav){
        color:#c2ffdc !important;
    }
    body .mobile-bottom-nav.bazar-bottom-nav .bazar-cart-icon { position:relative; display:inline-flex; }
    body .mobile-bottom-nav.bazar-bottom-nav .cart-badge {
        display:flex !important; align-items:center !important; justify-content:center !important;
        position:absolute !important; right:-11px !important; top:-9px !important;
        margin:0 !important; min-width:18px !important; height:18px !important;
        padding:0 4px !important; border-radius:99px !important;
        background:#ff304f !important; color:#fff !important; font-size:10px !important; font-weight:800 !important;
    }
    body .mobile-bottom-nav.bazar-bottom-nav .bazar-home-nav {
        min-height:52px !important; padding:0 !important;
    }
    body .mobile-bottom-nav.bazar-bottom-nav .bazar-home-circle {
        position:absolute !important; bottom:0 !important; width:73px !important; height:73px !important;
        display:flex !important; flex-direction:column !important; align-items:center !important; justify-content:center !important;
        gap:3px !important; border-radius:50% !important;
        background:linear-gradient(145deg,#ff4453,#db102b) !important; color:#ffffff !important;
        box-shadow:0 6px 16px rgba(0,0,0,.23), inset 0 2px 4px rgba(255,255,255,.42) !important;
        font-weight:800 !important; font-size:12px !important;
    }
    body .mobile-bottom-nav.bazar-bottom-nav .bazar-home-circle svg { width:29px !important; height:29px !important; }
    body { padding-bottom:calc(85px + env(safe-area-inset-bottom)) !important; }
    /* Keep support and floating-cart controls above the bottom bar. */
    #floatingContactWidget, .floating-cart-widget { bottom:calc(95px + env(safe-area-inset-bottom)) !important; }
}
@media (min-width:768px) { body .mobile-bottom-nav.bazar-bottom-nav { display:none !important; } }
@media (max-width:355px) {
    body .mobile-bottom-nav.bazar-bottom-nav .bottom-nav-item { font-size:9px !important; }
    body .mobile-bottom-nav.bazar-bottom-nav .bazar-home-circle { width:67px !important; height:67px !important; }
}


/* Header alignment hotfix: hamburger and brand share the first row. */
@media (max-width:767.98px) {
    #headerNavWrap .pet-main-header .pet-header-container.header-container {
        display:grid !important;
        grid-template-columns:36px minmax(0,1fr) !important;
        grid-template-rows:auto auto !important;
        column-gap:9px !important;
        row-gap:10px !important;
        align-items:center !important;
        justify-items:start !important;
        width:100% !important;
        max-width:100% !important;
        min-width:0 !important;
    }
    #headerNavWrap .pet-header-container .mobile-menu-btn#mobileMenuBtn {
        display:flex !important;
        grid-column:1 !important;
        grid-row:1 !important;
        position:relative !important;
        inset:auto !important;
        float:none !important;
        transform:none !important;
        width:34px !important;
        height:38px !important;
        min-width:34px !important;
        min-height:38px !important;
        margin:0 !important;
        padding:7px !important;
        justify-self:start !important;
        align-self:center !important;
        z-index:2 !important;
    }
    #headerNavWrap .pet-header-container .logo-brand-group.pet-logo-group {
        display:flex !important;
        grid-column:2 !important;
        grid-row:1 !important;
        width:auto !important;
        max-width:100% !important;
        min-width:0 !important;
        min-height:0 !important;
        margin:0 !important;
        padding:0 !important;
        position:static !important;
        transform:none !important;
        justify-self:start !important;
        align-self:center !important;
        flex:none !important;
    }
    #headerNavWrap .pet-header-container .pet-logo-group a.pet-logo.logo {
        display:inline-flex !important;
        align-items:center !important;
        justify-content:flex-start !important;
        position:static !important;
        transform:none !important;
        width:auto !important;
        max-width:100% !important;
        margin:0 !important;
        padding:0 !important;
        line-height:1 !important;
    }
    #headerNavWrap .pet-header-container .pet-logo.logo img {
        display:block !important;
        width:auto !important;
        height:auto !important;
        max-width:118px !important;
        max-height:38px !important;
        margin:0 !important;
        transform:none !important;
        object-fit:contain !important;
    }
    #headerNavWrap .pet-header-container .pet-search-section.search-section {
        grid-column:1 / -1 !important;
        grid-row:2 !important;
        justify-self:stretch !important;
        width:100% !important;
        max-width:100% !important;
        min-width:0 !important;
        margin:0 !important;
        transform:none !important;
    }
    #headerNavWrap .pet-header-container .pet-action-buttons.action-buttons {
        display:none !important;
    }
}

/* 16Bazar mobile bottom navigation: compact five-item refinement */
@media (max-width:767.98px) {
  body .mobile-bottom-nav.bazar-bottom-nav {
    min-height:60px !important;
    padding:7px max(7px,env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(7px,env(safe-area-inset-left)) !important;
    align-items:center !important;
    border-radius:20px 20px 0 0 !important;
    column-gap:3px !important;
  }
  body .mobile-bottom-nav.bazar-bottom-nav .bottom-nav-item {
    min-height:45px !important;
    height:45px !important;
    gap:2px !important;
    padding:2px 0 1px !important;
    font-size:9px !important;
    line-height:1.12 !important;
    font-weight:600 !important;
    white-space:nowrap !important;
  }
  body .mobile-bottom-nav.bazar-bottom-nav .bottom-nav-item > svg,
  body .mobile-bottom-nav.bazar-bottom-nav .bazar-cart-icon > svg {
    width:19px !important;
    height:19px !important;
  }
  body .mobile-bottom-nav.bazar-bottom-nav .bazar-home-nav {
    min-height:45px !important;
    height:45px !important;
    padding:0 !important;
  }
  body .mobile-bottom-nav.bazar-bottom-nav .bazar-home-circle {
    width:57px !important;
    height:57px !important;
    bottom:-2px !important;
    gap:1px !important;
    font-size:10px !important;
    box-shadow:0 4px 12px rgba(0,0,0,.19),inset 0 2px 3px rgba(255,255,255,.32) !important;
  }
  body .mobile-bottom-nav.bazar-bottom-nav .bazar-home-circle svg {
    width:23px !important;
    height:23px !important;
  }
  body .mobile-bottom-nav.bazar-bottom-nav .cart-badge {
    right:-8px !important;
    top:-7px !important;
    min-width:15px !important;
    height:15px !important;
    padding:0 3px !important;
    font-size:9px !important;
  }
  body { padding-bottom:calc(70px + env(safe-area-inset-bottom)) !important; }
  #floatingContactWidget, .floating-cart-widget {
    bottom:calc(82px + env(safe-area-inset-bottom)) !important;
  }
}
@media (max-width:355px) {
  body .mobile-bottom-nav.bazar-bottom-nav .bottom-nav-item { font-size:8px !important; }
  body .mobile-bottom-nav.bazar-bottom-nav .bazar-home-circle { width:54px !important; height:54px !important; font-size:9px !important; }
}
