/* ==========================================================================
   C3A Designer — Cenários 3D no Editor (1.10.0) · Composições e vídeo (1.11.0)
   ========================================================================== */
.c3a-3d-viewer-shell .c3a-scene-layer { position: absolute; inset: 0; z-index: 2; }
.c3a-3d-viewer-shell .c3a-scene-layer[hidden] { display: none !important; }
.c3a-3d-viewer-shell .c3a-scene-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; border-radius: inherit; }
.c3a-3d-viewer-shell .c3a-scene-canvas:active { cursor: grabbing; }
/* Esconde o viewer nativo em QUALQUER profundidade (slot → shell → canvas).
   O seletor `>` antigo quebrava na PDP 1.12.x (shell dentro do stage). */
.c3a-3d-viewer-shell.is-scene .c3a-3d-viewer,
.c3a-3d-viewer-shell.is-scene .c3a-product-3d,
.c3a-3d-viewer-shell.is-engine .c3a-3d-viewer,
.c3a-3d-viewer-shell.is-engine .c3a-product-3d,
.c3a-3d-stage[data-scene] .c3a-3d-stage__slot .c3a-3d-viewer,
.c3a-3d-stage[data-scene] .c3a-3d-stage__slot .c3a-product-3d,
.c3a-3d-stage[data-engine] .c3a-3d-stage__slot .c3a-3d-viewer,
.c3a-3d-stage[data-engine] .c3a-3d-stage__slot .c3a-product-3d { visibility: hidden !important; pointer-events: none !important; }
.c3a-3d-stage[data-scene] .c3a-3d-stage__bgs { display: none; }
.c3a-3d-stage[data-scene] { background: #0f172a; }
.c3a-scene-progress {
    position: absolute; left: 50%; bottom: 18%; transform: translateX(-50%); z-index: 5;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 10px 14px; border-radius: 12px; min-width: 190px;
    background: rgba(15,23,42,.72); color: #f8fafc; backdrop-filter: blur(6px);
    font-size: 12px; font-weight: 600; box-shadow: 0 6px 24px rgba(0,0,0,.25); pointer-events: none;
}
.c3a-scene-progress[hidden] { display: none; }
.c3a-scene-progress em { font-style: normal; }
.c3a-scene-progress__bar { display: block; width: 100%; height: 5px; border-radius: 99px; background: rgba(255,255,255,.18); overflow: hidden; }
.c3a-scene-progress__bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #38bdf8, #2E7BB8); border-radius: inherit; transition: width .2s ease; }
.c3a-scene-rec {
    position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 6;
    display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
    background: rgba(127,29,29,.88); color: #fff; font-size: 12px; font-weight: 700; pointer-events: none;
}
.c3a-scene-rec[hidden] { display: none; }
.c3a-scene-rec i { width: 8px; height: 8px; border-radius: 50%; background: #f87171; animation: c3a-scene-rec 1s ease-in-out infinite; }
@keyframes c3a-scene-rec { 50% { opacity: .25; } }

/* Barra de cenários no modal — stage menor p/ caber controles; body do modal faz scroll (1.12.21) */
.c3a-3d-modal.has-scenes .c3a-3d-stage--modal.c3a-mockup-stage {
    height: min(40vh, 400px);
    min-height: 220px;
    flex: 0 0 auto;
}
.c3a-3d-modal .c3a-scene-bar {
    flex: 0 0 auto;
    margin-top: 10px;
}
.c3a-scene-bar { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.c3a-scene-bar__head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.c3a-scene-chip {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
    min-height: 34px; padding: 6px 12px; border-radius: 999px; cursor: pointer;
    border: 1px solid color-mix(in srgb, #94a3b8 40%, transparent);
    background: var(--c3a-bg-card, #fff); color: var(--c3a-text-main, #0f172a);
    font-size: 12.5px; font-weight: 700; transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}
.c3a-scene-chip::after { content: ''; width: 26px; height: 15px; border-radius: 99px; background: #cbd5e1; box-shadow: inset -11px 0 0 2px #fff; transition: all .18s ease; margin-left: 2px; }
.c3a-scene-chip.is-active { border-color: var(--c3a-brand, #2E7BB8); color: var(--c3a-brand, #2E7BB8); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c3a-brand, #2E7BB8) 16%, transparent); }
.c3a-scene-chip.is-active::after { background: var(--c3a-brand, #2E7BB8); box-shadow: inset 11px 0 0 2px #fff; }
.c3a-scene-chip:focus-visible, .c3a-scene-thumb:focus-visible, .c3a-scene-swatch:focus-visible { outline: 2px solid var(--c3a-brand, #2E7BB8); outline-offset: 2px; }
.c3a-scene-strip { display: flex; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; padding: 3px 2px 6px; min-width: 0; flex: 1 1 auto; scrollbar-width: thin; }
.c3a-scene-thumb {
    position: relative; flex: 0 0 auto; width: 96px; height: 64px; padding: 0; border-radius: 10px; overflow: hidden; cursor: pointer;
    border: 2px solid transparent; background: linear-gradient(160deg, #e2e8f0, #cbd5e1); scroll-snap-align: start;
    box-shadow: 0 1px 3px rgba(15,23,42,.14); transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.c3a-scene-thumb:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(15,23,42,.18); }
.c3a-scene-thumb.is-active { border-color: var(--c3a-brand, #2E7BB8); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c3a-brand, #2E7BB8) 22%, transparent); }
.c3a-scene-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.c3a-scene-thumb__ph { position: absolute; inset: 0; display: grid; place-items: center; font-size: 22px; font-weight: 800; color: #475569; }
.c3a-scene-thumb--studio { background: radial-gradient(ellipse at 50% 40%, #fff, #dbe4ef); }
.c3a-scene-thumb__label {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 6px 4px; text-align: left;
    background: linear-gradient(transparent, rgba(2,6,23,.78)); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 1.15;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.c3a-scene-thumb--studio .c3a-scene-thumb__label { background: linear-gradient(transparent, rgba(15,23,42,.55)); }
.c3a-scene-thumb__tag { display: inline-block; padding: 0 4px; border-radius: 4px; background: #b91c1c; font-size: 9px; font-weight: 800; vertical-align: 1px; }
.c3a-scene-custom { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 8px 10px; border-radius: 12px; background: color-mix(in srgb, #94a3b8 10%, var(--c3a-bg-card, #fff)); border: 1px solid color-mix(in srgb, #94a3b8 20%, transparent); }
.c3a-scene-custom[hidden] { display: none; }
.c3a-scene-custom__group { display: inline-flex; align-items: center; gap: 6px; }
.c3a-scene-custom__label { font-size: 11.5px; font-weight: 700; color: var(--c3a-text-muted, #475569); margin-right: 2px; }
.c3a-scene-swatch { width: 22px; height: 22px; padding: 0; border-radius: 50%; cursor: pointer; background: var(--sw); border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(15,23,42,.22); }
.c3a-scene-swatch.is-active { box-shadow: 0 0 0 2px var(--c3a-brand, #2E7BB8); }
.c3a-scene-switch { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--c3a-text-main, #0f172a); cursor: pointer; user-select: none; }
.c3a-scene-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.c3a-scene-switch span { width: 30px; height: 17px; border-radius: 99px; background: #cbd5e1; position: relative; transition: background .15s; }
.c3a-scene-switch span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.c3a-scene-switch input:checked + span { background: var(--c3a-brand, #2E7BB8); }
.c3a-scene-switch input:checked + span::after { transform: translateX(13px); }
.c3a-scene-switch input:focus-visible + span { outline: 2px solid var(--c3a-brand, #2E7BB8); outline-offset: 2px; }
.c3a-scene-custom .c3a-3d-seg { flex: 0 0 auto; }
.c3a-scene-custom .c3a-3d-seg button { flex: 0 0 auto; min-height: 26px; padding: 3px 10px; }

/* Painel acoplado */
.c3a-scene-strip--dock { margin: 0 12px 10px; padding-bottom: 4px; }
.c3a-scene-strip--dock .c3a-scene-thumb { width: 72px; height: 48px; border-radius: 8px; }
.c3a-scene-strip--dock .c3a-scene-thumb__label { font-size: 9.5px; padding: 10px 4px 3px; }
/* Grade compacta no painel: NÃO esticar linhas (era a causa da faixa branca entre miniaturas). */
.c3a-3d-dock .c3a-scene-strip.c3a-scene-strip--dock {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
    gap: 8px;
    flex: 0 0 auto !important;
    align-content: start;
    align-items: start;
    height: auto !important;
    min-height: 0 !important;
    max-height: none;
    overflow: visible;
    scroll-snap-type: none;
    padding: 2px 0 6px;
}
.c3a-3d-dock .c3a-scene-strip--dock .c3a-scene-thumb {
    width: auto;
    height: auto;
    aspect-ratio: 3 / 2;
    min-height: 44px;
    max-height: 72px;
    align-self: start;
}
.c3a-scene-chip-btn.is-active { color: #fff !important; background: var(--c3a-brand, #2E7BB8) !important; border-color: var(--c3a-brand, #2E7BB8) !important; }

/* Composição (1.11.0) */
.c3a-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.c3a-comp { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.c3a-comp[hidden] { display: none; }
.c3a-comp__label { font-size: 11.5px; font-weight: 700; color: var(--c3a-text-muted, #475569); }
.c3a-comp__seg button { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; min-height: 30px; padding: 3px 11px; }
.c3a-comp__seg button svg { flex: 0 0 auto; opacity: .85; }
.c3a-comp__seg button.is-active svg { opacity: 1; }
.c3a-comp__adjust { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.c3a-comp__adjust[hidden] { display: none; }
.c3a-comp__range { display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 700; color: var(--c3a-text-muted, #475569); }
.c3a-comp__range input[type=range], .c3a-video__range input[type=range] { width: 120px; accent-color: var(--c3a-brand, #2E7BB8); }
.c3a-comp--dock { margin: 0 12px 8px; display: flex; justify-content: center; }
.c3a-comp--dock .c3a-comp__seg { width: 100%; justify-content: center; }
.c3a-comp--dock .c3a-comp__seg button { flex: 1 1 0; justify-content: center; min-height: 28px; padding: 2px 6px; }
.c3a-scene-bar__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }

/* Vídeo giratório (1.11.0) */
.c3a-video { margin-top: 10px; padding: 12px 14px; border-radius: 14px; background: var(--c3a-bg-card, #fff); border: 1px solid color-mix(in srgb, #94a3b8 30%, transparent); box-shadow: 0 6px 22px rgba(15,23,42,.08); }
.c3a-video[hidden] { display: none; }
.c3a-video__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.c3a-video__head strong { font-size: 13.5px; }
.c3a-video__close { width: 28px; height: 28px; border-radius: 8px; border: 0; background: transparent; color: inherit; font-size: 20px; line-height: 1; cursor: pointer; }
.c3a-video__close:hover { background: color-mix(in srgb, #94a3b8 16%, transparent); }
.c3a-video__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 10px 18px; }
.c3a-video__grid[aria-disabled=true] { opacity: .55; pointer-events: none; }
.c3a-video__row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.c3a-video__label { flex: 0 0 74px; font-size: 11.5px; font-weight: 700; color: var(--c3a-text-muted, #475569); }
.c3a-video__row .c3a-3d-seg { flex: 0 1 auto; flex-wrap: nowrap; }
.c3a-video__row .c3a-3d-seg button { flex: 0 0 auto; min-height: 28px; padding: 3px 10px; font-size: 12px; white-space: nowrap; }
.c3a-video__range { display: inline-flex; align-items: center; gap: 8px; }
.c3a-video__range input[type=range] { width: 150px; }
.c3a-video__range output { font-size: 12px; font-weight: 800; min-width: 34px; }
.c3a-video__summary { margin: 10px 0 6px; font-size: 11.5px; color: var(--c3a-text-muted, #475569); }
.c3a-video__progress { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.c3a-video__progress[hidden] { display: none; }
.c3a-video__progress .c3a-scene-progress__bar { background: color-mix(in srgb, #94a3b8 26%, transparent); height: 7px; }
.c3a-video__progress em { font-style: normal; font-size: 12px; font-weight: 700; }
.c3a-video__actions { display: flex; justify-content: flex-end; gap: 8px; }
.c3a-scene-video-btn.is-active { border-color: var(--c3a-brand, #2E7BB8) !important; color: var(--c3a-brand, #2E7BB8) !important; }

/* Tema escuro */
body.c3a-theme-dark .c3a-comp__label, body.c3a-theme-dark .c3a-comp__range, body.c3a-theme-dark .c3a-video__label, body.c3a-theme-dark .c3a-video__summary { color: #94a3b8; }
body.c3a-theme-dark .c3a-video { background: #141c2e; border-color: rgba(148,163,184,.2); color: #e2e8f0; box-shadow: 0 6px 22px rgba(0,0,0,.35); }
body.c3a-theme-dark .c3a-scene-chip { background: rgba(255,255,255,.04); color: #e2e8f0; border-color: rgba(148,163,184,.28); }
body.c3a-theme-dark .c3a-scene-chip.is-active { color: #7cc0ff; border-color: #4a9ad0; }
body.c3a-theme-dark .c3a-scene-chip::after { box-shadow: inset -11px 0 0 2px #1c263c; background: #475569; }
body.c3a-theme-dark .c3a-scene-chip.is-active::after { box-shadow: inset 11px 0 0 2px #1c263c; background: #4a9ad0; }
body.c3a-theme-dark .c3a-scene-custom { background: rgba(15,23,42,.55); border-color: rgba(148,163,184,.16); }
body.c3a-theme-dark .c3a-scene-switch { color: #e2e8f0; }
body.c3a-theme-dark .c3a-scene-custom__label { color: #94a3b8; }
body.c3a-theme-dark .c3a-scene-thumb { background: linear-gradient(160deg, #334155, #1e293b); }
body.c3a-theme-dark .c3a-scene-thumb--studio { background: radial-gradient(ellipse at 50% 40%, #33415a, #0f172a); }
body.c3a-theme-dark .c3a-scene-thumb__ph { color: #cbd5e1; }

/* Celular */
@media (max-width: 640px) {
    .c3a-3d-modal.has-scenes .c3a-3d-stage--modal.c3a-mockup-stage { height: min(36vh, 320px); min-height: 200px; }
    .c3a-scene-bar__head { flex-direction: column; align-items: stretch; gap: 6px; }
    .c3a-scene-chip { align-self: flex-start; }
    .c3a-scene-thumb { width: 82px; height: 56px; }
    .c3a-scene-custom { gap: 8px 10px; padding: 7px 8px; }
    .c3a-3d-modal__footer .c3a-scene-video-btn span, .c3a-3d-modal__footer .c3a-3d-4k-btn { padding-left: 10px; padding-right: 10px; }
    .c3a-comp { gap: 6px 10px; }
    .c3a-comp__label { width: 100%; }
    .c3a-comp__seg { width: 100%; }
    .c3a-comp__seg button { flex: 1 1 0; justify-content: center; padding: 3px 6px; }
    .c3a-comp__adjust { width: 100%; justify-content: space-between; }
    .c3a-comp__range input[type=range] { width: 96px; }
    .c3a-video { padding: 10px; }
    .c3a-video__grid { grid-template-columns: 1fr; }
    .c3a-video__label { flex-basis: 70px; }
    .c3a-video__range input[type=range] { width: 130px; }
    .c3a-video__actions .c3a-btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
    .c3a-scene-thumb, .c3a-scene-chip, .c3a-scene-progress__bar i { transition: none; }
    .c3a-scene-rec i { animation: none; }
}
