/* Self-contained product viewer. Shared page accent colors do not enter here. */
.pv-viewer {
    --pv-ink: #242429;
    --pv-muted: #6b6c75;
    --pv-line: #e2e3e8;
    --pv-accent: #6854df;
    --pv-surface: #f7f7f8;
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    min-width: 0;
    overflow: hidden;
    isolation: isolate;
    color: var(--pv-ink);
    background: #fff;
    border: 1px solid var(--pv-line);
    border-radius: 18px;
    font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
    line-height: 1.5;
}

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

.pv-viewer [hidden] {
    display: none !important;
}

.pv-header,
.pv-stage,
.pv-controls {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
}

.pv-header {
    position: relative;
    z-index: 2;
    align-self: start;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 20px 22px;
    pointer-events: none;
}

.pv-heading {
    flex: 1 1 118px;
    min-width: 0;
}

.pv-kicker {
    display: block;
    margin: 0 0 3px;
    color: var(--pv-accent);
    font-size: 10px;
    font-weight: 650;
    letter-spacing: .12em;
    line-height: 1.4;
    text-transform: uppercase;
}

.pv-name {
    display: block;
    margin: 0;
    color: var(--pv-ink);
    font-size: 19px;
    font-weight: 650;
    letter-spacing: -.025em;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.pv-product-switch {
    display: flex;
    align-items: stretch;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--pv-line);
    border-radius: 12px;
    background: rgba(255, 255, 255, .9);
    pointer-events: auto;
}

.pv-viewer button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    margin: 0;
    padding: 9px 14px;
    color: var(--pv-ink);
    background: #fff;
    border: 1px solid transparent;
    border-radius: 9px;
    font: inherit;
    font-size: 12px;
    font-weight: 550;
    line-height: 1.3;
    text-align: center;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}

.pv-viewer button:focus-visible {
    outline: 3px solid var(--pv-accent);
    outline-offset: 2px;
}

.pv-viewer button:disabled {
    color: #8b8c93;
    background: #eff0f3;
    border-color: transparent;
    cursor: default;
}

.pv-product-switch button {
    flex: 1 1 auto;
    min-width: 44px;
    padding-inline: 13px;
    color: var(--pv-muted);
    background: transparent;
}

.pv-product-switch button[aria-pressed="true"] {
    color: var(--pv-ink);
    background: #fff;
    border-color: #dddfe5;
    box-shadow: 0 1px 3px rgba(25, 26, 38, .05);
}

.pv-stage {
    position: relative;
    z-index: 0;
    height: clamp(400px, 48vw, 620px);
    overflow: hidden;
    background: var(--pv-surface);
}

.pv-canvas,
.pv-fallback {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
}

.pv-canvas {
    outline: none;
    touch-action: pan-y;
    cursor: grab;
}

.pv-canvas:active {
    cursor: grabbing;
}

.pv-canvas:focus-visible {
    outline: 3px solid var(--pv-accent);
    outline-offset: -5px;
}

.pv-fallback {
    object-fit: contain;
    padding: 72px 24px 84px;
}

.pv-loader {
    position: absolute;
    z-index: 1;
    right: 20px;
    bottom: 142px;
    left: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px;
    color: var(--pv-muted);
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
    overflow-wrap: anywhere;
    pointer-events: none;
}

.pv-viewer[data-state="loading"] .pv-loader {
    inset: 0;
    padding: 90px 24px;
    background: rgba(248, 249, 251, .9);
}

.pv-viewer[data-state="loading"] .pv-loader::before {
    content: "";
    width: 22px;
    height: 22px;
    border: 2px solid #dedee8;
    border-top-color: var(--pv-accent);
    border-radius: 50%;
    animation: pv-spin .8s linear infinite;
}

.pv-gesture {
    position: absolute;
    right: 16px;
    bottom: 90px;
    left: 16px;
    margin: 0;
    color: var(--pv-muted);
    font-size: 11px;
    line-height: 1.4;
    text-align: center;
    pointer-events: none;
}

.pv-viewer button.pv-enable {
    position: absolute;
    z-index: 2;
    bottom: 88px;
    left: 50%;
    width: max-content;
    max-width: calc(100% - 40px);
    padding-inline: 18px;
    color: #fff;
    background: #33313e;
    transform: translateX(-50%);
}

.pv-controls {
    position: relative;
    z-index: 2;
    align-self: end;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin: 16px;
    padding: 5px;
    border: 1px solid var(--pv-line);
    border-radius: 13px;
    background: rgba(255, 255, 255, .93);
}

.pv-view-tabs,
.pv-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    gap: 3px;
}

.pv-motion {
    flex: 0 1 auto;
    min-width: 0;
}

.pv-motion button {
    max-width: 100%;
    padding-inline: 10px;
    color: var(--pv-muted);
    background: transparent;
}

.pv-motion button[aria-pressed="true"] {
    color: var(--pv-accent);
    background: #efedf9;
    border-color: #ddd6f5;
}

.pv-view-tabs {
    flex: 1 1 auto;
}

.pv-view-tabs button {
    flex: 1 1 0;
    padding-inline: 12px;
    color: var(--pv-muted);
    background: transparent;
    overflow-wrap: anywhere;
    transition: color .16s ease;
}

.pv-viewer .pv-view-tabs button[aria-pressed="false"],
.pv-viewer .pv-view-tabs button[aria-pressed="false"]:focus,
.pv-viewer .pv-view-tabs button[aria-pressed="false"]:active {
    color: var(--pv-muted);
    background: transparent;
    box-shadow: none;
}

.pv-view-tabs button[aria-pressed="true"]:not(:disabled) {
    color: #fff;
    background: #292832;
}

.pv-actions {
    flex: 0 0 auto;
    padding-left: 8px;
    border-left: 1px solid var(--pv-line);
}

.pv-viewer button.pv-icon {
    width: 44px;
    padding: 0;
    background: transparent;
    font-size: 18px;
    font-weight: 400;
}

.pv-icon svg {
    display: block;
    width: 18px;
    height: 18px;
    pointer-events: none;
}

.pv-viewer button:disabled,
.pv-viewer button[aria-pressed="true"]:disabled {
    color: #8b8c93;
    background: #eff0f3;
    border-color: transparent;
    box-shadow: none;
    cursor: default;
}

.pv-caption {
    grid-column: 1;
    grid-row: 3;
    min-width: 0;
    padding: 15px 21px 17px;
    border-top: 1px solid var(--pv-line);
    background: #fff;
}

.pv-walkthrough {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
    padding: 20px 22px 18px;
    border-top: 1px solid var(--pv-line);
    background: #fff;
}

.pv-walkthrough-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-bottom: 12px;
}

.pv-walkthrough-label {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -.01em;
}

.pv-viewer [data-pv-action="walkthrough-play"] {
    min-height: 44px;
    padding: 9px 14px;
    border-color: #ded9ed;
    color: #55428d;
    background: #f5f3fb;
}

.pv-viewer [data-pv-action="walkthrough-play"][aria-pressed="true"] {
    border-color: #6c57b1;
    color: #fff;
    background: #65509f;
}

.pv-step-controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    min-width: 0;
}

.pv-viewer .pv-step-controls button {
    justify-content: flex-start;
    gap: 9px;
    min-width: 0;
    padding: 12px;
    color: var(--pv-muted);
    background: #f7f7f9;
    border-color: transparent;
    text-align: left;
    transition: color .16s ease;
}

.pv-step-number {
    display: grid;
    place-items: center;
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    border: 1px solid #d9d8df;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 650;
}

.pv-viewer .pv-step-controls button[aria-pressed="true"] {
    color: #433369;
    background: #f0ecfa;
    border-color: #d5cbee;
}

.pv-step-controls button[aria-pressed="true"] .pv-step-number {
    color: #fff;
    border-color: #7058a9;
    background: #7058a9;
}

.pv-step-description {
    max-width: 850px;
    min-height: 3.1em;
    margin: 12px 0 0;
    color: #55545f;
    font-size: 13px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.pv-viewer[data-viewer-mode="connected"][data-viewer-state="ready"] .pv-description {
    display: none;
}

.pv-viewer[data-viewer-mode="connected"][data-viewer-state="ready"] .pv-caption {
    padding-top: 10px;
    padding-bottom: 12px;
}

.pv-description {
    margin: 0;
    color: #4f5059;
    font-size: 13px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.pv-model-note {
    margin: 4px 0 0;
    color: var(--pv-muted);
    font-size: 11px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.pv-live {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.pv-viewer[data-state="ready"] .pv-fallback,
.pv-viewer[data-state="ready"] .pv-loader,
.pv-viewer[data-state="ready"] .pv-enable,
.pv-viewer[data-state="loading"] .pv-enable,
.pv-viewer:not([data-state="ready"]) .pv-gesture {
    display: none;
}

@media (hover: hover) {
    .pv-viewer button:not(:disabled):not([aria-pressed="true"]):hover {
        color: var(--pv-ink);
        background: #edecf4;
    }

    .pv-viewer button.pv-enable:not(:disabled):hover {
        color: #fff;
        background: #514572;
    }
}

@media (max-width: 600px) {
    .pv-viewer {
        border-radius: 14px;
    }

    .pv-stage {
        height: 440px;
    }

    .pv-header {
        gap: 9px;
        padding: 13px 14px;
    }

    .pv-kicker {
        font-size: 9px;
        letter-spacing: .08em;
    }

    .pv-name {
        font-size: 16px;
    }

    .pv-product-switch button {
        padding-inline: 10px;
        font-size: 11px;
    }

    .pv-controls {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 4px;
        margin: 10px;
        padding: 4px;
    }

    .pv-view-tabs {
        grid-column: 1 / -1;
    }

    .pv-view-tabs button {
        padding-inline: 7px;
        font-size: 11px;
    }

    .pv-actions {
        padding-left: 0;
        border-left: 0;
    }

    .pv-motion {
        justify-self: start;
        min-width: 0;
    }

    .pv-motion button {
        min-width: 0;
        padding-inline: 7px;
        font-size: 11px;
    }

    .pv-gesture {
        bottom: 123px;
        font-size: 10px;
    }

    .pv-viewer button.pv-enable {
        bottom: 125px;
    }

    .pv-loader {
        bottom: 176px;
        right: 14px;
        left: 14px;
    }

    .pv-fallback {
        padding: 72px 12px 106px;
    }

    .pv-caption {
        padding: 12px 14px 14px;
    }

    .pv-walkthrough {
        padding: 14px;
    }

    .pv-walkthrough-heading {
        gap: 5px 10px;
        margin-bottom: 10px;
    }

    .pv-walkthrough-label {
        flex: 1 1 110px;
        font-size: 12px;
    }

    .pv-viewer [data-pv-action="walkthrough-play"] {
        padding-inline: 10px;
        font-size: 11px;
    }

    .pv-step-controls {
        gap: 5px;
    }

    .pv-viewer .pv-step-controls button {
        flex-direction: column;
        justify-content: center;
        gap: 7px;
        padding: 10px 5px;
        font-size: 11px;
        text-align: center;
        overflow-wrap: anywhere;
    }

    .pv-step-description {
        min-height: 4.8em;
        font-size: 12px;
    }

    .pv-viewer[data-viewer-mode="connected"] .pv-actions {
        grid-column: 1 / -1;
        justify-self: center;
    }

    .pv-description {
        font-size: 12px;
    }

    .pv-model-note {
        font-size: 10px;
    }
}

@media (max-width: 380px) {
    .pv-view-tabs {
        flex-basis: 100%;
    }

    .pv-actions {
        padding-left: 0;
        border-left: 0;
    }
}

@keyframes pv-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .pv-viewer *,
    .pv-viewer *::before,
    .pv-viewer *::after {
        animation: none !important;
        transition: none !important;
    }
}
