/* Build-your-own chain sling page. Loaded only by templates/pages/custom/page/sling-builder.html. */
.arsb {
    --arsb-ink: #2d2d2d;
    --arsb-muted: #6b6b6b;
    --arsb-line: #dcdcdc;
    --arsb-soft: #f7f7f7;
    --arsb-accent: #e8632b;
    --arsb-accent-dark: #b9481a;
    --arsb-ok: #1f7a3d;
    align-items: start;
    color: var(--arsb-ink);
    display: grid;
    gap: 32px;
    grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
    margin: 24px 0 48px;
}

.arsb *,
.arsb *::before,
.arsb *::after {
    box-sizing: border-box;
}

/* The pending build */
.arsb-build {
    background: #fff;
    border: 1px solid var(--arsb-line);
    border-radius: 8px;
    padding: 16px;
    position: sticky;
    top: calc(var(--arsb-top, 0px) + 12px);
}

.arsb-picture {
    background: var(--arsb-soft);
    border-radius: 6px;
}

.arsb-svg {
    display: block;
    height: auto;
    margin: 0 auto;
    max-height: min(44vh, calc(100vh - var(--arsb-top, 0px) - 350px));
    min-height: 150px;
    width: 100%;
}

.arsb-summary {
    display: grid;
    gap: 2px 12px;
    grid-template-columns: 1fr 1fr;
    margin: 14px 0 0;
}

.arsb-summary div {
    border-bottom: 1px solid #eee;
    padding: 5px 0;
}

.arsb-summary dt {
    color: var(--arsb-muted);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.04em;
    margin: 0;
    text-transform: uppercase;
}

.arsb-summary dd {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
}

.arsb-summary dd.arsb-empty {
    color: #a0a0a0;
    font-weight: 400;
}

.arsb-wll {
    background: var(--arsb-ink);
    border-radius: 6px;
    color: #fff;
    display: grid;
    gap: 4px;
    margin-top: 14px;
    padding: 12px 14px;
}

.arsb-wll-title {
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.arsb-wll > strong {
    font-size: 26px;
    line-height: 1.1;
}

.arsb-wll-angles {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(3, 1fr);
}

.arsb-wll-angles span {
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 4px;
    display: grid;
    padding: 5px 6px;
}

.arsb-wll-angles span.is-current {
    background: #fff;
    color: var(--arsb-ink);
}

.arsb-wll-angles em {
    font-size: 12px;
    font-style: normal;
}

.arsb-wll-angles strong {
    font-size: 15px;
}

.arsb-wll-note {
    color: #cfcfcf;
    font-size: 12px;
}

.arsb-ok,
.arsb-bad {
    border-radius: 4px;
    font-size: 13px;
    font-weight: 700;
    padding: 4px 8px;
}

.arsb-ok {
    background: #dff3e5;
    color: #14572a;
}

.arsb-bad {
    background: #fde3df;
    color: #8f1d10;
}

.arsb-link {
    background: none;
    border: 0;
    color: var(--arsb-ink);
    cursor: pointer;
    font-size: 14px;
    margin-top: 12px;
    padding: 4px 0;
    text-decoration: underline;
}

/* Steps */
.arsb-step {
    border-top: 1px solid var(--arsb-line);
    padding: 20px 0 24px;
    scroll-margin-top: calc(var(--arsb-top, 0px) + 12px);
}

.arsb-step:first-child {
    border-top: 0;
    padding-top: 0;
}

.arsb-step h2,
.arsb-result h2 {
    align-items: center;
    display: flex;
    font-size: 22px;
    gap: 10px;
    line-height: 1.2;
    margin: 0 0 14px;
}

.arsb-step-number {
    align-items: center;
    background: var(--arsb-ink);
    border-radius: 50%;
    color: #fff;
    display: inline-flex;
    flex: none;
    font-size: 15px;
    height: 28px;
    justify-content: center;
    width: 28px;
}

.arsb-step.is-done .arsb-step-number {
    background: var(--arsb-ok);
}

.arsb-step.is-locked {
    opacity: 0.55;
}

.arsb-step.is-locked h2 {
    margin-bottom: 4px;
}

.arsb-hint {
    color: var(--arsb-muted);
    font-size: 14px;
    margin: 0 0 12px;
}

.arsb-options {
    display: grid;
    gap: 12px;
}

.arsb-options--5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.arsb-options--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.arsb-options--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.arsb-option {
    align-content: start;
    background: #fff;
    border: 2px solid var(--arsb-line);
    border-radius: 8px;
    color: var(--arsb-ink);
    cursor: pointer;
    display: grid;
    font: inherit;
    gap: 4px;
    justify-items: center;
    line-height: 1.3;
    margin: 0;
    min-height: 44px;
    padding: 12px 10px;
    position: relative;
    text-align: center;
    transition: border-color 0.12s, box-shadow 0.12s;
    width: 100%;
}

.arsb-option:hover:not(:disabled),
.arsb-option:focus-visible {
    border-color: var(--arsb-ink);
    outline: 0;
}

.arsb-option:focus-visible {
    box-shadow: 0 0 0 3px rgba(232, 99, 43, 0.45);
}

.arsb-option.is-selected {
    border-color: var(--arsb-accent);
    box-shadow: inset 0 0 0 1px var(--arsb-accent);
}

.arsb-option.is-selected::after {
    background: var(--arsb-accent);
    border-radius: 50%;
    color: #fff;
    content: "\2713";
    font-size: 12px;
    height: 20px;
    line-height: 20px;
    position: absolute;
    right: 6px;
    top: 6px;
    width: 20px;
}

.arsb-option:disabled {
    background: var(--arsb-soft);
    color: #9a9a9a;
    cursor: not-allowed;
}

.arsb-option:disabled img {
    opacity: 0.4;
}

.arsb-option-art {
    display: flex;
    gap: 8px;
    height: 92px;
    justify-content: center;
    width: 100%;
}

.arsb-option-art img,
.arsb-option-art svg {
    height: 100%;
    max-width: 100%;
    min-width: 0;
    object-fit: contain;
}

.arsb-mini {
    height: 84px;
    width: 80px;
}

.arsb-option-title {
    font-size: 16px;
    font-weight: 700;
}

.arsb-option-note {
    color: var(--arsb-muted);
    font-size: 13px;
}

.arsb-option:disabled .arsb-option-note {
    color: #9a9a9a;
}

/* Chain size and grade */
.arsb-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 28px;
    margin-bottom: 12px;
}

.arsb-field {
    display: grid;
    font-size: 14px;
    font-weight: 700;
    gap: 6px;
    margin: 0;
}

.arsb-input {
    align-items: center;
    border: 2px solid var(--arsb-line);
    border-radius: 6px;
    display: inline-flex;
    max-width: 190px;
    overflow: hidden;
}

.arsb-input:focus-within {
    border-color: var(--arsb-ink);
}

.arsb-input input {
    border: 0;
    box-shadow: none;
    font-size: 16px;
    height: 42px;
    min-width: 0;
    outline: 0;
    padding: 0 10px;
    width: 100%;
}

.arsb-input span {
    background: var(--arsb-soft);
    color: var(--arsb-muted);
    font-weight: 400;
    line-height: 42px;
    padding: 0 12px;
}

.arsb-angles {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.arsb-angles .arsb-option {
    font-size: 16px;
    font-weight: 700;
    min-width: 64px;
    padding: 9px 14px;
    width: auto;
}

.arsb-angles .arsb-option.is-selected::after {
    display: none;
}

.arsb-angles .arsb-option.is-selected {
    background: var(--arsb-ink);
    border-color: var(--arsb-ink);
    box-shadow: none;
    color: #fff;
}

.arsb-grid {
    border-collapse: separate;
    border-spacing: 8px;
    margin: 0 -8px 8px;
    table-layout: fixed;
    width: calc(100% + 16px);
}

.arsb-grid th {
    font-size: 14px;
    padding: 0 0 2px;
    text-align: center;
}

.arsb-grid tbody th {
    font-size: 17px;
    text-align: left;
    width: 22%;
}

.arsb-grid td {
    padding: 0;
}

.arsb-grid .arsb-option {
    padding: 10px 6px;
}

.arsb-badge {
    background: var(--arsb-ok);
    border-radius: 3px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
}

.arsb-alert {
    background: #fff4ec;
    border-left: 4px solid var(--arsb-accent);
    font-size: 14px;
    margin: 10px 0 0;
    padding: 10px 12px;
}

.arsb-chart {
    border: 1px solid var(--arsb-line);
    border-radius: 6px;
    margin-top: 12px;
    padding: 10px 14px;
}

.arsb-chart summary {
    cursor: pointer;
    font-weight: 700;
}

.arsb-chart p {
    color: var(--arsb-muted);
    font-size: 14px;
    margin: 8px 0;
}

.arsb-chart img {
    display: block;
    height: auto;
    max-width: 100%;
}

/* Length */
.arsb-length {
    display: grid;
    gap: 20px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.arsb-length > div:first-child {
    display: grid;
    gap: 16px;
    align-content: start;
}

.arsb-reach {
    align-items: center;
    background: var(--arsb-soft);
    border-radius: 6px;
    display: flex;
    gap: 10px;
    padding: 10px 14px;
}

.arsb-reach svg {
    flex: none;
    height: 150px;
    width: 118px;
}

.arsb-reach p {
    font-size: 14px;
    margin: 0;
}

/* Result */
.arsb-result {
    border: 2px solid var(--arsb-ink);
    border-radius: 8px;
    margin-top: 8px;
    padding: 20px;
    scroll-margin-top: calc(var(--arsb-top, 0px) + 12px);
}

.arsb-result-name {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 12px;
}

.arsb-code {
    background: var(--arsb-soft);
    border: 1px solid var(--arsb-line);
    border-radius: 3px;
    font-size: 13px;
    font-weight: 400;
    padding: 1px 6px;
    white-space: nowrap;
}

.arsb-result-wll {
    border-collapse: collapse;
    margin: 0 0 16px;
    width: auto;
}

.arsb-result-wll caption {
    color: var(--arsb-muted);
    font-size: 12px;
    letter-spacing: 0.05em;
    padding-bottom: 4px;
    text-align: left;
    text-transform: uppercase;
}

.arsb-result-wll th,
.arsb-result-wll td {
    border: 1px solid var(--arsb-line);
    font-size: 15px;
    padding: 6px 10px;
}

.arsb-result-wll th {
    background: var(--arsb-soft);
}

.arsb-match {
    align-items: center;
    display: flex;
    gap: 20px;
}

.arsb-match-photo:empty {
    display: none;
}

.arsb-match-photo img {
    border: 1px solid var(--arsb-line);
    border-radius: 6px;
    display: block;
    height: 150px;
    object-fit: contain;
    width: 150px;
}

.arsb-match-body p {
    margin: 8px 0 12px;
}

.arsb-match-body .button {
    margin: 0 8px 8px 0;
}

.arsb-match-price {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.1;
}

.arsb-tag {
    background: #fff4ec;
    border: 1px solid var(--arsb-accent);
    border-radius: 3px;
    color: var(--arsb-accent-dark);
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    text-transform: uppercase;
}

.arsb-tag--stock {
    background: #dff3e5;
    border-color: var(--arsb-ok);
    color: #14572a;
}

.arsb-near h3 {
    font-size: 15px;
    margin: 18px 0 6px;
}

.arsb-near ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.arsb-near li {
    border: 1px solid var(--arsb-line);
    border-radius: 4px;
    font-size: 14px;
    padding: 6px 10px;
}

.arsb-near a {
    font-weight: 700;
    text-decoration: underline;
}

.arsb-near span {
    color: var(--arsb-muted);
}

.arsb-share {
    margin: 10px 0 0;
}

.arsb-share .arsb-link {
    margin-top: 0;
}

#arsb-copied {
    color: var(--arsb-ok);
    font-size: 14px;
    margin-left: 10px;
}

.arsb-fineprint {
    color: var(--arsb-muted);
    font-size: 13px;
    margin: 10px 0 0;
}

@media (max-width: 800px) {
    .arsb {
        display: block;
        margin-top: 12px;
    }

    /* The picture stays in view at the top of the screen while the steps scroll under it. */
    .arsb-build {
        align-items: center;
        border-radius: 0 0 8px 8px;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
        display: grid;
        gap: 0 12px;
        grid-template-columns: 108px minmax(0, 1fr);
        margin: 0 -8px 20px;
        padding: 8px 10px;
        top: var(--arsb-top, 0px);
        z-index: 5;
    }

    .arsb-picture {
        grid-row: span 2;
    }

    .arsb-svg {
        max-height: 150px;
        min-height: 0;
    }

    .arsb-summary {
        gap: 0 10px;
        grid-template-columns: 1fr 1fr;
        margin: 0;
    }

    .arsb-summary div {
        border: 0;
        padding: 1px 0;
    }

    .arsb-summary dt {
        display: none;
    }

    .arsb-summary dd {
        font-size: 13px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .arsb-summary dd.arsb-empty {
        display: none;
    }

    .arsb-wll {
        gap: 2px;
        margin-top: 4px;
        padding: 6px 8px;
    }

    .arsb-wll > strong {
        font-size: 18px;
    }

    .arsb-wll-title,
    .arsb-wll-note {
        display: none;
    }

    .arsb-wll-angles span {
        padding: 2px 4px;
    }

    .arsb-wll-angles strong {
        font-size: 12px;
    }

    .arsb-build #arsb-reset {
        display: none;
    }

    .arsb-step {
        scroll-margin-top: calc(var(--arsb-top, 0px) + 180px);
    }

    .arsb-result {
        padding: 16px 14px;
        scroll-margin-top: calc(var(--arsb-top, 0px) + 180px);
    }

    .arsb-options--5,
    .arsb-options--3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .arsb-options--5 > :last-child {
        grid-column: span 2;
    }

    .arsb-option-art {
        height: 76px;
    }

    .arsb-length {
        grid-template-columns: 1fr;
    }

    .arsb-grid {
        border-spacing: 6px;
        margin: 0 -6px 8px;
        width: calc(100% + 12px);
    }

    .arsb-grid tbody th {
        font-size: 15px;
        width: 18%;
    }

    .arsb-grid .arsb-option-title {
        font-size: 14px;
    }

    .arsb-match {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .arsb-option {
        transition: none;
    }
}
