/* Sección de Finishing en el popup de color RAL */
.custom-color-finishing {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 10px;
    margin-top: 2px;
}
.custom-color-finishing-label {
    font-size: 15px;
    color: #fff;
    font-weight: 500;
    margin-right: 8px;
}
.custom-color-radio-label {
    font-size: 15px;
    color: #fff;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}
.custom-color-radio {
    accent-color: #2196f3;
    margin-right: 3px;
}
/* Popup principal de selección de color RAL */
.custom-color-overlay {
    position: fixed;
    z-index: 9999;
    left: 0; top: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
}
.custom-color-dialog {
    max-width: 370px;
    min-width: 320px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 32px rgba(0,0,0,0.18);
    padding: 28px 28px 20px 28px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.custom-color-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #222;
}

.custom-color-input-wrapper {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 8px;
    border: 1.5px solid #bbb;
    padding: 2px 8px;
    position: relative;
    width: 100%;
    max-width: 320px;
    margin: 0 auto 12px auto;
    box-sizing: border-box;
}

.custom-color-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 16px;
    padding: 8px 0;
    color: #222;
    font-weight: bold;
    min-width: 0;
}

.custom-color-dropdown-btn {
    margin-left: 8px;
    cursor: pointer;
    color: #222;
    font-size: 18px;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.custom-color-preview-row {
    display: flex;
    align-items: center;
    margin: 0 0 10px 0;
    min-height: 38px;
}

.custom-color-preview {
    background: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #bbb;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #888;
    flex-shrink: 0;
}

.custom-color-selected-name {
    font-size: 15px;
    color: #FFF;
    font-weight: bold;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-left: 10px;
}

.custom-color-error {
    color: #e53935;
    font-size: 13px;
    min-height: 18px;
    margin-bottom: 6px;
}

.custom-color-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

.custom-color-cancel,
.custom-color-accept {
    padding: 6px 18px;
    border-radius: 6px;
    border: none;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
}

.custom-color-cancel {
    background: #eee;
    color: #333;
}

.custom-color-accept {
    background: #222;
    color: #fff;
    opacity: 0.7;
    transition: opacity 0.15s;
}
.custom-color-accept:enabled {
    opacity: 1;
}
body {
    margin: 0;
    overflow: hidden;
    font-family: Arial, sans-serif;
}

canvas {
    display: block;
}

.container {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1;
}

.dropdown {
    margin: 10px;
    padding: 5px;
    font-size: 16px;
}

#help-overlay {
    position: fixed;
    left: 20px;
    bottom: 20px;
    background: rgba(30,30,30,0.85);
    color: #fff;
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 15px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    
}
.help-section {
    margin-bottom: 8px;
}
.help-icon {
    font-size: 20px;
    vertical-align: middle;
    margin-right: 8px;
}
.help-text {
    vertical-align: middle;
}
@media (pointer: coarse) {
    #help-pc { display: none; }
    #help-mobile { display: block; }
}
@media (pointer: fine) {
    #help-pc { display: block; }
    #help-mobile { display: none; }
}

#color-selectors {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 16px;
}

.color-selector-wrapper {
    position: relative;
    width: 80px;
    /* display: flex; */
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}

.color-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border 0.2s;
    background-size: cover;
    background-position: center;
}

.color-circle.active {
    border: 3px solid #2196f3;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.color-name {
    margin-top: 0;
    font-size: 13px;
    color: #fff;
    text-shadow: 0 1px 3px #222;
    text-align: center;
    max-width: 80px;
    word-break: break-word;
    width: 100%;
}

.color-list-popup {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 340px;
    background: rgba(30,30,30,0.98);
    border-radius: 0 0 0 18px;
    box-shadow: -4px 0 16px rgba(0,0,0,0.25);
    padding: 32px 24px 24px 24px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px 18px;
    z-index: 1002;
    overflow-y: auto;
    animation: fadeIn 0.2s;
}

.color-list-popup .color-list-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.color-list-popup .color-circle {
    margin-bottom: 6px;
    border: 2px solid #fff;
    width: 38px;
    height: 38px;
}

.color-list-popup .color-circle.selected {
    border: 3px solid #2196f3;
}

.color-list-popup .color-name {
    font-size: 13px;
    color: #fff;
    max-width: 80px;
    text-align: center;
    word-break: break-word;
}

.color-list-popup .color-list-spacer {
    height: 60px; /* Ajusta según el alto de tus items */
    grid-column: 1 / -1;
    pointer-events: none;
    background: transparent;
}

.part-name {
    font-size: 15px;
    color: #fff;
    font-weight: bold;
    margin-bottom: 6px;
    text-align: center;
    text-shadow: 0 1px 3px #222;
    letter-spacing: 0.5px;
    width: 100%;
}

.popup-part-header {
    font-size: 20px;
    color: #fff;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: center;
    grid-column: 1 / -1;
    letter-spacing: 0.5px;
}

.lighting-selector {
    position: fixed;
    bottom: 28px;
    right: 28px;
    background: rgba(30,30,30,0.95);
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
    padding: 12px 22px 12px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 1000;
    font-family: inherit;
}

.lighting-label {
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    margin-right: 8px;
}

.lighting-btn {
    background: #222;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 7px 18px;
    font-size: 15px;
    cursor: pointer;
    margin-left: 0;
    transition: background 0.2s, color 0.2s;
    outline: none;
}

.lighting-btn.selected,
.lighting-btn:hover {
    background: #2196f3;
    color: #fff;
}

.custom-color-overlay {
    position: fixed;
    z-index: 9999;
    left: 0; top: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
}
.custom-color-dialog {
    background: #232323;
    border-radius: 14px;
    padding: 28px 32px 22px 32px;
    box-shadow: 0 4px 32px rgba(0,0,0,0.25);
    min-width: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.custom-color-title {
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 18px;
}
.custom-color-input {
    font-size: 18px;
    padding: 8px 12px;
    border-radius: 6px;
    border: none;
    outline: none;
    margin-bottom: 14px;
    width: 120px;
    text-align: center;
}
.custom-color-preview {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-bottom: 10px;
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #232323;
    font-size: 13px;
    background: #fff;
}
.custom-color-error {
    color: #ff5252;
    font-size: 13px;
    min-height: 18px;
    margin-bottom: 10px;
}
.custom-color-actions {
    display: flex;
    gap: 18px;
    margin-top: 10px;
}
.custom-color-actions button {
    padding: 7px 18px;
    border-radius: 7px;
    border: none;
    font-size: 15px;
    cursor: pointer;
    background: #2196f3;
    color: #fff;
    transition: background 0.2s;
}
.custom-color-actions .custom-color-cancel {
    background: #444;
}
.custom-color-actions button:disabled {
    background: #888;
    cursor: not-allowed;
}

@media (max-width: 600px) {
    #help-mobile .help-mobile-row {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        flex-wrap: wrap;
        
    }

    #help-mobile .help-icon.material-icons {
        font-size: 24px;
        margin: 0 6px;
    }

    #help-mobile .help-text {
        font-size: 0.9em;
        margin: 0 8px 0 0;
        white-space: nowrap;
    }
}

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