/**
 * HENX3D Produktkonfigurator Styles
 * Styling für Varianten-Auswahl, Parametric-Konfigurator und 3D-Farbkonfiguration
 */

/* ============================================
   KONFIGURATOR BASIS
   ============================================ */

.configurator-wrapper {
    padding: 1rem 0;
}

.configurator-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    color: var(--text-muted, #8892a0);
}

.configurator-loading .spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(0, 229, 255, 0.2);
    border-top-color: var(--primary, #00e5ff);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.configurator-error {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #ef4444;
}

.configurator-error .error-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 14px;
}

.no-options {
    color: var(--text-muted, #8892a0);
    font-style: italic;
    padding: 1rem 0;
}

/* ============================================
   SIMPLE KONFIGURATOR (Dropdowns/Buttons)
   ============================================ */

.configurator-options {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.configurator-option {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.option-label {
    font-weight: 600;
    color: var(--text-primary, #ffffff);
    font-size: 0.9rem;
}

/* Dropdown Select */
.option-select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: var(--text-primary, #ffffff);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-select:hover,
.option-select:focus {
    border-color: var(--primary, #00e5ff);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.15);
}

.option-select option {
    background: var(--bg-dark, #0a0f1a);
    color: var(--text-primary, #ffffff);
    padding: 0.5rem;
}

/* Farb-Swatches */
.color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.color-swatch {
    position: relative;
    width: 40px;
    height: 40px;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
}

.color-swatch:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.color-swatch.selected {
    border-color: var(--primary, #00e5ff);
    box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.3);
}

.color-swatch .swatch-check {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    color: white;
    font-size: 1.2rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.color-swatch.selected .swatch-check {
    opacity: 1;
}

/* Größen-Buttons */
.size-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.size-btn {
    position: relative;
    padding: 0.6rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: var(--text-primary, #ffffff);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.size-btn:hover {
    border-color: var(--primary, #00e5ff);
    background: rgba(0, 229, 255, 0.1);
}

.size-btn.selected {
    background: var(--primary, #00e5ff);
    border-color: var(--primary, #00e5ff);
    color: var(--bg-dark, #0a0f1a);
    font-weight: 600;
}

.size-btn .price-mod {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted, #8892a0);
    margin-top: 0.25rem;
}

.size-btn.selected .price-mod {
    color: rgba(0, 0, 0, 0.6);
}

/* ============================================
   PARAMETRIC KONFIGURATOR (Maßeingaben)
   ============================================ */

.configurator-parametric {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.param-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.param-input {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.param-input label {
    font-weight: 600;
    color: var(--text-primary, #ffffff);
    font-size: 0.9rem;
}

.input-with-unit {
    display: flex;
    align-items: stretch;
}

.input-with-unit input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px 0 0 8px;
    color: var(--text-primary, #ffffff);
    font-size: 1rem;
    -moz-appearance: textfield;
}

.input-with-unit input::-webkit-outer-spin-button,
.input-with-unit input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.input-with-unit input:focus {
    border-color: var(--primary, #00e5ff);
    outline: none;
}

.input-with-unit .unit {
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    background: rgba(0, 229, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-left: none;
    border-radius: 0 8px 8px 0;
    color: var(--primary, #00e5ff);
    font-weight: 600;
    font-size: 0.85rem;
}

.param-hint {
    color: var(--text-muted, #8892a0);
    font-size: 0.8rem;
}

.param-attributes {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.param-attribute {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 150px;
}

.param-attribute label {
    font-weight: 600;
    color: var(--text-primary, #ffffff);
    font-size: 0.85rem;
}

/* Volumen-Info */
.volume-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(0, 229, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.volume-label {
    color: var(--text-muted, #8892a0);
}

.volume-value {
    color: var(--primary, #00e5ff);
    font-weight: 600;
}

/* ============================================
   COLOR3D KONFIGURATOR (Mehrfarbdruck)
   ============================================ */

.configurator-color3d {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.color3d-configurator {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.color3d-header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
}

.color3d-title {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary, #ffffff);
}

.color3d-subtitle {
    font-size: 0.85rem;
    color: var(--primary, #00e5ff);
    font-weight: 500;
}

/* Farbzonen */
.color-zones,
.color3d-zones {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
}

.color-zone,
.color3d-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.color-zone:hover,
.color3d-zone:hover {
    border-color: rgba(0, 229, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

.zone-preview {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.zone-number {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    border-radius: 10px;
}

.zone-label {
    font-size: 0.85rem;
    color: var(--text-muted, #8892a0);
    font-weight: 500;
}

.zone-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.zone-picker,
.zone-color-input {
    width: 48px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: transparent;
}

.zone-picker::-webkit-color-swatch-wrapper,
.zone-color-input::-webkit-color-swatch-wrapper {
    padding: 0;
}

.zone-picker::-webkit-color-swatch,
.zone-color-input::-webkit-color-swatch {
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
}

.zone-hex-input {
    width: 80px;
    padding: 0.35rem 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: var(--text-primary, #ffffff);
    font-size: 0.8rem;
    font-family: monospace;
    text-align: center;
    text-transform: uppercase;
}

.zone-hex-input:focus {
    border-color: var(--primary, #00e5ff);
    outline: none;
}

/* Farb-Presets */
.color-presets,
.color3d-presets {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.presets-label {
    font-size: 0.85rem;
    color: var(--text-muted, #8892a0);
}

.preset-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.preset-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary, #ffffff);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preset-btn:hover {
    border-color: var(--primary, #00e5ff);
    background: rgba(0, 229, 255, 0.1);
}

.preset-preview {
    width: 40px;
    height: 16px;
    border-radius: 4px;
}

.preset-name {
    white-space: nowrap;
}

/* Actions */
.color3d-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.btn-color3d {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: var(--text-primary, #ffffff);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-color3d:hover {
    border-color: var(--primary, #00e5ff);
    background: rgba(0, 229, 255, 0.1);
}

.btn-icon {
    font-size: 1rem;
}

/* Info Box */
.color3d-info {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(0, 229, 255, 0.05);
    border: 1px solid rgba(0, 229, 255, 0.2);
    border-radius: 8px;
}

.info-icon {
    color: var(--primary, #00e5ff);
    font-size: 1.1rem;
    line-height: 1;
}

.info-text {
    color: var(--text-muted, #8892a0);
    font-size: 0.85rem;
    line-height: 1.5;
}

.multicolor-note {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-muted, #8892a0);
    font-size: 0.85rem;
}

.multicolor-note .note-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: rgba(0, 229, 255, 0.15);
    border-radius: 50%;
    color: var(--primary, #00e5ff);
    font-size: 0.75rem;
    font-weight: 600;
}

/* ============================================
   KONFIGURATOR PREIS
   ============================================ */

.configurator-price {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.price-label {
    font-weight: 500;
    color: var(--text-muted, #8892a0);
}

.price-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary, #00e5ff);
}

.price-breakdown {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .color-zones,
    .color3d-zones {
        grid-template-columns: repeat(2, 1fr);
    }

    .param-inputs {
        grid-template-columns: 1fr;
    }

    .preset-buttons {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .color3d-actions {
        flex-direction: column;
    }

    .btn-color3d {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .color-zones,
    .color3d-zones {
        grid-template-columns: 1fr;
    }

    .size-buttons {
        flex-direction: column;
    }

    .size-btn {
        width: 100%;
        text-align: center;
    }
}

/* ============================================
   DARK MODE ADJUSTMENTS
   ============================================ */

[data-theme="light"] .configurator-wrapper {
    --text-primary: #1a1a1a;
    --text-muted: #666666;
    --bg-dark: #ffffff;
}

[data-theme="light"] .option-select,
[data-theme="light"] .input-with-unit input,
[data-theme="light"] .zone-hex-input {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.15);
    color: var(--text-primary);
}

[data-theme="light"] .size-btn,
[data-theme="light"] .btn-color3d,
[data-theme="light"] .preset-btn,
[data-theme="light"] .color-zone,
[data-theme="light"] .color3d-zone {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

/* ============================================
   3D VIEWER INTEGRATION
   ============================================ */

.product-3d-viewer-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    background: var(--bg-dark, #0a0f1a);
    border-radius: 12px;
    overflow: hidden;
}

.product-3d-viewer {
    width: 100%;
    height: 100%;
}

.viewer-toolbar {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 8px;
    backdrop-filter: blur(8px);
}

.viewer-toolbar button {
    padding: 0.5rem;
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.viewer-toolbar button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.viewer-toolbar button.active {
    background: var(--primary, #00e5ff);
    color: var(--bg-dark, #0a0f1a);
}
