/* Size guide (/size-guide): shirt chart with the measuring diagram, then the size charts from
   Admin > Product > Size charts (table left, product picture right). Built on policy-v2.css tokens. */

.sg-page {
    --sg-dark: #151618;
    --sg-dark-2: #232427;
    --sg-row: #f4f4f5;
    --sg-radius: 14px;
    position: relative;
    overflow: hidden;
    padding: clamp(28px, 4vw, 52px) 0 clamp(40px, 5vw, 72px);
}

.sg-page ::selection {
    background: var(--pv-red);
    color: #fff;
}

/* Brand slashes in the top corners (the angled cut used across the new homepage). */
.sg-slash {
    position: absolute;
    top: -40px;
    width: 120px;
    height: 150px;
    pointer-events: none;
}

.sg-slash::before,
.sg-slash::after {
    content: '';
    position: absolute;
    top: 0;
    width: 22px;
    height: 100%;
    background: var(--pv-red);
    transform: skewX(-32deg);
}

.sg-slash::after {
    width: 12px;
    opacity: 0.55;
}

.sg-slash--left {
    left: -10px;
}

.sg-slash--left::before {
    left: 10px;
}

.sg-slash--left::after {
    left: 52px;
}

.sg-slash--right {
    right: -10px;
}

.sg-slash--right::before {
    right: 10px;
}

.sg-slash--right::after {
    right: 52px;
}

/* ---------- Title ---------- */
.sg-head {
    position: relative;
    text-align: center;
    margin-bottom: clamp(24px, 3vw, 40px);
}

.sg-head__title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3em;
    margin: 0;
    font-family: var(--pv-head);
    font-size: clamp(36px, 4.6vw, 64px);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.01em;
    text-transform: uppercase;
    color: var(--pv-ink);
}

.sg-jump {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
}

.sg-jump a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 6px 14px;
    border: 1px solid var(--pv-line);
    border-radius: 999px;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    color: var(--pv-ink);
    text-decoration: none;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.sg-jump a:hover {
    border-color: var(--pv-red);
    color: #d00415;
}

/* ---------- Sections ---------- */
.sg-section {
    scroll-margin-top: 110px;
}

.sg-section + .sg-section {
    margin-top: clamp(40px, 5vw, 64px);
}

.sg-section__title {
    margin: 0 0 14px;
    font-family: var(--pv-head);
    font-size: clamp(22px, 2.2vw, 30px);
    font-weight: 900;
    line-height: 1.1;
    text-transform: uppercase;
    color: var(--pv-ink);
}

.sg-layout {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: clamp(20px, 2.6vw, 36px);
    align-items: start;
}

/* ---------- The table card ---------- */
.sg-card {
    border-radius: var(--sg-radius);
    background: #fff;
    box-shadow: 0 12px 32px rgba(17, 19, 23, 0.1);
    overflow: hidden;
}

.sg-card__scroll {
    overflow: hidden;
}

.sg-card__scroll--wide {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.sg-card__scroll:focus-visible {
    outline: 3px solid #f98487;
    outline-offset: -3px;
}

.sg-tbl {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    font-size: 16px;
    font-variant-numeric: tabular-nums;
    color: var(--pv-ink);
}

.sg-tbl--wide {
    min-width: 600px;
}

.sg-tbl th,
.sg-tbl td {
    padding: 12px 14px;
    text-align: center;
    vertical-align: middle;
}

.sg-tbl thead th {
    position: relative;
    background: var(--sg-dark);
    font-family: var(--pv-head);
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 0.02em;
    line-height: 1.15;
    text-transform: uppercase;
    color: #fff;
    border-bottom: 3px solid var(--pv-red);
}

/* Fit names over their two columns */
.sg-tbl thead .sg-tbl__group {
    padding-top: 14px;
    padding-bottom: 12px;
    font-size: clamp(16px, 1.7vw, 22px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.sg-tbl__sub th {
    background: var(--sg-dark-2);
    font-size: 13px;
    white-space: nowrap;
}

.sg-tbl__sub th + th {
    box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.16);
}

/* "Size" corner with the red angled cut on its right edge */
.sg-tbl thead .sg-tbl__corner {
    padding-right: 18px;
    text-align: left;
    font-size: clamp(16px, 1.6vw, 21px);
}

.sg-tbl thead .sg-tbl__corner::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 3px;
    background: var(--pv-red);
}

.sg-tbl tbody th {
    text-align: left;
    padding-left: 20px;
    font-size: 16px;
    font-weight: 800;
    color: var(--pv-ink);
}

.sg-tbl tbody tr:nth-child(even) {
    background: var(--sg-row);
}

.sg-tbl tbody td {
    box-shadow: inset 1px 0 0 #e3e4e7;
}

.sg-tbl tbody tr + tr > * {
    border-top: 1px solid #e9eaec;
}

.sg-tbl .sg-tbl__split,
.sg-tbl tbody td.sg-tbl__split {
    box-shadow: inset 2px 0 0 var(--pv-red);
}

/* A / B markers tie the columns to the diagram */
.sg-key {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--pv-red);
    font-family: var(--pv-body);
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1;
    color: #fff;
    vertical-align: 1px;
}

.sg-dot {
    margin: 0 6px;
    opacity: 0.7;
}

/* ---------- How to measure ---------- */
.sg-measure {
    padding: clamp(16px, 1.8vw, 22px);
    border-radius: var(--sg-radius);
    background: #f6f6f7;
}

.sg-measure__title {
    margin: 0 0 12px;
    font-family: var(--pv-head);
    font-size: 18px;
    font-weight: 900;
    line-height: 1.2;
    text-transform: uppercase;
    color: var(--pv-ink);
}

.sg-measure__body {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
    gap: 16px;
    align-items: center;
}

.sg-diagram {
    display: block;
    width: 100%;
    height: auto;
}

.sg-diagram__shirt path {
    fill: #fff;
    stroke: var(--pv-ink);
    stroke-width: 3.5;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.sg-diagram__shirt path + path {
    fill: none;
    stroke-width: 2.5;
}

.sg-diagram__measure {
    color: var(--pv-red);
}

.sg-diagram__measure line {
    stroke: currentColor;
    stroke-width: 3.5;
}

.sg-diagram__measure circle {
    fill: currentColor;
}

.sg-diagram__measure text {
    fill: #fff;
    font-family: var(--pv-body);
    font-size: 21px;
    font-weight: 800;
    text-anchor: middle;
    dominant-baseline: central;
}

.sg-steps {
    display: grid;
    gap: 14px;
    margin: 0;
}

.sg-step dt {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 3px;
    font-size: 14px;
    font-weight: 700;
    color: var(--pv-ink);
}

.sg-step .sg-key {
    width: 20px;
    height: 20px;
    font-size: 10.5px;
}

.sg-step dd {
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
    color: var(--pv-text);
}

/* ---------- Other products: table left, picture right ---------- */
/* Title and note above; the table and its picture share a row, the picture centred on the table. */
.sg-chart__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 340px);
    gap: clamp(20px, 3vw, 40px);
    align-items: center;
}

.sg-chart__body--solo {
    grid-template-columns: minmax(0, 1fr);
}

.sg-chart__note {
    margin: -6px 0 14px;
    font-size: 13.5px;
    color: var(--pv-muted);
}

.sg-card__note {
    margin: 10px 0 0;
    font-size: 12.5px;
    color: var(--pv-muted);
}

.sg-chart__swipe {
    display: none;
    margin: 8px 0 0;
    font-size: 12.5px;
    color: var(--pv-muted);
}

.sg-chart__media {
    margin: 0;
    padding: 16px;
    border: 1px solid var(--pv-line);
    border-radius: var(--sg-radius);
    background: #fff;
    text-align: center;
}

.sg-chart__media img {
    display: block;
    width: 100%;
    max-height: 320px;
    object-fit: contain;
}

.sg-chart__media figcaption {
    margin-top: 10px;
    font-size: 13.5px;
}

.sg-chart__media a,
.sg-help a {
    font-weight: 600;
    color: var(--pv-ink);
    text-decoration: underline;
    text-decoration-color: var(--pv-red);
    text-underline-offset: 3px;
}

.sg-chart__media a:hover,
.sg-help a:hover {
    color: #d00415;
}

/* ---------- Help line ---------- */
.sg-help {
    margin: clamp(32px, 4vw, 48px) 0 0;
    font-size: 13.5px;
    line-height: 1.6;
    text-align: center;
    color: var(--pv-muted);
}

@media (prefers-reduced-motion: reduce) {
    .sg-jump a {
        transition: none;
    }
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .sg-layout,
    .sg-chart__body {
        grid-template-columns: minmax(0, 1fr);
    }

    .sg-measure__body {
        grid-template-columns: 180px minmax(0, 1fr);
    }

    .sg-chart__media {
        padding: 12px;
    }

    .sg-chart__media img {
        width: auto;
        max-width: 100%;
        max-height: 180px;
        margin: 0 auto;
    }

    .sg-slash {
        width: 80px;
        height: 100px;
        opacity: 0.8;
    }
}

@media (max-width: 575.98px) {
    .sg-tbl {
        font-size: 14px;
    }

    .sg-tbl th,
    .sg-tbl td {
        padding: 10px 6px;
    }

    .sg-tbl tbody th {
        padding-left: 12px;
        font-size: 14px;
    }

    .sg-tbl thead .sg-tbl__corner {
        padding-left: 12px;
        padding-right: 12px;
        font-size: 14px;
    }

    .sg-tbl thead .sg-tbl__group {
        font-size: 14px;
    }

    .sg-tbl__sub th {
        font-size: 10.5px;
        white-space: normal;
    }

    /* No room for the markers in the shirt column labels on a phone; the steps keep them. */
    .sg-tbl__sub .sg-key,
    .sg-tbl__sub .sg-dot {
        display: none;
    }

    .sg-measure__body {
        grid-template-columns: 112px minmax(0, 1fr);
        gap: 12px;
    }

    .sg-chart__swipe {
        display: block;
    }

    .sg-chart__media img {
        max-height: 150px;
    }

    .sg-slash {
        display: none;
    }
}
