/* 3D Limbowand Konfigurator — Brand UI */

:root {
    --lw-red: #e30613;
    --lw-red-dark: #b80510;
    --lw-ink: #1a1a1a;
    --lw-muted: #5c5c5c;
    --lw-line: #e2e2e2;
    --lw-surface: #f4f4f2;
    --lw-panel: #ffffff;
    --lw-studio: #b0aea9;
    --lw-studio-top: #c4c2be;
    --lw-studio-bottom: #95938e;
    --lw-radius: 12px;
    --lw-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.limbowand-3d-wrapper {
    margin: 28px 0;
    background: var(--lw-panel);
    border: 1px solid var(--lw-line);
    border-radius: var(--lw-radius);
    box-shadow: var(--lw-shadow);
    overflow: hidden;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    color: var(--lw-ink);
}

.limbowand-3d-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--lw-line);
    background: linear-gradient(180deg, #fff 0%, #fafafa 100%);
}

.limbowand-3d-logo {
    display: block;
    height: 36px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
}

.limbowand-3d-header-text h3 {
    margin: 0 0 2px;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--lw-ink);
    line-height: 1.25;
}

.limbowand-3d-header-text p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--lw-muted);
    line-height: 1.35;
}

.limbowand-3d-body {
    display: flex;
    align-items: stretch;
    min-height: 0;
}

.limbowand-3d-viewer-wrap {
    flex: 1;
    min-width: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    background: transparent;
}

#limbo-container {
    flex: 1 1 auto;
    width: 100%;
    height: 600px;
    background: transparent;
    overflow: hidden;
    position: relative;
}

#limbo-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.limbowand-3d-viewer-footer {
    flex: 0 0 auto;
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: 2;
    padding: 10px 14px;
    background: #ffd6d9;
    border-top: 1px solid rgba(227, 6, 19, 0.2);
    pointer-events: none;
    box-sizing: border-box;
}

.limbowand-3d-hint {
    margin: 0;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--lw-red-dark);
    font-weight: 600;
}

.limbowand-3d-controls {
    flex-shrink: 0;
    width: 280px;
    padding: 18px 16px 20px;
    background: var(--lw-surface);
    border-left: 1px solid var(--lw-line);
    display: flex;
    flex-direction: column;
    gap: 18px;
    box-sizing: border-box;
}

.lw-field-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lw-group-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--lw-muted);
}

.lw-dims {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px 0;
}

.limbowand-3d-controls label {
    display: block;
    margin: 4px 0 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--lw-ink);
}

.limbowand-3d-controls input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--lw-line);
    border-radius: 8px;
    font-size: 1rem;
    line-height: 1.2;
    background: #fff;
    color: var(--lw-ink);
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.limbowand-3d-controls input[type="number"]:focus {
    outline: none;
    border-color: var(--lw-red);
    box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.15);
}

.lw-tiles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.lw-tile {
    padding: 10px 8px;
    border: 1px solid var(--lw-line);
    border-radius: 8px;
    background: #fff;
    color: var(--lw-ink);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s;
}

.lw-tile:hover {
    border-color: #cfcfcf;
}

.lw-tile.is-active {
    border-color: var(--lw-red);
    background: #fff5f5;
    color: var(--lw-red);
    box-shadow: inset 0 0 0 1px var(--lw-red);
}

.lw-chips {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lw-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--lw-line);
    border-radius: 8px;
    background: #fff;
    color: var(--lw-ink);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s;
}

.lw-chip:hover {
    border-color: #cfcfcf;
}

.lw-chip.is-active {
    border-color: var(--lw-red);
    background: #fff5f5;
    color: var(--lw-red);
    box-shadow: inset 0 0 0 1px var(--lw-red);
}

.lw-chip-swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
}

.lw-chip-white .lw-chip-swatch {
    background: #ffffff;
}

.lw-chip-green .lw-chip-swatch {
    background: #3aad4f;
}

.lw-toggle {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--lw-line);
    border-radius: 8px;
    background: #fff;
    color: var(--lw-ink);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s;
}

.lw-toggle.is-active {
    border-color: var(--lw-red);
    background: #fff5f5;
    color: var(--lw-red);
    box-shadow: inset 0 0 0 1px var(--lw-red);
}

.lw-toggle:hover {
    border-color: #cfcfcf;
}

.lw-toggle.is-active:hover {
    border-color: var(--lw-red);
}

.lw-actions {
    margin-top: auto;
    padding-top: 4px;
}

.limbowand-3d-controls .btn-pdf {
    width: 100%;
    padding: 14px 16px;
    background: #fff;
    color: var(--lw-red);
    border: 2px solid var(--lw-red);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    transition: background 0.2s, color 0.2s, transform 0.15s;
    box-sizing: border-box;
    min-height: 48px;
}

.limbowand-3d-controls .btn-pdf:hover {
    background: var(--lw-red);
    color: #fff;
}

.limbowand-3d-controls .btn-pdf:active {
    background: var(--lw-red-dark);
    border-color: var(--lw-red-dark);
    color: #fff;
    transform: translateY(1px);
}

.limbowand-3d-controls .btn-pdf:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.limbowand-3d-loading {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.78);
    z-index: 10;
}

.limbowand-3d-loading.active {
    display: flex;
}

.limbowand-3d-loading p {
    margin: 0;
    padding: 14px 22px;
    background: #fff;
    border: 1px solid var(--lw-line);
    border-radius: 8px;
    box-shadow: var(--lw-shadow);
    font-weight: 600;
    color: var(--lw-ink);
}

.limbowand-3d-toast {
    position: absolute;
    right: 14px;
    bottom: 52px;
    z-index: 12;
    max-width: 260px;
    padding: 10px 14px;
    background: var(--lw-ink);
    color: #fff;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: var(--lw-shadow);
}

.limbowand-3d-toast[hidden] {
    display: none !important;
}

@media (max-width: 900px) {
    .limbowand-3d-body {
        flex-direction: column;
    }

    .limbowand-3d-controls {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--lw-line);
        order: 2;
    }

    .limbowand-3d-viewer-wrap {
        order: 1;
    }

    #limbo-container {
        height: 420px !important;
    }

    .lw-tiles {
        grid-template-columns: repeat(4, 1fr);
    }

    .lw-chips {
        flex-direction: row;
    }

    .lw-chip {
        flex: 1;
    }
}

@media (max-width: 560px) {
    .limbowand-3d-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 14px;
    }

    .limbowand-3d-logo {
        height: 30px;
    }

    #limbo-container {
        height: 320px !important;
    }

    .limbowand-3d-controls {
        padding: 14px;
        gap: 14px;
    }

    .lw-tiles {
        grid-template-columns: 1fr 1fr;
    }

    .lw-tile,
    .lw-chip,
    .limbowand-3d-controls .btn-pdf {
        min-height: 44px;
    }

    .limbowand-3d-controls input[type="number"] {
        font-size: 16px;
        min-height: 44px;
    }
}

@media (max-width: 360px) {
    #limbo-container {
        height: 260px !important;
    }

    .lw-chips {
        flex-direction: column;
    }
}
