/* ===== RESET Y BASE ===== */
body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: Arial, sans-serif;
    height: 100vh;
}

/* ===== HEADER - MANTENER GROSOR ===== */
#LogoImg {
    width: 120px;
    height: auto;
}

.div1-header {
    background-color: #008B8B;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    height: 70px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

#Titulo {
    width: 290px;
    height: auto;
}

.project-name input {
    background: rgba(33, 229, 255, 0.8);
    border: 2px solid rgba(33, 229, 255, 0.8);
    color: #333;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 1rem;
    width: 250px;
    text-align: center;
    transition: all 0.3s ease;
}

.project-name input:focus {
    outline: none;
    border-color: #4ecdc4;
    background: white;
    box-shadow: 0 0 10px rgba(78, 205, 196, 0.3);
}

/* ===== LAYOUT PRINCIPAL - BAJADO ===== */
.main-container {
    display: grid;
    grid-template-columns: 250px 1fr 280px;
    grid-template-rows: 1fr;
    gap: 0;
    height: calc(100vh - 70px);
    padding: 0;
    margin: 0;
    position: fixed;
    top: 100px; /* Empieza justo debajo del header */
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
}

/* ===== PANEL IZQUIERDO ===== */
.left-panel {
    background: #008B8B;
    padding: 0;
    overflow-y: auto;
    height: 100%;
    margin: 0;
}

/* Reset completo para eliminar espacios */
.left-panel > *:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.tool-section {
    border-bottom: 1px solid #005db9;
    margin: 0;
}

.tool-section:first-child {
    border-top: none;
}

.tool-section:last-child {
    border-bottom: none;
}

/* BOTONES CON GROSOR MANTENIDO */
.tool-section-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #00ffff, #008B8B);
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 1rem;
    position: relative;
    margin: 0;
}

.tool-section-btn:hover {
    background: linear-gradient(135deg, #02c9c9, #009999);
    transform: translateX(5px);
}

.tool-section-btn.active {
    background: linear-gradient(135deg, #008B8B, #006666);
    box-shadow: inset 3px 0 0 #00e6e6;
}

.tool-section-btn::after {
    content: "▶";
    position: absolute;
    right: 20px;
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.tool-section-btn.active::after {
    transform: rotate(90deg);
}

.section-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.section-text {
    flex: 1;
    text-align: left;
}

.section-content {
    display: none;
    padding: 15px 20px;
    background: #008B8B;
    border-top: 1px solid #005db9;
    animation: fadeIn 0.3s ease;
    margin: 0;
}

.tool-section-btn.active + .section-content {
    display: block;
}

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

/* Contenido paneles izquierdo */
.upload-panel, .elements-panel {
    background: #00ffff8f;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #e9ecef;
    color: white;
    margin: 0;
}

.upload-panel h4, .elements-panel h4 {
    margin-bottom: 15px;
    color: white;
    font-size: 1rem;
}

.upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.upload-area:hover {
    border-color: #4ecdc4;
    background: rgba(78, 205, 196, 0.05);
}

.upload-placeholder .upload-icon {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
    color: #6c757d;
}

.upload-placeholder p {
    margin: 0 0 8px 0;
    color: #495057;
    font-weight: 500;
}

.upload-placeholder small {
    color: #6c757d;
}

.elements-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.element-item {
    padding: 10px;
    background: rgb(26, 209, 200);
    border: 1px solid #e9ecef;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    color: #2c3e50;
    font-weight: 500;
}

.element-item:hover {
    border-color: #4ecdc4;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.inspiration-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.inspiration-item {
    aspect-ratio: 1;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.3s ease;
    border: 2px solid transparent;
}

.inspiration-item:hover {
    transform: scale(1.05);
    border-color: #4ecdc4;
}

/* ===== PANEL CENTRAL ===== */
.center-panel {
    display: flex;
    flex-direction: column;
    background: white;
    overflow: hidden;
    height: 100%;
    margin: 0;
}

.view-controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.view-btn {
    padding: 8px 15px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.view-btn.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

.canvas-container {
    flex: 1;
    background-color: white;
    overflow: hidden;
    position: relative;
}

#templateCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

.info-panel {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background-color: rgba(255,255,255,0.9);
    padding: 10px 15px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.info-panel p {
    margin: 5px 0;
    font-size: 0.9rem;
}

/* ===== PANEL DERECHO ===== */
.right-panel {
    background: #008B8B;
    padding: 0;
    overflow-y: auto;
    height: 100%;
    margin: 0;
}

/* Reset completo para eliminar espacios */
.right-panel > *:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.right-panel .logo {
    margin-bottom: 20px;
    text-align: center;
    padding: 20px 20px 0;
}

.right-panel .logo h1 {
    font-size: 1.5rem;
    color: white;
    margin: 0;
}

.right-panel .logo h2 {
    font-size: 1rem;
    color: #e0f7fa;
    font-weight: normal;
    margin: 5px 0 0 0;
}

/* Contenido paneles derecho */
.config-panel {
    background: #00ffff8f;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #e9ecef;
    color: white;
    margin: 0;
}

.config-panel h4 {
    margin-bottom: 15px;
    color: white;
    font-size: 1rem;
    text-align: center;
}

.dimension-inputs {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.dimension-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dimension-item label {
    color: white;
    font-weight: 500;
    flex: 1;
    font-size: 0.9rem;
}

.dimension-item input {
    width: 80px;
    padding: 8px;
    border: 1px solid #008B8B;
    border-radius: 4px;
    background: white;
    color: #333;
    font-size: 0.9rem;
}

.color-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.color-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.color-item label {
    color: white;
    font-weight: 500;
    flex: 1;
    font-size: 0.9rem;
}

.color-item input[type="color"] {
    width: 60px;
    height: 30px;
    border: 2px solid #008B8B;
    border-radius: 4px;
    cursor: pointer;
    background: white;
}

.apply-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #008B8B, #006666);
    border: none;
    border-radius: 5px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    font-size: 0.9rem;
}

.apply-btn:hover {
    background: linear-gradient(135deg, #009999, #005555);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.right-panel .windows-activation {
    margin-top: 20px;
    padding: 15px;
    background: #006666;
    border-radius: 4px;
    text-align: center;
    font-size: 0.8rem;
    color: #e0f7fa;
    border-top: 1px solid #005db9;
}

.right-panel .windows-activation p {
    margin: 5px 0;
}

/* ===== OCULTAR SCROLLBARS ===== */
.left-panel::-webkit-scrollbar,
.right-panel::-webkit-scrollbar {
    display: none;
}

.left-panel,
.right-panel {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .main-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
        position: relative;
        top: 70px;
        height: calc(100vh - 70px);
    }
    
    .left-panel, .right-panel {
        max-height: 40vh;
    }
}

/* ===== ESTILOS PARA EXPORTACIÓN ===== */
.export-panel {
    background: #00ffff8f;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #e9ecef;
    color: white;
    margin: 0;
}

.export-panel h4 {
    margin-bottom: 15px;
    color: white;
    font-size: 1rem;
    text-align: center;
}

.export-panel h5 {
    margin: 15px 0 10px 0;
    color: white;
    font-size: 0.9rem;
    text-align: left;
}

.export-format-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.export-format-btn {
    padding: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid transparent;
    border-radius: 5px;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    text-align: center;
}

.export-format-btn:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.export-format-btn.active {
    background: white;
    border-color: #008B8B;
    color: #008B8B;
    font-weight: bold;
}

.export-actions {
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.export-confirm-btn {
    flex: 2;
    padding: 10px;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    border: none;
    border-radius: 5px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.export-confirm-btn:hover {
    background: linear-gradient(135deg, #229954, #27ae60);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.export-cancel-btn {
    flex: 1;
    padding: 10px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border: none;
    border-radius: 5px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.export-cancel-btn:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Estados de los botones de exportación */
.export-format-btn:disabled,
.export-confirm-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.export-format-btn:disabled:hover,
.export-confirm-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}
/* ===== ESTILOS PARA CONTROLES DE ZOOM ===== */
.canvas-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 15px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    border: 1px solid #e0e0e0;
    z-index: 100;
}

.canvas-controls button {
    padding: 8px 12px;
    background: linear-gradient(135deg, #008B8B, #006666);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 40px;
}

.canvas-controls button:hover {
    background: linear-gradient(135deg, #006666, #004d4d);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

#zoomLevel {
    font-weight: bold;
    min-width: 50px;
    text-align: center;
    color: #333;
    font-size: 14px;
}

.info-cara {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 15px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    border: 1px solid #e0e0e0;
    max-width: 250px;
    z-index: 100;
    font-size: 14px;
    line-height: 1.4;
}

.info-cara strong {
    color: #008B8B;
}

/* ===== ESTILOS PARA VISTA 3D ===== */
#preview3dContainer {
    width: 100%;
    height: 100%;
    position: relative;
    background: #1a1a1a;
}

.view-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#templateCanvas {
    display: block;
    background: #f8f9fa;
}

/* Asegurar que el contenedor 3D ocupe todo el espacio */
#view3D {
    position: relative;
    width: 100%;
    height: 100%;
}

.view-controls {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.view-btn {
    padding: 10px 20px;
    background-color: white;
    border: 2px solid #008B8B;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    margin: 0 5px;
    transition: all 0.3s ease;
}

.view-btn.active {
    background-color: #008B8B;
    color: white;
    border-color: #008B8B;
}

.view-btn:hover:not(.active) {
    background-color: #e6f7f7;
    border-color: #006666;
}
/* ===== ESTILOS PARA CONTROLES DE ZOOM ===== */
.canvas-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 15px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    border: 1px solid #e0e0e0;
    z-index: 100;
}

.canvas-controls button {
    padding: 8px 12px;
    background: linear-gradient(135deg, #008B8B, #006666);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 40px;
}

.canvas-controls button:hover {
    background: linear-gradient(135deg, #006666, #004d4d);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

#zoomLevel {
    font-weight: bold;
    min-width: 50px;
    text-align: center;
    color: #333;
    font-size: 14px;
}

.info-cara {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 15px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    border: 1px solid #e0e0e0;
    max-width: 250px;
    z-index: 100;
    font-size: 14px;
    line-height: 1.4;
}

.info-cara strong {
    color: #008B8B;
}

/* ===== ESTILOS PARA VISTA 3D ===== */
#preview3dContainer {
    width: 100%;
    height: 100%;
    position: relative;
    background: #1a1a1a;
}

.view-container {
    position: relative;
    width: 100%;
    height: calc(100% - 70px); /* Restar altura de los controles */
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#templateCanvas {
    display: block;
    background: #f8f9fa;
    width: 100%;
    height: 100%;
}

/* Asegurar que el contenedor 3D ocupe todo el espacio */
#view3D {
    position: relative;
    width: 100%;
    height: 100%;
}

.view-controls {
    display: flex;
    justify-content: center;
    padding: 15px 20px;
    background: #0accccef;
    border-bottom: 1px solid #e9ecef;
    height: 60px;
    box-sizing: border-box;
}

.view-btn {
    padding: 10px 20px;
    background-color: white;
    border: 2px solid #008B8B;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    margin: 10 5px;
    transition: all 0.3s ease;
}

.view-btn.active {
    background-color: #008B8B;
    color: white;
    border-color: #008B8B;
}

.view-btn:hover:not(.active) {
    background-color: #e6f7f7;
    border-color: #006666;
}

/* Info panel para 3D */
.info-panel {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 15px;
    border-radius: 6px;
    color: #333;
    font-size: 12px;
    z-index: 100;
}

/* Asegurar que el center-panel ocupe todo el espacio disponible */
.center-panel {
    display: flex;
    flex-direction: column;
    background: #0accccfd;
    overflow: hidden;
    height: 100%;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .canvas-controls {
        bottom: 10px;
        right: 10px;
        padding: 8px 12px;
    }
    
    .info-cara {
        bottom: 10px;
        left: 10px;
        max-width: 200px;
    }
    
    .view-controls {
        padding: 10px 15px;
        height: 50px;
    }
    
    .view-btn {
        padding: 8px 15px;
        font-size: 12px;
    }
}
.two-sides{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 10px;
  align-items: start;
}

.side-card{
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(0,0,0,.08);
  padding: 10px;
}

.side-title{
  font-weight: 700;
  margin: 4px 0 10px;
}

.canvas-wrapper.two{
  display: flex;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 10px;
}

.canvas-box{
  flex: 1;
  min-width: 0;
  background: #ffffff;
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,.10);
}

.canvas-title{
  font-weight: 600;
  margin-bottom: 8px;
}
.canvas-box canvas{
  width: 100%;
  height: auto;
  display: block;
  background: #fff;
  border-radius: 10px;
}




/* ===========================
   PATCH layout v21 - canvases 2D centrados y sin alargarse
   =========================== */

/* El grid de las 2 vistas */
.canvas-wrapper.two{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 10px;
  align-items: stretch;
}

/* Cada tarjeta ocupa una altura estable para que el canvas no quede eterno */
.canvas-wrapper.two .canvas-box{
  display: flex;
  flex-direction: column;
  height: calc(100vh - 210px); /* Ajusta aquí si quieres más/menos alto */
  min-height: 520px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(0,0,0,.08);
  padding: 12px;
  overflow: hidden;
}

/* El canvas llena el espacio disponible */
.canvas-wrapper.two .canvas-box canvas{
  flex: 1 1 auto;
  width: 100%;
  height: 100% !important; /* clave: para que el JS mida bien el rect */
  display: block;
  border-radius: 10px;
  background: #fff;
}


/* ===== FIX v3: el cuadro derecho no debe "chocar" con el borde turquesa =====
   Requiere que el HTML tenga <div class="canvas-area"> envolviendo .canvas-wrapper.two
*/

/* Aire real alrededor de ambos cuadros (más aire a la derecha) */
.canvas-area{
  padding: 16px 22px 16px 16px; /* top right bottom left */
  box-sizing: border-box;
  height: 100%;
}

/* Evita que el grid se desborde y pegue el cuadro derecho al borde */
.canvas-wrapper.two{
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  box-sizing: border-box;
}

/* Espacio interno igual para Exterior/Interior */
.canvas-wrapper.two .canvas-box{
  padding: 14px;
  box-sizing: border-box;
  border-radius: 16px;
  overflow: hidden; /* para que el canvas respete el borde */
  position: relative;
  background: #fff;
}

/* Canvas y título bien alineados */
.canvas-wrapper.two .canvas-title{
  margin: 0 0 10px 0;
  font-weight: 600;
}

.canvas-wrapper.two .canvas-box canvas{
  width: 100%;
  height: 100% !important;
  display: block;
  border-radius: 12px;
}

