/* ==========================================================
   DESIGNER PAGE
   ========================================================== */
.designer-body {
    background: var(--bg-alt, #f8f7f4);
}

.designer-main {
    padding-top: 100px;
    padding-bottom: 80px;
    min-height: 100vh;
}

.designer-topbar {
    padding: 30px 0 40px;
    border-bottom: 1px solid rgba(26, 26, 46, 0.08);
    background: #fff;
    margin-bottom: 40px;
}

.designer-heading {
    font-family: var(--font-display, 'Playfair Display', serif);
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    color: var(--primary, #1a1a2e);
    margin: 10px 0 8px;
}

.designer-sub {
    color: var(--text, #2d2d2d);
    max-width: 760px;
    line-height: 1.6;
}

/* Grid layout */
.designer-container {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 40px;
    align-items: start;
}

/* ==========================================================
   LIVE PREVIEW (sticky)
   ========================================================== */
.designer-preview {
    position: sticky;
    top: 100px;
    background: #fff;
    border-radius: 16px;
    border: 1px solid rgba(26, 26, 46, 0.08);
    box-shadow: 0 20px 50px rgba(26, 26, 46, 0.06);
    overflow: hidden;
}

.preview-tabs {
    display: flex;
    border-bottom: 1px solid rgba(26, 26, 46, 0.08);
}

.preview-tab {
    flex: 1;
    padding: 14px 12px;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    color: var(--text-light, #6b6b6b);
    transition: all 0.2s ease;
}

.preview-tab.active {
    color: var(--primary, #1a1a2e);
    border-bottom-color: var(--accent, #c9a96e);
}

.preview-tab:hover:not(.active) {
    color: var(--primary, #1a1a2e);
    background: rgba(201, 169, 110, 0.04);
}

.preview-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 5;
    background: linear-gradient(135deg, #ebe7df 0%, #f5f1e9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#previewCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

.preview-watermark {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display, 'Playfair Display', serif);
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: 700;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.18);
    transform: rotate(-20deg);
    pointer-events: none;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
    user-select: none;
}

.preview-meta {
    padding: 14px 20px;
    font-size: 0.85rem;
    color: var(--text-light, #6b6b6b);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-top: 1px solid rgba(26, 26, 46, 0.08);
    background: #fbfaf7;
}

/* ==========================================================
   WIZARD
   ========================================================== */
.designer-wizard {
    background: #fff;
    border-radius: 16px;
    border: 1px solid rgba(26, 26, 46, 0.08);
    box-shadow: 0 20px 50px rgba(26, 26, 46, 0.06);
    padding: 28px;
}

.step-indicator {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0 0 28px;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
}

.step-indicator::-webkit-scrollbar { display: none; }

.step-indicator li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 30px;
    background: #f3efe6;
    font-size: 0.78rem;
    color: var(--text-light, #6b6b6b);
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}

.step-indicator li span {
    display: inline-flex;
    width: 22px;
    height: 22px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #fff;
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--text-light, #6b6b6b);
}

.step-indicator li.active {
    background: var(--primary, #1a1a2e);
    color: #fff;
}

.step-indicator li.active span {
    background: var(--accent, #c9a96e);
    color: #fff;
}

.step-indicator li.done span {
    background: var(--accent, #c9a96e);
    color: #fff;
}

.step-panel {
    display: none;
}

.step-panel.active {
    display: block;
    animation: fadeSlide 0.25s ease;
}

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

.step-panel h2 {
    font-family: var(--font-display, 'Playfair Display', serif);
    font-size: 1.5rem;
    color: var(--primary, #1a1a2e);
    margin: 0 0 8px;
}

.step-panel > p {
    color: var(--text-light, #6b6b6b);
    margin: 0 0 22px;
    line-height: 1.55;
}

/* Fields */
.field-group {
    margin-bottom: 22px;
}

.field-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary, #1a1a2e);
    margin-bottom: 10px;
}

.field-label small {
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-light, #6b6b6b);
    margin-left: 6px;
}

/* Toggle buttons */
.toggle-group {
    display: inline-flex;
    background: #f3efe6;
    border-radius: 10px;
    padding: 4px;
    gap: 2px;
}

.toggle-btn {
    padding: 10px 16px;
    font-size: 0.85rem;
    border: 0;
    border-radius: 7px;
    background: transparent;
    cursor: pointer;
    color: var(--text-light, #6b6b6b);
    transition: all 0.2s ease;
}

.toggle-btn.active {
    background: #fff;
    color: var(--primary, #1a1a2e);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* Choice grid (scene) */
.choice-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.choice-btn {
    padding: 14px 10px;
    border: 1px solid rgba(26, 26, 46, 0.1);
    border-radius: 10px;
    background: #fff;
    font-size: 0.85rem;
    color: var(--text, #2d2d2d);
    cursor: pointer;
    transition: all 0.2s ease;
}

.choice-btn.active {
    border-color: var(--accent, #c9a96e);
    background: rgba(201, 169, 110, 0.08);
    color: var(--primary, #1a1a2e);
    font-weight: 500;
}

/* Palette */
.palette-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.palette-swatch {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(26, 26, 46, 0.15);
    cursor: pointer;
    transition: transform 0.15s ease;
}

.palette-swatch:hover {
    transform: scale(1.08);
}

.palette-swatch.used::after {
    content: "";
    position: absolute;
    top: -4px;
    right: -4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent, #c9a96e);
    border: 2px solid #fff;
}

.palette-empty {
    color: var(--text-light, #6b6b6b);
    font-size: 0.82rem;
    padding: 8px 0;
}

/* Size form (en × boy) */
.size-form {
    display: flex;
    gap: 12px;
    align-items: end;
    flex-wrap: wrap;
}

.size-form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.78rem;
    color: var(--text-light, #6b6b6b);
    flex: 1;
    min-width: 120px;
}

.size-form input[type="number"] {
    padding: 10px 12px;
    border: 1px solid rgba(26, 26, 46, 0.12);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    width: 100%;
}

.size-form .size-x {
    font-weight: 600;
    color: var(--text-light, #6b6b6b);
    padding-bottom: 12px;
    font-size: 1.1rem;
}

/* Stripe form */
.stripe-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 10px;
    align-items: end;
}

.stripe-form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.78rem;
    color: var(--text-light, #6b6b6b);
}

.stripe-form input[type="number"] {
    padding: 10px 12px;
    border: 1px solid rgba(26, 26, 46, 0.12);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    width: 100%;
}

.stripe-form input[type="color"] {
    height: 42px;
    border: 1px solid rgba(26, 26, 46, 0.12);
    border-radius: 8px;
    padding: 2px;
    cursor: pointer;
    background: #fff;
    width: 100%;
}

.btn.btn-accent {
    background: var(--accent, #c9a96e);
    color: #fff;
    padding: 11px 18px;
    font-size: 0.85rem;
    border-radius: 8px;
    border: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn.btn-accent:hover {
    background: #b5965c;
    transform: translateY(-1px);
}

.hint {
    font-size: 0.78rem;
    color: var(--text-light, #6b6b6b);
    margin-top: 8px;
    line-height: 1.5;
}

/* Stripe list */
.stripe-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border: 1px dashed rgba(26, 26, 46, 0.12);
    border-radius: 10px;
    overflow: hidden;
}

.stripe-list:empty::before {
    content: attr(data-empty);
    display: block;
    padding: 16px;
    text-align: center;
    color: var(--text-light, #6b6b6b);
    font-size: 0.85rem;
}

.stripe-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(26, 26, 46, 0.06);
    font-size: 0.9rem;
}

.stripe-list li:last-child {
    border-bottom: 0;
}

.stripe-list .color-chip {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    border: 1px solid rgba(26, 26, 46, 0.15);
    flex: none;
}

.stripe-list .stripe-meta {
    flex: 1;
    color: var(--text, #2d2d2d);
}

.stripe-list .remove-btn {
    background: transparent;
    border: 0;
    color: var(--text-light, #6b6b6b);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.stripe-list .remove-btn:hover {
    background: #fbeeea;
    color: #c24a3a;
}

/* Checkbox row */
.checkbox-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.92rem;
    color: var(--text, #2d2d2d);
}

.checkbox-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent, #c9a96e);
}

.inherit-dependent.disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* Wizard nav */
.wizard-nav {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid rgba(26, 26, 46, 0.08);
}

.wizard-nav .btn {
    padding: 12px 26px;
    font-size: 0.88rem;
    border-radius: 8px;
    cursor: pointer;
}

.wizard-nav .btn[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Summary */
.summary-card {
    background: var(--bg-alt, #f8f7f4);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.summary-card h3 {
    font-family: var(--font-display, 'Playfair Display', serif);
    color: var(--primary, #1a1a2e);
    margin: 0 0 12px;
    font-size: 1.1rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(26, 26, 46, 0.06);
    font-size: 0.88rem;
}

.summary-row:last-child { border-bottom: 0; }

.summary-row strong {
    color: var(--primary, #1a1a2e);
    font-weight: 600;
}

.summary-row .colors {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.summary-row .colors span {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid rgba(26, 26, 46, 0.15);
}

.result-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.result-actions .btn {
    flex: 1;
    min-width: 200px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
}

/* Responsive */
@media (max-width: 1024px) {
    .designer-container {
        grid-template-columns: 1fr;
    }
    .designer-preview {
        position: static;
    }
}

@media (max-width: 600px) {
    .designer-wizard {
        padding: 20px;
    }
    .stripe-form {
        grid-template-columns: 1fr 1fr;
    }
    .stripe-form .btn {
        grid-column: 1 / -1;
    }
    .choice-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
