/* Source style 1 (v101165-mobile-header-third-row-final) */
/* V101-165
   Mobile-only hard lock for the requested 3-row header:
   row 1 = logo + language
   row 2 = search
   row 3 = account + cart, side-by-side on the right
   Desktop untouched.
*/
@media (max-width:760px){

  header .head{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto auto!important;
    grid-template-rows:auto auto auto!important;
    align-items:center!important;
    width:100%!important;
    max-width:100%!important;
    padding:8px 12px 10px!important;
    column-gap:6px!important;
    row-gap:8px!important;
  }

  header .primaryNav{
    display:none!important;
  }

  /* Flatten wrappers so the actual controls can occupy fixed grid cells. */
  header .head>.headerTools,
  header .head .headerIdentityStack,
  header .head .headerAuthRow{
    display:contents!important;
  }

  /* Row 1 */
  header .head>.mainLogoLink{
    display:block!important;
    grid-column:1!important;
    grid-row:1!important;
    width:min(172px,47vw)!important;
    max-width:47vw!important;
    min-width:0!important;
    margin:0!important;
  }
  header .head>.mainLogoLink .headerMainLogo{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    height:auto!important;
  }

  header .head .headerTools .headerLangSwitch{
    display:flex!important;
    grid-column:2 / 4!important;
    grid-row:1!important;
    justify-self:end!important;
    align-self:center!important;
    position:static!important;
    inset:auto!important;
    margin:0!important;
    z-index:40!important;
    max-width:132px!important;
  }

  /* Row 2 */
  header .head .headerTools>.search{
    display:block!important;
    grid-column:1 / 4!important;
    grid-row:2!important;
    width:100%!important;
    max-width:none!important;
    min-width:0!important;
    margin:0!important;
  }
  header .head .headerTools>.search input{
    width:100%!important;
    min-width:0!important;
    height:40px!important;
    font-size:16px!important;
    padding:0 46px 0 14px!important;
  }
  header .head .headerTools>.search .searchIconBtn{
    display:inline-flex!important;
    width:34px!important;
    height:34px!important;
    top:3px!important;
    right:3px!important;
  }

  /* Row 3: force BOTH Account and Cart to exist and sit together on the right. */
  header .head .headerIdentityStack .headerAuthRow>.headerAccountBtn,
  header .head .headerTools .headerAccountBtn{
    display:inline-flex!important;
    grid-column:2!important;
    grid-row:3!important;
    justify-self:end!important;
    align-self:center!important;
    position:static!important;
    width:auto!important;
    min-width:82px!important;
    max-width:calc(100vw - 118px)!important;
    height:36px!important;
    min-height:36px!important;
    max-height:36px!important;
    margin:0!important;
    padding:0 12px!important;
    border:1px solid #d8cec2!important;
    border-radius:10px!important;
    background:#fffdf9!important;
    color:#211d19!important;
    box-shadow:none!important;
    white-space:nowrap!important;
    font-size:11px!important;
    line-height:1!important;
    font-weight:750!important;
    align-items:center!important;
    justify-content:center!important;
    gap:7px!important;
    overflow:hidden!important;
  }

  /* This selector is deliberately more specific than the old
     .headerTools>.btn.dark { display:none!important } rules. */
  header .head .headerTools>.btn.dark.headerCartBtn,
  header .head .headerTools>.headerCartBtn{
    display:inline-flex!important;
    visibility:visible!important;
    opacity:1!important;
    pointer-events:auto!important;
    grid-column:3!important;
    grid-row:3!important;
    justify-self:end!important;
    align-self:center!important;
    position:static!important;
    width:auto!important;
    min-width:76px!important;
    max-width:none!important;
    height:36px!important;
    min-height:36px!important;
    max-height:36px!important;
    margin:0!important;
    padding:0 9px 0 11px!important;
    border:1px solid #211d19!important;
    border-radius:10px!important;
    background:#211d19!important;
    color:#fff!important;
    box-shadow:none!important;
    white-space:nowrap!important;
    font-size:11px!important;
    line-height:1!important;
    font-weight:750!important;
    align-items:center!important;
    justify-content:center!important;
    gap:5px!important;
    overflow:visible!important;
  }

  header .head .headerTools>.headerCartBtn .headerCartCount{
    display:inline-flex!important;
    visibility:visible!important;
    opacity:1!important;
    align-items:center!important;
    justify-content:center!important;
    min-width:18px!important;
    width:auto!important;
    height:18px!important;
    padding:0 5px!important;
    border-radius:999px!important;
    background:rgba(255,255,255,.16)!important;
    color:#fff!important;
    font-size:9px!important;
    line-height:18px!important;
  }

  /* Signed-in account: Shiba + name/email + caret. */
  header .head .headerAccountBtn.signedIn{
    min-width:0!important;
    max-width:calc(100vw - 112px)!important;
    height:38px!important;
    min-height:38px!important;
    max-height:38px!important;
    padding:0 9px 0 4px!important;
    border-radius:999px!important;
    justify-content:flex-start!important;
  }
  header .head .headerAccountBtn.signedIn .accountSignedAvatar{
    display:block!important;
    width:32px!important;
    min-width:32px!important;
    max-width:32px!important;
    height:32px!important;
    min-height:32px!important;
    max-height:32px!important;
    flex:0 0 32px!important;
    border-radius:50%!important;
    overflow:hidden!important;
    background:#fffaf4!important;
  }
  header .head .headerAccountBtn.signedIn .accountSignedAvatar img{
    width:100%!important;
    height:100%!important;
    object-fit:cover!important;
    border-radius:50%!important;
  }
  header .head .headerAccountBtn.signedIn .accountBtnLabel{
    display:block!important;
    min-width:0!important;
    max-width:132px!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
    font-size:10.5px!important;
    font-weight:750!important;
    line-height:1!important;
  }
  header .head .headerAccountBtn.signedIn .accountMobileCaret{
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    width:12px!important;
    min-width:12px!important;
    height:12px!important;
    flex:0 0 12px!important;
    font-size:9px!important;
    color:#75695f!important;
  }

  /* Account dropdown stays out of grid flow. */
  header .head .accountQuickMenu{
    position:fixed!important;
    left:12px!important;
    right:12px!important;
    width:auto!important;
    max-width:none!important;
    z-index:10040!important;
  }

  /* ---------- BOTTOM ACTIONS: exact V101-162 approved geometry ---------- */
  #mobileCartBar,
  .mobileCartBar{
    position:fixed!important;
    right:10px!important;
    left:auto!important;
    bottom:calc(10px + env(safe-area-inset-bottom))!important;
    width:auto!important;
    min-width:118px!important;
    max-width:150px!important;
    height:44px!important;
    min-height:44px!important;
    max-height:44px!important;
    padding:0 12px!important;
    gap:9px!important;
    border-radius:12px!important;
    justify-content:space-between!important;
    align-items:center!important;
    font-size:12px!important;
    line-height:1!important;
    box-sizing:border-box!important;
    z-index:10020!important;
  }
  #mobileCartBar .mcCount,
  .mobileCartBar .mcCount{
    min-width:23px!important;
    width:auto!important;
    height:23px!important;
    padding:0 7px!important;
    line-height:23px!important;
    flex:0 0 auto!important;
    box-sizing:border-box!important;
  }

  /* Shiba AI button sits directly ABOVE View Cart, aligned to the same right edge. */
  #v44Fabs,
  .v44-fabs{
    position:fixed!important;
    right:10px!important;
    bottom:calc(60px + env(safe-area-inset-bottom))!important;
    width:44px!important;
    height:44px!important;
    gap:0!important;
    z-index:10019!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:flex-end!important;
    justify-content:flex-end!important;
  }
  #v44SupportBtn{
    width:44px!important;
    min-width:44px!important;
    max-width:44px!important;
    height:44px!important;
    min-height:44px!important;
    max-height:44px!important;
    border-radius:15px!important;
    padding:0!important;
    margin:0!important;
    overflow:hidden!important;
  }
  #v44SupportBtn .v105SupportDog{
    width:40px!important;
    min-width:40px!important;
    max-width:40px!important;
    height:40px!important;
    min-height:40px!important;
    max-height:40px!important;
    border-radius:13px!important;
  }
  #v104CartBtn,
  #v44NotifyBtn{display:none!important;}

  /* Reserve space without enlarging or clipping either fixed control. */
  body{
    padding-bottom:calc(118px + env(safe-area-inset-bottom))!important;
  }

}

@media (max-width:390px){
  header .head{
    padding-left:10px!important;
    padding-right:10px!important;
    column-gap:5px!important;
  }
  header .head>.mainLogoLink{
    width:min(164px,45vw)!important;
    max-width:45vw!important;
  }
  header .head .headerAccountBtn.signedIn .accountBtnLabel{
    max-width:108px!important;
  }
}
/* Source style 2 (v101167-mobile-search-icon-center-fix) */
@media (max-width:760px){
  /* V101-167: keep the magnifying-glass perfectly centered inside the round button. */
  header .head .headerTools>.search .searchIconBtn{
    display:grid!important;
    place-items:center!important;
    align-items:center!important;
    justify-items:center!important;
    justify-content:center!important;
    padding:0!important;
  }
  header .head .headerTools>.search .searchIconBtn svg{
    display:block!important;
    width:14px!important;
    height:14px!important;
    margin:0!important;
    transform:none!important;
  }
}
/* Source style 3 (v101169-mobile-account-ui-only) */
@media (max-width:760px){

  /* Signed-in account: NO extra box/border around the Shiba area. */
  .minnaSignedIn header .head .headerAccountBtn.signedIn,
  header .head .headerAccountBtn.signedIn{
    display:inline-flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    gap:7px!important;

    width:auto!important;
    min-width:126px!important;
    max-width:176px!important;

    height:38px!important;
    min-height:38px!important;
    max-height:38px!important;

    padding:0 4px!important;
    margin:0!important;

    border:0!important;
    outline:0!important;
    border-radius:0!important;
    background:transparent!important;
    box-shadow:none!important;

    color:#211d19!important;
    overflow:hidden!important;
  }

  /* Shiba itself: clean, no ring/border/shadow. */
  .minnaSignedIn header .head .headerAccountBtn.signedIn .accountSignedAvatar,
  header .head .headerAccountBtn.signedIn .accountSignedAvatar{
    display:block!important;
    width:32px!important;
    min-width:32px!important;
    max-width:32px!important;
    height:32px!important;
    min-height:32px!important;
    max-height:32px!important;
    flex:0 0 32px!important;

    overflow:hidden!important;
    border:0!important;
    outline:0!important;
    box-shadow:none!important;
    background:transparent!important;
    border-radius:50%!important;
  }

  .minnaSignedIn header .head .headerAccountBtn.signedIn .accountSignedAvatar img,
  header .head .headerAccountBtn.signedIn .accountSignedAvatar img{
    width:100%!important;
    height:100%!important;
    object-fit:cover!important;
    display:block!important;
    border:0!important;
    outline:0!important;
    box-shadow:none!important;
    border-radius:50%!important;
  }

  /* Existing auth code already writes full_name first, otherwise email.
     Only un-hide that label here. */
  .minnaSignedIn header .head .headerAccountBtn.signedIn .accountBtnLabel,
  header .head .headerAccountBtn.signedIn .accountBtnLabel{
    display:block!important;
    flex:1 1 auto!important;
    min-width:0!important;
    max-width:126px!important;

    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;

    font-size:10.5px!important;
    font-weight:750!important;
    line-height:1!important;
    text-align:left!important;
    color:#211d19!important;
  }

  /* Existing V157 script controls aria-expanded.
     Only make the already-existing caret visible and animate it. */
  .minnaSignedIn header .head .headerAccountBtn.signedIn .accountMobileCaret,
  header .head .headerAccountBtn.signedIn .accountMobileCaret{
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    width:12px!important;
    min-width:12px!important;
    height:12px!important;
    flex:0 0 12px!important;

    margin:0!important;
    font-size:9px!important;
    line-height:1!important;
    color:#75695f!important;

    transform:rotate(0deg)!important;
    transform-origin:center!important;
    transition:transform .18s ease!important;
  }

  .minnaSignedIn header .head .headerAccountBtn.signedIn[aria-expanded="true"] .accountMobileCaret,
  header .head .headerAccountBtn.signedIn[aria-expanded="true"] .accountMobileCaret{
    transform:rotate(180deg)!important;
  }
}
