/* ── Preview table on product page ───────────────────────────────── */
.jojo-sc-preview {
    margin: 0 0 16px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

.jojo-sc-preview-wrap {
    position: relative;
    overflow: hidden;
}

/* fade-out gradient when there are more rows */
.jojo-sc-preview-wrap.jojo-sc-faded::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,0.95) 100%);
    pointer-events: none;
}

.jojo-sc-preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.jojo-sc-preview-table thead th {
    background: #1a1a2e;
    color: #fff;
    padding: 8px 12px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.jojo-sc-preview-table tbody td {
    padding: 7px 12px;
    border-top: 1px solid #ebebeb;
    text-align: center;
    color: #444;
}

.jojo-sc-preview-table tbody td:first-child {
    font-weight: 700;
    background: #f7f7f7;
    color: #111;
}

/* "View full size chart" link */
a.jojo-sc-view-full {
    display: block;
    text-align: center;
    padding: 9px 0;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a2e;
    text-decoration: none;
    background: #f7f7f7;
    border-top: 1px solid #e0e0e0;
    transition: background 0.15s, color 0.15s;
}
a.jojo-sc-view-full:hover {
    background: #1a1a2e;
    color: #fff;
}

/* fallback plain link (when no table data) */
a.jojo-sc-open:not(.jojo-sc-view-full) {
    display: inline-block;
    margin: 0 0 14px;
    font-size: 14px;
    color: #333;
    text-decoration: underline;
}

/* ── Modal backdrop + dialog ──────────────────────────────────────── */
#jojo-sc-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.jojo-sc-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.jojo-sc-dialog {
    position: relative;
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 720px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

/* ── Dialog header ────────────────────────────────────────────────── */
.jojo-sc-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e5e5;
    background: #fff;
    flex-shrink: 0;
}

.jojo-sc-dialog-head strong {
    font-size: 16px;
    color: #1a1a1a;
}

.jojo-sc-close {
    background: none;
    border: none;
    font-size: 26px;
    line-height: 1;
    color: #777;
    cursor: pointer;
    padding: 0 2px;
    transition: color 0.15s;
}
.jojo-sc-close:hover {
    color: #000;
}

/* ── Dialog body + table ──────────────────────────────────────────── */
.jojo-sc-dialog-body {
    overflow-y: auto;
    padding: 20px;
    -webkit-overflow-scrolling: touch;
}

.jojo-sc-table-wrap {
    overflow-x: auto;
}

.jojo-sc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 320px;
}

.jojo-sc-table thead th {
    background: #1a1a2e;
    color: #fff;
    padding: 11px 16px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    white-space: nowrap;
}

.jojo-sc-table tbody td {
    padding: 10px 16px;
    border: 1px solid #e8e8e8;
    text-align: center;
    color: #333;
}

/* first column (Size label) stands out */
.jojo-sc-table tbody td:first-child {
    font-weight: 700;
    background: #f5f5f5;
    color: #111;
}

.jojo-sc-table tbody tr:hover td {
    background: #eef4ff;
}
.jojo-sc-table tbody tr:hover td:first-child {
    background: #dce9ff;
}

.jojo-sc-note {
    margin: 14px 0 0;
    font-size: 12px;
    color: #999;
    text-align: right;
}

/* ── Mobile ───────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .jojo-sc-dialog {
        max-height: 92vh;
        border-radius: 6px;
    }
    .jojo-sc-table thead th,
    .jojo-sc-table tbody td {
        padding: 8px 10px;
        font-size: 13px;
    }
}
