/* ==========================================================================
   modal_editor_3d.css - Estilos Scoped para el Modal de Estudio 3D (SPA)
   Tienda IORO - Idéntico en estética y componentes a visor_simple.css
   ========================================================================== */

/* --- 1. CONTENEDOR PRINCIPAL DEL MODAL FLOTANTE --- */
.modal-editor-3d {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background-color: #0b101e;
    z-index: 99999;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    touch-action: pan-x pan-y;
    opacity: 0;
    transform: translateY(100%);
    transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.28s ease;
    pointer-events: none;
    font-family: 'Space Grotesk', sans-serif;
    color: #f1f5f9;
    box-sizing: border-box;
}

.modal-editor-3d,
.modal-editor-3d * {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

.modal-editor-3d.activo {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Bloqueo de scroll en la tienda cuando el modal 3D está abierto */
body.modal-3d-abierto {
    overflow: hidden !important;
}

/* Ocultar barra de navegación inferior móvil cuando el modal está activo */
body.modal-3d-abierto .bottom-nav-bar,
body.modal-3d-abierto #bottomNavBar {
    display: none !important;
}

/* ==========================================================================
   BLINDAJE DE ICONOS FONT AWESOME 6 (EVITA EL ERROR DE CUADRADO / TOFU)
   ========================================================================== */
.modal-editor-3d i,
.modal-editor-3d span[class*="fa-"],
.modal-editor-3d [class*="fa-solid"],
.modal-editor-3d [class*="fa-regular"],
.modal-editor-3d [class*="fa-brands"],
.modal-editor-3d .fa,
.modal-editor-3d .fas,
.modal-editor-3d .far,
.modal-editor-3d .fab {
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    line-height: 1;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
}

.modal-editor-3d [class*="fa-solid"],
.modal-editor-3d .fa-solid,
.modal-editor-3d .fas {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
}

.modal-editor-3d [class*="fa-regular"],
.modal-editor-3d .fa-regular,
.modal-editor-3d .far {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 400 !important;
}

.modal-editor-3d [class*="fa-brands"],
.modal-editor-3d .fa-brands,
.modal-editor-3d .fab {
    font-family: "Font Awesome 6 Brands" !important;
    font-weight: 400 !important;
}

.modal-editor-3d i[class*="fa-"]::before,
.modal-editor-3d span[class*="fa-"]::before,
.modal-editor-3d [class*="fa-solid"]::before,
.modal-editor-3d [class*="fa-regular"]::before,
.modal-editor-3d [class*="fa-brands"]::before {
    font-family: inherit !important;
}

/* --- 2. PANTALLA DE CARGA INICIAL (LOADER 3D) --- */
.modal-editor-3d .loader-3d-modal {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, #131b2e 0%, #0b101e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.modal-editor-3d .loader-3d-modal.oculto {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.modal-editor-3d .loader-3d-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    max-width: 320px;
    padding: 24px;
}

.modal-editor-3d .loader-3d-spinner {
    font-size: 2.8rem;
    color: #d4af37;
    filter: drop-shadow(0 0 16px rgba(212, 175, 55, 0.6));
    margin-bottom: 4px;
}

.modal-editor-3d .loader-3d-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.4px;
    font-family: 'Space Grotesk', sans-serif;
}

.modal-editor-3d .loader-3d-subtitle {
    margin: 0;
    font-size: 0.88rem;
    color: #94a3b8;
}

.modal-editor-3d .loader-3d-progressbar {
    width: 220px;
    height: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 8px;
}

.modal-editor-3d .loader-3d-progressfill {
    width: 25%;
    height: 100%;
    background: linear-gradient(90deg, #d4af37, #fde047);
    border-radius: 10px;
    transition: width 0.3s ease;
    animation: loaderPulse 1.4s ease-in-out infinite alternate;
}

@keyframes loaderPulse {
    from { opacity: 0.8; }
    to { opacity: 1; }
}

/* --- 3. LIENZO CANVAS WEBGL 3D --- */
.modal-editor-3d .canvas-3d-modal-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    cursor: grab;
}

.modal-editor-3d .canvas-3d-modal-container:active {
    cursor: grabbing;
}

/* ==========================================================================
   2. HEADER SUPERIOR INTEGRADO - RÉPLICA EXACTA DE VISOR_SIMPLE.CSS
   ========================================================================== */
.modal-editor-3d .modal-3d-header {
    height: 120px;
    top: 0;
    left: 0;
    position: absolute;
    width: 100%;
    z-index: 1000;
    background-color: rgba(18, 18, 66, 0.5);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.062);
    pointer-events: none;
    margin: 0;
    padding: 0;
}

.modal-editor-3d .modal-3d-header > * {
    pointer-events: auto;
}

/* 2.1 Logo Empresa (Círculo grande a la izquierda) */
.modal-editor-3d #modalLogoEmpresa,
.modal-editor-3d .logo-empresa {
    position: absolute;
    top: 0px;
    height: 120px;
    width: 120px;
    left: 3%;
    background-color: rgba(14, 3, 3, 0.068);
    border-radius: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1002;
    cursor: pointer;
    border: none;
    box-shadow: none;
}

.modal-editor-3d #modalLogoEmpresa .logo-circle-link,
.modal-editor-3d .logo-empresa .logo-circle-link {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-editor-3d #modalLogoEmpresa img,
.modal-editor-3d .logo-empresa img {
    margin-top: 0px;
    width: 100%;
    height: 100%;
    background-color: transparent;
    border-radius: 40%;
    margin-left: 0px;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.modal-editor-3d #modalLogoEmpresa:hover img {
    transform: scale(1.05);
}

/* 2.2 Título / Logo Tipográfico de la Tienda */
.modal-editor-3d #modalHeaderTituloEnlace,
.modal-editor-3d .header-titulo-enlace {
    position: absolute;
    top: 15px;
    left: 175px;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    z-index: 1002;
    cursor: pointer;
}

.modal-editor-3d #modalTituloLogov {
    width: 160px;
    height: auto;
    display: block;
    object-fit: contain;
    border-radius: 10%;
    background-color: transparent;
    transition: opacity 0.2s ease;
}

.modal-editor-3d #modalHeaderTituloEnlace:hover #modalTituloLogov {
    opacity: 0.9;
}

/* 2.3 Buscador-Carrito y Carrito en Esquina Superior Derecha */
.modal-editor-3d .buscador-carrito {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 15px;
    margin-left: auto;
    margin-right: 85px;
    z-index: 1;
    pointer-events: none;
}

.modal-editor-3d .carrito-container {
    display: flex;
    align-items: center;
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    background-color: transparent;
    margin-right: 0px;
    z-index: 1002;
    cursor: pointer;
    pointer-events: auto;
}

.modal-editor-3d .carrito-container .carrito {
    position: relative;
    width: 45px;
    height: auto;
    cursor: pointer;
    filter: invert(100%);
    transition: transform 0.2s ease;
    display: block;
}

.modal-editor-3d .carrito-container:hover .carrito {
    transform: scale(1.05);
}

/* El número dentro del carrito (contador rojo visible en todo momento) */
.modal-editor-3d #modalNumeroCarrito {
    position: absolute;
    top: -8px;
    right: -8px;
    background: red !important;
    color: white !important;
    border-radius: 50% !important;
    width: 20px !important;
    height: 20px !important;
    font-size: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-family: 'Space Grotesk', sans-serif !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    pointer-events: none !important;
    z-index: 1005 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45) !important;
}

/* ==========================================================================
   2.4 BARRA SUPERIOR INTEGRADA (TOP BAR) - IDÉNTICA A VISOR_SIMPLE.CSS
   ========================================================================== */
.modal-editor-3d .visor-top-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 120px;
    z-index: 1001;
    pointer-events: none;
}

.modal-editor-3d .visor-top-bar > * {
    pointer-events: auto;
}

/* Botón Volver a la Tienda (Inmediatamente después del logo de la tienda) */
.modal-editor-3d .btn-visor-volver {
    position: absolute;
    left: 360px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #f1f5f9;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
    padding: 8px 18px;
    border-radius: 25px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
    transition: all 0.2s ease;
    cursor: pointer;
    z-index: 1005;
}

.modal-editor-3d .btn-visor-volver:hover {
    background: rgba(212, 175, 55, 0.25);
    border-color: rgba(212, 175, 55, 0.6);
    color: #d4af37;
    transform: translateY(-50%) scale(1.03);
}

.modal-editor-3d .btn-visor-volver:active {
    transform: translateY(-50%) scale(0.96);
}

/* Contenedor del Nombre del Producto, Precio y Talla (Centrado en el Header) */
.modal-editor-3d .visor-product-header {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(212, 175, 55, 0.35);
    padding: 8px 22px;
    border-radius: 28px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 1005;
}

.modal-editor-3d .visor-product-title {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
}

.modal-editor-3d .visor-product-price-pill {
    background: rgba(212, 175, 55, 0.2);
    color: #d4af37;
    border: 1px solid rgba(212, 175, 55, 0.45);
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 0.82rem;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    white-space: nowrap;
}

.modal-editor-3d .visor-product-size-pill {
    background: rgba(212, 175, 55, 0.15);
    color: #fde047;
    border: 1px solid rgba(212, 175, 55, 0.4);
    padding: 4px 12px;
    border-radius: 14px;
    font-size: 0.8rem;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-editor-3d .visor-product-size-pill:hover {
    background: rgba(212, 175, 55, 0.3);
    border-color: #d4af37;
    transform: scale(1.05);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.3);
}

.modal-editor-3d .visor-product-size-pill:active {
    transform: scale(0.96);
}

/* =======================================================
   DASHBOARD DE MODELOS PERSONALIZABLES (PC: LATERAL IZQUIERDO / MÓVIL: SUPERIOR)
   ======================================================= */
/* Versión PC / Computadora (> 768px): Dashboard lateral izquierdo con miniaturas grandes */
.modal-editor-3d .visor-sugerencias-container,
.visor-sugerencias-container {
    position: fixed;
    left: 24px;
    top: 130px;
    width: 250px;
    max-height: calc(100vh - 210px);
    z-index: 1004;
    pointer-events: auto;
    animation: slideInDashboardModal 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInDashboardModal {
    from {
        opacity: 0;
        transform: translateX(-25px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.modal-editor-3d .visor-sugerencias-inner,
.visor-sugerencias-inner {
    background: rgba(11, 16, 30, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(212, 175, 55, 0.32);
    border-radius: 20px;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55), 0 0 1px rgba(212, 175, 55, 0.4);
}

.modal-editor-3d .visor-sugerencias-header,
.visor-sugerencias-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 8px;
}

.modal-editor-3d .visor-sugerencias-title,
.visor-sugerencias-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.86rem;
    font-weight: 700;
    color: #d4af37;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-editor-3d .visor-sugerencias-title i,
.visor-sugerencias-title i {
    font-size: 0.95rem;
    color: #fde047;
    animation: magicPulseModal 2.5s infinite ease-in-out;
}

@keyframes magicPulseModal {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(253, 224, 71, 0.4)); }
    50% { transform: scale(1.15) rotate(8deg); filter: drop-shadow(0 0 6px rgba(253, 224, 71, 0.8)); }
}

.modal-editor-3d .txt-sugerencias-mobile,
.txt-sugerencias-mobile {
    display: none;
}

.modal-editor-3d .visor-sugerencias-subtitle,
.visor-sugerencias-subtitle {
    font-size: 0.72rem;
    color: #94a3b8;
    font-weight: 500;
}

.modal-editor-3d .visor-sugerencias-list,
.visor-sugerencias-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 280px);
    padding-right: 4px;
}

.modal-editor-3d .visor-sugerencias-list::-webkit-scrollbar,
.visor-sugerencias-list::-webkit-scrollbar {
    width: 4px;
}
.modal-editor-3d .visor-sugerencias-list::-webkit-scrollbar-track,
.visor-sugerencias-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
}
.modal-editor-3d .visor-sugerencias-list::-webkit-scrollbar-thumb,
.visor-sugerencias-list::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.35);
    border-radius: 4px;
}

/* Tarjeta / Item de producto en PC con foto GRANDE */
.modal-editor-3d .sugerencia-chip,
.sugerencia-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 8px 10px;
    color: #f1f5f9;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.modal-editor-3d .sugerencia-chip:hover,
.sugerencia-chip:hover {
    background: rgba(212, 175, 55, 0.14);
    border-color: rgba(212, 175, 55, 0.45);
    color: #ffffff;
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
}

.modal-editor-3d .sugerencia-chip:active,
.sugerencia-chip:active {
    transform: scale(0.98);
}

/* Chip del producto activo actualmente en PC */
.modal-editor-3d .sugerencia-chip.activo,
.sugerencia-chip.activo {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.28), rgba(212, 175, 55, 0.08));
    border: 1.5px solid #d4af37;
    box-shadow: 0 0 16px rgba(212, 175, 55, 0.3);
    cursor: default;
    pointer-events: none;
}

/* Miniatura GRANDE en PC (52px x 52px) */
.modal-editor-3d .sugerencia-chip-thumb,
.sugerencia-chip-thumb {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    overflow: hidden;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.modal-editor-3d .sugerencia-chip.activo .sugerencia-chip-thumb,
.sugerencia-chip.activo .sugerencia-chip-thumb {
    border-color: #d4af37;
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}

.modal-editor-3d .sugerencia-chip-thumb img,
.sugerencia-chip-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.modal-editor-3d .sugerencia-chip:hover .sugerencia-chip-thumb img,
.sugerencia-chip:hover .sugerencia-chip-thumb img {
    transform: scale(1.08);
}

.modal-editor-3d .sugerencia-chip-info,
.sugerencia-chip-info {
    display: flex;
    flex-direction: column;
    text-align: left;
    gap: 3px;
    flex: 1;
    min-width: 0;
}

.modal-editor-3d .sugerencia-chip-nombre,
.sugerencia-chip-nombre {
    font-size: 0.82rem;
    font-weight: 600;
    color: #f8fafc;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.modal-editor-3d .sugerencia-chip.activo .sugerencia-chip-nombre,
.sugerencia-chip.activo .sugerencia-chip-nombre {
    color: #ffffff;
    font-weight: 700;
}

.modal-editor-3d .sugerencia-chip-precio,
.sugerencia-chip-precio {
    font-size: 0.78rem;
    font-weight: 700;
    color: #d4af37;
    font-family: 'Space Grotesk', sans-serif;
}

.modal-editor-3d .sugerencia-chip-badge,
.sugerencia-chip-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: #d4af37;
    color: #0b101e;
    font-size: 0.55rem;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* Botones Flotantes de Control 3D (Reiniciar Cámara y Guía Tutorial) - Fuera del Header, debajo del Carrito */
.modal-editor-3d .visor-top-actions {
    position: absolute;
    top: 135px;
    right: 25px;
    width: 45px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 1005;
    pointer-events: auto;
}

.modal-editor-3d .btn-visor-action-round {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
    transition: all 0.2s ease;
}

.modal-editor-3d .btn-visor-action-round:hover {
    color: #ffffff;
    border-color: rgba(212, 175, 55, 0.5);
    background: rgba(30, 41, 59, 0.95);
    transform: scale(1.08);
}

.modal-editor-3d .btn-visor-action-round:active {
    transform: scale(0.94);
}

/* ==========================================================================
   3. STUDIO DOCK (BARRA INFERIOR FLOTANTE) - IDÉNTICO A VISOR_SIMPLE.CSS
   ========================================================================== */
.modal-editor-3d .visor-studio-dock,
.visor-studio-dock {
    position: absolute !important;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px)) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background: rgba(15, 23, 42, 0.88) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 40px !important;
    padding: 6px 10px !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    z-index: 5000 !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
    max-width: calc(100% - 24px) !important;
    pointer-events: auto !important;
}

.modal-editor-3d .dock-tab-btn,
.dock-tab-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 8px 14px;
    border-radius: 30px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 58px;
}

.modal-editor-3d .dock-tab-icon,
.dock-tab-icon {
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.modal-editor-3d .dock-tab-label,
.dock-tab-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    font-family: 'Space Grotesk', sans-serif;
}

.modal-editor-3d .dock-tab-btn:hover,
.dock-tab-btn:hover {
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.06);
}

.modal-editor-3d .dock-tab-btn.activo,
.dock-tab-btn.activo {
    background: rgba(212, 175, 55, 0.18);
    color: #d4af37;
    border: 1px solid rgba(212, 175, 55, 0.35);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.2);
}

.modal-editor-3d .dock-tab-btn.activo .dock-tab-icon,
.dock-tab-btn.activo .dock-tab-icon {
    transform: translateY(-2px);
}

.modal-editor-3d .dock-btn-checkout,
.dock-btn-checkout {
    background: linear-gradient(135deg, #d4af37, #b38f2a);
    color: #0b101e;
    border: none;
    border-radius: 30px;
    padding: 10px 20px;
    font-size: 0.92rem;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.45);
    transition: all 0.25s ease;
    margin-left: 6px;
    white-space: nowrap;
}

.modal-editor-3d .dock-btn-checkout:hover,
.dock-btn-checkout:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.6);
}

.modal-editor-3d .dock-btn-checkout:active,
.dock-btn-checkout:active {
    transform: scale(0.96);
}

.modal-editor-3d .dock-tab-badge,
.dock-tab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #d4af37;
    color: #0b101e;
    font-size: 0.65rem;
    font-weight: 800;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.7);
}

/* ==========================================================================
   4. STUDIO DRAWER (SUBPANEL EMERGENTE FLOTANTE) - IDÉNTICO A VISOR_SIMPLE.CSS
   ========================================================================== */
.modal-editor-3d .visor-studio-drawer,
.visor-studio-drawer {
    position: absolute !important;
    bottom: calc(92px + env(safe-area-inset-bottom, 0px)) !important;
    left: 50% !important;
    transform: translateX(-50%) translateY(20px) scale(0.96) !important;
    width: 420px !important;
    max-width: calc(100% - 24px) !important;
    background: rgba(20, 28, 41, 0.95) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 22px !important;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
    z-index: 5100 !important;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: calc(100vh - 180px) !important;
    display: flex !important;
    flex-direction: column !important;
}

.modal-editor-3d .visor-studio-drawer.abierto,
.visor-studio-drawer.abierto {
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: translateX(-50%) translateY(0) scale(1) !important;
}

.modal-editor-3d .drawer-header,
.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-editor-3d .drawer-title-box,
.drawer-title-box {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-editor-3d .drawer-icon,
.drawer-icon {
    color: #d4af37;
    font-size: 1.05rem;
}

.modal-editor-3d .drawer-title,
.drawer-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    color: #ffffff;
}

.modal-editor-3d .btn-close-drawer,
.btn-close-drawer {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1.15rem;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-editor-3d .btn-close-drawer:hover,
.btn-close-drawer:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.modal-editor-3d .drawer-body,
.drawer-body {
    padding: 16px 18px;
    overflow-y: auto;
}

.modal-editor-3d .drawer-body::-webkit-scrollbar,
.drawer-body::-webkit-scrollbar {
    width: 5px;
}
.modal-editor-3d .drawer-body::-webkit-scrollbar-track,
.drawer-body::-webkit-scrollbar-track {
    background: transparent;
}
.modal-editor-3d .drawer-body::-webkit-scrollbar-thumb,
.drawer-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

.modal-editor-3d .drawer-tool-panel,
.drawer-tool-panel {
    display: none;
}

.modal-editor-3d .drawer-tool-panel.activo,
.drawer-tool-panel.activo {
    display: block;
    animation: fadeInTool 0.25s ease-out;
}

@keyframes fadeInTool {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-editor-3d .tool-section-desc,
.tool-section-desc {
    font-size: 0.82rem;
    color: #94a3b8;
    margin-bottom: 12px;
    text-align: left;
    font-weight: 500;
}

/* ==========================================================================
   5. CONTENIDOS DE CADA PESTAÑA DEL DRAWER - IDÉNTICO A VISOR_SIMPLE.CSS
   ========================================================================== */

/* --- 1. PALETA DE COLORES --- */
.modal-editor-3d .paleta-colores,
.paleta-colores {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 6px 0;
}

.modal-editor-3d .color-swatch,
.color-swatch {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.modal-editor-3d .color-swatch:hover,
.color-swatch:hover {
    transform: scale(1.12);
}

.modal-editor-3d .color-swatch.activo,
.color-swatch.activo {
    border-color: #d4af37;
    transform: scale(1.18);
    box-shadow: 0 0 14px rgba(212, 175, 55, 0.6);
}

.modal-editor-3d .color-swatch.activo::after,
.color-swatch.activo::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free' !important;
    font-weight: 900 !important;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.8rem;
    color: #ffffff;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.9));
}

/* --- 2. SUBIDA DE IMÁGENES / LOGO --- */
.modal-editor-3d .image-tools-modern,
.image-tools-modern {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-editor-3d .btn-subir-modern,
.btn-subir-modern {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(212, 175, 55, 0.05));
    border: 1px dashed rgba(212, 175, 55, 0.5);
    color: #d4af37;
    padding: 14px;
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 700;
    font-size: 0.92rem;
    transition: all 0.25s ease;
    text-align: center;
}

.modal-editor-3d .btn-subir-modern:hover,
.btn-subir-modern:hover {
    background: rgba(212, 175, 55, 0.25);
    border-style: solid;
    transform: translateY(-2px);
}

.modal-editor-3d .btn-subir-modern:active,
.btn-subir-modern:active {
    transform: scale(0.98);
}

.modal-editor-3d .btn-subir-modern i,
.btn-subir-modern i {
    font-size: 1.25rem;
}

.modal-editor-3d .miniaturas-container-modern,
.miniaturas-container-modern {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 6px 2px 10px 2px;
    justify-content: flex-start;
}

.modal-editor-3d .miniaturas-container-modern::-webkit-scrollbar,
.miniaturas-container-modern::-webkit-scrollbar {
    height: 4px;
}
.modal-editor-3d .miniaturas-container-modern::-webkit-scrollbar-thumb,
.miniaturas-container-modern::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

/* Badges de precios para zonas de personalización */
.modal-editor-3d .badge-zona-precio,
.badge-zona-precio {
    font-size: 0.62rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 8px;
    margin-top: 3px;
    text-align: center;
    white-space: nowrap;
    letter-spacing: 0.2px;
    transition: all 0.25s ease;
    display: inline-block;
}

.modal-editor-3d .badge-zona-precio.incluido,
.badge-zona-precio.incluido {
    background: rgba(34, 197, 94, 0.18);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.45);
}

.modal-editor-3d .badge-zona-precio.extra,
.badge-zona-precio.extra {
    background: rgba(212, 175, 55, 0.15);
    color: #d4af37;
    border: 1px solid rgba(212, 175, 55, 0.35);
}

.modal-editor-3d .badge-zona-precio.activa,
.badge-zona-precio.activa {
    background: rgba(59, 130, 246, 0.3);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.7);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}

/* Animación de pulso cuando cambia el precio */
@keyframes precioPulse {
    0% {
        transform: scale(1);
    }
    40% {
        transform: scale(1.18);
        background: rgba(212, 175, 55, 0.45);
        border-color: #d4af37;
        box-shadow: 0 0 18px rgba(212, 175, 55, 0.75);
    }
    100% {
        transform: scale(1);
    }
}

.modal-editor-3d .precio-pulsando,
.precio-pulsando {
    animation: precioPulse 0.45s ease-out forwards;
}

/* Botones de acción flotantes en miniaturas (Ojo / Ocultar y Borrar) */
.modal-editor-3d .btn-thumb-action,
.btn-thumb-action {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    transition: all 0.2s ease;
    z-index: 5;
    padding: 0;
}

.modal-editor-3d .btn-thumb-eye,
.btn-thumb-eye {
    top: -6px;
    right: -6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.modal-editor-3d .btn-thumb-eye.is-visible,
.btn-thumb-eye.is-visible {
    background: #0284c7;
    color: #ffffff;
}

.modal-editor-3d .btn-thumb-eye.is-visible:hover,
.btn-thumb-eye.is-visible:hover {
    background: #0369a1;
    transform: scale(1.15);
}

.modal-editor-3d .btn-thumb-eye.is-hidden,
.btn-thumb-eye.is-hidden {
    background: #475569;
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.modal-editor-3d .btn-thumb-eye.is-hidden:hover,
.btn-thumb-eye.is-hidden:hover {
    background: #64748b;
    color: #ffffff;
    transform: scale(1.15);
}

.modal-editor-3d .btn-thumb-delete,
.btn-thumb-delete {
    top: -6px;
    left: -6px;
    background: #ef4444;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.modal-editor-3d .btn-thumb-delete:hover,
.btn-thumb-delete:hover {
    background: #dc2626;
    transform: scale(1.15);
}

/* Estado de imagen miniatura oculta */
.modal-editor-3d .thumb-wrapper-item.thumb-oculto,
.thumb-wrapper-item.thumb-oculto {
    opacity: 0.75;
}

.modal-editor-3d .thumb-inner-box.thumb-img-oculta img,
.thumb-inner-box.thumb-img-oculta img {
    opacity: 0.35;
    filter: grayscale(85%);
}

.modal-editor-3d .thumb-overlay-oculto,
.thumb-overlay-oculto {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f43f5e;
    font-size: 14px;
    border-radius: 6px;
    pointer-events: none;
}

/* Toolbar de visibilidad de fotos */
.modal-editor-3d .visibilidad-fotos-toolbar,
.visibilidad-fotos-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 6px 12px;
    margin-top: 2px;
    margin-bottom: 4px;
}

.modal-editor-3d .visibilidad-toolbar-label,
.visibilidad-toolbar-label {
    font-size: 0.76rem;
    font-weight: 600;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
}

.modal-editor-3d .visibilidad-toolbar-label i,
.visibilidad-toolbar-label i {
    color: #38bdf8;
}

.modal-editor-3d .btn-toggle-global-visibilidad,
.btn-toggle-global-visibilidad {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #38bdf8;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.modal-editor-3d .btn-toggle-global-visibilidad:hover,
.btn-toggle-global-visibilidad:hover {
    background: rgba(56, 189, 248, 0.22);
    color: #ffffff;
    border-color: #38bdf8;
}

/* Controles de Escala / Tamaño */
.modal-editor-3d .controles-escala-box,
.controles-escala-box {
    background: rgba(11, 16, 30, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 12px 14px;
    margin-top: 10px;
}

.modal-editor-3d .slider-header-row,
.slider-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #94a3b8;
    margin-bottom: 8px;
    font-weight: 600;
}

.modal-editor-3d .slider-modern,
.slider-modern {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.12);
    outline: none;
}

.modal-editor-3d .slider-modern::-webkit-slider-thumb,
.slider-modern::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #d4af37;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.7);
    transition: transform 0.15s ease;
}

.modal-editor-3d .slider-modern::-webkit-slider-thumb:hover,
.slider-modern::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* --- 3. DISEÑOS DE FONDO Y ESTAMPADOS --- */
.modal-editor-3d .banner-vista-fondo,
.banner-vista-fondo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.12) 0%, rgba(14, 165, 233, 0.05) 100%);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 12px;
    gap: 10px;
}

.modal-editor-3d .banner-vista-fondo-info,
.banner-vista-fondo-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-editor-3d .banner-vista-fondo-info i,
.banner-vista-fondo-info i {
    font-size: 1.2rem;
    color: #38bdf8;
}

.modal-editor-3d .banner-vista-title,
.banner-vista-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #f8fafc;
}

.modal-editor-3d .banner-vista-subtitle,
.banner-vista-subtitle {
    font-size: 0.72rem;
    color: #94a3b8;
}

.modal-editor-3d .btn-switch-ver-fondo,
.btn-switch-ver-fondo {
    background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    font-family: inherit;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
    white-space: nowrap;
    flex-shrink: 0;
}

.modal-editor-3d .btn-switch-ver-fondo:hover,
.btn-switch-ver-fondo:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.45);
}

.modal-editor-3d .paleta-fondos-modern,
.paleta-fondos-modern {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    max-height: 250px;
    overflow-y: auto;
    padding: 4px 2px;
}

.modal-editor-3d .paleta-fondos-modern::-webkit-scrollbar,
.paleta-fondos-modern::-webkit-scrollbar {
    width: 4px;
}
.modal-editor-3d .paleta-fondos-modern::-webkit-scrollbar-thumb,
.paleta-fondos-modern::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.modal-editor-3d .bg-swatch,
.bg-swatch {
    background: #141c29;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 6px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    text-align: center;
}

.modal-editor-3d .bg-swatch:hover,
.bg-swatch:hover {
    transform: translateY(-2px);
    border-color: rgba(212, 175, 55, 0.4);
    background: #1e293b;
}

.modal-editor-3d .bg-swatch.activo,
.bg-swatch.activo {
    border-color: #d4af37;
    background: rgba(212, 175, 55, 0.12);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.3);
}

.modal-editor-3d .bg-swatch-thumb,
.bg-swatch-thumb {
    width: 100%;
    height: 52px;
    border-radius: 8px;
    overflow: hidden;
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-editor-3d .bg-swatch-thumb img,
.bg-swatch-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-editor-3d .bg-swatch-empty,
.bg-swatch-empty {
    color: #94a3b8;
    font-size: 1.2rem;
    border: 1px dashed rgba(255, 255, 255, 0.2);
}

.modal-editor-3d .bg-swatch-name,
.bg-swatch-name {
    font-size: 0.72rem;
    font-weight: 600;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.modal-editor-3d .bg-swatch.activo .bg-swatch-name,
.bg-swatch.activo .bg-swatch-name {
    color: #d4af37;
}

/* --- 4. TEXTO PERSONALIZADO --- */
.modal-editor-3d .texto-input-wrapper,
.texto-input-wrapper {
    margin-bottom: 12px;
}

.modal-editor-3d .input-texto-modern,
.input-texto-modern {
    width: 100%;
    background: #0f172a;
    color: #ffffff;
    border: 1px solid #475569;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.modal-editor-3d .input-texto-modern:focus,
.input-texto-modern:focus {
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

/* --- 4.1 GENERADOR DE FRASES E INSPIRACIÓN CON IA --- */
.modal-editor-3d .ia-frases-container,
.ia-frases-container {
    margin: 10px 0 14px 0 !important;
    background: linear-gradient(145deg, rgba(20, 28, 41, 0.95), rgba(15, 23, 42, 0.9)) !important;
    border: 1px solid rgba(212, 175, 55, 0.35) !important;
    border-radius: 14px !important;
    padding: 12px 14px !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35) !important;
    text-align: left !important;
    display: block !important;
}

.modal-editor-3d .ia-frases-header,
.ia-frases-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-bottom: 8px !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
}

.modal-editor-3d .ia-badge,
.ia-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.25), rgba(212, 175, 55, 0.1)) !important;
    color: #d4af37 !important;
    font-size: 0.74rem !important;
    font-weight: 700 !important;
    font-family: 'Space Grotesk', sans-serif !important;
    padding: 3px 8px !important;
    border-radius: 20px !important;
    border: 1px solid rgba(212, 175, 55, 0.4) !important;
    letter-spacing: 0.5px !important;
    text-transform: uppercase !important;
}

.modal-editor-3d .ia-subtitulo,
.ia-subtitulo {
    font-size: 0.74rem !important;
    color: #94a3b8 !important;
}

.modal-editor-3d .ia-temas-chips,
.ia-temas-chips {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    margin-bottom: 10px !important;
}

.modal-editor-3d .ia-chip-btn,
.ia-chip-btn {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #cbd5e1 !important;
    font-size: 0.74rem !important;
    padding: 5px 9px !important;
    border-radius: 14px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    font-family: 'Montserrat', sans-serif !important;
    line-height: 1 !important;
}

.modal-editor-3d .ia-chip-btn:hover,
.ia-chip-btn:hover {
    background: rgba(212, 175, 55, 0.18) !important;
    border-color: rgba(212, 175, 55, 0.45) !important;
    color: #fff !important;
    transform: translateY(-1px) !important;
}

.modal-editor-3d .ia-chip-btn.activo,
.ia-chip-btn.activo {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.35), rgba(212, 175, 55, 0.18)) !important;
    border-color: #d4af37 !important;
    color: #fef08a !important;
    font-weight: 600 !important;
}

.modal-editor-3d .ia-input-custom-row,
.ia-input-custom-row {
    display: flex !important;
    gap: 6px !important;
    margin-bottom: 6px !important;
}

.modal-editor-3d .input-ia-custom,
.input-ia-custom {
    flex: 1 !important;
    background: rgba(0, 0, 0, 0.35) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    border-radius: 8px !important;
    padding: 7px 10px !important;
    color: #fff !important;
    font-size: 0.8rem !important;
    outline: none !important;
    transition: border-color 0.2s !important;
}

.modal-editor-3d .input-ia-custom:focus,
.input-ia-custom:focus {
    border-color: #d4af37 !important;
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.2) !important;
}

.modal-editor-3d .btn-generar-ia,
.btn-generar-ia {
    background: linear-gradient(135deg, #d4af37, #b38f2a) !important;
    color: #0b101e !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 7px 14px !important;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    font-family: 'Space Grotesk', sans-serif !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    transition: all 0.2s !important;
    white-space: nowrap !important;
}

.modal-editor-3d .btn-generar-ia:hover,
.btn-generar-ia:hover {
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.45) !important;
    transform: translateY(-1px) !important;
}

.modal-editor-3d .btn-generar-ia:disabled,
.btn-generar-ia:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

.modal-editor-3d .ia-frases-resultados,
.ia-frases-resultados {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    margin-top: 8px !important;
    animation: fadeIn 0.3s ease-out !important;
}

.modal-editor-3d .ia-frase-card,
.ia-frase-card {
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 8px !important;
    padding: 8px 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    text-align: left !important;
}

.modal-editor-3d .ia-frase-card:hover,
.ia-frase-card:hover {
    background: rgba(212, 175, 55, 0.12) !important;
    border-color: rgba(212, 175, 55, 0.4) !important;
    transform: translateX(2px) !important;
}

.modal-editor-3d .ia-frase-card.seleccionada,
.ia-frase-card.seleccionada {
    background: rgba(212, 175, 55, 0.22) !important;
    border-color: #d4af37 !important;
}

.modal-editor-3d .ia-frase-text,
.ia-frase-text {
    font-size: 0.8rem !important;
    color: #e2e8f0 !important;
    font-style: italic !important;
    flex: 1 !important;
    line-height: 1.3 !important;
}

.modal-editor-3d .btn-usar-frase,
.btn-usar-frase {
    background: transparent !important;
    border: 1px solid rgba(212, 175, 55, 0.4) !important;
    color: #d4af37 !important;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    padding: 3px 8px !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    transition: all 0.2s !important;
}

.modal-editor-3d .ia-frase-card:hover .btn-usar-frase,
.ia-frase-card:hover .btn-usar-frase {
    background: #d4af37 !important;
    color: #0b101e !important;
}

/* --- 4.2 GENERADOR DE STICKERS E ILUSTRACIONES CON IA --- */
.modal-editor-3d .ia-stickers-box,
.ia-stickers-box {
    margin: 12px 0 10px 0 !important;
    background: linear-gradient(145deg, rgba(20, 28, 41, 0.95), rgba(15, 23, 42, 0.9)) !important;
    border: 1px dashed rgba(212, 175, 55, 0.45) !important;
    border-radius: 14px !important;
    padding: 12px 14px !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35) !important;
    text-align: left !important;
    display: block !important;
}

.modal-editor-3d .btn-sticker-chip,
.btn-sticker-chip {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #cbd5e1 !important;
    font-size: 0.72rem !important;
    padding: 4px 8px !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    line-height: 1.2 !important;
    font-family: 'Montserrat', sans-serif !important;
}

.modal-editor-3d .btn-sticker-chip:hover,
.btn-sticker-chip:hover {
    background: rgba(212, 175, 55, 0.18) !important;
    border-color: rgba(212, 175, 55, 0.45) !important;
    color: #fff !important;
    transform: translateY(-1px) !important;
}

.modal-editor-3d .texto-config-grid,
.texto-config-grid {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 10px;
    margin-bottom: 12px;
}

.modal-editor-3d .texto-config-item,
.texto-config-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    text-align: left;
}

.modal-editor-3d .texto-config-item label,
.texto-config-item label {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.modal-editor-3d .color-picker-wrapper,
.color-picker-wrapper {
    width: 100%;
    height: 38px;
    background: #0f172a;
    border: 1px solid #475569;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 2px;
}

.modal-editor-3d .color-picker-wrapper input[type="color"],
.color-picker-wrapper input[type="color"] {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    cursor: pointer;
}

.modal-editor-3d .select-fuente-modern,
.select-fuente-modern {
    width: 100%;
    height: 38px;
    background: #0f172a;
    color: #ffffff;
    border: 1px solid #475569;
    border-radius: 8px;
    padding: 0 10px;
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    cursor: pointer;
}

.modal-editor-3d .select-fuente-modern:focus,
.select-fuente-modern:focus {
    border-color: #d4af37;
}

.modal-editor-3d .posicion-texto-box,
.posicion-texto-box {
    background: rgba(11, 16, 30, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 10px 12px;
    text-align: left;
}

.modal-editor-3d .posicion-lbl,
.posicion-lbl {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.modal-editor-3d .posicion-btns-group,
.posicion-btns-group {
    display: flex;
    gap: 8px;
}

.modal-editor-3d .btn-alinear,
.modal-editor-3d .btn-alinear-texto,
.btn-alinear,
.btn-alinear-texto {
    flex: 1;
    background: rgba(30, 41, 59, 0.8);
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.modal-editor-3d .btn-alinear:hover,
.modal-editor-3d .btn-alinear-texto:hover,
.btn-alinear:hover,
.btn-alinear-texto:hover {
    color: #ffffff;
    background: rgba(51, 65, 85, 0.8);
}

.modal-editor-3d .btn-alinear.activo,
.modal-editor-3d .btn-alinear-texto.activo,
.btn-alinear.activo,
.btn-alinear-texto.activo {
    background: rgba(212, 175, 55, 0.2);
    color: #d4af37;
    border-color: rgba(212, 175, 55, 0.45);
}

/* --- 5. SELECTOR DE TALLAS INTERACTIVO --- */
.modal-editor-3d .talla-selector-wrapper,
.talla-selector-wrapper {
    width: 100%;
    margin-top: 6px;
}

.modal-editor-3d .tallas-grid-modern,
.tallas-grid-modern {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 10px;
    margin-top: 8px;
    margin-bottom: 12px;
}

.modal-editor-3d .btn-talla-chip,
.modal-editor-3d .chip-talla-modern,
.btn-talla-chip,
.chip-talla-modern {
    background: rgba(15, 23, 42, 0.85);
    border: 1.5px solid rgba(255, 255, 255, 0.14);
    color: #f1f5f9;
    border-radius: 12px;
    padding: 12px 6px;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 52px;
    user-select: none;
    font-family: inherit;
}

.modal-editor-3d .btn-talla-chip:hover,
.modal-editor-3d .chip-talla-modern:hover,
.btn-talla-chip:hover,
.chip-talla-modern:hover {
    border-color: rgba(212, 175, 55, 0.5);
    background: rgba(30, 41, 59, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.modal-editor-3d .btn-talla-chip:active,
.modal-editor-3d .chip-talla-modern:active,
.btn-talla-chip:active,
.chip-talla-modern:active {
    transform: translateY(0) scale(0.96);
}

.modal-editor-3d .btn-talla-chip.activo,
.modal-editor-3d .chip-talla-modern.activo,
.btn-talla-chip.activo,
.chip-talla-modern.activo {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.28), rgba(212, 175, 55, 0.12));
    border: 2px solid #d4af37;
    color: #fde047;
    box-shadow: 0 0 16px rgba(212, 175, 55, 0.4);
    transform: translateY(-2px);
}

.modal-editor-3d .btn-talla-chip .talla-check-icon,
.btn-talla-chip .talla-check-icon {
    font-size: 0.65rem;
    color: #d4af37;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.modal-editor-3d .btn-talla-chip.activo .talla-check-icon,
.btn-talla-chip.activo .talla-check-icon {
    opacity: 1;
}

.modal-editor-3d .shake-talla,
.shake-talla {
    animation: shakeTallaAnim 0.5s ease-in-out;
}

@keyframes shakeTallaAnim {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

.modal-editor-3d .dock-tab-badge,
.dock-tab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #d4af37;
    color: #0b101e;
    font-size: 0.62rem;
    font-weight: 800;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 6px rgba(212, 175, 55, 0.8);
}

.modal-editor-3d .talla-info-box,
.talla-info-box {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.35);
    color: #4ade80;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    animation: fadeInTalla 0.25s ease;
}

@keyframes fadeInTalla {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   6. RESPONSIVE (MÓVIL Y TABLET) - IDÉNTICO A VISOR_SIMPLE.CSS
   ========================================================================== */
@media (max-width: 1200px) {
    .modal-editor-3d .btn-visor-volver {
        left: 310px;
        padding: 7px 14px;
        font-size: 0.82rem;
    }
    .modal-editor-3d .visor-product-title {
        max-width: 200px;
    }
}

@media (max-width: 950px) {
    .modal-editor-3d .btn-visor-volver {
        left: 270px;
        padding: 7px 12px;
        font-size: 0.8rem;
    }
    .modal-editor-3d .visor-product-title {
        max-width: 160px;
    }
}

@media (max-width: 768px) {
    .modal-editor-3d .modal-3d-header {
        height: 60px !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        pointer-events: none !important;
        padding: 0 !important;
        display: block !important;
    }

    .modal-editor-3d .modal-3d-header > * {
        pointer-events: auto !important;
    }

    .modal-editor-3d #modalLogoEmpresa,
    .modal-editor-3d .logo-empresa {
        width: 40px !important;
        height: 40px !important;
        top: 10px !important;
        left: 10px !important;
        background: rgba(15, 23, 42, 0.85) !important;
        border: 1px solid rgba(255, 255, 255, 0.18) !important;
        border-radius: 50% !important;
        padding: 2px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        z-index: 1005 !important;
    }

    .modal-editor-3d #modalLogoEmpresa img,
    .modal-editor-3d .logo-empresa img {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
        border-radius: 50% !important;
    }

    .modal-editor-3d #modalHeaderTituloEnlace,
    .modal-editor-3d .header-titulo-enlace {
        display: none !important;
    }

    .modal-editor-3d .visor-top-bar {
        height: 105px !important;
        pointer-events: none !important;
    }

    .modal-editor-3d .btn-visor-volver {
        left: 58px !important;
        top: 10px !important;
        height: 40px !important;
        transform: none !important;
        padding: 6px 14px !important;
        font-size: 0.80rem !important;
        border-radius: 20px !important;
        background: rgba(15, 23, 42, 0.88) !important;
        border: 1px solid rgba(255, 255, 255, 0.18) !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 6px !important;
        z-index: 1005 !important;
    }

    .modal-editor-3d .btn-visor-volver:hover {
        transform: none !important;
    }

    .modal-editor-3d .btn-visor-volver span {
        display: inline !important;
    }

    .modal-editor-3d .carrito-container {
        position: fixed !important;
        top: 10px !important;
        right: 12px !important;
        transform: none !important;
        z-index: 1005 !important;
    }

    .modal-editor-3d .carrito-container .carrito {
        width: 38px !important;
    }

    .modal-editor-3d .visor-product-header {
        left: 50% !important;
        top: 58px !important;
        bottom: auto !important;
        transform: translateX(-50%) !important;
        padding: 5px 14px !important;
        max-width: calc(100% - 20px) !important;
        border-radius: 20px !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 8px !important;
        z-index: 1005 !important;
    }

    .modal-editor-3d .visor-product-title {
        max-width: 160px !important;
        font-size: 0.82rem !important;
    }

    /* Barra / Dashboard de Sugerencias en Móvil: Flotante Centrado bajo el Pill */
    .modal-editor-3d .visor-sugerencias-container,
    .visor-sugerencias-container {
        position: absolute !important;
        left: 50% !important;
        top: 95px !important;
        transform: translateX(-50%) !important;
        width: calc(100% - 20px) !important;
        max-width: 480px !important;
        max-height: none !important;
        z-index: 1004 !important;
        animation: fadeInSugerenciasModal 0.4s ease-out !important;
    }

    @keyframes fadeInSugerenciasModal {
        from { opacity: 0; transform: translate(-50%, -8px); }
        to { opacity: 1; transform: translate(-50%, 0); }
    }

    .modal-editor-3d .visor-sugerencias-inner,
    .visor-sugerencias-inner {
        flex-direction: row !important;
        padding: 4px 6px 4px 8px !important;
        gap: 6px !important;
        border-radius: 20px !important;
        justify-content: flex-start !important;
        align-items: center !important;
    }

    .modal-editor-3d .visor-sugerencias-header,
    .visor-sugerencias-header {
        border-bottom: none !important;
        padding-bottom: 0 !important;
        flex-shrink: 0 !important;
        flex-direction: row !important;
        align-items: center !important;
    }

    .modal-editor-3d .visor-sugerencias-title,
    .visor-sugerencias-title {
        font-size: 0.68rem !important;
        gap: 4px !important;
    }

    .modal-editor-3d .txt-sugerencias-desktop,
    .txt-sugerencias-desktop {
        display: none !important;
    }

    .modal-editor-3d .txt-sugerencias-mobile,
    .txt-sugerencias-mobile {
        display: none !important;
    }

    .modal-editor-3d .visor-sugerencias-subtitle,
    .visor-sugerencias-subtitle {
        display: none !important;
    }

    .modal-editor-3d .visor-sugerencias-list,
    .visor-sugerencias-list {
        flex-direction: row !important;
        gap: 6px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        max-height: none !important;
        scrollbar-width: none !important;
        -webkit-overflow-scrolling: touch !important;
        padding-right: 0 !important;
    }

    .modal-editor-3d .visor-sugerencias-list::-webkit-scrollbar,
    .visor-sugerencias-list::-webkit-scrollbar {
        display: none !important;
    }

    .modal-editor-3d .sugerencia-chip,
    .sugerencia-chip {
        padding: 2px 8px 2px 3px !important;
        gap: 5px !important;
        border-radius: 16px !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        width: auto !important;
    }

    .modal-editor-3d .sugerencia-chip:hover,
    .sugerencia-chip:hover {
        transform: none !important;
    }

    .modal-editor-3d .sugerencia-chip-thumb,
    .sugerencia-chip-thumb {
        width: 24px !important;
        height: 24px !important;
        border-radius: 50% !important;
    }

    .modal-editor-3d .sugerencia-chip-nombre,
    .sugerencia-chip-nombre {
        font-size: 0.70rem !important;
        max-width: 80px !important;
        display: inline-block !important;
        white-space: nowrap !important;
    }

    .modal-editor-3d .sugerencia-chip-precio,
    .sugerencia-chip-precio {
        font-size: 0.64rem !important;
    }

    .modal-editor-3d .sugerencia-chip-badge,
    .sugerencia-chip-badge {
        position: static !important;
        font-size: 0.52rem !important;
        margin-left: 2px !important;
        padding: 1px 4px !important;
    }

    .modal-editor-3d .visor-top-actions,
    .visor-top-actions {
        position: absolute !important;
        top: 148px !important;
        right: 12px !important;
        width: 38px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 8px !important;
        z-index: 1005 !important;
        pointer-events: auto !important;
    }

    .modal-editor-3d #modalNumeroCarrito {
        top: -4px !important;
        right: -4px !important;
        background: red !important;
        color: white !important;
        font-size: 11px !important;
        font-weight: 700 !important;
        width: 18px !important;
        height: 18px !important;
        min-width: 18px !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        pointer-events: none !important;
        z-index: 1005 !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45) !important;
    }

    .modal-editor-3d .btn-visor-action-round {
        width: 36px !important;
        height: 36px !important;
        font-size: 0.9rem !important;
    }

    .modal-editor-3d .visor-studio-dock,
    .visor-studio-dock {
        bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
        width: calc(100% - 16px) !important;
        padding: 5px 6px !important;
        gap: 4px !important;
        justify-content: space-around !important;
        border-radius: 28px !important;
    }

    .modal-editor-3d .dock-tab-btn,
    .dock-tab-btn {
        padding: 6px 6px !important;
        min-width: 46px !important;
        flex: 1 !important;
        border-radius: 20px !important;
    }

    .modal-editor-3d .dock-tab-icon,
    .dock-tab-icon {
        font-size: 1.05rem !important;
    }

    .modal-editor-3d .dock-tab-label,
    .dock-tab-label {
        font-size: 0.65rem !important;
    }

    .modal-editor-3d .dock-btn-checkout,
    .dock-btn-checkout {
        padding: 8px 14px !important;
        font-size: 0.82rem !important;
        border-radius: 22px !important;
        margin-left: 2px !important;
        flex-shrink: 0 !important;
    }

    .modal-editor-3d .btn-checkout-text,
    .btn-checkout-text {
        font-size: 0.8rem !important;
    }

    .modal-editor-3d .visor-studio-drawer,
    .visor-studio-drawer {
        bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
        width: calc(100% - 16px) !important;
        max-height: 55vh !important;
        border-radius: 18px !important;
    }

    .modal-editor-3d .drawer-body,
    .drawer-body {
        max-height: calc(55vh - 55px) !important;
        padding: 12px 14px !important;
    }
}

@media (max-width: 420px) {
    .modal-editor-3d .dock-tab-btn,
    .dock-tab-btn {
        padding: 5px 3px !important;
        min-width: 40px !important;
    }

    .modal-editor-3d .dock-tab-label,
    .dock-tab-label {
        font-size: 0.60rem !important;
    }

    .modal-editor-3d .dock-tab-icon,
    .dock-tab-icon {
        font-size: 0.95rem !important;
    }

    .modal-editor-3d .dock-btn-checkout,
    .dock-btn-checkout {
        padding: 7px 10px !important;
        font-size: 0.78rem !important;
        gap: 4px !important;
    }

    .modal-editor-3d .btn-visor-volver {
        padding: 5px 10px !important;
        font-size: 0.76rem !important;
    }

    .modal-editor-3d .visor-product-title {
        max-width: 130px !important;
    }
}

/* ==========================================================================
   7. PRIORIDAD DE LA CESTA DE COMPRAS SOBRE EL MODAL 3D
   ========================================================================== */
#contenedorCompra.contenedorCompra:not(.none),
.contenedorCompra:not(.none) {
    z-index: 100005 !important;
}
