/* =============================================
   Customizer — Step-by-Step Configurator
   ============================================= */

.customizer {
    padding: 120px 0;
    position: relative;
    z-index: 1;
}

.customizer__header {
    text-align: center;
    margin-bottom: 48px;
}

.customizer__title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.customizer__subtitle {
    color: rgba(232, 228, 240, 0.6);
    font-size: 1.05rem;
}

.customizer__note {
    text-align: center;
    font-size: 0.78rem;
    color: rgba(232, 228, 240, 0.4);
    line-height: 1.5;
    margin-top: 16px;
}

/* ── Step Progress Bar ── */
.cfg-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 48px;
}

.cfg-progress__step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.4;
    transition: opacity 0.4s ease;
}

.cfg-progress__step.active,
.cfg-progress__step.completed {
    opacity: 1;
}

.cfg-progress__dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 700;
    color: rgba(232, 228, 240, 0.5);
    transition: all 0.4s ease;
}

.cfg-progress__step.active .cfg-progress__dot {
    background: var(--gradient-accent);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 0 20px rgba(0, 105, 135, 0.4);
}

.cfg-progress__step.completed .cfg-progress__dot {
    background: var(--cyan);
    border-color: transparent;
    color: #fff;
}

.cfg-progress__step span {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.cfg-progress__line {
    width: 60px;
    height: 2px;
    background: var(--glass-border);
    margin: 0 8px;
    margin-bottom: 24px;
    transition: background 0.4s ease;
}

.cfg-progress__line.completed {
    background: var(--cyan);
}

/* ── Workspace Layout ── */
.cfg-workspace {
    display: flex;
    gap: 48px;
    align-items: flex-start;
}

/* ── Preview (left side, always visible) ── */
.cfg-preview {
    flex: 0 0 340px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: sticky;
    top: 120px;
}

.cfg-preview__canvas {
    position: relative;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 48px;
    width: 100%;
    min-height: 340px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.cfg-preview__canvas[data-uv="true"] {
    border-color: rgba(168, 85, 247, 0.3);
    box-shadow: 0 0 40px rgba(168, 85, 247, 0.08);
}

.cfg-preview__label {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: rgba(232, 228, 240, 0.35);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.cfg-preview__price {
    margin-top: 16px;
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 800;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Resin Preview ── */
.customizer__resin-preview {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 0 60px rgba(0, 105, 135, 0.2),
        0 20px 60px rgba(0, 0, 0, 0.4),
        inset 0 -4px 12px rgba(0, 0, 0, 0.3),
        inset 0 4px 12px rgba(255, 255, 255, 0.1);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), border-radius 0.4s ease;
}

.cfg-preview__canvas[data-type="ashtray"] .customizer__resin-preview { border-radius: 4px; width: 200px; height: 200px; }
.cfg-preview__canvas[data-type="tray"] .customizer__resin-preview { border-radius: 16px; width: 240px; height: 160px; }
.cfg-preview__canvas[data-type="decor"] .customizer__resin-preview { border-radius: 50%; width: 190px; height: 190px; }

.resin-preview__base {
    position: absolute;
    inset: 0;
    background: #4A1A4E;
    transition: background 0.6s ease;
    border-radius: inherit;
}

.resin-preview__swirl {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 70%, var(--teal) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 30%, var(--cyan) 0%, transparent 50%);
    opacity: 0.6;
    mix-blend-mode: screen;
    transition: background 0.6s ease, opacity 0.6s ease, filter 0.4s ease;
    border-radius: inherit;
    animation: swirlMove 8s ease-in-out infinite;
}

@keyframes swirlMove {
    0%, 100% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(3deg) scale(1.02); }
}

.resin-preview__glitter {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0.8;
    transition: opacity 0.4s ease;
}

.resin-preview__glitter[data-glitter="gold"] {
    background:
        radial-gradient(1px 1px at 20% 30%, rgba(255, 215, 0, 0.8) 0%, transparent 100%),
        radial-gradient(1px 1px at 60% 15%, rgba(255, 215, 0, 0.7) 0%, transparent 100%),
        radial-gradient(1px 1px at 80% 60%, rgba(255, 215, 0, 0.9) 0%, transparent 100%),
        radial-gradient(1px 1px at 40% 75%, rgba(255, 215, 0, 0.6) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 50% 50%, rgba(255, 223, 100, 0.9) 0%, transparent 100%);
    animation: glitterShimmer 3s ease-in-out infinite;
}

.resin-preview__glitter[data-glitter="silver"] {
    background:
        radial-gradient(1px 1px at 20% 30%, rgba(220, 220, 255, 0.8) 0%, transparent 100%),
        radial-gradient(1px 1px at 60% 15%, rgba(200, 200, 240, 0.7) 0%, transparent 100%),
        radial-gradient(1px 1px at 80% 60%, rgba(230, 230, 255, 0.9) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 50% 50%, rgba(255, 255, 255, 0.9) 0%, transparent 100%);
    animation: glitterShimmer 3s ease-in-out infinite 0.5s;
}

.resin-preview__glitter[data-glitter="holographic"] {
    background:
        radial-gradient(1.5px 1.5px at 20% 30%, rgba(255, 0, 128, 0.6) 0%, transparent 100%),
        radial-gradient(1px 1px at 60% 15%, rgba(0, 248, 255, 0.6) 0%, transparent 100%),
        radial-gradient(1px 1px at 80% 60%, rgba(255, 215, 0, 0.6) 0%, transparent 100%),
        radial-gradient(1px 1px at 40% 75%, rgba(123, 47, 247, 0.6) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 50% 50%, rgba(255, 255, 255, 0.7) 0%, transparent 100%);
    animation: glitterShimmer 2.5s ease-in-out infinite, holoShift 6s linear infinite;
}

@keyframes holoShift { 0% { filter: hue-rotate(0deg); } 100% { filter: hue-rotate(360deg); } }
.resin-preview__glitter[data-glitter="none"] { opacity: 0; }
@keyframes glitterShimmer { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }

.resin-preview__shine {
    position: absolute;
    top: -30%;
    left: -30%;
    width: 160%;
    height: 160%;
    background: radial-gradient(ellipse at 30% 30%, rgba(255,255,255,0.15) 0%, transparent 60%);
    border-radius: inherit;
    animation: resinShine 6s ease-in-out infinite;
    pointer-events: none;
}

/* ── Step Panels (right side) ── */
.cfg-steps {
    flex: 1;
    min-width: 0;
}

.cfg-step {
    display: none;
    animation: cfgFadeIn 0.4s ease;
}

.cfg-step--active,
.cfg-step.active {
    display: block;
}

@keyframes cfgFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.cfg-step__title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.cfg-step__desc {
    color: rgba(232, 228, 240, 0.5);
    font-size: 0.95rem;
    margin-bottom: 32px;
}

/* ── Color Palettes (Step 1 & 2) ── */
.cfg-palettes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.cfg-palette {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 8px;
    border-radius: var(--radius-md);
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    cursor: pointer;
    transition: all 0.3s ease;
}

.cfg-palette:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
}

.cfg-palette.selected {
    border-color: var(--cyan);
    background: rgba(0, 120, 150, 0.1);
    box-shadow: 0 0 20px rgba(0, 105, 135, 0.2);
}

.cfg-palette__swatch {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: inset 0 -2px 6px rgba(0, 0, 0, 0.3), inset 0 2px 6px rgba(255, 255, 255, 0.15);
}

.cfg-palette span {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: rgba(232, 228, 240, 0.6);
    text-align: center;
}

.cfg-palette.selected span {
    color: var(--light);
}

/* ── Custom Color Picker ── */
.cfg-custom-color {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
}

.cfg-custom-color__label {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: rgba(232, 228, 240, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.color-input {
    -webkit-appearance: none;
    appearance: none;
    width: 42px;
    height: 42px;
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: none;
    padding: 2px;
}

.color-input:hover { border-color: rgba(255, 255, 255, 0.2); }
.color-input::-webkit-color-swatch-wrapper { padding: 0; }
.color-input::-webkit-color-swatch { border: none; border-radius: 4px; }
.color-input::-moz-color-swatch { border: none; border-radius: 4px; }

/* ── Option Groups (Step 3) ── */
.cfg-option-group {
    margin-bottom: 28px;
}

.cfg-option-group__label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(232, 228, 240, 0.45);
    margin-bottom: 12px;
}

.cfg-option-group__items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cfg-option {
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 500;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: rgba(232, 228, 240, 0.65);
    cursor: pointer;
    transition: all 0.3s ease;
}

.cfg-option:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--light);
}

.cfg-option.active {
    background: var(--gradient-accent);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 12px rgba(0, 105, 135, 0.3);
}

#uv-options .cfg-option[data-uv="yes"].active {
    background: var(--gradient-uv);
    box-shadow: 0 2px 16px rgba(168, 85, 247, 0.4);
}

/* ── Review (Step 4) ── */
.cfg-review {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.cfg-review__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.cfg-review__row:last-child {
    border-bottom: none;
}

.cfg-review__row--total {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--glass-border);
    border-bottom: none;
}

.cfg-review__label {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(232, 228, 240, 0.5);
}

.cfg-review__row--total .cfg-review__label {
    color: var(--light);
    font-weight: 700;
}

.cfg-review__value {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cfg-review__row--total .cfg-review__value {
    font-size: 1.4rem;
    font-weight: 800;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cfg-review__swatch {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: inset 0 -1px 3px rgba(0, 0, 0, 0.3);
}

/* ── Navigation Buttons ── */
.cfg-step__nav {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.cfg-next,
.cfg-back {
    padding: 12px 28px;
    border-radius: var(--radius-full);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.cfg-next {
    background: var(--gradient-accent);
    color: #fff;
    box-shadow: 0 4px 20px rgba(0, 105, 135, 0.4);
    margin-left: auto;
}

.cfg-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 105, 135, 0.5);
}

.cfg-back {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: rgba(232, 228, 240, 0.6);
}

.cfg-back:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--light);
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .customizer {
        padding: 60px 0;
    }

    .cfg-workspace {
        flex-direction: column;
    }

    .cfg-preview {
        flex: none;
        width: 100%;
        position: static;
    }

    .cfg-preview__canvas {
        min-height: 220px;
        padding: 24px;
    }

    .customizer__resin-preview {
        width: 160px !important;
        height: 160px !important;
    }

    .cfg-progress__step span {
        font-size: 0.6rem;
    }

    .cfg-progress__line {
        width: 30px;
    }

    .cfg-palettes {
        grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    }
}

@media (max-width: 480px) {
    .cfg-palettes {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .cfg-palette {
        padding: 10px 4px;
    }

    .cfg-palette__swatch {
        width: 32px;
        height: 32px;
    }

    .cfg-option {
        padding: 8px 14px;
        font-size: 0.75rem;
    }

    .cfg-progress__line {
        width: 16px;
    }

    .cfg-progress__dot {
        width: 30px;
        height: 30px;
        font-size: 0.72rem;
    }
}