/* ═══════════════════════════════════════════════════════════════
   eg-size-chart.css — Storlekstabell, shared by every size chart
   (template: templates/_partials/size-chart.tpl).
   Self-contained colours so it looks the same outside .pgr-page
   (B2B offer page etc.).
═══════════════════════════════════════════════════════════════ */
.eg-sc {
  --sc-ink: #1a1a1a;
  --sc-soft: #6b6457;
  --sc-line: #ece6dc;
  --sc-head: #f4efe7;
  --sc-hit: #fff1d1;
  --sc-hit-bd: #ffbc38;
  font-family: inherit;
  color: var(--sc-ink);
}
.eg-sc__title {
  display: inline-block;
  margin: 14px 0 6px;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--sc-head);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
}
.eg-sc__title:first-child { margin-top: 0; }
.eg-sc__scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--sc-line);
  border-radius: 8px;
  background: #fff;
}
.eg-sc__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}
.eg-sc__table th,
.eg-sc__table td {
  padding: 8px 12px;
  text-align: center;
  white-space: nowrap;
  border-bottom: 1px solid var(--sc-line);
}
.eg-sc__table tbody tr:last-child th,
.eg-sc__table tbody tr:last-child td { border-bottom: 0; }
.eg-sc__table thead th {
  background: var(--sc-head);
  font-weight: 700;
  font-size: 12px;
}
.eg-sc__table tbody th {
  font-weight: 700;
  text-align: left;
  position: sticky; left: 0;
  background: #fff;
}
.eg-sc__table thead th:first-child {
  text-align: left;
  position: sticky; left: 0;
  z-index: 1;
}
.eg-sc__table tbody tr:nth-child(even) td,
.eg-sc__table tbody tr:nth-child(even) th { background: #fbf9f5; }

/* chosen size (set by JS from the size buttons) */
.eg-sc__table tr.eg-sc-hit td,
.eg-sc__table tr.eg-sc-hit th,
.eg-sc__table .eg-sc-hit { background: var(--sc-hit) !important; }
.eg-sc__table tr.eg-sc-hit th { box-shadow: inset 3px 0 0 var(--sc-hit-bd); }

.eg-sc__foot {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--sc-soft);
  line-height: 1.5;
}
.eg-sc__foot span { display: block; }

/* "Så mäter du" drawing (size-chart.tpl) */
.eg-sc__howto {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  margin-top: 12px; padding: 12px 14px;
  border-radius: 8px;
  background: var(--sc-head);
}
.eg-sc__fig { width: 150px; height: auto; flex: 0 0 auto; }
.eg-sc__fig-g { fill: #fff; stroke: var(--sc-soft); stroke-width: 1.5; stroke-linejoin: round; }
.eg-sc__fig-g2 { fill: none; stroke: var(--sc-soft); stroke-width: 1.2; }
.eg-sc__fig-m { stroke: #8c4e08; stroke-width: 2; }
.eg-sc__fig-h { fill: none; stroke: #8c4e08; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.eg-sc__fig-t { font-size: 13px; font-weight: 700; fill: #8c4e08; font-family: inherit; }
.eg-sc__howto-txt { flex: 1 1 220px; font-size: 13px; line-height: 1.45; }
.eg-sc__howto-txt strong { display: block; margin-bottom: 2px; font-size: 14px; }
.eg-sc__howto-txt span { display: block; }
.eg-sc__howto-txt span + span { margin-top: 2px; }
.eg-sc__howto-txt b { font-weight: 700; }
/* several charts of the same type in a row: show the drawing once, under the last */
.eg-sc[data-howto="top"]:has(~ .eg-sc[data-howto="top"]) .eg-sc__howto,
.eg-sc[data-howto="pants"]:has(~ .eg-sc[data-howto="pants"]) .eg-sc__howto,
.eg-sc[data-howto="body"]:has(~ .eg-sc[data-howto="body"]) .eg-sc__howto { display: none; }

/* product page: the Storlekstabell accordion body must not clip the table */
.pgr-accordion-body.pgr-open.pgr-acc-sc { max-height: none; }

/* link next to the size list (product page) — darker than the yellow accent for contrast */
.pgr-page .pgr-size-link {
  color: #8c4e08;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}
.pgr-page .pgr-size-link:hover { color: #1a1a1a; }

/* link next to "Storlekar och önskemål" on the B2B offer page (modules/egoffert landing.js) */
.b2b-sc-link {
  border: 0; background: none; padding: 0; margin: 0 0 0 8px;
  font: inherit; font-size: 12px; font-weight: 600;
  color: #8c4e08; text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer; white-space: nowrap;
}
.b2b-sc-link:hover { color: #1a1a1a; }
.b2b-sc-link[hidden] { display: none; }
/* phone: the label is one ellipsised line - drop "och önskemål" when the link is there so it fits */
@media (max-width: 640px) {
  .b2b-row2__sizes:has(.b2b-sc-link:not([hidden])) .b2b-sc-oo { display: none; }
}

/* modal (built by JS in product.tpl from the accordion copy; offer page builds its own) */
.eg-sc-noscroll, .eg-sc-noscroll body { overflow: hidden; }
/* chat bubble (egettryckchat, shadow DOM, max z-index) would cover the modal — hide it while open */
.eg-sc-noscroll #egettryck-chat-widget-host { display: none !important; }
.eg-sc-modal {
  position: fixed; inset: 0; z-index: 100000;
  background: rgba(26, 26, 26, .55);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.eg-sc-modal[hidden] { display: none; }
.eg-sc-modal__box {
  background: #fff;
  border-radius: 14px;
  width: 100%; max-width: 640px;
  max-height: calc(100vh - 32px);
  display: flex; flex-direction: column;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .25);
}
.eg-sc-modal__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #ece6dc;
  font-size: 16px;
}
.eg-sc-modal__x {
  border: 0; background: #f4efe7; color: #1a1a1a;
  width: 36px; height: 36px; border-radius: 50%;
  font-size: 22px; line-height: 1; cursor: pointer;
}
.eg-sc-modal__x:hover { background: #ece6dc; }
.eg-sc-modal__body { padding: 16px 18px 18px; overflow-y: auto; }
.eg-sc-modal__body .eg-sc + .eg-sc { margin-top: 16px; }
@media (max-width: 575px) {
  .eg-sc-modal { align-items: flex-end; padding: 0; }
  .eg-sc-modal__box { max-width: none; max-height: 88vh; border-radius: 14px 14px 0 0; }
}
