/*
 * WEAUTY WXP-01 — Global UI foundation, Header, Mobile Navigation, Commerce Search.
 * Presentation only. No search semantics, commerce logic, indexing or provider logic.
 */

:root{
  --wx-ink:#171717;
  --wx-text:#242424;
  --wx-secondary:#687279;
  --wx-muted:#7a7a7a;
  --wx-canvas:#ffffff;
  --wx-subtle:#fafafa;
  --wx-soft:#f5f5f5;
  --wx-border:rgba(17,17,17,.09);
  --wx-border-strong:rgba(17,17,17,.18);
  --wx-sale:#e8363c;
  --wx-success:#1f7a4d;
  --wx-error:#b42318;
  --wx-r-xs:8px;
  --wx-r-sm:10px;
  --wx-r-md:12px;
  --wx-r-lg:16px;
  --wx-r-xl:18px;
  --wx-r-2xl:24px;
  --wx-shadow-low:0 8px 24px rgba(17,17,17,.045);
  --wx-shadow-hover:0 16px 38px rgba(17,17,17,.09);
  --wx-shadow-overlay:0 24px 80px rgba(17,17,17,.14);
  --wx-ease:cubic-bezier(.2,.7,.2,1);
}

:where(a,button,input,select,textarea,[tabindex]):focus-visible{
  outline:2px solid var(--wx-ink)!important;
  outline-offset:3px!important;
}

/* ---------- Header foundation ---------- */
#header{
  --wx-header-hit:44px;
}

#header [data-row="middle"]{
  transition:background-color .22s var(--wx-ease),box-shadow .22s var(--wx-ease),border-color .22s var(--wx-ease);
}

body:not(.home) #header [data-device="desktop"] [data-row="middle"],
body:not(.home) #header [data-device="mobile"] [data-row="middle"]{
  background:rgba(255,255,255,.96);
  border-bottom:1px solid var(--wx-border);
  backdrop-filter:saturate(140%) blur(14px);
  -webkit-backdrop-filter:saturate(140%) blur(14px);
}

#header .ct-container{
  width:min(1280px,calc(100% - 48px));
}

#header .header-menu-1 > ul > li > .ct-menu-link{
  min-height:44px;
  display:flex;
  align-items:center;
  padding-inline:13px;
  font-size:14px;
  font-weight:500;
  line-height:1.4;
  color:inherit;
  border-radius:10px;
  transition:background-color .18s var(--wx-ease),color .18s var(--wx-ease),opacity .18s var(--wx-ease);
}

#header .header-menu-1 > ul > li > .ct-menu-link:hover,
#header .header-menu-1 > ul > li.current-menu-item > .ct-menu-link,
#header .header-menu-1 > ul > li.current-menu-ancestor > .ct-menu-link{
  background:rgba(17,17,17,.055);
}

#header .sub-menu{
  padding:8px!important;
  border:1px solid var(--wx-border)!important;
  border-radius:16px!important;
  box-shadow:var(--wx-shadow-hover)!important;
  background:#fff!important;
}

#header .sub-menu .ct-menu-link{
  min-height:42px;
  display:flex;
  align-items:center;
  border-radius:10px;
  padding:8px 12px!important;
  color:var(--wx-text)!important;
  font-size:13px;
  font-weight:500;
}

#header .sub-menu .ct-menu-link:hover{
  background:var(--wx-soft)!important;
}

#header .ct-header-search,
#header .ct-account-item,
#header .ct-cart-item,
#header .ct-header-trigger,
#header .weauty-mobile-account{
  min-width:var(--wx-header-hit)!important;
  width:var(--wx-header-hit);
  min-height:var(--wx-header-hit)!important;
  height:var(--wx-header-hit);
  display:inline-flex!important;
  align-items:center;
  justify-content:center;
  padding:0!important;
  border-radius:999px!important;
  transition:background-color .18s var(--wx-ease),transform .18s var(--wx-ease)!important;
}

#header .ct-header-search:hover,
#header .ct-account-item:hover,
#header .ct-cart-item:hover,
#header .ct-header-trigger:hover,
#header .weauty-mobile-account:hover{
  background:rgba(17,17,17,.06)!important;
  transform:none!important;
}

#header .ct-header-search .ct-icon,
#header .ct-account-item .ct-icon,
#header .ct-cart-item svg,
#header .ct-header-trigger .ct-icon,
#header .weauty-mobile-account svg{
  width:18px!important;
  height:18px!important;
}

#header .ct-dynamic-count-cart{
  min-width:17px;
  height:17px;
  padding:0 4px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  font-size:10px;
  font-weight:700;
  line-height:1;
}

/* ---------- Mobile header / drawer ---------- */
@media(max-width:999px){
  #header [data-device="mobile"] .ct-sticky-container{
    height:70px!important;
  }

  #header [data-device="mobile"] [data-row="middle"] .ct-container{
    min-height:70px;
    width:calc(100% - 28px);
    gap:8px;
  }

  #header [data-device="mobile"] [data-column="end"] [data-items="primary"]{
    gap:2px;
  }

  #header .weauty-mobile-header-search{
    margin:0!important;
  }

  #offcanvas{
    background:rgba(17,17,17,.36)!important;
    backdrop-filter:blur(4px);
    -webkit-backdrop-filter:blur(4px);
  }

  #offcanvas .ct-panel-actions{
    inset:18px 18px auto auto!important;
    z-index:3;
  }

  #offcanvas .ct-toggle-close{
    width:44px!important;
    height:44px!important;
    display:flex!important;
    align-items:center;
    justify-content:center;
    border:1px solid var(--wx-border)!important;
    border-radius:999px!important;
    background:#fff!important;
    color:var(--wx-ink)!important;
  }

  #offcanvas .ct-panel-content[data-device="mobile"]{
    width:min(88vw,390px)!important;
    max-width:390px!important;
    background:#fff!important;
    box-shadow:var(--wx-shadow-overlay)!important;
    border-radius:0 0 0 24px;
  }

  #offcanvas .ct-panel-content-inner{
    padding:82px 20px 28px!important;
  }

  .weauty-wxp-drawer-brand{
    display:flex;
    align-items:baseline;
    justify-content:space-between;
    gap:12px;
    padding:0 4px 18px;
    margin-bottom:10px;
    border-bottom:1px solid var(--wx-border);
  }

  .weauty-wxp-drawer-brand strong{
    font-size:18px;
    letter-spacing:.06em;
    font-weight:700;
    color:var(--wx-ink);
  }

  .weauty-wxp-drawer-brand span{
    font-size:11px;
    color:var(--wx-muted);
    letter-spacing:.04em;
  }

  #offcanvas .mobile-menu > ul > li{
    border-bottom:1px solid rgba(17,17,17,.065);
  }

  #offcanvas .mobile-menu .ct-menu-link,
  #offcanvas .mobile-menu .ct-sub-menu-parent{
    min-height:52px;
    display:flex;
    align-items:center;
    font-size:15px;
    font-weight:500;
  }

  #offcanvas .mobile-menu .ct-toggle-dropdown-mobile{
    min-width:44px!important;
    min-height:44px!important;
    border-radius:999px;
  }

  #offcanvas .mobile-menu .sub-menu{
    margin:0 8px 10px!important;
    padding:4px 10px 8px!important;
    border:0!important;
    border-right:1px solid var(--wx-border)!important;
    border-radius:0!important;
    box-shadow:none!important;
  }

  #offcanvas .ct-header-cta{
    margin-top:22px!important;
  }

  #offcanvas .ct-header-cta .ct-button{
    width:100%;
    min-height:48px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:12px!important;
    background:var(--wx-ink)!important;
    color:#fff!important;
    font-size:14px;
    font-weight:700;
  }

  #offcanvas .ct-header-socials{
    margin-top:20px!important;
  }

  #offcanvas .ct-social-box{
    gap:8px!important;
  }

  #offcanvas .ct-social-box a{
    width:44px!important;
    height:44px!important;
    display:flex!important;
    align-items:center;
    justify-content:center;
    border:1px solid var(--wx-border);
    border-radius:999px;
  }
}

/* ---------- Commerce search ---------- */
#search-modal{
  background:rgba(247,247,247,.965)!important;
  backdrop-filter:saturate(130%) blur(10px);
  -webkit-backdrop-filter:saturate(130%) blur(10px);
  color:var(--wx-text)!important;
}

#search-modal .ct-panel-actions{
  top:22px!important;
  left:22px!important;
  right:auto!important;
  z-index:20;
}

#search-modal .ct-toggle-close{
  width:46px!important;
  height:46px!important;
  display:flex!important;
  align-items:center;
  justify-content:center;
  background:#fff!important;
  color:var(--wx-ink)!important;
  border:1px solid var(--wx-border)!important;
  border-radius:999px!important;
  box-shadow:var(--wx-shadow-low);
}

#search-modal .ct-panel-content{
  min-height:100%;
  display:flex!important;
  flex-direction:column;
  align-items:center;
  justify-content:flex-start!important;
  gap:18px;
  overflow-y:auto;
  padding:clamp(72px,9vh,112px) 24px 48px!important;
}

.weauty-wxp-search-intro{
  width:min(900px,100%);
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:4px;
}

.weauty-wxp-search-intro .eyebrow{
  margin:0;
  font-size:12px;
  line-height:1.6;
  font-weight:700;
  color:var(--wx-secondary);
}

.weauty-wxp-search-intro h2{
  margin:0;
  color:var(--wx-ink);
  font-size:clamp(24px,3vw,36px);
  line-height:1.45;
  font-weight:700;
  letter-spacing:-.02em;
}

.weauty-wxp-search-intro p{
  margin:2px 0 0;
  color:var(--wx-secondary);
  font-size:13px;
  line-height:1.8;
}

#search-modal .ct-search-form{
  width:min(900px,100%)!important;
  max-width:900px!important;
  margin:0!important;
  padding:18px!important;
  box-sizing:border-box;
  border:1px solid var(--wx-border)!important;
  border-radius:24px!important;
  background:#fff!important;
  box-shadow:var(--wx-shadow-overlay)!important;
}

#search-modal .ct-search-form-inner{
  min-height:58px!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 52px;
  align-items:center;
  background:var(--wx-subtle)!important;
  border:1px solid var(--wx-border-strong)!important;
  border-radius:14px!important;
  overflow:hidden;
  box-shadow:none!important;
}

#search-modal .ct-search-form input[type="search"]{
  min-width:0!important;
  height:58px!important;
  padding:0 18px!important;
  border:0!important;
  outline:0!important;
  background:transparent!important;
  color:var(--wx-ink)!important;
  font-size:16px!important;
  line-height:1.6!important;
  font-weight:500!important;
}

#search-modal .ct-search-form input[type="search"]::placeholder{
  color:#8b8b8b!important;
  opacity:1!important;
  font-weight:400!important;
}

#search-modal .ct-search-form-inner:focus-within{
  border-color:var(--wx-ink)!important;
  box-shadow:0 0 0 3px rgba(17,17,17,.07)!important;
}

#search-modal .ct-search-form button[type="submit"]{
  width:52px!important;
  min-width:52px!important;
  height:50px!important;
  min-height:50px!important;
  margin:4px!important;
  padding:0!important;
  display:flex!important;
  align-items:center;
  justify-content:center;
  border:0!important;
  border-radius:11px!important;
  background:var(--wx-ink)!important;
  color:#fff!important;
}

#search-modal .ct-search-form button[type="submit"] .ct-icon{
  width:18px!important;
  height:18px!important;
}

#search-modal .ct-search-results{
  position:relative!important;
  inset:auto!important;
  width:100%!important;
  max-height:none!important;
  margin:14px 0 0!important;
  padding:14px 0 0!important;
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px!important;
  border:0!important;
  border-top:1px solid var(--wx-border)!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  transform:none!important;
  overflow:visible!important;
}

.weauty-wxp-results-heading{
  grid-column:1/-1;
  display:flex;
  align-items:center;
  justify-content:space-between;
  min-height:30px;
  color:var(--wx-secondary);
  font-size:12px;
  font-weight:700;
}

.weauty-wxp-results-heading span:last-child{
  font-weight:500;
  color:var(--wx-muted);
}

#search-modal .ct-search-item{
  min-width:0;
  min-height:96px;
  display:grid!important;
  grid-template-columns:72px minmax(0,1fr);
  align-items:center!important;
  gap:12px!important;
  padding:10px!important;
  border:1px solid var(--wx-border)!important;
  border-radius:16px!important;
  background:#fff!important;
  color:var(--wx-text)!important;
  text-decoration:none!important;
  transition:border-color .18s var(--wx-ease),box-shadow .18s var(--wx-ease),transform .18s var(--wx-ease)!important;
}

#search-modal .ct-search-item:hover,
#search-modal .ct-search-item[aria-selected="true"]{
  border-color:var(--wx-border-strong)!important;
  box-shadow:var(--wx-shadow-low)!important;
  transform:translateY(-1px);
}

#search-modal .ct-search-item .ct-media-container{
  width:72px!important;
  height:76px!important;
  min-width:72px!important;
  overflow:hidden!important;
  border-radius:12px!important;
  background:var(--wx-soft)!important;
}

#search-modal .ct-search-item .ct-media-container img{
  width:100%!important;
  height:100%!important;
  object-fit:cover!important;
  aspect-ratio:auto!important;
}

.weauty-wxp-search-item-info{
  min-width:0;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:7px;
}

.weauty-wxp-search-title{
  width:100%;
  color:var(--wx-ink);
  font-size:14px;
  font-weight:700;
  line-height:1.65;
  white-space:normal;
  overflow:hidden;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
}

.weauty-wxp-search-meta{
  width:100%;
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:6px 9px;
  color:var(--wx-secondary);
  font-size:12px;
  line-height:1.5;
}

.weauty-wxp-search-price{
  color:var(--wx-ink);
  font-weight:700;
}

.weauty-wxp-search-old-price{
  color:#969696;
  text-decoration:line-through;
  font-size:11px;
}

.weauty-wxp-search-discount{
  display:inline-flex;
  align-items:center;
  min-height:22px;
  padding:2px 7px;
  border-radius:999px;
  background:rgba(232,54,60,.09);
  color:var(--wx-sale);
  font-size:10px;
  font-weight:700;
}

.weauty-wxp-search-stock{
  display:inline-flex;
  align-items:center;
  gap:5px;
  color:var(--wx-secondary);
}

.weauty-wxp-search-stock::before{
  content:"";
  width:6px;
  height:6px;
  border-radius:999px;
  background:var(--wx-success);
}

.weauty-wxp-search-stock.is-out{
  color:var(--wx-error);
}

.weauty-wxp-search-stock.is-out::before{
  background:var(--wx-error);
}

.weauty-wxp-search-code{
  color:var(--wx-muted);
  font-size:11px;
}

#search-modal .ct-search-more{
  grid-column:1/-1!important;
  min-height:46px;
  display:flex!important;
  align-items:center;
  justify-content:center;
  margin-top:2px;
  border-radius:12px!important;
  background:var(--wx-ink)!important;
  color:#fff!important;
  font-size:13px!important;
  font-weight:700!important;
  text-decoration:none!important;
}

.weauty-wxp-search-shortcut{
  grid-column:1/-1;
  min-height:52px;
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border:1px solid var(--wx-border);
  border-radius:14px;
  background:var(--wx-subtle);
  color:var(--wx-text)!important;
  text-decoration:none!important;
}

.weauty-wxp-search-shortcut small{
  color:var(--wx-secondary);
  font-size:11px;
  font-weight:500;
}

.weauty-wxp-search-shortcut strong{
  min-width:0;
  font-size:13px;
  font-weight:700;
}

.weauty-wxp-search-shortcut b{
  font-size:12px;
  font-weight:700;
}

.weauty-wxp-search-empty{
  margin-top:14px;
  padding:22px 18px;
  border-top:1px solid var(--wx-border);
  text-align:center;
}

.weauty-wxp-search-empty strong{
  display:block;
  margin-bottom:5px;
  color:var(--wx-ink);
  font-size:15px;
}

.weauty-wxp-search-empty p{
  margin:0 auto 14px;
  max-width:480px;
  color:var(--wx-secondary);
  font-size:13px;
  line-height:1.8;
}

.weauty-wxp-search-empty a{
  min-height:44px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:8px 16px;
  border-radius:12px;
  background:var(--wx-ink);
  color:#fff!important;
  text-decoration:none!important;
  font-size:13px;
  font-weight:700;
}

@media(max-width:689px){
  #search-modal{
    background:#fff!important;
    backdrop-filter:none;
    -webkit-backdrop-filter:none;
  }

  #search-modal .ct-panel-actions{
    top:12px!important;
    left:12px!important;
  }

  #search-modal .ct-toggle-close{
    width:44px!important;
    height:44px!important;
    box-shadow:none!important;
  }

  #search-modal .ct-panel-content{
    padding:68px 14px 24px!important;
    gap:12px;
  }

  .weauty-wxp-search-intro{
    gap:2px;
  }

  .weauty-wxp-search-intro .eyebrow{
    font-size:11px;
  }

  .weauty-wxp-search-intro h2{
    font-size:24px;
  }

  .weauty-wxp-search-intro p{
    font-size:12px;
  }

  #search-modal .ct-search-form{
    padding:12px!important;
    border-radius:18px!important;
    box-shadow:none!important;
  }

  #search-modal .ct-search-form-inner{
    grid-template-columns:minmax(0,1fr) 48px;
    min-height:54px!important;
  }

  #search-modal .ct-search-form input[type="search"]{
    height:54px!important;
    padding:0 13px!important;
    font-size:15px!important;
  }

  #search-modal .ct-search-form button[type="submit"]{
    width:46px!important;
    min-width:46px!important;
    height:46px!important;
  }

  #search-modal .ct-search-results{
    grid-template-columns:1fr;
    gap:8px!important;
  }

  #search-modal .ct-search-item{
    min-height:88px;
    grid-template-columns:64px minmax(0,1fr);
    gap:10px!important;
    padding:8px!important;
    border-radius:14px!important;
  }

  #search-modal .ct-search-item .ct-media-container{
    width:64px!important;
    min-width:64px!important;
    height:72px!important;
    border-radius:10px!important;
  }

  .weauty-wxp-search-title{
    font-size:13px;
  }

  #search-modal .ct-search-more{
    min-height:48px;
  }
}

@media(prefers-reduced-motion:reduce){
  #header *,
  #search-modal *{
    transition-duration:.01ms!important;
    animation-duration:.01ms!important;
    animation-iteration-count:1!important;
  }
}


/* WXP-01 focus override: Blocksy palette-1 is promotional red; Search focus stays neutral/ink. */
#search-modal .ct-search-form input[type="search"]:focus,
#search-modal .ct-search-form input[type="search"]:focus-visible{
  outline:0!important;
  box-shadow:none!important;
  border-color:transparent!important;
}
#search-modal .ct-search-form .ct-search-form-inner:focus-within,
#search-modal .ct-search-form .ct-pseudo-input:focus-within{
  outline:0!important;
  border-color:var(--wx-ink)!important;
  box-shadow:0 0 0 3px rgba(17,17,17,.07)!important;
  --theme-form-field-border-focus-color:var(--wx-ink)!important;
}


/* Drawer contrast repair after switching Blocksy off-canvas from dark to light. */
@media(max-width:999px){
  #offcanvas .mobile-menu .ct-menu-link,
  #offcanvas .mobile-menu .ct-sub-menu-parent,
  #offcanvas .mobile-menu .ct-toggle-dropdown-mobile{
    color:var(--wx-ink)!important;
  }

  #offcanvas .mobile-menu > ul > li.current-menu-item > .ct-menu-link,
  #offcanvas .mobile-menu > ul > li.current-menu-ancestor > .ct-sub-menu-parent{
    color:var(--wx-ink)!important;
    background:var(--wx-soft)!important;
    border-radius:10px;
  }

  #offcanvas .mobile-menu .ct-toggle-dropdown-mobile svg,
  #offcanvas .mobile-menu .ct-toggle-dropdown-mobile path{
    fill:currentColor!important;
  }

  #offcanvas .ct-toggle-close svg,
  #offcanvas .ct-toggle-close path,
  #search-modal .ct-toggle-close svg,
  #search-modal .ct-toggle-close path{
    fill:currentColor!important;
    color:var(--wx-ink)!important;
  }

  #offcanvas .ct-social-box a{
    color:var(--wx-secondary)!important;
  }

  #offcanvas .ct-social-box a svg,
  #offcanvas .ct-social-box a path,
  #offcanvas .ct-social-box a circle{
    fill:currentColor!important;
    color:currentColor!important;
  }
}

#search-modal .ct-toggle-close svg,
#search-modal .ct-toggle-close path{
  fill:currentColor!important;
  color:var(--wx-ink)!important;
}


/* Cart count is a neutral utility state, not a promotional red accent. */
#header .ct-dynamic-count-cart{
  background:var(--wx-ink)!important;
  color:#fff!important;
  border:2px solid #fff!important;
}

/* WXP01 mobile header: neutralize Blocksy cart margins that push the icon into the logo. */
@media(max-width:999px){
  #header [data-device="mobile"] .ct-header-cart{
    margin-inline:0!important;
  }
  #header [data-device="mobile"] [data-column="end"] > [data-items="primary"]{
    transform:translateX(-18px)!important;
  }
}

@media(max-width:380px){
  #header [data-device="mobile"] [data-id="logo"]{
    width:clamp(90px,calc(100vw - 250px),130px)!important;
    margin-inline-end:0!important;
  }
}


/* WXP01 owner 2026-10-05: slightly larger account glyph on mobile. */
@media(max-width:999px){
  #header .weauty-mobile-account svg,
  #header .ct-account-item .ct-icon{
    width:22px!important;
    height:22px!important;
  }
}
