/* MISMAS REGLAS BÁSICAS, AÑADIENDO AL FINAL EL BLOQUE RESPONSIVE */
:root { --color-negro: #1a1a1a; --color-terracota: #a85a4e; --color-fondo: #f7f7f5; }
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', sans-serif; height: 100vh; overflow: hidden; display: flex; flex-direction: column; }

.top-bar { height: 50px; background: white; display: flex; justify-content: space-between; align-items: center; padding: 0 15px; border-bottom: 1px solid #ddd; z-index: 10; }
.logo-area { cursor: pointer; }
.logo-text { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 1.2rem; }
.logo-sub { font-family: 'Inter', sans-serif; font-size: 0.6rem; letter-spacing: 3px; color: var(--color-terracota); margin-left: 8px; font-weight: 600; }

.actions-top { display: flex; gap: 8px; align-items: center; }
.separator { width: 1px; height: 24px; background: #ddd; margin: 0 5px; }
.action-btn { background: #f4f4f4; border: 1px solid #eee; padding: 6px 12px; border-radius: 4px; cursor: pointer; display: flex; align-items: center; gap: 6px; font-size: 0.8rem; position: relative; }
.action-btn:hover { background: #e9e9e9; }
.action-btn.active { background: #d4e8d4; border-color: #a0cfa0; color: #2e7d32; }
/* Tooltip CSS */
.action-btn:hover::after { content: attr(title); position: absolute; top: 110%; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.8); color: white; padding: 5px 8px; border-radius: 4px; font-size: 0.6rem; white-space: nowrap; z-index: 100; pointer-events: none; }

.special-btn { background: var(--color-negro); color: white; border: none; font-weight: 600; }
.price-tag { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 1.2rem; color: var(--color-terracota); }

.workspace { display: flex; flex: 1; position: relative; }
#canvas-container { flex: 1; background: radial-gradient(circle at center, #ffffff 0%, #f0ece6 100%); }
#calibration-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.2); z-index: 20; display: none; }
.calib-instructions { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); background: white; padding: 15px 25px; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.2); text-align: center; }
#reference-rect { width: 300px; height: 212px; border: 2px solid red; background: rgba(255, 0, 0, 0.15); position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); cursor: move; resize: both; overflow: hidden; }
.rect-label { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: red; font-weight: bold; font-size: 0.9rem; pointer-events: none; }
.btn-primary-action.small { padding: 8px 15px; font-size: 0.7rem; margin-top: 0; }
.btn-cancel { background: #ddd; border: none; padding: 8px 15px; border-radius: 4px; cursor: pointer; font-size: 0.7rem; font-weight: 600; }

.config-panel { width: 310px; background: white; border-left: 1px solid #ddd; padding: 20px; display: flex; flex-direction: column; gap: 15px; overflow-y: auto; z-index: 5; }
.panel-section h3 { font-size: 0.8rem; text-transform: uppercase; margin-bottom: 8px; color: #888; letter-spacing: 1px; }
.slider-group { display: flex; align-items: center; gap: 5px; margin-bottom: 5px; }
.slider-group label { flex: 1; font-size: 0.75rem; }
input[type="range"] { flex: 2; } .num-input { width: 55px; text-align: center; border: 1px solid #ddd; padding: 4px; border-radius: 4px; }
.components-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 5px; }
.comp-btn { background: white; border: 1px solid #ccc; padding: 8px; border-radius: 4px; cursor: pointer; font-size: 0.75rem; display: flex; align-items: center; justify-content: center; gap: 5px; }
.comp-btn:hover { background: #f9f9f9; } .comp-btn.danger { color: #c00; }
.toggle-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; margin-top: 5px; }
.special-control { background: #fdfae0; border: 1px solid #e8e0b0; padding: 10px; border-radius: 4px; display: flex; gap: 10px; font-size: 0.8rem; }
.dropdown { width: 100%; padding: 8px; margin-bottom: 10px; border: 1px solid #ddd; }
.color-selector { display: flex; gap: 8px; flex-wrap: wrap; }
.color-opt { width: 28px; height: 28px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; box-shadow: 0 2px 4px rgba(0,0,0,0.1); } .color-opt:hover { transform: scale(1.1); }
.btn-primary-action { margin-top: auto; padding: 15px; background: var(--color-negro); color: white; border: none; font-weight: 600; cursor: pointer; text-transform: uppercase; }
.btn-primary-action:hover { background: var(--color-terracota); }
.cart-panel { position: absolute; top: 60px; left: 20px; width: 240px; background: rgba(255,255,255,0.95); padding: 15px; border-radius: 8px; border: 1px solid #eee; z-index: 4; }
.cart-panel h3 { font-size: 0.9rem; border-bottom: 1px solid #eee; margin-bottom: 10px; }
#cart-list { list-style: none; max-height: 300px; overflow-y: auto; font-size: 0.75rem; margin-bottom: 10px; }
#cart-list li { display: flex; justify-content: space-between; margin-bottom: 6px; border-bottom: 1px dashed #eee; padding-bottom: 4px; }
.cart-total { font-weight: 700; text-align: right; margin-bottom: 10px; border-top: 2px solid var(--color-negro); padding-top: 10px; }
.btn-checkout { width: 100%; padding: 10px; background: var(--color-terracota); color: white; border: none; cursor: pointer; font-size: 0.8rem; font-weight: 600; }
#input-load-project { display: none; }

/* --- RESPONSIVE CONFIGURADOR --- */
@media (max-width: 768px) {
    .workspace { 
        flex-direction: column; 
        height: calc(100vh - 50px); /* Ajuste altura */
    }

    /* Visor 3D arriba (40%) */
    #canvas-container {
        height: 40%; width: 100%; flex: none;
    }

    /* Controles abajo (60%) con scroll */
    .config-panel {
        width: 100%; height: 60%;
        border-left: none; border-top: 1px solid #ddd;
        padding: 15px;
    }

    /* Barra superior compacta */
    .actions-top { gap: 5px; }
    .action-btn { padding: 8px; font-size: 0; } /* Solo iconos */
    .action-btn i { font-size: 1.2rem; }
    .separator { display: none; }
    
    /* Ocultar texto logo en móvil */
    .nav-logo svg { width: 40px; } 
    .nav-logo text { display: none; }

    /* Carrito oculto en móvil por defecto */
    .cart-panel { display: none; } 
}