/* TBY Size Guide Manager — V1.2.5
   Modern light fit-room interface + status-style badge. */
html.tby-sgm-open,
body.tby-sgm-open{
  overflow:hidden!important;
  overscroll-behavior:none!important;
}
body.tby-sgm-open{touch-action:none!important;}

/* Hide theme guide controls whenever TBY owns the product guide. */
body.tby-sgm-mode-hide.single-product .summary a[href*="size-guide"],
body.tby-sgm-mode-hide.single-product .summary a[href*="size_guide"],
body.tby-sgm-mode-hide.single-product .summary [class*="size-guide"],
body.tby-sgm-mode-hide.single-product .summary [class*="size_guide"],
body.tby-sgm-has-guide.single-product .summary a[href*="size-guide"],
body.tby-sgm-has-guide.single-product .summary a[href*="size_guide"],
body.tby-sgm-has-guide.single-product .summary .product-size-guide,
body.tby-sgm-has-guide.single-product .summary .size-guide-link,
body.tby-sgm-has-guide.single-product .summary .size-guide-button{
  display:none!important;
}
.tby-sgm-native-hidden{
  display:none!important;
  visibility:hidden!important;
  pointer-events:none!important;
}

/* Product-page trigger */
.tby-sgm-trigger-wrap{
  width:100%;
  display:flex;
  justify-content:center;
  align-items:center;
  margin:0 0 15px;
}
.tby-sgm-trigger{
  -webkit-appearance:none;
  appearance:none;
  position:relative;
  border:0;
  border-radius:0;
  background:transparent;
  color:#777;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:5px 2px 11px;
  font:inherit;
  font-size:12px;
  font-weight:500;
  line-height:1;
  letter-spacing:.155em;
  text-transform:uppercase;
  cursor:pointer;
  box-shadow:none;
}
.tby-sgm-trigger::after{
  content:"";
  position:absolute;
  left:0;
  right:0;
  bottom:1px;
  height:1px;
  background:rgba(119,119,119,.48);
}
.tby-sgm-trigger:hover,
.tby-sgm-trigger:focus{color:#676767;outline:none;}
.tby-sgm-trigger-icon{
  width:16px;
  height:12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
}
.tby-sgm-trigger-icon svg{
  width:16px;
  height:12px;
  display:block;
  fill:none;
  stroke:currentColor;
  stroke-width:1.35;
  stroke-linecap:round;
  stroke-linejoin:round;
}

/* Overlay */
.tby-sgm-modal{
  position:fixed;
  inset:0;
  z-index:2147483000;
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transition:opacity .2s ease,visibility .2s ease;
}
.tby-sgm-modal.is-open{
  opacity:1;
  visibility:visible;
  pointer-events:auto;
}
.tby-sgm-backdrop{
  position:absolute;
  inset:0;
  background:rgba(14,14,14,.42);
  -webkit-backdrop-filter:blur(6px) saturate(115%);
  backdrop-filter:blur(6px) saturate(115%);
}

/* Main modal */
.tby-sgm-panel{
  position:absolute;
  left:50%;
  top:50%;
  width:min(720px,calc(100vw - 32px));
  max-height:88vh;
  transform:translate(-50%,-47%) scale(.985);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  background:#f8f8f7;
  color:#151515;
  border:1px solid rgba(0,0,0,.06);
  border-radius:24px;
  box-shadow:0 28px 80px rgba(0,0,0,.24);
  transition:transform .24s cubic-bezier(.22,.8,.25,1);
}
.tby-sgm-modal.is-open .tby-sgm-panel{transform:translate(-50%,-50%) scale(1);}

.tby-sgm-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:18px;
  padding:24px 24px 18px;
  border-bottom:1px solid rgba(0,0,0,.07);
  background:#f8f8f7;
}
/* React/admin-style neutral status badge */
.tby-sgm-kicker{
  width:max-content;
  min-height:28px;
  margin:0 0 11px;
  padding:0 11px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid #dedfdf;
  border-radius:999px;
  background:#eceeed;
  color:#5f6262;
  font-size:9px;
  font-weight:600;
  line-height:1;
  letter-spacing:.16em;
  text-transform:uppercase;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.85);
}
.tby-sgm-head h2{
  margin:0;
  max-width:520px;
  font-size:24px;
  font-weight:500;
  line-height:1.08;
  letter-spacing:.055em;
  text-transform:uppercase;
}
.tby-sgm-close{
  width:36px;
  height:36px;
  min-width:36px;
  padding:0;
  border:1px solid rgba(0,0,0,.08);
  border-radius:999px;
  background:#fff;
  color:#191919;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:23px;
  font-weight:300;
  line-height:1;
  cursor:pointer;
  box-shadow:0 1px 2px rgba(0,0,0,.04);
}

.tby-sgm-body{
  padding:21px 24px 24px;
  overflow:auto;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
}
.tby-sgm-intro{
  margin:0 0 18px;
  max-width:620px;
  color:#686868;
  font-size:11px;
  line-height:1.65;
  letter-spacing:.075em;
  text-transform:uppercase;
}

/* Optional artwork */
.tby-sgm-image{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  margin:0 0 20px;
  padding:10px;
  overflow:hidden;
  border:1px solid rgba(0,0,0,.08);
  border-radius:18px;
  background:#fff;
}
.tby-sgm-image img{
  display:block;
  width:100%;
  height:auto;
  max-height:none;
  object-fit:contain;
  border-radius:12px;
}

.tby-sgm-table-top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  margin:0 0 10px;
  color:#696c6c;
  font-size:9px;
  font-weight:600;
  line-height:1;
  letter-spacing:.17em;
  text-transform:uppercase;
}
.tby-sgm-table-top>span{
  display:inline-flex;
  align-items:center;
  gap:8px;
}
.tby-sgm-table-top>span::before{
  content:"";
  width:18px;
  height:1px;
  background:#222;
  opacity:.45;
}

/* Light segmented control: no heavy black button */
.tby-sgm-toggle{
  display:inline-grid;
  grid-template-columns:1fr 1fr;
  gap:2px;
  padding:3px;
  border:1px solid #e0e1e1;
  border-radius:999px;
  background:#eceeed;
}
.tby-sgm-toggle button{
  min-width:43px;
  padding:8px 11px;
  border:0;
  border-radius:999px;
  background:transparent;
  color:#777a7a;
  font-size:9px;
  font-weight:600;
  line-height:1;
  letter-spacing:.11em;
  cursor:pointer;
  box-shadow:none;
}
.tby-sgm-toggle button.is-active{
  background:#fff;
  color:#161616;
  box-shadow:0 1px 3px rgba(0,0,0,.08);
}

.tby-sgm-table-wrap{
  width:100%;
  overflow:auto;
  border:1px solid rgba(0,0,0,.08);
  border-radius:16px;
  background:#fff;
}
.tby-sgm-table{
  width:100%;
  min-width:390px;
  border-collapse:separate;
  border-spacing:0;
}
.tby-sgm-table th,
.tby-sgm-table td{
  padding:14px 15px;
  border-bottom:1px solid rgba(0,0,0,.065);
  text-align:left;
  white-space:nowrap;
  font-size:11px;
  line-height:1.2;
  letter-spacing:.065em;
  text-transform:uppercase;
}
.tby-sgm-table th{
  background:#f1f2f1;
  color:#212121;
  font-weight:600;
}
.tby-sgm-table td{
  background:#fff;
  color:#646767;
}
.tby-sgm-table .tby-sgm-label-cell{
  color:#171717;
  font-weight:600;
}
.tby-sgm-table tr:last-child td{border-bottom:0;}

.tby-sgm-notes{
  margin-top:18px;
  padding:16px 17px;
  border:1px solid rgba(0,0,0,.07);
  border-radius:16px;
  background:#eff0ef;
  color:#191919;
}
.tby-sgm-notes h3{
  margin:0 0 8px;
  color:#343636;
  font-size:9px;
  font-weight:600;
  line-height:1;
  letter-spacing:.17em;
  text-transform:uppercase;
}
.tby-sgm-notes p{
  margin:0;
  color:#626565;
  font-size:11px;
  line-height:1.7;
  letter-spacing:.055em;
  text-transform:uppercase;
}

.tby-sgm-foot{
  padding:14px 24px calc(15px + env(safe-area-inset-bottom));
  border-top:1px solid rgba(0,0,0,.07);
  background:#f8f8f7;
  text-align:center;
}
.tby-sgm-foot a{
  color:#1b1b1b;
  text-decoration:none;
  border-bottom:1px solid currentColor;
  padding-bottom:4px;
  font-size:9px;
  font-weight:600;
  line-height:1;
  letter-spacing:.16em;
  text-transform:uppercase;
}

@media(max-width:767px){
  .tby-sgm-panel{
    left:0;
    right:0;
    top:auto;
    bottom:0;
    width:100%;
    max-height:90vh;
    border-width:1px 0 0;
    border-radius:24px 24px 0 0;
    transform:translateY(102%);
    box-shadow:0 -18px 62px rgba(0,0,0,.22);
  }
  .tby-sgm-panel::before{
    content:"";
    position:absolute;
    top:9px;
    left:50%;
    width:38px;
    height:4px;
    border-radius:999px;
    background:rgba(0,0,0,.18);
    transform:translateX(-50%);
  }
  .tby-sgm-modal.is-open .tby-sgm-panel{transform:translateY(0);}
  .tby-sgm-head{
    padding:28px 20px 16px;
    gap:12px;
  }
  .tby-sgm-kicker{
    min-height:27px;
    margin-bottom:10px;
    padding:0 10px;
    font-size:8px;
  }
  .tby-sgm-head h2{
    max-width:275px;
    font-size:21px;
    letter-spacing:.05em;
  }
  .tby-sgm-close{
    width:34px;
    height:34px;
    min-width:34px;
    font-size:22px;
  }
  .tby-sgm-body{padding:18px 20px 22px;}
  .tby-sgm-intro{margin-bottom:15px;font-size:10px;line-height:1.62;}
  .tby-sgm-image{padding:8px;margin-bottom:17px;border-radius:16px;}
  .tby-sgm-image img{border-radius:11px;}
  .tby-sgm-table-top{font-size:8px;}
  .tby-sgm-toggle button{min-width:40px;padding:7px 9px;font-size:8px;}
  .tby-sgm-table-wrap{border-radius:14px;}
  .tby-sgm-table{min-width:360px;}
  .tby-sgm-table th,
  .tby-sgm-table td{padding:13px 13px;font-size:10px;}
  .tby-sgm-notes{padding:15px 15px;border-radius:14px;}
  .tby-sgm-notes p{font-size:10px;line-height:1.68;}
  .tby-sgm-foot{padding:13px 20px calc(14px + env(safe-area-inset-bottom));}
}


/* =========================================================
   V1.2.7 — ADDITIVE FEATURES ON V1.2.5 VISUAL BASELINE
   The V1.2.5 rules above are intentionally preserved.
   ========================================================= */

/* Optional fit label; deliberately quieter than the main heading. */
.tby-sgm-heading-row{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.tby-sgm-fit-type{
  min-height:20px;
  padding:0 7px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid #dedfdf;
  border-radius:999px;
  background:#eceeed;
  color:#666969;
  font-size:7px;
  font-weight:600;
  line-height:1;
  letter-spacing:.13em;
  text-transform:uppercase;
  white-space:nowrap;
}

/* Keep V1.2.5 measurement controls available while scrolling. */
.tby-sgm-table-top{
  position:sticky;
  top:0;
  z-index:8;
  background:#f8f8f7;
}
.tby-sgm-table thead th{
  position:sticky;
  top:0;
  z-index:2;
}

/* Selected product size. */
.tby-sgm-table tbody tr.is-selected-size td{
  background:#f1f2ef;
  color:#171717;
  font-weight:600;
}
.tby-sgm-table tbody tr.is-selected-size .tby-sgm-label-cell::after{
  content:"SELECTED";
  display:inline-flex;
  margin-left:7px;
  padding:3px 6px;
  border-radius:999px;
  background:#171717;
  color:#fff;
  font-size:7px;
  font-weight:600;
  line-height:1;
  letter-spacing:.1em;
  vertical-align:middle;
}

.tby-sgm-tolerance{
  margin:10px 2px 0;
  color:#858787;
  font-size:9px;
  font-weight:500;
  line-height:1.5;
  letter-spacing:.08em;
  text-transform:uppercase;
}

@media(max-width:767px){
  .tby-sgm-fit-type{min-height:19px;padding:0 6px;font-size:7px;}
  .tby-sgm-table tbody tr.is-selected-size .tby-sgm-label-cell::after{
    display:block;
    width:max-content;
    margin:5px 0 0;
  }
  .tby-sgm-tolerance{font-size:8px;}
}
