/**
 * Size Chart - Frontend Styles
 *
 * Styles for:
 * - Block mode link
 * - Tab mode inline preview (image + table)
 * - Popup overlay with title, description, subtitle, image, table
 *
 * Kolory/fonty/spacing przez design tokens var(--wh-*, fallback) —
 * fallback = wyglad standalone (projekt bez theme-tokens.css).
 */

.wh-sizetable-link {
    display: inline-flex;
    align-items: center;
    color: var(--wh-color-secondary, #908981);
    font-size: var(--wh-font-size-small, 1.2rem);
    font-weight: var(--wh-font-weight-regular, 400);
    text-decoration: underline;
    cursor: pointer;
}

.wh-sizetable-link .material-icons {
    font-size: var(--wh-font-size-small, 1.2rem);
}

.wh-sizetable-tab-content {
    padding: var(--wh-space-md, 15px) 0;
}

.wh-sizetable-image-wrapper {
    text-align: center;
    margin-bottom: var(--wh-space-mid, 20px);
}

.wh-sizetable-image-link {
    display: inline-block;
    cursor: zoom-in;
}

.wh-sizetable-image {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--wh-color-border-subtle, #e5e5e5);
    border-radius: var(--wh-radius-sm, 4px);
}

.wh-sizetable-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--wh-space-xs, 4px);
    margin-top: var(--wh-space-sm, 8px);
    color: var(--wh-color-text-muted, #999);
    font-size: var(--wh-font-size-small, 1.2rem);
}

.wh-sizetable-hint a {
    color: var(--wh-color-text-muted, #999);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--wh-space-xs, 4px);
}

.wh-sizetable-hint a:hover {
    color: var(--wh-color-text-primary, #666);
}

.wh-sizetable-hint .material-icons {
    font-size: var(--wh-font-size-small, 1.2rem);
}

.wh-sizetable-inline-table {
    margin-top: var(--wh-space-sm, 10px);
}

.wh-sizetable-table-title {
    font-size: var(--wh-font-size-body, 0.95rem);
    font-weight: var(--wh-font-weight-bold, 700);
    color: var(--wh-color-text-primary, #333);
    margin: 0 0 var(--wh-space-small, 12px);
}

.wh-sizetable-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--wh-font-size-body, 0.875rem);
    color: var(--wh-color-text-primary, #333);
}

.wh-sizetable-table thead th {
    font-weight: var(--wh-font-weight-regular, 400);
    color: var(--wh-color-text-muted, #888);
    font-size: var(--wh-font-size-small, 0.8rem);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: var(--wh-space-sm, 10px) var(--wh-space-md, 16px);
    border-bottom: 1px solid var(--wh-color-border-subtle, #e5e5e5);
    background: transparent;
}

.wh-sizetable-table tbody td {
    padding: var(--wh-space-small, 12px) var(--wh-space-md, 16px);
    border-bottom: 1px solid var(--wh-color-border-light, #f0f0f0);
    font-weight: var(--wh-font-weight-regular, 400);
    vertical-align: middle;
}

.wh-sizetable-table tbody tr:last-child td {
    border-bottom: none;
}

.wh-sizetable-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--wh-z-index-modal, 10000);
}

.wh-sizetable-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--wh-st-overlay-bg, rgba(0, 0, 0, 0.5));
}

.wh-sizetable-popup-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 720px;
    max-height: 90vh;
    background: var(--wh-color-bg-base, #fff);
    border-radius: var(--wh-radius-md, 6px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--wh-shadow-lg, 0 8px 32px rgba(0, 0, 0, 0.2));
}

.wh-sizetable-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 24px 20px 24px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--wh-color-border-subtle, #dedede);
}

.wh-sizetable-popup-title {
    margin: 0;
    font-size: var(--wh-font-size-h3, 1.15rem);
    font-weight: var(--wh-font-weight-semibold, 600);
    color: var(--wh-color-text-primary, #40362e);
}

.wh-sizetable-popup-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--wh-color-text-muted, #666);
    border-radius: 50%;
    transition:
        background var(--wh-duration-base, 0.2s) ease,
        color var(--wh-duration-base, 0.2s) ease;
    flex-shrink: 0;
}

.wh-sizetable-popup-close:hover {
    background: var(--wh-color-bg-subtle, #f0f0f0);
    color: var(--wh-color-text-primary, #333);
}

.wh-sizetable-popup-body {
    overflow-y: auto;
}

.wh-sizetable-popup-description {
    color: var(--wh-color-text-muted, #908981);
    font-size: var(--wh-font-size-body, 0.875rem);
    line-height: 1.6;
    padding: 31px 45px 20px 45px;
}

.wh-sizetable-popup-description p:last-child {
    margin-bottom: 0;
}

.wh-sizetable-popup-table-title {
    font-size: var(--wh-font-size-body, 0.875rem);
    font-weight: var(--wh-font-weight-bold, 700);
    color: var(--wh-color-text-primary, #40362e);
    padding: 0 45px 30px 45px;
    margin-bottom: 0;
}

.wh-sizetable-popup-image-wrapper {
    text-align: left;
    margin-bottom: 40px;
    padding: 0 45px;
}

.wh-sizetable-popup-image {
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

.wh-sizetable-popup-table-wrap {
    margin-top: 4px;
}

.wh-sizetable-front-table {
    width: 100%;
    color: var(--wh-color-text-muted, #908981);
    text-align: center;
    font-weight: var(--wh-font-weight-regular, 400);
    font-size: var(--wh-font-size-body, 0.875rem);
}

.wh-sizetable-front-table th {
    font-weight: var(--wh-font-weight-regular, 400);
    color: var(--wh-color-text-muted, #908981);
}

.wh-sizetable-front-table thead tr {
    color: unset;
}

.wh-sizetable-front-table tbody tr:nth-of-type(odd) {
    background: var(--wh-color-bg-subtle, #f9f9f9);
}

.wh-sizetable-front-table td, .wh-sizetable-front-table th {
    padding: var(--wh-space-small, 13px);
}

@media (max-width: 767px) {
    .wh-sizetable-popup-container {
        width: 96%;
        max-height: 94vh;
    }

    .wh-sizetable-popup-header {
        padding: 14px 16px 0;
    }

    .wh-sizetable-popup-body {
        padding: 12px 16px 16px;
    }

    .wh-sizetable-popup-title {
        font-size: var(--wh-font-size-body, 1rem);
    }

    .wh-sizetable-table thead th,
    .wh-sizetable-table tbody td {
        padding: var(--wh-space-sm, 8px) var(--wh-space-sm, 10px);
        font-size: var(--wh-font-size-small, 0.8rem);
    }
}

.accordion-body .wh-sizetable-popup-description {
    padding: var(--wh-space-md, 15px) 0;
}
