/* ==========================================
   Cake Design Wizard Styles
   ========================================== */

.wizard-wrapper {
    min-height: 80vh;
    padding: 2rem 0 4rem;
    background: linear-gradient(180deg, var(--bg-pink) 0%, var(--bg-cream) 100%);
}

.wizard-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.wizard-header {
    text-align: center;
    margin-bottom: 2rem;
}

.wizard-header h1 {
    font-family: var(--font-heading);
    color: var(--text-dark);
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.wizard-header p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Progress Bar */
.wizard-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    position: relative;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.wizard-progress::before {
    content: '';
    position: absolute;
    top: 16px;
    left: 20px;
    right: 20px;
    height: 3px;
    background: var(--border-color);
    z-index: 0;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    cursor: pointer;
    flex-shrink: 0;
    min-width: 60px;
}

.progress-step .step-number {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--bg-white);
    border: 3px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-light);
    transition: var(--transition);
    margin-bottom: 6px;
}

.progress-step .step-label {
    font-size: 0.65rem;
    color: var(--text-light);
    text-align: center;
    transition: var(--transition);
    white-space: nowrap;
}

.progress-step.active .step-number {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(233, 30, 99, 0.2);
}

.progress-step.active .step-label {
    color: var(--primary);
    font-weight: 600;
}

.progress-step.completed .step-number {
    background: var(--mint);
    border-color: var(--mint);
    color: #fff;
}

.progress-step.completed .step-label {
    color: var(--mint);
}

/* Step Panels */
.wizard-step {
    display: none;
    animation: fadeInStep 0.35s ease;
}

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

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

.step-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.step-card h2 {
    font-family: var(--font-heading);
    color: var(--text-dark);
    font-size: 1.5rem;
    margin-bottom: 0.3rem;
}

.step-card .step-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* Option Cards Grid */
.option-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

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

.option-grid.four-col {
    grid-template-columns: repeat(4, 1fr);
}

.option-card {
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.2rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.option-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.option-card.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.15);
}

.option-card .option-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.option-card .option-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-dark);
}

.option-card .option-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

/* Size Options */
.size-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
}

.size-option {
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.size-option:hover {
    border-color: var(--primary-light);
}

.size-option.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}

.size-option .size-label {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.size-option .size-serves {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

/* Color Swatches */
.color-section {
    margin-bottom: 1.5rem;
}

.color-section h3 {
    font-size: 0.95rem;
    color: var(--text-dark);
    margin-bottom: 0.8rem;
}

.color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.color-swatch {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    border: 3px solid transparent;
    position: relative;
}

.color-swatch:hover {
    transform: scale(1.15);
}

.color-swatch.selected {
    border-color: var(--text-dark);
    box-shadow: 0 0 0 3px rgba(62, 39, 35, 0.2);
}

.color-swatch.selected::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 0.85rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.color-name {
    font-size: 0.7rem;
    text-align: center;
    margin-top: 0.3rem;
    color: var(--text-muted);
}

/* Decoration Checkboxes */
.decoration-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
}

.decoration-item {
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.decoration-item:hover {
    border-color: var(--primary-light);
}

.decoration-item.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}

.decoration-item .deco-icon {
    font-size: 1.2rem;
}

.decoration-item .deco-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-dark);
}

/* Form Inputs in Wizard */
.wizard-field {
    margin-bottom: 1.2rem;
}

.wizard-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.4rem;
}

.wizard-field input,
.wizard-field select,
.wizard-field textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-dark);
    background: var(--bg-white);
    transition: var(--transition);
}

.wizard-field input:focus,
.wizard-field select:focus,
.wizard-field textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.1);
}

.wizard-field textarea {
    resize: vertical;
    min-height: 80px;
}

.wizard-field .char-count {
    text-align: right;
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.3rem;
}

.wizard-field .field-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Filling Selector */
.filling-selector {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.filling-selector h3 {
    font-size: 0.95rem;
    color: var(--text-dark);
    margin-bottom: 0.8rem;
}

/* Navigation Buttons */
.wizard-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem;
    gap: 1rem;
}

.wizard-nav .btn-wizard {
    padding: 0.8rem 2rem;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-wizard-prev {
    background: var(--bg-white);
    color: var(--text-body);
    border: 2px solid var(--border-color) !important;
}

.btn-wizard-prev:hover {
    background: var(--bg-light);
    border-color: var(--border-medium) !important;
}

.btn-wizard-next {
    background: var(--primary);
    color: #fff;
    margin-left: auto;
}

.btn-wizard-next:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-wizard-submit {
    background: linear-gradient(135deg, var(--primary), #ff6090);
    color: #fff;
    margin-left: auto;
    padding: 1rem 2.5rem !important;
    font-size: 1.05rem !important;
}

.btn-wizard-submit:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Review Step */
.review-section {
    margin-bottom: 1.5rem;
}

.review-section h3 {
    font-size: 1rem;
    color: var(--primary);
    margin-bottom: 0.8rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--primary-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.review-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

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

.review-label {
    font-weight: 600;
    color: var(--text-dark);
}

.review-value {
    color: var(--text-body);
    text-align: right;
}

.review-colors {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.review-color-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,0.1);
    display: inline-block;
}

/* Validation Error */
.wizard-error {
    background: #ffebee;
    color: #c62828;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    display: none;
    align-items: center;
    gap: 0.5rem;
}

.wizard-error.show {
    display: flex;
}

/* Success Page */
.wizard-success {
    text-align: center;
    padding: 3rem 1rem;
}

.wizard-success .success-icon {
    font-size: 4rem;
    color: var(--mint);
    margin-bottom: 1rem;
}

.wizard-success h2 {
    font-family: var(--font-heading);
    color: var(--text-dark);
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.wizard-success .order-number {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    margin: 0.5rem 0;
}

.wizard-success p {
    color: var(--text-muted);
    max-width: 500px;
    margin: 1rem auto;
    line-height: 1.6;
}

/* Loading State */
.wizard-loading {
    display: none;
    text-align: center;
    padding: 2rem;
}

.wizard-loading.show {
    display: block;
}

.wizard-loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .wizard-header h1 { font-size: 1.6rem; }
    .step-card { padding: 1.5rem; }

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

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

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

    .field-row {
        grid-template-columns: 1fr;
    }

    .size-options {
        grid-template-columns: 1fr;
    }

    .wizard-progress {
        gap: 0;
    }

    .progress-step {
        min-width: 48px;
    }

    .progress-step .step-label {
        font-size: 0.55rem;
    }

    .review-row {
        flex-direction: column;
        gap: 0.2rem;
    }

    .review-value {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .wizard-wrapper { padding: 1rem 0 2rem; }
    .wizard-container { padding: 0 1rem; }
    .step-card { padding: 1.2rem; }
    .step-card h2 { font-size: 1.2rem; }

    .option-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.7rem;
    }

    .option-card { padding: 0.8rem 0.5rem; }
    .option-card .option-icon { font-size: 1.5rem; }

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

    .wizard-nav .btn-wizard {
        padding: 0.7rem 1.2rem;
        font-size: 0.85rem;
    }

    .progress-step .step-label {
        display: none;
    }

    .progress-step .step-number {
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
    }
}
