:root {
    --dusty-rose: #dfb1bc;
    --dusty-rose-light: #f4e7ed;
    --gold: #d4af37;
    --gold-light: #e5d5b0;
    --anthracite: #2d2d2d;
    --text-grey: #666666;
    --white: #ffffff;
    --bg-main: #fdfcfc;
    --shadow-premium: 0 10px 40px rgba(223, 177, 188, 0.2);
    --radius-premium: 24px;
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

h1, h2, h3, .serif { 
    font-family: 'Playfair Display', serif; 
}
body { 
    font-family: 'Montserrat', sans-serif; 
    margin: 0;
    padding: 0;
    background-color: var(--bg-main);
    color: var(--anthracite);
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes progressFill {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes checkmark {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(212, 175, 55, 0); }
    100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
}

@keyframes float {
    0% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}

/* Header Overrides */
.builder-header {
    padding: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.builder-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 40px;
    max-width: 1300px;
    margin: 0 auto;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--anthracite);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.back-link:hover {
    color: var(--dusty-rose);
}

/* Page Container */
.builder-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-main) 0%, var(--dusty-rose-light) 100%);
    padding: 40px 20px;
}

.builder-page .container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Intro Section */
.builder-intro {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInUp 0.6s ease-out;
}

.builder-intro h1 {
    font-size: 2.8rem;
    color: var(--anthracite);
    margin-bottom: 10px;
}

.builder-intro .italic {
    font-style: italic;
    color: var(--dusty-rose);
}

.builder-intro p {
    font-size: 1.1rem;
    color: var(--text-grey);
}

/* Step Content Titles */
.step-title {
    font-size: 1.8rem;
    margin-bottom: 8px;
    color: var(--anthracite);
}

.step-subtitle {
    color: var(--text-grey);
    font-size: 0.95rem;
    margin-bottom: 30px;
}

/* Wizard Container */
.wizard-container {
    width: 100%;
    max-width: 1100px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-premium);
    box-shadow: var(--shadow-premium);
    display: flex;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255,255,255,0.5);
}

/* Progress Sidebar (Desktop) */
.wizard-sidebar {
    width: 300px;
    background: rgba(255, 255, 255, 0.5);
    padding: 40px 30px;
    border-right: 1px solid rgba(223, 177, 188, 0.3);
}

.step-indicator {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    position: relative;
    opacity: 0.5;
    transition: var(--transition);
}

.step-indicator::after {
    content: '';
    position: absolute;
    left: 17px;
    top: 40px;
    width: 2px;
    height: calc(100% - 10px);
    background: var(--dusty-rose-light);
    z-index: 1;
}

.step-indicator:last-child::after {
    display: none;
}

.step-indicator.active {
    opacity: 1;
}

.step-indicator.completed {
    opacity: 1;
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--white);
    border: 2px solid var(--dusty-rose);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--dusty-rose);
    z-index: 2;
    transition: var(--transition);
}

.active .step-number {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--white);
    box-shadow: 0 0 0 5px rgba(212, 175, 55, 0.2);
}

.completed .step-number {
    background: var(--dusty-rose);
    color: var(--white);
}

.step-label {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    color: var(--anthracite);
}

/* Mobile Progress */
.wizard-progress-mobile {
    display: none;
}

/* Content Area */
.wizard-content {
    flex: 1;
    padding: 40px;
    position: relative;
    min-height: 500px;
    display: flex;
    flex-direction: column;
}

.wizard-step {
    display: none;
    flex: 1;
    animation: fadeInUp 0.5s ease forwards;
}

.wizard-step.active {
    display: block;
}

.wizard-step h2 {
    font-size: 2rem;
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--anthracite);
}

.wizard-step > p {
    color: var(--text-grey);
    margin-bottom: 30px;
}

/* Step 1 - Categories */
.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.category-card {
    background: var(--white);
    border: 2px solid transparent;
    border-radius: 16px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    animation: scaleIn 0.5s ease forwards;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.category-card.selected {
    border-color: var(--gold);
    background: rgba(212, 175, 55, 0.05);
    box-shadow: 0 10px 25px rgba(212, 175, 55, 0.2);
    animation: pulse 2s infinite;
}

.category-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--dusty-rose-light), var(--white));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--dusty-rose);
}

.category-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--anthracite);
}

/* Step 2 - Configuration */
.config-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row .form-group {
    flex: 1;
}

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

.form-group label {
    font-weight: 500;
    color: var(--anthracite);
    font-size: 0.95rem;
}

.form-group select,
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 12px;
    background: rgba(255,255,255,0.9);
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    color: var(--anthracite);
    transition: var(--transition);
    height: 48px;
    box-sizing: border-box;
}

.form-group textarea {
    height: 120px;
    resize: vertical;
}

.form-group select:focus,
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--dusty-rose);
    box-shadow: 0 0 0 3px rgba(223, 177, 188, 0.2);
}

/* Step 3 - Reference Image */
.upload-zone {
    border: 2px dashed rgba(223, 177, 188, 0.6);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: var(--transition);
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.upload-zone:hover, .upload-zone.dragover {
    background: rgba(244, 231, 237, 0.5);
    border-color: var(--dusty-rose);
    box-shadow: 0 0 20px rgba(223, 177, 188, 0.2);
}

.upload-preview {
    margin-top: 20px;
    position: relative;
    display: none; /* Shown via JS */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.upload-preview img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    display: block;
}

.remove-image {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255,255,255,0.9);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #ff4444;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: var(--transition);
}

.remove-image:hover {
    background: #ff4444;
    color: white;
}

/* Step 4 - Summary */
.summary-card {
    background: var(--white);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 15px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

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

.summary-label {
    font-weight: 500;
    color: var(--text-grey);
}

.summary-value {
    font-weight: 600;
    color: var(--anthracite);
    text-align: right;
}

/* Navigation Buttons */
.wizard-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.wizard-nav button {
    padding: 12px 24px;
    border-radius: 12px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-prev {
    background: transparent;
    border: 2px solid var(--dusty-rose);
    color: var(--dusty-rose);
}

.btn-prev:hover {
    background: rgba(223, 177, 188, 0.1);
}

.btn-next {
    background: var(--dusty-rose);
    border: 2px solid var(--dusty-rose);
    color: var(--white);
    margin-left: auto;
}

.btn-next:hover {
    background: #c993a2;
    border-color: #c993a2;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(223, 177, 188, 0.4);
}

.btn-submit {
    background: var(--gold);
    border: 2px solid var(--gold);
    color: var(--white);
    padding: 12px 32px;
    font-size: 1.1rem;
    margin-left: auto;
    display: none; /* Shown on last step */
}

.btn-submit:hover {
    background: #c29d2b;
    border-color: #c29d2b;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.4);
}

/* Success State */
.success-screen {
    position: absolute;
    inset: 0;
    background: var(--white);
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
    display: none; /* Toggle via JS */
}

.success-screen.active {
    display: flex;
    animation: fadeInUp 0.5s ease forwards;
}

.success-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--dusty-rose-light);
    color: var(--dusty-rose);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin-bottom: 20px;
    animation: checkmark 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards, float 3s ease-in-out infinite;
}

.success-title {
    font-size: 2.5rem;
    color: var(--anthracite);
    margin-bottom: 10px;
}

.success-subtitle {
    font-size: 1.1rem;
    color: var(--text-grey);
}

/* Responsive */
@media (max-width: 960px) {
    .wizard-sidebar {
        display: none;
    }

    .wizard-progress-mobile {
        display: block;
        padding: 20px 40px 0;
    }

    .progress-bar {
        height: 6px;
        background: rgba(0,0,0,0.05);
        border-radius: 3px;
        position: relative;
        margin-bottom: 15px;
    }

    .progress-fill {
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        background: var(--dusty-rose);
        border-radius: 3px;
        width: 25%; /* Default */
        transition: width 0.4s ease;
    }

    .progress-step-dots {
        display: flex;
        justify-content: space-between;
    }

    .progress-step-dots span {
        font-size: 0.8rem;
        color: var(--text-grey);
        font-weight: 500;
    }

    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .builder-page {
        padding: 0;
    }

    .wizard-container {
        border-radius: 0;
        min-height: 100vh;
        border: none;
    }

    .wizard-content {
        padding: 20px;
    }

    .category-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        flex-direction: column;
        gap: 20px;
    }

    .wizard-nav {
        flex-direction: column-reverse;
        gap: 15px;
    }
    
    .btn-prev, .btn-next, .btn-submit {
        width: 100%;
        justify-content: center;
        margin-left: 0;
    }
}

/* Validation Error States */
.is-invalid {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15) !important;
}

.error-message {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

.text-danger {
    color: #e74c3c;
    font-weight: 600;
}

/* Shake Animation */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* Form Control Base (for dynamically generated fields) */
.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0d6d9;
    border-radius: 12px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    color: var(--anthracite);
    background: var(--white);
    transition: var(--transition);
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: var(--dusty-rose);
    box-shadow: 0 0 0 3px rgba(223, 177, 188, 0.2);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* Full Width Group Utility */
.full-width-group {
    width: 100%;
}

/* Color Swatches (Muestras de Color) */
.color-swatch-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.swatch-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 8px;
    background: var(--white);
    border: 2px solid #e2d8dc;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    color: var(--anthracite);
}

.swatch-btn:hover {
    border-color: var(--dusty-rose);
    transform: translateY(-2px);
}

.swatch-btn.active {
    border-color: var(--dusty-rose);
    background: var(--dusty-rose-light);
    box-shadow: 0 4px 12px rgba(223, 177, 188, 0.4);
    font-weight: 600;
}

.swatch-circle {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

/* Pills Selection (Tallas y Medidas) */
.pills-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.pill-btn {
    padding: 10px 22px;
    background: var(--white);
    border: 2px solid #e2d8dc;
    border-radius: 50px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--anthracite);
    cursor: pointer;
    transition: var(--transition);
}

.pill-btn:hover {
    border-color: var(--dusty-rose);
    color: var(--dusty-rose);
    transform: translateY(-2px);
}

.pill-btn.active {
    background: var(--dusty-rose);
    color: var(--white);
    border-color: var(--dusty-rose);
    box-shadow: 0 4px 15px rgba(223, 177, 188, 0.5);
}

/* Mini Visual Option Cards (Tarjetas de opciones con icono) */
.visual-cards-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.mini-option-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--white);
    border: 2px solid #e2d8dc;
    border-radius: 16px;
    cursor: pointer;
    transition: var(--transition);
}

.mini-option-card:hover {
    border-color: var(--dusty-rose);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
}

.mini-option-card.active {
    border-color: var(--dusty-rose);
    background: var(--dusty-rose-light);
    box-shadow: 0 4px 15px rgba(223, 177, 188, 0.35);
}

.mini-card-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--dusty-rose-light), #fff);
    color: var(--dusty-rose);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.mini-option-card.active .mini-card-icon {
    background: var(--dusty-rose);
    color: var(--white);
}

.mini-card-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--anthracite);
    line-height: 1.3;
}

/* Mockup Live Preview Layout */
.mockup-preview-wrapper {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    align-items: start;
}

.mockup-display-card {
    background: var(--white);
    border-radius: var(--radius-premium);
    padding: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.04);
    border: 1px solid rgba(223, 177, 188, 0.3);
    position: sticky;
    top: 100px;
}

.mockup-badge {
    font-size: 12px;
    font-weight: 600;
    color: var(--dusty-rose);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mockup-img-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 16px;
    overflow: hidden;
    background: #f8f6f7;
}

.mockup-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.2s ease-in-out;
}

.mockup-overlay-badge {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(45, 45, 45, 0.8);
    color: var(--white);
    backdrop-filter: blur(5px);
    padding: 4px 14px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

@media (max-width: 860px) {
    .mockup-preview-wrapper {
        grid-template-columns: 1fr;
    }
    
    .mockup-display-card {
        position: static;
        max-width: 320px;
        margin: 0 auto 20px;
    }
}


