* { box-sizing: border-box; font-family: 'Inter', sans-serif; margin: 0; padding: 0; }
body { background: #050505; color: #fff; height: 100vh; display: flex; flex-direction: column; overflow: hidden; padding: 0; }

/* RE-BRANDING HEADER */
.main-header {
    background: #000;
    border-bottom: 2px solid #ff6600;
    padding: 0 30px;
    height: 100px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    z-index: 2000;
}

.logo-container {
    display: flex;
    align-items: center;
}

.site-logo {
    height: 80px;
    transition: transform 0.3s ease;
}

.site-logo:hover {
    transform: scale(1.02);
}

.app-container { 
    width: 100%; 
    height: calc(100% - 100px); 
    display: flex; 
    flex-direction: column; 
    margin-top: 40px; 
}

/* [FREEZE] SCALE 1:1 INDUSTRIAL CONTAINER */
#overlay {
    position: fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.9);
    z-index: 5000; display: none; flex-direction: column; align-items: center; justify-content: center;
    color: #ff6600; font-weight: 800; font-size: 20px; text-transform: uppercase;
}

.progress-wrapper { width: 80%; background: #222; height: 10px; margin: 20px 0; border-radius: 5px; overflow: hidden; position: relative; }
#progress-bar { width: 0%; height: 100%; background: #ff6600; transition: width 0.3s ease; box-shadow: 0 0 15px #ff6600; }

/* TOP: TABLE REGION */
.table-section { height: 260px; min-height: 260px; overflow-y: auto; background: #080808; border-bottom: 2px solid #ff6600; margin-top: 0; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th { background: #111; color: #ff6600; padding: 12px 8px; font-size: 14px; text-transform: uppercase; border: 1px solid #555; position: sticky; top: 0; z-index: 10; white-space: nowrap; }
td { padding: 10px 8px; border: 1px solid #555; font-size: 14px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
tr:hover { background: #1a1a1a; cursor: pointer; }
tr.selected { background: #222 !important; outline: 2px solid #ff6600; outline-offset: -2px; }
tr.selected td { color: #ff6600; font-weight: 800; }

.qty-input { width: 70px; text-align: center; background: #000; color: #fff; border: 1px solid #ff660044; padding: 4px; border-radius: 2px; font-size: 14px; }
.btn-delete { color: #f44336; cursor: pointer; font-size: 18px; }
tr.selected .btn-delete { color: #fff !important; }

/* MIDDLE: SUMMARY BAR */
.summary-bar { background: #111; padding: 20px 40px; display: flex; justify-content: space-between; align-items: center; border-bottom: 4px solid #ff6600; }
.summary-info { color: #ff6600; font-weight: 900; }
.grand-total { font-size: 32px; }
.grand-weight { font-size: 14px; color: #888; margin-top: 5px; }
.btn-pdf { background: #ff6600; color: #000; border: none; padding: 12px 35px; border-radius: 4px; font-weight: 900; cursor: pointer; text-transform: uppercase; }

/* BOTTOM: CONTROL PANEL (TRIPARTITE) */
.control-panel { background: #0a0a0a; padding: 25px; display: grid; grid-template-columns: 400px 1fr 280px; gap: 30px; }
/* Left: Selects + Mini Info */
.ctrl-group { display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.input-group { display: flex; flex-direction: column; gap: 5px; }
.input-group label { color: #ff6600; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.input-group select, .input-group input { background: #000; border: 1px solid #333; color: #fff; padding: 8px; border-radius: 3px; font-size: 14px; }

/* Bottom: Control Panel Realigned */
.control-panel { background: #0a0a0a; padding: 10px 40px; display: grid; grid-template-columns: 1fr 2fr; gap: 40px; border-top: 1px solid #222; margin-top: -10px; }
.ctrl-group { display: flex; flex-direction: column; gap: 5px; justify-content: center; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; width: 100%; }

.btn-load, .btn-order { height: 70px; background: #ff6600; color: #000; border: none; border-radius: 6px; font-weight: 900; font-size: 20px; cursor: pointer; text-transform: uppercase; }
.btn-load:hover, .btn-order:hover { background: #ff751a; box-shadow: 0 0 20px rgba(255,102,0,0.3); }
.btn-order:disabled { background: #222; color: #444; cursor: not-allowed; box-shadow: none; }
.btn-clear { background: #000; color: #ff3333; border: 1px solid #ff333344; padding: 8px; border-radius: 4px; font-weight: 800; cursor: pointer; text-transform: uppercase; font-size: 11px; margin-top: 5px; }

/* SUCCESS MODAL */
#success-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 2000; justify-content: center; align-items: center; }
.success-content { background: #111; border: 2px solid #ff6600; padding: 40px; text-align: center; border-radius: 8px; max-width: 400px; box-shadow: 0 0 30px rgba(255,102,0,0.3); }
.success-content h2 { color: #ff6600; text-transform: uppercase; margin-top: 0; }
.order-number { font-size: 32px; font-weight: 900; color: #fff; margin: 20px 0; font-family: 'Consolas', monospace; }
.btn-modal-close { background: #ff6600; color: #000; border: none; padding: 10px 30px; font-weight: 800; cursor: pointer; text-transform: uppercase; border-radius: 4px; }

/* [NEW] PREVIEW PANEL STYLES */
.preview-panel {
    display: none; /* hidden until selection */
    background: #000;
    flex: 1;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 15px 40px 10px 40px;
    overflow-y: auto;
}
.preview-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.preview-box {
    background: #050505;
    border: 1px solid #333;
    border-radius: 6px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: inset 0 0 20px #000;
    height: 300px;
    min-height: 300px;
}
.preview-header {
    color: #ff6600;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-left: 3px solid #ff6600;
    padding-left: 10px;
}
#view-2d img { max-width: 95%; max-height: 95%; filter: drop-shadow(0 0 10px #ff660022); }
.dim-row {
    background: #080808; padding: 6px 15px; border: 1px solid #222; border-radius: 4px;
    color: #ff6600; font-size: 13px; font-weight: 700; text-align: center;
    display: flex; justify-content: space-around;
}
.price-breakdown {
    margin: 5px auto; width: 100%; max-width: 800px; border-collapse: collapse; background: #050505; border-radius: 4px; overflow: hidden; border: 1px solid #222;
}
.price-breakdown td {
    text-align: left; padding: 5px 15px; font-size: 13px; border: 1px solid #111; color: #aaa; line-height: 1.2;
}
.price-breakdown b { color: #fff; }
.price-breakdown .total-cell { text-align: right; color: #ff6600; font-weight: 900; font-size: 15px; width: 150px; }
model-viewer { width: 100%; height: 100%; --poster-color: transparent; }
