/* ==================================================================== *
 * Size guide charts (UX Blocks) — product-page popup.
 *
 * Same design language as the /size-guides/ page: the theme's own tokens,
 * Barlow Condensed headings, card-wrapped tables with a dark header.
 * Colours come from the variables below, so the palette is changed in one
 * place rather than per rule.
 *
 * The class contract is fixed by the blocks and by assets/size-guide.js —
 * .active on tabs/panes/unit buttons and [data-unit] on the section — so
 * restyle freely but keep those hooks.
 * ==================================================================== */

.kz-sg-section,
.kz-sg-apparel {
  --kz-sg-accent: #C8102E;
  --kz-sg-accent-ink: #9E0B22;
  --kz-sg-fg: #15181d;
  --kz-sg-muted: #6a7280;
  --kz-sg-border: #e6e8eb;
  --kz-sg-surface: #f4f5f7;
  --kz-sg-tint: #fff1f0;
  --kz-sg-radius: 12px;
  --kz-sg-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --kz-sg-shadow: 0 6px 24px rgba(15, 24, 40, .10);
}

.kz-sg-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 20px 64px;
  color: var(--kz-sg-fg);
  font-family: inherit;
}

.kz-sg-title {
  margin-bottom: 8px;
  color: var(--kz-sg-fg);
  font-family: var(--kz-sg-display);
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -.01em;
  line-height: 1.05;
  text-align: center;
  text-transform: uppercase;
}

.kz-sg-subtitle {
  margin-bottom: 34px;
  color: var(--kz-sg-muted);
  font-size: 15px;
  font-weight: 400;
  text-align: center;
}

/* === Unit toggle (segmented control) === */
.kz-sg-unit-toggle {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-bottom: 26px;
}

.kz-sg-unit-btn {
  margin: 0;
  padding: 0 22px;
  height: 38px;
  border: 1.5px solid var(--kz-sg-border);
  background: #fff;
  color: var(--kz-sg-muted);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.kz-sg-unit-btn:first-child { border-radius: 8px 0 0 8px; }
.kz-sg-unit-btn:last-child { border-radius: 0 8px 8px 0; border-left-width: 0; }

.kz-sg-unit-btn:hover { color: var(--kz-sg-accent); border-color: var(--kz-sg-accent); }

.kz-sg-unit-btn.active,
.kz-sg-unit-btn.active:hover {
  background: var(--kz-sg-accent);
  border-color: var(--kz-sg-accent);
  color: #fff;
}

/* The active button owns the shared edge, so its colour isn't cut in half. */
.kz-sg-unit-btn.active + .kz-sg-unit-btn { border-left-color: var(--kz-sg-border); }
.kz-sg-unit-btn.active:last-child { border-left-width: 1.5px; }

/* === Garment tabs === */
.kz-sg-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 26px;
}

.kz-sg-tab {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1.5px solid var(--kz-sg-border);
  border-radius: 8px;
  background: #fff;
  color: var(--kz-sg-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.kz-sg-tab:hover { border-color: var(--kz-sg-accent); color: var(--kz-sg-accent); }

.kz-sg-tab.active,
.kz-sg-tab.active:hover {
  background: var(--kz-sg-accent);
  border-color: var(--kz-sg-accent);
  color: #fff;
}

/* === Panel === */
.kz-sg-panel {
  display: none;
  animation: kzSgFade .3s ease;
}

.kz-sg-panel.active { display: block; }

@keyframes kzSgFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === Section headings (chart, how to measure, washing) === */
.kz-sg-panel-label,
.kz-sg-measure-label,
.kz-sg-washing-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  color: var(--kz-sg-fg);
  font-family: var(--kz-sg-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .01em;
  text-transform: uppercase;
}

.kz-sg-panel-label::before,
.kz-sg-measure-label::before,
.kz-sg-washing-label::before {
  content: '';
  flex: none;
  width: 4px;
  height: 20px;
  border-radius: 2px;
  background: var(--kz-sg-accent);
}

.kz-sg-panel-label::after,
.kz-sg-measure-label::after,
.kz-sg-washing-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--kz-sg-border);
}

/* === Table === */
.kz-sg-table-wrap {
  margin-bottom: 30px;
  border: 1px solid var(--kz-sg-border);
  border-radius: var(--kz-sg-radius);
  background: #fff;
  box-shadow: var(--kz-sg-shadow);
  overflow-x: auto;                  /* wide charts scroll inside the card */
  -webkit-overflow-scrolling: touch;
}

.kz-sg-table {
  width: 100%;
  min-width: 480px;
  margin: 0;
  border-collapse: collapse;
}

.kz-sg-table thead th {
  padding: 13px 16px;
  border: 0;
  background: var(--kz-sg-fg);
  color: #fff;
  font-family: var(--kz-sg-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}

.kz-sg-table thead th:first-child { padding-left: 20px; text-align: left; }

.kz-sg-table tbody td {
  padding: 12px 16px;
  border: 0;
  border-top: 1px solid var(--kz-sg-border);
  color: var(--kz-sg-fg);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
}

.kz-sg-table tbody tr:nth-child(even) td { background: #fafbfc; }

.kz-sg-table tbody td:first-child {
  padding-left: 20px;
  background: rgba(225, 6, 0, .045);
  font-weight: 700;
  text-align: left;
}

.kz-sg-table tbody tr:hover td { background: var(--kz-sg-surface); }
.kz-sg-table tbody tr:hover td:first-child { color: var(--kz-sg-accent); }

/* Unit toggle hide/show */
.kz-sg-section[data-unit="in"] .col-cm { display: none; }
.kz-sg-section[data-unit="cm"] .col-in { display: none; }

/* Shoe charts quote one unit only and carry no .col-in/.col-cm cells, so their
   Inches/CM switch is a control that cannot do anything. Hide it there rather
   than let a shopper click it and conclude the popup is broken. */
.kz-sg-section:not(:has(.col-in)) .kz-sg-unit-toggle { display: none; }

/* === How to measure === */
.kz-sg-measure {
  margin-top: 16px;
  padding-top: 24px;
}

.kz-sg-measure-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

.kz-sg-measure-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.kz-sg-measure-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--kz-sg-border);
  color: var(--kz-sg-muted);
  font-size: 14px;
  line-height: 1.55;
}

.kz-sg-measure-list li:first-child { border-top: 1px solid var(--kz-sg-border); }

.kz-sg-step {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--kz-sg-accent);
  color: #fff;
  font-size: 11.5px;
  font-weight: 800;
}

.kz-sg-measure-list strong {
  color: var(--kz-sg-fg);
  font-weight: 700;
}

.kz-sg-measure-img {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.kz-sg-measure-img img {
  max-width: 100%;
  max-height: 400px;
  border: 1px solid var(--kz-sg-border);
  border-radius: var(--kz-sg-radius);
}

/* === Caveat under a chart ("these are garment measurements…") === */
.kz-sg-note {
  margin-top: 20px;
  padding: 13px 16px;
  border: 1px solid var(--kz-sg-border);
  border-left: 3px solid var(--kz-sg-accent);
  border-radius: 8px;
  background: var(--kz-sg-surface);
  color: var(--kz-sg-muted);
  font-size: 13.5px;
  line-height: 1.55;
}

.kz-sg-note strong { color: var(--kz-sg-fg); }

/* === Washing symbols === */
.kz-sg-washing { margin-top: 40px; }

.kz-sg-wash-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 13px 4px;
  border-bottom: 1px solid var(--kz-sg-border);
}

.kz-sg-wash-item:first-child { border-top: 1px solid var(--kz-sg-border); }

.kz-sg-wash-item:hover { padding-left: 12px; transition: padding .2s ease; }

.kz-sg-wash-item img {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.kz-sg-wash-item p {
  margin: 0;
  color: var(--kz-sg-muted);
  font-size: 14px;
  line-height: 1.55;
}

/* === CTA === */
.kz-sg-cta {
  margin-top: 48px;
  padding: 32px;
  border: 1px solid var(--kz-sg-border);
  border-radius: var(--kz-sg-radius);
  background: var(--kz-sg-surface);
  text-align: center;
}

.kz-sg-cta p {
  margin-bottom: 18px;
  color: var(--kz-sg-muted);
  font-size: 15px;
}

.kz-sg-cta a {
  display: inline-block;
  padding: 13px 30px;
  border-radius: 8px;
  background: var(--kz-sg-accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color .15s ease;
}

.kz-sg-cta a:hover { background: var(--kz-sg-accent-ink); }

/* === Responsive === */
@media (max-width: 768px) {
  .kz-sg-section { padding: 34px 16px 48px; }
  .kz-sg-title { font-size: 28px; }
  /* A long garment name ("3D Hoodie / Zip Hoodie / Sweatshirt") leaves the
     trailing rule no room, so the bar moves to a border and the rule goes. */
  .kz-sg-panel-label,
  .kz-sg-measure-label,
  .kz-sg-washing-label {
    display: block;
    padding-left: 12px;
    border-left: 4px solid var(--kz-sg-accent);
    font-size: 17px;
    line-height: 1.25;
  }
  .kz-sg-panel-label::before,
  .kz-sg-measure-label::before,
  .kz-sg-washing-label::before,
  .kz-sg-panel-label::after,
  .kz-sg-measure-label::after,
  .kz-sg-washing-label::after { display: none; }
  .kz-sg-tabs { gap: 6px; }
  .kz-sg-tab { min-height: 36px; padding: 0 13px; font-size: 12.5px; }
  .kz-sg-measure-body { grid-template-columns: 1fr; gap: 24px; }
  .kz-sg-measure-img { order: -1; }
}

/* ================================================================== *
 * Product page
 *
 * The chart above is authored for a full-width page; Flatsome's
 * lightbox supplies the frame, close button and scroll lock, so only
 * the trigger and a tighter inner padding are needed here.
 * ================================================================== */

.kz-sg-trigger-row {
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  border-top:1px solid #e6e8eb; margin:2px 0 0; padding:14px 0 2px;
}
.kz-sg-hint { font-size:14px; color:#6a7280; }
.kz-sg-trigger {
  display:inline-flex; align-items:center; gap:5px;
  font-size:14px; font-weight:700; color:#15181d; text-decoration:none;
}
.kz-sg-trigger:hover { color:#C8102E; }
.kz-sg-trigger svg { flex:none; }

/* Inside the lightbox the page's hero spacing is wasted height. */
.kz-sg-popup { max-width:none; padding:4px 0 8px; }
.kz-sg-popup .kz-sg-unit-toggle { margin-bottom:18px; }
.kz-sg-popup .kz-sg-panel-label { margin-top:0; }

/* Keep the whole thing on screen: the chart scrolls inside the lightbox
   instead of running past the fold and taking the page scroll with it. */
#kz-size-guide {
  max-height:82vh; overflow-y:auto; overscroll-behavior:contain;
}

/* "How to measure" ran to 708px — taller than the chart it supports. It is
   reference material, so it gets tighter spacing and a smaller diagram in the
   popup; the full-size version on the size guide page is untouched. */
.kz-sg-popup .kz-sg-table td,
.kz-sg-popup .kz-sg-table th { padding-top:10px !important; padding-bottom:10px !important; }
.kz-sg-popup .kz-sg-measure { margin-top:26px; }
.kz-sg-popup .kz-sg-measure li { margin-bottom:0; }
.kz-sg-popup .kz-sg-measure-img img { max-height:230px; width:auto; margin:0 auto; display:block; }

@media (max-width:600px) {
  .kz-sg-popup { padding:0; }
  #kz-size-guide { max-height:88vh; }
}

/* ================================================================== *
 * Multi-garment guide (tabs)
 *
 * Used where one category covers several garments. Each pane holds a
 * whole garment block, so only the open one is in the layout — the
 * hidden panes cost no height in the popup.
 * ================================================================== */
.kz-sg-apparel .kz-sg-tabs { margin-bottom:6px; }
.kz-sg-apparel .kz-sg-pane { display:none; }
.kz-sg-apparel .kz-sg-pane.active { display:block; }

/* The garment blocks were authored to stand alone; inside a pane their
   own top padding doubles up with the tab row. */
.kz-sg-apparel .kz-sg-pane .kz-sg-section { padding-top:0; }
.kz-sg-apparel .kz-sg-pane .kz-sg-unit-toggle { margin-bottom:16px; }
