/* ═══════════════════════════════════════════════════════════
   Visor 3D de Vidrio — ventana.plus  v3.0
   ═══════════════════════════════════════════════════════════ */

/* ── Preloader ── */
.vid3d-preloader {
    position: absolute;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4f6f8;
    border-radius: 14px;
    transition: opacity .5s ease;
}
.vid3d-preloader.hidden {
    opacity: 0;
    pointer-events: none;
}
.vid3d-preloader-inner {
    text-align: center;
}
.vid3d-preloader-spinner {
    width: 48px; height: 48px;
    margin: 0 auto 18px;
    border: 4px solid #e0e0e0;
    border-top-color: #58CCB3;
    border-radius: 50%;
    animation: vid3dSpin 1s linear infinite;
}
@keyframes vid3dSpin {
    to { transform: rotate(360deg); }
}
.vid3d-preloader-text {
    font-size: 15px;
    font-weight: 600;
    color: #092143;
    margin-bottom: 14px;
    letter-spacing: 0.02em;
}
.vid3d-preloader-bar {
    width: 220px;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    margin: 0 auto 8px;
}
.vid3d-preloader-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #092143, #58CCB3);
    border-radius: 3px;
    transition: width .3s ease;
}
.vid3d-preloader-pct {
    font-size: 13px;
    color: #666;
    font-variant-numeric: tabular-nums;
}


.vid3d-wrapper {
    display: flex;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    height: calc(100vh - 200px);
    min-height: 500px;
    background: #f4f6f8;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(9,33,67,.12);
    font-family: inherit;
    position: relative;
}

/* ── Panel lateral izquierdo ──────────────────────────── */
.vid3d-panel {
    width: 310px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #e0e6ef;
    display: flex;
    flex-direction: column;
    padding: 20px;
    gap: 16px;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
}

.vid3d-panel-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #092143;
    margin: 0 0 2px;
    line-height: 1.2;
}
.vid3d-panel-subtitle {
    font-size: 0.78rem;
    color: #888;
    margin: 0;
}

/* ── Secciones del panel ─────────────────────────────── */
.vid3d-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
}
.vid3d-section-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #092143;
    text-transform: uppercase;
    letter-spacing: .06em;
}

/* ── Botones de tipo de vidrio ───────────────────────── */
.vid3d-type-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}
.vid3d-type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 4px 6px;
    background: #f8fafb;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color .18s, background .18s, transform .12s;
    text-align: center;
}
.vid3d-type-btn:hover {
    border-color: #58CCB3;
    background: #f0faf9;
    transform: translateY(-1px);
}
.vid3d-type-btn.active {
    border-color: #58CCB3;
    background: #e8f8f5;
    box-shadow: 0 0 0 1px #58CCB3 inset;
}
.vid3d-type-icon {
    width: 24px;
    height: 24px;
    border-radius: 5px;
    display: block;
}
.vid3d-type-name {
    font-size: 0.68rem;
    font-weight: 600;
    color: #092143;
    line-height: 1.2;
}

/* ── Selector de espesor (pills reutilizable) ────────── */
.vid3d-esp-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.vid3d-esp-unit {
    font-size: 0.7rem;
    color: #999;
    margin-top: -4px;
}

/* ── Dropdown espesor ────────────────────────────────── */
.vid3d-esp-select-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}
.vid3d-esp-select {
    flex: 1;
    padding: 7px 12px;
    background: #f8fafb;
    border: 2px solid #e2e8f0;
    border-radius: 9px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #092143;
    cursor: pointer;
    outline: none;
    transition: border-color .15s;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23092143' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}
.vid3d-esp-select:hover,
.vid3d-esp-select:focus {
    border-color: #58CCB3;
}

/* ── Selector tamaño bisel ────────────────────────────── */
.vid3d-bisel-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 2px;
}
.vid3d-bisel-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.78rem;
    color: #555;
}
.vid3d-bisel-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #58CCB3;
    cursor: pointer;
}
.vid3d-bisel-toggle-label {
    user-select: none;
}
.vid3d-bisel-size-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}
.vid3d-bisel-label {
    font-size: 0.72rem;
    color: #888;
    white-space: nowrap;
}
.vid3d-bisel-select {
    flex: 1;
    padding: 5px 10px;
    background: #f8fafb;
    border: 2px solid #e2e8f0;
    border-radius: 9px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #092143;
    cursor: pointer;
    outline: none;
    transition: border-color .15s;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23092143' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 26px;
}
.vid3d-bisel-select:hover,
.vid3d-bisel-select:focus {
    border-color: #58CCB3;
}

/* ── Color lacado ────────────────────────────────────── */
.vid3d-color-pick {
    display: flex;
    align-items: center;
    gap: 10px;
}
.vid3d-color-pick label { font-size: 0.80rem; color: #555; }
#vid3d-lacado-color {
    width: 44px;
    height: 34px;
    padding: 2px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    background: none;
}
.vid3d-color-hex {
    font-size: 0.75rem;
    color: #888;
    font-family: monospace;
}

/* ── RAL color grid ───────────────────────────────────── */
.vid3d-ral-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 5px;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}
.vid3d-ral-btn {
    width: 100%;
    aspect-ratio: 1;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: transform .12s, border-color .15s;
}
.vid3d-ral-btn:hover { transform: scale(1.12); }
.vid3d-ral-btn.active { border-color: #58CCB3; box-shadow: 0 0 0 2px #58CCB3; }
.vid3d-ral-name {
    font-size: 0.7rem;
    color: #888;
    margin-top: 2px;
}

/* ── Canto buttons ────────────────────────────────────── */
.vid3d-canto-btn {
    padding: 5px 11px;
    background: #f4f6f8;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    transition: all .15s;
}
.vid3d-canto-btn:hover { border-color: #58CCB3; color: #092143; }
.vid3d-canto-btn.active { background: #58CCB3; border-color: #58CCB3; color: #fff; }

/* ── Checkbox tratamiento ─────────────────────────────── */
.vid3d-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: #555;
    cursor: pointer;
}
.vid3d-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #58CCB3;
}

/* ── Medidas ──────────────────────────────────────────── */
.vid3d-dims {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}
.vid3d-dim-field {
    flex: 1;
}
.vid3d-dim-field label {
    display: block;
    font-size: 0.72rem;
    color: #888;
    margin-bottom: 3px;
}
.vid3d-dim-input-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
}
.vid3d-dim-input-wrap input {
    width: 100%;
    padding: 6px 8px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #092143;
    text-align: center;
    outline: none;
    transition: border-color .15s;
}
.vid3d-dim-input-wrap input:focus {
    border-color: #58CCB3;
}
.vid3d-dim-input-wrap span {
    font-size: 0.72rem;
    color: #999;
    white-space: nowrap;
}
.vid3d-dim-x {
    font-size: 1rem;
    color: #bbb;
    padding-bottom: 6px;
}

/* ── Panel de información dinámica ───────────────────── */
.vid3d-info-panel {
    background: #f4f8fb;
    border: 1px solid #d8e4ef;
    border-radius: 9px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.vid3d-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.76rem;
    line-height: 1.4;
}
.vid3d-info-row span { color: #888; }
.vid3d-info-row strong { color: #092143; font-weight: 600; }
.vid3d-info-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #58CCB3, transparent);
    margin: 6px 0;
}
.vid3d-info-calumen span {
    color: #58CCB3 !important;
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Precio ───────────────────────────────────────────── */
.vid3d-price-panel {
    background: linear-gradient(135deg, #092143 0%, #0d3366 100%);
    border-radius: 10px;
    padding: 14px 16px;
    color: #fff;
}
.vid3d-price-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    opacity: 0.7;
    margin-bottom: 6px;
}
.vid3d-price-row {
    font-size: 0.78rem;
    opacity: 0.8;
    margin-bottom: 4px;
}
.vid3d-price-total {
    font-size: 1.4rem;
    font-weight: 700;
    color: #58CCB3;
    line-height: 1.2;
}
.vid3d-price-total small {
    font-size: 0.7rem;
    font-weight: 400;
    opacity: 0.6;
    color: #fff;
}
.vid3d-price-note {
    font-size: 0.65rem;
    opacity: 0.5;
    margin-top: 6px;
}

/* ── CTA link ────────────────────────────────────────── */
.vid3d-cta {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #eef1f5;
}
.vid3d-cta-link {
    display: block;
    text-align: center;
    background: #092143;
    color: #fff !important;
    padding: 10px 16px;
    border-radius: 35px;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none !important;
    transition: background .18s;
}
.vid3d-cta-link:hover {
    background: #58CCB3;
}

/* ── Canvas 3D ───────────────────────────────────────── */
.vid3d-canvas-wrap {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #d8dfe8;
}
#vid3d-canvas {
    width: 100% !important;
    height: 100% !important;
    min-height: 380px;
    display: block;
    cursor: grab;
}
#vid3d-canvas:active { cursor: grabbing; }

/* ── Hint ────────────────────────────────────────────── */
.vid3d-hint {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(9,33,67,.55);
    color: #fff;
    font-size: 0.72rem;
    padding: 5px 14px;
    border-radius: 20px;
    pointer-events: none;
    opacity: 0.7;
    white-space: nowrap;
}

/* ── Forma buttons ───────────────────────────────────── */
.vid3d-forma-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    background: #f4f6f8;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    transition: all .15s;
}
.vid3d-forma-btn svg { flex-shrink: 0; }
.vid3d-forma-btn:hover { border-color: #58CCB3; color: #092143; }
.vid3d-forma-btn.active { background: #58CCB3; border-color: #58CCB3; color: #fff; }
.vid3d-forma-btn.active svg { color: #fff; }

/* ── Light simulator ─────────────────────────────────── */
.vid3d-light-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}
.vid3d-light-icon {
    font-size: 1rem;
    line-height: 1;
}
.vid3d-light-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, #ffb347, #fff8e1, #ff6b6b);
    outline: none;
}
.vid3d-light-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #092143;
    border: 2px solid #58CCB3;
    cursor: pointer;
    transition: transform .12s;
}
.vid3d-light-slider::-webkit-slider-thumb:hover { transform: scale(1.15); }
.vid3d-light-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #092143;
    border: 2px solid #58CCB3;
    cursor: pointer;
}
.vid3d-light-label-wrap {
    text-align: center;
    font-size: 0.75rem;
    color: #888;
    font-weight: 600;
}

/* ── WhatsApp button ─────────────────────────────────── */
.vid3d-whatsapp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 16px;
    background: #25D366;
    color: #fff;
    border: none;
    border-radius: 35px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .18s, transform .12s;
}
.vid3d-whatsapp-btn:hover {
    background: #1fba59;
    transform: translateY(-1px);
}
.vid3d-whatsapp-btn svg { flex-shrink: 0; }

/* ── Composición / Textura / Escena / Comparador buttons ── */
.vid3d-comp-btn,
.vid3d-textura-btn,
.vid3d-escena-btn,
.vid3d-comp-type-btn {
    padding: 5px 11px;
    background: #f4f6f8;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    transition: all .15s;
}
.vid3d-comp-btn:hover,
.vid3d-textura-btn:hover,
.vid3d-escena-btn:hover,
.vid3d-comp-type-btn:hover { border-color: #58CCB3; color: #092143; }
.vid3d-comp-btn.active,
.vid3d-textura-btn.active,
.vid3d-escena-btn.active,
.vid3d-comp-type-btn.active { background: #58CCB3; border-color: #58CCB3; color: #fff; }

/* ── Actions row (WhatsApp + PDF) ────────────────────── */
.vid3d-actions-row {
    flex-direction: row !important;
    gap: 6px !important;
}
.vid3d-actions-row .vid3d-whatsapp-btn {
    flex: 1;
    padding: 9px 12px;
    font-size: 0.78rem;
}
.vid3d-pdf-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1;
    padding: 9px 12px;
    background: #092143;
    color: #fff;
    border: none;
    border-radius: 35px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .18s, transform .12s;
}
.vid3d-pdf-btn:hover {
    background: #0d3366;
    transform: translateY(-1px);
}
.vid3d-pdf-btn svg { flex-shrink: 0; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
    .vid3d-wrapper {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        border-radius: 10px;
    }
    .vid3d-canvas-wrap {
        height: 55vh;
        height: 55dvh;
        flex: none;
        position: sticky;
        top: 0;
        z-index: 5;
    }
    .vid3d-panel {
        width: 100%;
        border-right: none;
        border-top: 2px solid #eee;
        padding: 16px;
        gap: 12px;
        overflow-y: visible;
        position: relative;
        z-index: 6;
    }
    .vid3d-panel-title { font-size: .95rem; }
    .vid3d-panel-subtitle { font-size: .72rem; }
    .vid3d-type-grid { grid-template-columns: repeat(2, 1fr); }
    .vid3d-dropdown-header { padding: 11px 12px; min-height: 40px; }
    .vid3d-dropdown-title { font-size: .84rem; }
    .vid3d-dropdown-body { padding: 8px 10px 12px; }
}

/* Dropdowns v5.0 eliminados — usa cfg3d-section (config-shared.css) */
.vid3d-disclaimer {
    font-size: .72rem;
    color: #999;
    line-height: 1.5;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

/* Borde azul marino para Parsol Gris activo */
.vid3d-type-btn.active[data-tipo="parsol_gris"] {
    border-color: #092143;
    box-shadow: 0 0 0 1px #092143 inset;
}

/* Botones sidebar y sticky CTA → movidos a config-shared.css */
