/* ==========================================================================
   SIMULADOR "FOTO DA MINHA PAREDE" (MOCKUP 2D & AR) - HARTEN DECOR
   Permite projetar o móvel sobre a foto da parede real do cliente
   ========================================================================== */

.wall-sim-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.wall-sim-modal.active {
    display: flex !important;
    opacity: 1 !important;
}

.wall-sim-container {
    background: #ffffff;
    border-radius: 20px;
    width: 100%;
    max-width: 960px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
    position: relative;
}

/* CABEÇALHO DO MODAL */
.wall-sim-header {
    padding: 18px 24px;
    background: #0f172a;
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #1e293b;
}

.wall-sim-title-box {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wall-sim-icon {
    font-size: 1.6rem;
}

.wall-sim-title {
    font-size: 1.15rem;
    font-weight: 800;
    margin: 0;
    color: #ffffff;
    letter-spacing: -0.2px;
}

.wall-sim-subtitle {
    font-size: 0.76rem;
    color: #94a3b8;
    margin: 2px 0 0;
}

.wall-sim-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s;
}

.wall-sim-close-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.08);
}

/* CORPO DO SIMULADOR (GRID WORKSPACE + CONTROLES) */
.wall-sim-body {
    display: grid;
    grid-template-columns: 1fr 320px;
    overflow-y: auto;
    flex: 1;
}

@media (max-width: 860px) {
    .wall-sim-body {
        grid-template-columns: 1fr;
    }
}

/* ÁREA DE PROJEÇÃO / CANVAS */
.wall-sim-viewport {
    position: relative;
    background: #1e293b;
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    user-select: none;
    touch-action: none;
}

.wall-sim-stage {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
}

/* ELEMENTO DO MÓVEL ARRASTÁVEL */
.wall-sim-furniture-layer {
    position: absolute;
    cursor: grab;
    transform-origin: center center;
    filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.45));
    transition: filter 0.2s ease;
    z-index: 10;
}

.wall-sim-furniture-layer:active {
    cursor: grabbing;
}

.wall-sim-furniture-img {
    display: block;
    max-width: 100%;
    pointer-events: none;
}

/* DICA FLUTUANTE DE ARRASTAR */
.wall-sim-hint {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.75);
    color: #ffffff;
    font-size: 0.74rem;
    padding: 6px 14px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
    pointer-events: none;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* PAINEL LATERAL DE CONTROLES */
.wall-sim-controls {
    padding: 24px 20px;
    background: #f8fafc;
    border-left: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

.wall-sim-section-label {
    font-size: 0.75rem;
    font-weight: 800;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* BOTOES DE UPLOAD E PRESETS */
.wall-upload-btn-wrap {
    position: relative;
    overflow: hidden;
}

.wall-upload-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #ffffff;
    border: 2px dashed #94a3b8;
    color: #1e293b;
    padding: 12px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.wall-upload-btn:hover {
    border-color: #2563eb;
    background: #eff6ff;
    color: #2563eb;
}

.wall-upload-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* SELETOR DE PAREDES MODELO */
.wall-preset-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.wall-preset-btn {
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    height: 48px;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    overflow: hidden;
}

.wall-preset-btn:hover {
    transform: scale(1.04);
}

.wall-preset-btn.active {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.4);
}

.wall-preset-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.7);
    color: #ffffff;
    font-size: 0.6rem;
    font-weight: 700;
    text-align: center;
    padding: 2px;
}

/* SLIDERS DE AJUSTE */
.wall-sim-slider-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.wall-sim-slider-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.76rem;
    font-weight: 700;
    color: #334155;
}

.wall-sim-slider {
    width: 100%;
    accent-color: #2563eb;
    height: 6px;
    cursor: pointer;
}

/* BOTOES DE AÇÃO E EXPORTAÇÃO */
.wall-sim-actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid #e2e8f0;
}

.btn-wall-whatsapp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #059669;
    color: #ffffff;
    font-size: 0.84rem;
    font-weight: 800;
    padding: 12px 16px;
    border-radius: 10px;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
    transition: all 0.2s;
}

.btn-wall-whatsapp:hover {
    background: #047857;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(5, 150, 105, 0.45);
}

.btn-wall-download {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #1e293b;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-wall-download:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.btn-wall-ar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: #38bdf8;
    border: 1px solid #334155;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 9px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-wall-ar:hover {
    background: #0f172a;
    color: #7dd3fc;
    border-color: #38bdf8;
}

/* BOTÃO DE ACIONAMENTO EXTERNO (TRIGGER) */
.btn-trigger-wall-sim {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 800;
    padding: 9px 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.35);
    transition: all 0.2s;
}

.btn-trigger-wall-sim:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.5);
}

/* SWITCH DE REMOÇÃO DE FUNDO */
.wall-sim-toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.wall-sim-switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    margin: 0;
    flex-shrink: 0;
}

.wall-sim-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.wall-sim-slider-toggle {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #cbd5e1;
    transition: 0.25s ease;
    border-radius: 24px;
}

.wall-sim-slider-toggle:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    transition: 0.25s ease;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.wall-sim-switch input:checked + .wall-sim-slider-toggle {
    background-color: #2563eb;
}

.wall-sim-switch input:checked + .wall-sim-slider-toggle:before {
    transform: translateX(18px);
}

/* ==========================================================================
   ESTILOS DE MULTI-CAMADAS & ACESSÓRIOS
   ========================================================================== */

.wall-sim-item {
    position: absolute;
    cursor: grab;
    transform-origin: center center;
    filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.45));
    transition: filter 0.2s ease, outline 0.15s ease;
    user-select: none;
    touch-action: none;
    z-index: 10;
}

.wall-sim-item:active {
    cursor: grabbing;
}

.wall-sim-item.selected {
    outline: 2px dashed #38bdf8;
    outline-offset: 4px;
    z-index: 50;
}

.wall-sim-item-toolbar {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 3px 6px;
    display: none;
    align-items: center;
    gap: 6px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
    z-index: 60;
    pointer-events: auto;
}

.wall-sim-item.selected .wall-sim-item-toolbar {
    display: flex;
}

.wall-sim-tool-btn {
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: #ffffff;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
}

.wall-sim-tool-btn:hover {
    background: #2563eb;
    transform: scale(1.1);
}

.wall-sim-tool-btn.danger:hover {
    background: #ef4444;
}

/* ABAS DE NAVEGAÇÃO DOS CONTROLES */
.wall-sim-tabs {
    display: flex;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 16px;
    gap: 4px;
}

.wall-sim-tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 10px 4px;
    font-size: 0.76rem;
    font-weight: 800;
    color: #64748b;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.wall-sim-tab-btn:hover {
    color: #1e293b;
}

.wall-sim-tab-btn.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

.wall-sim-tab-content {
    display: none;
}

.wall-sim-tab-content.active {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* BANDEJA DE ACESSÓRIOS */
.wall-accessory-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.wall-accessory-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.wall-accessory-card:hover {
    border-color: #2563eb;
    background: #eff6ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
}

.wall-accessory-thumb {
    width: 68px;
    height: 44px;
    object-fit: contain;
    margin-bottom: 6px;
}

.wall-accessory-title {
    font-size: 0.74rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.wall-accessory-desc {
    font-size: 0.65rem;
    color: #64748b;
    margin-top: 2px;
}

.wall-accessory-btn-add {
    margin-top: 6px;
    background: #2563eb;
    color: #ffffff;
    border: none;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    cursor: pointer;
}

/* BARRA DE ITENS ATIVOS NA PAREDE */
.wall-active-items-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
    max-height: 140px;
    overflow-y: auto;
}

.wall-active-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.74rem;
    cursor: pointer;
    transition: all 0.15s;
}

.wall-active-item-row:hover, .wall-active-item-row.active {
    border-color: #2563eb;
    background: #eff6ff;
}

.wall-active-item-delete {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 2px 4px;
}

.wall-active-item-delete:hover {
    color: #ef4444;
}
