/* Truss Designer 3D Styles */
:root {
    --designer-bg: #f8f9fa;
    --designer-sidebar: #fff;
    --designer-accent: #007aff;
    --designer-border: #e2e8f0;
}

.td-header {
    background: #fff;
    padding: 40px 0;
    border-bottom: 1px solid var(--designer-border);
}

.designer-layout {
    display: flex;
    height: calc(100vh - 180px);
    position: relative;
    overflow: hidden;
}

/* Sidebar */
.designer-sidebar {
    width: 320px;
    background: var(--designer-sidebar);
    border-right: 1px solid var(--designer-border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: 0.3s;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--designer-border);
}

.sidebar-header h3 {
    font-size: 1.1rem;
    font-weight: 900;
    margin: 0;
}

.sidebar-header p {
    font-size: 0.75rem;
    color: #64748b;
    margin: 4px 0 0;
}

.sidebar-catalog {
    flex-grow: 1;
    overflow-y: auto;
    padding: 16px;
}

.piece-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: 0.2s;
    position: relative;
}

.piece-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.piece-img {
    width: 54px;
    height: 54px;
    background: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border: 1px solid var(--designer-border);
}

.piece-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.piece-info {
    flex-grow: 1;
}

.piece-title {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: #000;
}

.piece-price {
    font-size: 0.7rem;
    color: #007aff;
    font-weight: 800;
}

.piece-add {
    width: 24px;
    height: 24px;
    background: #000;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

/* Canvas Area */
.designer-canvas-wrap {
    flex-grow: 1;
    background: #111;
    position: relative;
}

#designer-canvas {
    width: 100%;
    height: 100%;
}

.canvas-controls {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    padding: 8px;
    border-radius: 16px;
    display: flex;
    gap: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.control-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: none;
    background: none;
    color: #000;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.control-btn:hover {
    background: #f1f5f9;
    color: #007aff;
}

.control-divider {
    width: 1px;
    background: #cbd5e1;
    margin: 8px 4px;
}

.canvas-stats {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    padding: 16px 20px;
    border-radius: 20px;
    color: #fff;
    display: flex;
    gap: 32px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    font-weight: 900;
    letter-spacing: 0.1em;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 800;
}

/* Overlay */
.designer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.overlay-content {
    max-width: 440px;
    padding: 40px;
}

.overlay-content h2 {
    font-weight: 900;
}

.overlay-content p {
    color: #64748b;
    font-size: 0.95rem;
}

/* Button */
.btn-designer-add {
    background: #007aff;
    color: #fff;
    border: none;
    padding: 14px 28px;
    border-radius: 14px;
    font-weight: 800;
    font-size: 0.85rem;
    transition: 0.3s;
    box-shadow: 0 10px 30px rgba(0, 122, 255, 0.25);
}

.btn-designer-add:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(0, 122, 255, 0.35);
}

@media (max-width: 991px) {
    .designer-sidebar {
        width: 100px;
    }

    .piece-info,
    .sidebar-header {
        display: none;
    }
}