/* [WVG-AI-ROOT] 基础变量与兼容层。
   以后 AI 修改样式时，请直接在对应区块内改，不要在文件底部继续叠加补丁。 */
.wvg-scope,
.wvt6m-layer{
  --wvg-accent:#00b9cd;
  --wvg-accent-rgb:0,185,205;
  --wvg-grid-radius:8px;
  --wvg-panel-radius:12px;
  --wvg-muted-border:#e5e7eb;
  --wvg-hover-border:#4b5563;
}

/* v2.0.35: hide original selects only when PHP rendered a usable grid in this form.
   Without a grid the native WooCommerce dropdown must remain available. */
form.variations_form:has(.wvg-scope) .variations,
form.variations_form:has(.wvg-scope) .reset_variations{
  display:none !important;
}

html{
  scrollbar-gutter:stable;
}

/* [WVG-AI-BAR] 顶部属性行与库存行。 */
form.variations_form .wvt6-bar{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin:0 0 var(--wvg-linked-bar-bottom,10px);
}

form.variations_form .wvt6-attrs{
  display:flex;
  flex-wrap:wrap;
  gap:16px;
  font-size:var(--wvg-linked-title-size,14px);
  font-weight:var(--wvg-linked-title-weight,700);
  line-height:var(--wvg-linked-title-line,1.35);
  color:#111;
}

form.variations_form .wvt6-attr b{
  font-size:inherit;
  font-weight:inherit;
  line-height:inherit;
}

form.variations_form .wvt6-attr .clear{
  margin-left:6px;
  cursor:pointer;
  color:#666;
  font-size:13px;
}

form.variations_form .wvt6-attr .clear:hover{
  color:#000;
}

form.variations_form .wvt6-stock{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:14px;
  color:#111;
  white-space:nowrap;
}

form.variations_form .wvt6-stock.is-hidden{
  display:none;
}

form.variations_form .wvt6-stock .dot{
  width:10px;
  height:10px;
  border-radius:9999px;
  display:inline-block;
  background:#9ca3af;
}

form.variations_form .wvt6-stock.instock .dot{ background:#16a34a; }
form.variations_form .wvt6-stock.onbackorder .dot{ background:#d97706; }
form.variations_form .wvt6-stock.outofstock .dot{ background:#dc2626; }

form.variations_form .wvt6-stock .txt{
  font-weight:700;
}

@media (max-width:1024px){
  form.variations_form .wvt6-bar{
    gap:10px;
  }

  form.variations_form .wvt6-attrs{
    min-width:0;
    gap:10px;
    flex:1 1 auto;
  }

  form.variations_form .wvt6-stock{
    flex:0 0 auto;
    font-size:13px;
  }
}

/* Keyboard controls share the visual tiles; focus is not tied to mouse hover. */
form.variations_form .wvt6-item:focus-visible,
.wvt6m-layer .wvt6m-item:focus-visible{
  outline:2px solid var(--wvg-accent,#00b9cd);
  outline-offset:2px;
  border-radius:var(--wvg-grid-radius,8px);
}

/* [WVG-AI-MAIN-GRID] 首屏主网格结构。 */
form.variations_form .wvt6-wrap{
  width:100%;
  box-sizing:border-box;
  margin:var(--wvg-linked-wrap-top,10px) 0 var(--wvg-linked-wrap-bottom,16px);
}

form.variations_form .wvt6-grid{
  gap:var(--wvg-linked-tile-gap,10px);
}

/* Keep the standalone 2.0.37 grid geometry: seven desktop columns and four mobile columns. */
form.variations_form .wvt6-grid.desktop{
  display:grid;
  grid-template-columns:repeat(7, minmax(0,1fr));
}

form.variations_form .wvt6-grid.mobile{
  display:none;
  grid-template-columns:repeat(4, minmax(0,1fr));
}

@media (max-width:1024px){
  form.variations_form .wvt6-grid.desktop{ display:none; }
  form.variations_form .wvt6-grid.mobile{
    display:grid;
    gap:var(--wvg-linked-mobile-gap,var(--wvg-native-mobile-gap,7px));
  }
  form.variations_form .wvt6-grid.mobile .wvt6-cap{
    font-size:var(--wvg-linked-mobile-caption,var(--wvg-native-mobile-caption,12px));
  }
}

form.variations_form .wvt6-item{
  user-select:none;
  cursor:pointer;
  position:relative;
  min-width:0;
  width:100%;
  box-sizing:border-box;
}

form.variations_form .wvt6-item[aria-disabled="true"]{
  cursor:not-allowed;
  opacity:.62;
  filter:grayscale(20%);
}

form.variations_form .wvt6-item[aria-disabled="true"] .wvt6-box::after{
  content:"×";
  position:absolute;
  right:6px;
  top:6px;
  width:18px;
  height:18px;
  border-radius:9999px;
  background:#dc2626;
  color:#fff;
  font-size:13px;
  line-height:18px;
  text-align:center;
  z-index:4;
}

form.variations_form .wvt6-item[aria-disabled="true"].is-active .wvt6-box{
  border-color:var(--wvg-muted-border);
  box-shadow:none;
}

form.variations_form .wvt6-item[aria-disabled="true"].is-active .wvt6-box::after{
  display:none;
}

form.variations_form .wvt6-box{
  width:100%;
  min-width:0;
  aspect-ratio:1 / 1;
  position:relative;
  overflow:hidden;
  box-sizing:border-box;
  background:#fff;
  border:1px solid var(--wvg-muted-border);
  border-radius:var(--wvg-grid-radius);
  transition:border-color .15s ease, box-shadow .15s ease;
}

form.variations_form .wvt6-img{
  position:absolute!important;
  inset:0!important;
  display:block!important;
  width:100%!important;
  height:100%!important;
  max-width:none!important;
  object-fit:cover!important;
  object-position:center!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  box-sizing:border-box!important;
}

form.variations_form .wvt6-picture{
  position:absolute;
  inset:0;
  display:block;
  width:100%;
  height:100%;
}

form.variations_form .wvt6-status-badge{
  position:absolute;
  left:50%;
  bottom:8px;
  transform:translateX(-50%);
  max-width:calc(100% - 16px);
  padding:4px 8px;
  border-radius:9999px;
  background:rgba(17,17,17,.78);
  color:#fff;
  font-size:11px;
  line-height:1.2;
  font-weight:700;
  text-align:center;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  z-index:2;
}



/* [WVG-AI-MAIN-SKELETON] 首屏骨架屏：只服务首屏网格，不遮挡交互。 */
form.variations_form .wvt6-box.has-media{
  background:#f3f4f6;
}

form.variations_form .wvt6-skel{
  position:absolute;
  inset:0;
  display:block;
  background:linear-gradient(90deg, #eef2f7 0%, #f7f9fb 48%, #eef2f7 100%);
  background-size:200% 100%;
  animation:wvg-skel-shimmer 1.25s linear infinite;
  pointer-events:none;
  z-index:1;
  opacity:1;
  transition:opacity .22s ease, visibility .22s ease;
}

form.variations_form .wvt6-box .wvt6-img{
  position:relative;
  z-index:2;
  opacity:1;
  transition:opacity .22s ease;
}

/* 图片显示不再依赖 JS 的 is-loaded 状态，避免延迟脚本导致首屏长期灰块。 */
form.variations_form .wvt6-box.is-loaded .wvt6-img{
  opacity:1;
}

form.variations_form .wvt6-box.is-loaded .wvt6-skel{
  opacity:0;
  visibility:hidden;
}

@keyframes wvg-skel-shimmer{
  0%{ background-position:200% 0; }
  100%{ background-position:-200% 0; }
}

@media (prefers-reduced-motion: reduce){
  form.variations_form .wvt6-skel,
  .wvt6m-skel{
    animation:none;
  }
}

/* [WVG-AI-STOCKOUT] 首屏缺货分组。 */
form.variations_form .wvt6-stockout-section{
  display:none !important;
}

form.variations_form .wvt6-stockout-section{
  margin-top:20px;
}

form.variations_form .wvt6-stockout-title{
  margin:0 0 12px;
  font-size:18px;
  line-height:1.2;
  font-weight:700;
  color:#111827;
}

form.variations_form .wvt6-stockout-grid{
  display:grid;
  gap:10px;
  grid-template-columns:repeat(7, minmax(0,1fr));
}

@media (max-width:1024px){
  form.variations_form .wvt6-stockout-grid{
    grid-template-columns:repeat(4, minmax(0,1fr));
  }
}

form.variations_form .wvt6-stockout-grid .wvt6-item[aria-disabled="true"]{
  opacity:.42;
  filter:grayscale(65%);
}


/* [WVG-AI-MAIN-STATE] 首屏状态：默认、悬停、选中。 */
form.variations_form .wvt6-item.is-active .wvt6-box{
  border-color:var(--wvg-accent);
  box-shadow:0 0 0 1px rgba(var(--wvg-accent-rgb), .15) inset, 0 0 0 2px rgba(var(--wvg-accent-rgb), .10);
}

form.variations_form .wvt6-item.is-active .wvt6-box::after{
  content:"✓";
  position:absolute;
  right:6px;
  top:6px;
  width:18px;
  height:18px;
  border-radius:9999px;
  background:var(--wvg-accent);
  color:#fff;
  font-size:12px;
  line-height:18px;
  text-align:center;
  z-index:4;
}

form.variations_form .wvt6-item:not(.is-active):not([aria-disabled="true"]) .wvt6-box:hover{
  border-color:var(--wvg-hover-border);
}

form.variations_form .wvt6-cap{
  margin-top:6px;
  text-align:center;
  font-size:12px;
  color:#111;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* [WVG-AI-MORE-TILE] +N 入口卡片。 */
form.variations_form .wvt6-more{
  cursor:pointer;
}

form.variations_form .wvt6-more .wvt6-cap{
  display:none;
}

form.variations_form .wvt6-more .wvt6-box::before{
  content:"";
  position:absolute;
  inset:0;
  background:rgba(17,17,17,.55);
  z-index:3;
  pointer-events:none;
}

form.variations_form .wvt6-more .wvt6-plus{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:700;
  font-size:18px;
  color:#fff;
  z-index:5;
  pointer-events:none;
  text-shadow:0 1px 2px rgba(0,0,0,.28);
}

/* [WVG-AI-OVERLAY] 选择层容器与面板。 */
.wvt6m-layer{
  position:fixed !important;
  inset:0 !important;
  z-index:999999999999 !important;
  isolation:isolate;
  background:rgba(17,17,17,.55);
  backdrop-filter:saturate(120%) blur(2px);
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transition:opacity .28s ease, visibility .28s step-end;
}

.wvt6m-layer:not(.is-open):not(.is-closing){
  /* Hundreds of hidden variation tiles should not participate in page layout. */
  content-visibility:hidden;
}
.wvt6m-layer.is-open,
.wvt6m-layer.is-closing{
  content-visibility:visible;
}

.wvt6m-layer.is-open{
  opacity:1;
  visibility:visible;
  pointer-events:auto;
  transition:opacity .28s ease, visibility .28s step-start;
}

.wvt6m-layer.is-closing{
  opacity:0;
  visibility:visible;
  pointer-events:none;
}
.wvt6m-layer:not(.is-open) .wvt6m-skel{animation:none!important}
.wvt6m-stockout-section[hidden]{display:none!important}

.wvt6m-panel{
  position:absolute !important;
  z-index:1000000000000 !important;
  display:flex;
  flex-direction:column;
  background:#fff;
  box-shadow:0 10px 30px rgba(0,0,0,.25);
  border-radius:var(--wvg-panel-radius);
  overflow:hidden;
  transition:transform .30s ease, opacity .25s ease;
}

@media (min-width:641px){
  .wvt6m-panel{
    left:50%;
    top:50%;
    width:min(1100px, 96vw);
    max-height:90vh;
    transform:translate(-50%, calc(-50% + 24px));
    opacity:0;
  }

  .wvt6m-layer.is-open .wvt6m-panel{
    transform:translate(-50%, -50%);
    opacity:1;
  }

  .wvt6m-layer.is-closing .wvt6m-panel{
    transform:translate(-50%, calc(-50% + 24px));
    opacity:0;
  }
}

@media (max-width:1024px){
  .wvt6m-panel{
    left:0;
    right:0;
    bottom:0;
    top:auto;
    width:100vw;
    max-height:85vh;
    border-radius:0;
    transform:translateY(100%);
    opacity:1;
  }

  .wvt6m-layer.is-open .wvt6m-panel{ transform:translateY(0); }
  .wvt6m-layer.is-closing .wvt6m-panel{ transform:translateY(100%); }
}

.wvt6m-head{
  position:relative;
  z-index:1000000000001 !important;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 14px 12px;
  background:#fff;
  border-bottom:1px solid #eee;
  border-radius:var(--wvg-panel-radius) var(--wvg-panel-radius) 0 0;
  flex:0 0 auto;
}

@media (max-width:1024px){
  .wvt6m-head,
  .wvt6m-close{
    border-radius:0;
  }
}

.wvt6m-body{
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
  scrollbar-gutter:stable;
}

.wvt6m-title{
  font-size:16px;
  font-weight:700;
  color:#111;
}

.wvt6m-close{
  appearance:none;
  border:0;
  background:none;
  cursor:pointer;
  font-size:18px;
  line-height:1;
  padding:6px 10px;
  border-radius:8px;
  color:#111;
}

.wvt6m-close:hover{
  background:#f3f4f6;
}

/* [WVG-AI-OVERLAY-GRID] 选择层网格。 */
.wvt6m-grid{
  display:grid;
  gap:0;
  grid-template-columns:repeat(6, minmax(0,1fr));
  padding:12px 8px 18px;
}

@media (max-width:1024px){
  .wvt6m-grid{
    grid-template-columns:repeat(4, minmax(0,1fr));
    padding:12px 3px 14px;
  }
}

.wvt6m-stockout-section{
  padding:4px 8px 18px;
}

.wvt6m-stockout-title{
  margin:0 0 12px;
  padding:0 4px;
  font-size:18px;
  line-height:1.2;
  font-weight:700;
  color:#111827;
}

.wvt6m-stockout-grid{
  display:grid;
  gap:0;
  grid-template-columns:repeat(6, minmax(0,1fr));
}

@media (max-width:1024px){
  .wvt6m-stockout-section{
    padding:2px 3px 14px;
  }

  .wvt6m-stockout-grid{
    grid-template-columns:repeat(4, minmax(0,1fr));
  }
}

.wvt6m-stockout-grid .wvt6m-item[aria-disabled="true"]{
  opacity:.42;
  filter:grayscale(65%);
}


@media (min-width:1025px){
  .wvt6m-stockout-grid .wvt6m-item:nth-child(6n+1){ border-left:1px solid var(--wvg-muted-border); }
  .wvt6m-stockout-grid .wvt6m-item:nth-child(-n+6){ border-top:1px solid var(--wvg-muted-border); }
}

@media (max-width:1024px){
  .wvt6m-stockout-grid .wvt6m-item:nth-child(4n+1){ border-left:1px solid var(--wvg-muted-border); }
  .wvt6m-stockout-grid .wvt6m-item:nth-child(-n+4){ border-top:1px solid var(--wvg-muted-border); }
}

@media (min-width:641px){
  .wvt6m-body::-webkit-scrollbar{
    width:10px;
  }

  .wvt6m-body::-webkit-scrollbar-thumb{
    background:rgba(107,114,128,.45);
    border-radius:9999px;
    border:2px solid #fff;
  }

  .wvt6m-body::-webkit-scrollbar-track{
    background:transparent;
  }
}

@media (max-width:1024px){
  .wvt6m-body{
    scrollbar-gutter:auto;
  }
}

.wvt6m-item{
  user-select:none;
  cursor:pointer;
  position:relative;
  background:#fff;
  border-right:1px solid var(--wvg-muted-border);
  border-bottom:1px solid var(--wvg-muted-border);
}

.wvt6m-item[aria-disabled="true"]{
  cursor:not-allowed;
  opacity:.62;
  filter:grayscale(20%);
}

.wvt6m-item[aria-disabled="true"]::after{
  content:"×";
  position:absolute;
  right:6px;
  top:6px;
  width:18px;
  height:18px;
  border-radius:9999px;
  background:#dc2626;
  color:#fff;
  font-size:13px;
  line-height:18px;
  text-align:center;
  z-index:4;
}

.wvt6m-item[aria-disabled="true"].is-active::after,
.wvt6m-item[aria-disabled="true"].is-active .wvt6m-box::after{
  display:none;
}

@media (min-width:1025px){
  .wvt6m-item:nth-child(6n+1){ border-left:1px solid var(--wvg-muted-border); }
  .wvt6m-item:nth-child(-n+6){ border-top:1px solid var(--wvg-muted-border); }
}

@media (max-width:1024px){
  .wvt6m-item:nth-child(4n+1){ border-left:1px solid var(--wvg-muted-border); }
  .wvt6m-item:nth-child(-n+4){ border-top:1px solid var(--wvg-muted-border); }
}

.wvt6m-box{
  width:100%;
  aspect-ratio:1 / 1;
  position:relative;
  overflow:hidden;
  background:#fff;
  border:none;
  border-radius:0;
  z-index:1;
}

.wvt6m-box.has-media{
  background:#fff;
}

.wvt6m-skel{
  position:absolute;
  inset:0;
  display:block;
  background:#fff;
  background-size:200% 100%;
  animation:none;
  pointer-events:none;
  z-index:1;
  opacity:1;
  transition:opacity .18s ease, visibility .18s ease;
}

.wvt6m-img{
  position:relative;
  z-index:2;
  opacity:1;
  transition:opacity .18s ease, transform .2s ease;
}

.wvt6m-box.is-loaded .wvt6m-img{
  opacity:1;
}

.wvt6m-box.is-loaded .wvt6m-skel{
  opacity:0;
  visibility:hidden;
}

.wvg-skeleton-off .wvt6-skel,
.wvg-skeleton-off .wvt6m-skel{
  display:none !important;
}

.wvg-skeleton-off .wvt6-box .wvt6-img,
.wvg-skeleton-off .wvt6m-img{
  opacity:1 !important;
}

.wvt6m-status-badge{
  position:absolute;
  left:50%;
  bottom:28px;
  transform:translateX(-50%);
  max-width:calc(100% - 16px);
  padding:4px 8px;
  border-radius:9999px;
  background:rgba(17,17,17,.78);
  color:#fff;
  font-size:11px;
  line-height:1.2;
  font-weight:700;
  text-align:center;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  z-index:4;
}


/* [WVG-AI-OVERLAY-BADGE] 仅弹层显示预订标识。 */
.wvt6m-backorder-badge{
  position:absolute;
  left:0;
  top:0;
  max-width:calc(100% - 12px);
  padding:4px 8px;
  border-radius:0;
  background:#d97706;
  color:#fff;
  font-size:11px;
  line-height:1.2;
  font-weight:700;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  z-index:4;
}

@media (max-width:1024px){
  .wvt6m-backorder-badge{
    max-width:calc(100% - 4px);
    padding:2px 5px;
    font-size:9px;
    line-height:1.15;
  }

  .wvt6m-status-badge{
    max-width:calc(100% - 8px);
    bottom:22px;
    padding:3px 6px;
    font-size:10px;
    line-height:1.15;
  }

  .wvt6m-cap{
    padding:3px 5px;
    font-size:11px;
  }
}

/* [WVG-AI-OVERLAY-STATE] 选择层状态：悬停、选中、标题浮层。 */
.wvt6m-item:not([aria-disabled="true"]):hover::before{
  content:"";
  position:absolute;
  inset:0;
  z-index:2;
  pointer-events:none;
  border:1px solid var(--wvg-accent);
  border-radius:0;
  background:transparent;
}

.wvt6m-item:not([aria-disabled="true"]):hover .wvt6m-img{
  transform:scale(1.04);
}

.wvt6m-item.is-active::after{
  content:"";
  position:absolute;
  inset:0;
  z-index:3;
  pointer-events:none;
  border:1px solid var(--wvg-accent);
  border-radius:0;
  background:transparent;
}

.wvt6m-item.is-active:hover::before{
  border:none;
}

.wvt6m-item.is-active .wvt6m-box::after{
  content:"✓";
  position:absolute;
  right:6px;
  top:6px;
  width:18px;
  height:18px;
  border-radius:9999px;
  background:var(--wvg-accent);
  color:#fff;
  font-size:12px;
  line-height:18px;
  text-align:center;
  z-index:4;
}

.wvt6m-cap{
  position:absolute;
  left:0;
  bottom:0;
  padding:4px 6px;
  font-size:12px;
  color:#374151;
  border-radius:0;
  box-shadow:none;
  border:none;
  z-index:4;
  pointer-events:none;
}

.wvt6m-box::before{
  content:attr(data-title);
  position:absolute;
  left:50%;
  top:6px;
  transform:translate(-50%, 8px);
  opacity:0;
  background:transparent;
  color:#fff;
  font-size:12px;
  line-height:1;
  padding:0;
  border-radius:0;
  white-space:nowrap;
  pointer-events:none;
  z-index:4;
  transition:opacity .18s ease, transform .18s ease, padding .18s ease, background-color .18s ease;
}

.wvt6m-item.has-backorder .wvt6m-box::before{
  top:32px;
}

.wvt6m-item:not([aria-disabled="true"]):hover .wvt6m-box::before{
  opacity:1;
  transform:translate(-50%, 0);
  padding:4px 8px;
  background:var(--wvg-accent);
}

@media (max-width:1024px){
  .wvt6m-box::before,
  .wvt6m-item:not([aria-disabled="true"]):hover .wvt6m-box::before{
    display:none !important;
  }
}

@media (hover:none){
  .wvt6m-box::before{
    display:none !important;
  }
}

/* [WVG-AI-ACCESSIBILITY] 强对比模式补丁。 */
@media (forced-colors: active){
  form.variations_form .wvt6-item.is-active .wvt6-box{
    border-color:ButtonText !important;
    box-shadow:none !important;
  }

  form.variations_form .wvt6-item.is-active .wvt6-box::after{
    background:ButtonText !important;
    color:ButtonFace !important;
  }

  .wvt6m-item.is-active::after,
  .wvt6m-item:not([aria-disabled="true"]):hover::before{
    border-color:ButtonText !important;
  }
}

/* [WVG-AI-ADD-TO-CART] 未选完整时的按钮接管兼容层。 */
.wvg-addtocart-gate{
  display:none !important;
  pointer-events:none !important;
}

button.single_add_to_cart_button.wvg-needs-selection,
button.single_add_to_cart_button[data-wvg-needs-selection="1"],
button.single_add_to_cart_button.wc-variation-selection-needed{
  pointer-events:auto !important;
  cursor:pointer !important;
  opacity:1 !important;
}

/* === v2.0.33：Gallery 内嵌式变体即时预览（修复 fixed 浮层/滑动错位） === */
.wvg-gallery-preview-host{
  position:relative !important;
}
.wvg-gallery-preview,
.wvg-gallery-thumb-preview{
  position:absolute;
  inset:0;
  z-index:4;
  pointer-events:none;
  overflow:hidden;
  box-sizing:border-box;
  background:#fff;
  opacity:1;
  transition:opacity .22s ease;
}
.wvg-gallery-thumb-preview{
  z-index:4;
}
.wvg-gallery-preview.is-hiding,
.wvg-gallery-thumb-preview.is-hiding{
  opacity:0;
}
.wvg-gallery-preview__img,
.wvg-gallery-thumb-preview__img{
  display:block;
  width:100%;
  height:100%;
  object-fit:contain;
  object-position:center center;
  background:#fff;
}
