/* Tema opcional. Os valores originais permanecem enquanto nenhuma paleta estiver ativa. */
html[data-editor-palette] body{background-color:var(--bg-main);background-image:none;color:var(--text-primary)}
html[data-editor-palette] :is(.site-header,.site-footer,.modal-dialog,.cart-drawer-panel,.demo-modal-header,.demo-viewport-wrapper,.drawer-footer){background-color:var(--bg-secondary);color:var(--text-primary)}
html[data-editor-palette] :is(.product-card,.product-card:hover,.hero-showcase-box,.hero-feature-pill,.customer-download-card,.search-result-item,.checkout-summary-panel,.checkout-summary-box,.form-field input,.form-field select,.form-field textarea,.header-search-btn,.header-action-btn,.filter-pill-btn,.payment-option){background-color:var(--bg-card);color:var(--text-primary);border-color:var(--border-subtle)}
html[data-editor-palette] :is(.header-inner>nav,.modal-prod-preview-area,.modal-prod-info-area,.product-img-wrapper,.demo-viewport-container){background-color:var(--bg-secondary)}
html[data-editor-palette] :is(.gradient-text){background-image:linear-gradient(135deg,var(--accent-cyan),var(--primary-light))}
html[data-editor-palette] :is(.brand-logo,.nav-menu-link:hover,.product-title,.cart-item-title,.download-prod-title,.search-result-title,.modal-title,.footer-logo-text){color:var(--text-primary)}
html[data-editor-palette] :is(.brand-icon-box,.btn-hero-cta,.btn-hero-cta:hover,.btn-buy-primary,.btn-buy-primary:hover,.btn-primary,.btn-primary:hover,.filter-pill-btn.active,.filter-pill-btn.active:hover,.demo-device-btn.active){background:var(--primary);color:var(--palette-button-ink);border-color:var(--primary)}
html[data-editor-palette] :is(.btn-hero-cta,.btn-buy-primary,.brand-icon-box){box-shadow:var(--shadow-glow)}
html[data-editor-palette] :is(.btn-hero-cta,.btn-buy-primary,.btn-primary,.filter-pill-btn.active) :is(span,svg){color:inherit}
html[data-editor-palette] :is(.btn-demo-secondary,.btn-demo-secondary:hover,.header-editor-btn,.hero-eyebrow,.current-price,.search-result-price,.cart-item-price,.hero-stat-number,.product-category,.filter-pill-btn:hover,.footer-link:hover){color:var(--accent-cyan);border-color:var(--border-glow)}
html[data-editor-palette] .btn-demo-secondary{background-color:var(--bg-surface)}
html[data-editor-palette] :is(.product-badge,.badge-order,.cart-counter-badge){background:var(--palette-accent);color:var(--palette-accent-ink)}
html[data-editor-palette] :is(.product-description,.hero-subtitle,.footer-description,.search-result-desc,.modal-prod-subtitle,.nav-menu-link,.footer-link){color:var(--text-secondary)}
/* Preserva os backgrounds com fotos (incluindo a Hero e seus overlays). */
.editor-palette-preview{display:flex;flex-direction:column;align-items:flex-start;gap:12px;padding:18px;border:1px solid #516078;border-radius:12px;margin:14px 0;min-height:140px}
.editor-palette-sample{padding:9px 18px;border-radius:8px;font-weight:700}
.editor-palette-slot .editor-row{display:grid;grid-template-columns:80px minmax(0,1fr);gap:10px}
.editor-palette-slot input[type=color]{padding:4px;width:100%;min-height:44px;cursor:pointer}
.editor-palette-slot button{display:block;width:100%;margin-top:8px;min-height:44px;white-space:normal}
.editor-palette-canvas{display:block;width:100%;height:auto;margin-top:12px;border:1px solid #516078;border-radius:8px;cursor:crosshair;touch-action:manipulation}
.editor-palette-canvas[hidden]{display:none}
.editor-panel #editorPaletteAuto,.editor-panel #editorPaletteApply{width:100%;min-height:44px;white-space:normal}
.editor-panel #editorPaletteImage{max-width:100%;font-size:12px}
/* O painel mantém contraste próprio, independente da paleta do site. */
.editor-panel{--text-primary:#e7efff;--text-secondary:#a9b8d0;--border-subtle:#34465f;--primary:#2867db;--primary-dark:#2055b5;--accent-cyan:#75cfff;color:#e7efff}
/* Conteúdo secundário e janelas acompanham fundos claros ou escuros. */
html[data-editor-palette] :is(.modal-title-group h3,.footer-col-title,.checkout-summary-title,.checkout-item-title,.checkout-item-price,.checkout-total-value,.cart-total-final,.customer-greeting,.form-field label,.payment-method-title,.search-result-price,.btn-outline,.qty-control button,.empty-catalog-state h3,.empty-downloads-state h4){color:var(--text-primary)}
html[data-editor-palette] :is(.checkout-sidebar,.checkout-panel,.customer-info-card,.product-card-media,.hero-feature-pill){background-color:var(--bg-surface)}
html[data-editor-palette] .footer-social-title{color:var(--text-primary)!important}
html[data-editor-palette] .hero-showcase-box{box-shadow:var(--shadow-card)}
html[data-editor-palette] .filter-pill-btn.active{box-shadow:var(--shadow-glow)}
html[data-editor-palette] .catalog-layout-button[aria-pressed="true"]{color:var(--palette-button-ink)}
html[data-editor-palette] #productDetailsModal .modal-header{background-color:var(--bg-secondary)}
html[data-editor-palette] #productDetailsModal :is(.modal-title-group h3,.modal-close-btn){color:var(--text-primary)}
html[data-editor-palette] #productDetailsModal :is(.modal-title-group p,.product-details-file,.modal-feature-item){color:var(--text-secondary)}
html[data-editor-palette] #productDetailsModal .product-details-file{background-color:var(--bg-surface)}
html[data-editor-palette] #modalProdDesc{color:var(--text-secondary)}
html[data-editor-palette] #modalProdPrice{color:var(--text-primary)}
html[data-editor-palette] #modalProdOriginalPrice{color:var(--text-muted)}
html[data-editor-palette] #modalProdImage{background-color:var(--bg-secondary)}
html[data-editor-palette] .btn-cart-secondary{background-color:var(--bg-surface);color:var(--text-primary);border-color:var(--border-subtle)}
html[data-editor-palette] #productDetailsModal :is(.product-details-payment,.modal-feature-item svg){color:var(--accent-cyan)}
