/* shopsizetable — storefront (Yandex Market–inspired, 2026) */

.st-block {
    margin: 0.75rem 0 1rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #212121;
}

/* Inline accordion / open block */
.st-details {
    border: 1px solid #e8e8e8;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
}

.st-summary {
    cursor: pointer;
    padding: 14px 16px;
    font-weight: 600;
    font-size: 15px;
    list-style: none;
    color: #0066ff;
}

.st-summary::-webkit-details-marker {
    display: none;
}

.st-body {
    padding: 0 16px 16px;
}

.st-body--open {
    padding: 16px;
    border: 1px solid #e8e8e8;
    border-radius: 16px;
    background: #fff;
}

.st-title {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
}

.st-desc {
    margin-bottom: 12px;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.st-footnote {
    margin-top: 12px;
    font-size: 13px;
    color: #888;
    line-height: 1.45;
}

.st-figure img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

/* Dialog trigger (Market-style link) */
.st-block--dialog {
    margin: 0.5rem 0;
}

.st-dialog-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #0066ff;
    font: inherit;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    cursor: pointer;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
}

.st-dialog-trigger:hover,
.st-dialog-trigger:focus-visible {
    color: #0052cc;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.st-dialog-trigger-icon {
    display: inline-flex;
    flex-shrink: 0;
    opacity: 0.85;
}

/* Modal overlay */
.st-dialog {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    box-sizing: border-box;
}

.st-dialog[hidden] {
    display: none !important;
}

.st-dialog-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.st-dialog-panel {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(720px, 100%);
    max-height: min(88vh, 820px);
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.st-dialog-grabber {
    display: none;
}

.st-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.st-dialog-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
    color: #212121;
}

.st-dialog-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f5f5f5;
    color: #666;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.st-dialog-close:hover,
.st-dialog-close:focus-visible {
    background: #ebebeb;
    color: #212121;
}

.st-dialog-body {
    flex: 1 1 auto;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 20px 20px;
}

.st-dialog-body .st-title {
    display: none;
}

.st-dialog-body .st-desc {
    margin-top: 4px;
}

/* Table + horizontal scroll */
.st-scroll-wrap {
    position: relative;
    margin: 0 -2px;
}

.st-scroll-wrap::before,
.st-scroll-wrap::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 18px;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.2s;
}

.st-scroll-wrap::before {
    left: 0;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.95), transparent);
}

.st-scroll-wrap::after {
    right: 0;
    background: linear-gradient(to left, rgba(255, 255, 255, 0.95), transparent);
}

.st-scroll-wrap[data-st-scroll-left="1"]::before {
    opacity: 1;
}

.st-scroll-wrap[data-st-scroll-right="1"]::after {
    opacity: 1;
}

.st-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.st-scroll::-webkit-scrollbar {
    height: 6px;
}

.st-scroll::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 999px;
}

.st-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
    min-width: 280px;
}

.st-table th,
.st-table td {
    border: 1px solid #ececec;
    padding: 11px 14px;
    vertical-align: middle;
}

.st-table th {
    background: #fafafa;
    font-weight: 600;
    white-space: nowrap;
    color: #333;
    position: relative;
}

.st-table tbody tr:nth-child(even) td {
    background: #fcfcfc;
}

.st-table--compact th,
.st-table--compact td {
    padding: 7px 10px;
}

.st-col-highlight {
    background: #fff8e1 !important;
}

.st-scroll--sticky .st-table th:first-child,
.st-scroll--sticky .st-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: #fff;
    box-shadow: 2px 0 6px rgba(0, 0, 0, 0.06);
}

.st-scroll--sticky .st-table th:first-child {
    background: #fafafa;
    z-index: 2;
}

.st-scroll--sticky .st-table tbody tr:nth-child(even) td:first-child {
    background: #fcfcfc;
}

.st-block--compact .st-body {
    padding: 8px 12px 12px;
}

body.st-dialog-open {
    overflow: hidden;
    touch-action: none;
}

/* Mobile: bottom sheet */
@media (max-width: 640px) {
    .st-dialog {
        align-items: flex-end;
        padding: 0;
    }

    .st-dialog-panel {
        width: 100%;
        max-height: 92vh;
        max-height: 92dvh;
        border-radius: 20px 20px 0 0;
        animation: st-dialog-slide-up 0.28s ease-out;
    }

    .st-dialog-grabber {
        display: block;
        width: 40px;
        height: 4px;
        margin: 10px auto 0;
        border-radius: 999px;
        background: #ddd;
        flex-shrink: 0;
    }

    .st-dialog-header {
        padding: 12px 16px 10px;
    }

    .st-dialog-title {
        font-size: 18px;
    }

    .st-dialog-body {
        padding: 0 12px calc(16px + env(safe-area-inset-bottom, 0px));
    }

    .st-table {
        font-size: 13px;
    }

    .st-table th,
    .st-table td {
        padding: 10px 12px;
    }

    .st-dialog-trigger {
        font-size: 14px;
        min-height: 44px;
        align-items: center;
    }

    .st-summary {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

@keyframes st-dialog-slide-up {
    from {
        transform: translateY(100%);
        opacity: 0.6;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .st-dialog-panel {
        animation: none;
    }
}
