/* HEADER STABILITY FIX V4
   1) reserve scrollbar space on every shop subpage;
   2) avoid transform-based centering (fractional pixel text rasterization);
   3) use an immediately available system font in the header to prevent font-swap jumps.
*/
html{
  overflow-y:scroll !important;
  scrollbar-gutter:stable !important;
}
#tomoShopHeader,
#tomoShopHeader button,
#tomoShopHeader a,
#tomoShopHeader span,
#searchOverlay,
#searchOverlay button,
#searchOverlay input{
  font-family:"Noto Sans JP",sans-serif !important;
  font-synthesis:none !important;
  -webkit-font-smoothing:antialiased !important;
  text-rendering:geometricPrecision !important;
}

/* TOMO ONE shared shop header v2
   Single source of truth for:
   goods list / product detail / favorites / cart / checkout.
   Homepage header remains independent.
*/

#tomoShopHeader,
#tomoShopHeader *,
#searchOverlay,
#searchOverlay *,
.site-mobile-overlay,
.site-mobile-overlay *,
.site-mobile-drawer,
.site-mobile-drawer *{
  box-sizing:border-box;
}

#tomoShopHeader{
  position:sticky !important;
  top:0 !important;
  z-index:100 !important;
  width:100% !important;
  height:82px !important;
  margin:0 !important;
  padding:0 !important;
  border:0 !important;
  background:#fff !important;
  color:#111 !important;
  font-family:"Noto Sans JP",sans-serif !important;
  line-height:1.45 !important;
}

#tomoShopHeader .site-header-inner{
  position:relative !important;
  display:grid !important;
  grid-template-columns:320px minmax(0,1fr) 320px !important;
  align-items:center !important;
  width:100% !important;
  max-width:none !important;
  height:82px !important;
  min-height:82px !important;
  margin:0 !important;
  padding:0 34px !important;
  background:#fff !important;
}

/* Brand: exactly the product-listing header baseline */
#tomoShopHeader .brand{
  position:static !important;
  transform:none !important;
  justify-self:start !important;
  display:flex !important;
  align-items:center !important;
  gap:0 !important;
  width:auto !important;
  height:54px !important;
  margin:0 !important;
  padding:0 !important;
  color:#111 !important;
  text-decoration:none !important;
}
#tomoShopHeader .brand img{
  display:block !important;
  width:180px !important;
  height:54px !important;
  margin:0 !important;
  padding:0 !important;
  object-fit:contain !important;
  object-position:left center !important;
}
#tomoShopHeader .brand img:first-child{
  width:70px !important;
  height:45px !important;
  padding-left:17px !important;
}

/* Main navigation */
#tomoShopHeader .site-main-nav{
  position:static !important;
  transform:none !important;
  justify-self:center !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:26px !important;
  width:max-content !important;
  height:82px !important;
  margin:0 !important;
  padding:0 !important;
  white-space:nowrap !important;
}
#tomoShopHeader .site-main-nav > a,
#tomoShopHeader .site-nav-trigger{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  min-width:0 !important;
  min-height:0 !important;
  margin:0 !important;
  padding:12px 14px !important;
  border:0 !important;
  border-radius:24px !important;
  background:transparent !important;
  color:#111 !important;
  font-family:"Noto Sans JP",sans-serif !important;
  font-size:18px !important;
  font-weight:600 !important;
  line-height:1.45 !important;
  letter-spacing:0 !important;
  text-decoration:none !important;
  white-space:nowrap !important;
  cursor:pointer !important;
  appearance:none !important;
}
#tomoShopHeader .site-main-nav > a:hover,
#tomoShopHeader .site-nav-trigger:hover{
  background:#EEEAE5 !important;
}

/* Dropdowns */
#tomoShopHeader .site-nav-item{
  position:relative !important;
  display:flex !important;
  align-items:center !important;
  height:100% !important;
  margin:0 !important;
  padding:0 !important;
}
#tomoShopHeader .site-dropdown{
  position:absolute !important;
  left:50% !important;
  top:70px !important;
  z-index:120 !important;
  width:280px !important;
  min-width:250px !important;
  margin:0 !important;
  padding:10px !important;
  transform:translateX(-50%) translateY(8px) !important;
  border:1px solid #ded8d1 !important;
  border-radius:16px !important;
  background:#fff !important;
  box-shadow:0 18px 40px rgba(0,0,0,.08) !important;
  opacity:0 !important;
  visibility:hidden !important;
  pointer-events:none !important;
  transition:.18s ease !important;
}
#tomoShopHeader .site-dropdown-goods{width:340px !important;}
#tomoShopHeader .site-nav-item.open > .site-dropdown,
#tomoShopHeader .site-nav-item:hover > .site-dropdown{
  transform:translateX(-50%) translateY(0) !important;
  opacity:1 !important;
  visibility:visible !important;
  pointer-events:auto !important;
}
#tomoShopHeader .site-dropdown a{
  display:block !important;
  margin:0 !important;
  padding:10px 12px !important;
  border-radius:10px !important;
  background:transparent !important;
  color:#555 !important;
  font-size:15px !important;
  font-weight:400 !important;
  line-height:1.45 !important;
  text-decoration:none !important;
}
#tomoShopHeader .site-dropdown a:hover{
  background:#f7f5f2 !important;
  color:#111 !important;
}

/* Right-side actions */
#tomoShopHeader .site-header-actions{
  position:static !important;
  transform:none !important;
  justify-self:end !important;
  display:flex !important;
  align-items:center !important;
  justify-content:flex-end !important;
  gap:8px !important;
  width:320px !important;
  min-width:320px !important;
  height:54px !important;
  margin:0 !important;
  padding:0 !important;
  white-space:nowrap !important;
}
#tomoShopHeader .site-icon-btn{
  position:relative !important;
  display:grid !important;
  place-items:center !important;
  flex:0 0 42px !important;
  width:42px !important;
  height:42px !important;
  min-width:42px !important;
  min-height:42px !important;
  margin:0 !important;
  padding:0 !important;
  border:0 !important;
  border-radius:0 !important;
  background:transparent !important;
  color:#111 !important;
  text-decoration:none !important;
  cursor:pointer !important;
  appearance:none !important;
}
#tomoShopHeader .site-icon-btn svg{
  display:block !important;
  width:22px !important;
  height:22px !important;
  margin:0 !important;
  fill:none !important;
  stroke:#111 !important;
  stroke-width:1.7 !important;
  stroke-linecap:round !important;
  stroke-linejoin:round !important;
}
#tomoShopHeader .badge-count{
  position:absolute !important;
  right:-1px !important;
  top:1px !important;
  display:grid !important;
  place-items:center !important;
  min-width:16px !important;
  height:16px !important;
  padding:0 4px !important;
  border-radius:999px !important;
  background:#111 !important;
  color:#fff !important;
  font-size:9px !important;
  font-weight:500 !important;
  line-height:16px !important;
}

/* Language selector */
#tomoShopHeader .shop-lang-compact-wrap{
  position:relative !important;
  display:flex !important;
  align-items:center !important;
  height:54px !important;
  margin:0 !important;
  padding:0 !important;
}
#tomoShopHeader .shop-lang-compact{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:6px !important;
  height:44px !important;
  margin:0 !important;
  padding:0 14px !important;
  border:0 !important;
  border-radius:24px !important;
  background:transparent !important;
  color:#111 !important;
  font-family:"Noto Sans JP",sans-serif !important;
  font-size:18px !important;
  font-weight:600 !important;
  line-height:1 !important;
  cursor:pointer !important;
  appearance:none !important;
}
#tomoShopHeader .shop-lang-compact:hover,
#tomoShopHeader .shop-lang-compact-wrap.open .shop-lang-compact{
  background:#EEEAE5 !important;
}
#tomoShopHeader .shop-lang-compact svg{
  display:block !important;
  width:15px !important;
  height:15px !important;
  fill:none !important;
  stroke:#111 !important;
  stroke-width:1.8 !important;
  transition:transform .18s ease !important;
}
#tomoShopHeader .shop-lang-compact-wrap.open .shop-lang-compact svg{
  transform:rotate(180deg) !important;
}
#tomoShopHeader .shop-lang-menu{
  position:absolute !important;
  top:60px !important;
  right:50% !important;
  z-index:125 !important;
  width:150px !important;
  margin:0 !important;
  padding:10px 0 !important;
  transform:translate(50%,8px) !important;
  border:1px solid #ded8d1 !important;
  border-radius:16px !important;
  background:#fff !important;
  box-shadow:0 18px 45px rgba(0,0,0,.08) !important;
  opacity:0 !important;
  visibility:hidden !important;
  pointer-events:none !important;
  transition:.18s ease !important;
}
#tomoShopHeader .shop-lang-compact-wrap.open .shop-lang-menu{
  transform:translate(50%,0) !important;
  opacity:1 !important;
  visibility:visible !important;
  pointer-events:auto !important;
}
#tomoShopHeader .shop-lang-menu button{
  display:block !important;
  width:100% !important;
  min-width:0 !important;
  height:auto !important;
  margin:0 !important;
  padding:11px 20px !important;
  border:0 !important;
  border-radius:0 !important;
  background:transparent !important;
  color:#555 !important;
  font-family:"Noto Sans JP",sans-serif !important;
  font-size:15px !important;
  font-weight:400 !important;
  line-height:1.45 !important;
  text-align:left !important;
  cursor:pointer !important;
  appearance:none !important;
}
#tomoShopHeader .shop-lang-menu button:hover{
  background:#f7f5f2 !important;
  color:#111 !important;
}

/* Search overlay is shared too and isolated from every page stylesheet. */
#searchOverlay{
  position:fixed !important;
  inset:0 !important;
  z-index:150 !important;
  display:block !important;
  margin:0 !important;
  padding:0 !important;
  background:rgba(246,243,238,.96) !important;
  color:#111 !important;
  font-family:"Noto Sans JP",sans-serif !important;
  opacity:0 !important;
  visibility:hidden !important;
  pointer-events:none !important;
  transition:.25s !important;
}
#searchOverlay.open{
  opacity:1 !important;
  visibility:visible !important;
  pointer-events:auto !important;
}
#searchOverlay .search-close{
  position:absolute !important;
  right:40px !important;
  top:30px !important;
  display:grid !important;
  place-items:center !important;
  width:45px !important;
  height:45px !important;
  margin:0 !important;
  padding:0 !important;
  border:0 !important;
  background:transparent !important;
  color:#111 !important;
  cursor:pointer !important;
}
#searchOverlay .search-close svg{
  width:23px !important;
  height:23px !important;
  fill:none !important;
  stroke:currentColor !important;
  stroke-width:1.7 !important;
}
#searchOverlay .search-dialog{
  width:auto !important;
  max-width:900px !important;
  margin:140px auto 0 !important;
  padding:0 30px !important;
}
#searchOverlay .search-dialog > p{
  margin:0 0 16px !important;
  color:#111 !important;
  font-size:12px !important;
  font-weight:400 !important;
  letter-spacing:.16em !important;
}
#searchOverlay .search-dialog label{
  display:flex !important;
  align-items:center !important;
  margin:0 !important;
  padding:8px 0 !important;
  border:0 !important;
  border-bottom:2px solid #111 !important;
}
#searchOverlay .search-dialog input{
  display:block !important;
  width:100% !important;
  height:auto !important;
  margin:0 !important;
  padding:0 !important;
  border:0 !important;
  border-radius:0 !important;
  outline:0 !important;
  background:transparent !important;
  color:#111 !important;
  font-family:"Noto Sans JP",sans-serif !important;
  font-size:32px !important;
  line-height:1.45 !important;
}
#searchOverlay .search-dialog label span svg{
  width:30px !important;
  height:30px !important;
  fill:none !important;
  stroke:#111 !important;
  stroke-width:1.7 !important;
}
#searchOverlay .search-results{
  display:grid !important;
  grid-template-columns:repeat(4,1fr) !important;
  gap:16px !important;
  margin-top:28px !important;
}
#searchOverlay .search-result{
  display:block !important;
  padding:10px !important;
  background:#fff !important;
  color:#111 !important;
  text-decoration:none !important;
}
#searchOverlay .search-result img{
  display:block !important;
  width:100% !important;
  aspect-ratio:1 !important;
  object-fit:cover !important;
}

/* Mobile elements generated by shop-header.js */
.site-mobile-menu-btn,
.site-mobile-overlay,
.site-mobile-drawer{
  display:none;
}

@media (max-width:1080px){
  #tomoShopHeader{
    height:70px !important;
  }
  #tomoShopHeader .site-header-inner{
    display:flex !important;
    align-items:center !important;
    justify-content:space-between !important;
    height:70px !important;
    min-height:70px !important;
    padding:0 16px !important;
    overflow:visible !important;
  }
  #tomoShopHeader .brand{
    position:static !important;
    transform:none !important;
    flex:0 1 auto !important;
    min-width:0 !important;
    height:42px !important;
  }
  #tomoShopHeader .brand img{
    width:158px !important;
    height:42px !important;
  }
  #tomoShopHeader .brand img:first-child{
    display:none !important;
  }
  #tomoShopHeader .site-main-nav,
  #tomoShopHeader .site-header-actions > .shop-lang-compact-wrap,
  #tomoShopHeader .site-header-actions > .site-icon-btn{
    display:none !important;
  }
  #tomoShopHeader .site-header-actions{
    position:static !important;
    transform:none !important;
    display:flex !important;
    width:auto !important;
    min-width:0 !important;
    height:auto !important;
    margin-left:auto !important;
  }
  #tomoShopHeader .site-mobile-menu-btn{
    display:grid !important;
    place-items:center !important;
    width:42px !important;
    height:42px !important;
    margin:0 !important;
    padding:0 !important;
    border:0 !important;
    background:transparent !important;
    color:#111 !important;
    cursor:pointer !important;
  }
  #tomoShopHeader .site-mobile-menu-btn svg{
    width:26px !important;
    height:26px !important;
    fill:none !important;
    stroke:currentColor !important;
    stroke-width:2 !important;
    stroke-linecap:round !important;
  }

  .site-mobile-overlay{
    position:fixed !important;
    inset:0 !important;
    z-index:160 !important;
    display:block !important;
    margin:0 !important;
    background:rgba(0,0,0,.3) !important;
    opacity:0 !important;
    visibility:hidden !important;
    pointer-events:none !important;
    transition:.2s ease !important;
  }
  .site-mobile-overlay.open{
    opacity:1 !important;
    visibility:visible !important;
    pointer-events:auto !important;
  }
  .site-mobile-drawer{
    position:fixed !important;
    top:0 !important;
    right:0 !important;
    bottom:0 !important;
    z-index:170 !important;
    display:block !important;
    width:min(88vw,390px) !important;
    margin:0 !important;
    padding:18px !important;
    background:#fff !important;
    color:#111 !important;
    font-family:"Noto Sans JP",sans-serif !important;
    transform:translateX(105%) !important;
    transition:transform .24s ease !important;
    overflow-y:auto !important;
    box-shadow:-18px 0 50px rgba(0,0,0,.12) !important;
  }
  .site-mobile-drawer.open{transform:translateX(0) !important;}
  .site-mobile-drawer-head{
    display:flex !important;
    align-items:center !important;
    justify-content:space-between !important;
    height:56px !important;
    border-bottom:1px solid rgba(17,17,17,.14) !important;
  }
  .site-mobile-drawer-head img{
    display:block !important;
    width:160px !important;
    height:40px !important;
    object-fit:contain !important;
    object-position:left center !important;
  }
  .site-mobile-drawer-close{
    display:grid !important;
    place-items:center !important;
    width:42px !important;
    height:42px !important;
    margin:0 !important;
    padding:0 !important;
    border:0 !important;
    background:transparent !important;
    cursor:pointer !important;
  }
  .site-mobile-drawer-close svg{
    width:24px !important;
    height:24px !important;
    fill:none !important;
    stroke:#111 !important;
    stroke-width:2 !important;
  }
  .site-mobile-drawer nav{display:grid !important;}
  .site-mobile-drawer nav a,
  .site-mobile-drawer nav summary,
  .site-mobile-search-btn{
    display:flex !important;
    align-items:center !important;
    justify-content:space-between !important;
    width:100% !important;
    min-height:54px !important;
    margin:0 !important;
    padding:0 !important;
    border:0 !important;
    border-bottom:1px solid rgba(17,17,17,.14) !important;
    background:transparent !important;
    color:#111 !important;
    font-family:"Noto Sans JP",sans-serif !important;
    font-size:16px !important;
    font-weight:700 !important;
    line-height:1.45 !important;
    text-align:left !important;
    text-decoration:none !important;
    list-style:none !important;
    cursor:pointer !important;
  }
  .site-mobile-drawer nav summary::-webkit-details-marker{display:none !important;}
  .site-mobile-drawer nav details > a{
    min-height:auto !important;
    padding:11px 12px !important;
    border-bottom:0 !important;
    color:#5e5853 !important;
    font-size:14px !important;
    font-weight:500 !important;
  }
  .site-mobile-search-btn svg{
    width:21px !important;
    height:21px !important;
    fill:none !important;
    stroke:#111 !important;
    stroke-width:1.8 !important;
  }
  .site-mobile-drawer-lang{
    display:grid !important;
    grid-template-columns:1fr 1fr !important;
    gap:8px !important;
    margin-top:20px !important;
  }
  .site-mobile-drawer-lang button{
    margin:0 !important;
    padding:10px !important;
    border:1px solid #d7d2cc !important;
    border-radius:999px !important;
    background:#fff !important;
    color:#111 !important;
    font-family:"Noto Sans JP",sans-serif !important;
    font-size:14px !important;
    font-weight:700 !important;
    cursor:pointer !important;
  }
  .site-mobile-drawer-lang button.active{
    border-color:#111 !important;
    background:#111 !important;
    color:#fff !important;
  }
  body.site-mobile-menu-open{overflow:hidden !important;}

  #searchOverlay .search-dialog{margin-top:100px !important;}
  #searchOverlay .search-dialog input{font-size:23px !important;}
  #searchOverlay .search-results{grid-template-columns:repeat(2,1fr) !important;}
}

@media (min-width:1081px) and (max-width:1280px){
  #tomoShopHeader .site-header-inner{
    grid-template-columns:260px minmax(0,1fr) 260px !important;
    padding-left:24px !important;
    padding-right:24px !important;
  }
  #tomoShopHeader .site-header-actions{
    width:260px !important;
    min-width:260px !important;
  }
  #tomoShopHeader .site-main-nav{gap:18px !important;}
  #tomoShopHeader .site-main-nav > a,
  #tomoShopHeader .site-nav-trigger{
    padding-left:10px !important;
    padding-right:10px !important;
  }
}

/* TOMO ONE: Feeding is temporarily unavailable on every page */
#tomoShopHeader .site-nav-disabled {cursor:not-allowed !important;}
#tomoShopHeader .site-nav-disabled-label {display:inline-flex;align-items:center;color:#aaa !important;opacity:.6;cursor:not-allowed !important;pointer-events:none !important;}
#tomoShopHeader .site-nav-disabled:hover .site-nav-disabled-label {color:#aaa !important;}
.site-mobile-drawer a[href="#"], .site-mobile-drawer button[data-care-disabled] {cursor:not-allowed;}

/* V19: no persistent selected state on any navigation page. */
#tomoShopHeader .site-main-nav .active,
#tomoShopHeader .site-main-nav .current,
#tomoShopHeader .site-main-nav [aria-current="page"] {
  background:transparent !important;
}
#tomoShopHeader .site-main-nav .active:hover,
#tomoShopHeader .site-main-nav .current:hover,
#tomoShopHeader .site-main-nav [aria-current="page"]:hover {
  background:#EEEAE5 !important;
}
#tomoShopHeader .shop-lang-compact-wrap { z-index:130 !important; pointer-events:auto !important; }
#tomoShopHeader #shopLangTrigger { pointer-events:auto !important; }
#tomoShopHeader #shopLangMenu { z-index:200 !important; }

/* V20: SHOP is a normal navigable anchor; preserve the dropdown on hover. */
#tomoShopHeader .site-nav-item > a.site-nav-trigger {
  display:inline-flex !important; text-decoration:none !important; pointer-events:auto !important;
}
