:root {
    --wz-primary: #f26525;
    --wz-primary-hover: #d9551a;
    --wz-primary-dark: #b84715;
    --wz-primary-soft: #fff4ef;
    --wz-primary-muted: #fde8dc;
    --wz-bg: #f7f7f8;
    --wz-white: #ffffff;
    --wz-text: #1a1a1a;
    --wz-text-muted: #6b7280;
    --wz-text-dark: #374151;
    --wz-border: #e8e8ea;
    --wz-charcoal-200: #d8d8dc;
    --wz-radius: 14px;
    --wz-radius-sm: 10px;
    --wz-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    --wz-shadow-hover: 0 8px 28px rgba(242, 101, 37, 0.18);
    --font: Vazirmatn, Tahoma, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html {
    font-family: var(--font);
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    background: var(--wz-bg);
    color: var(--wz-text);
}

.wizard-root,
.wizard-root button,
.wizard-root input,
.wizard-root select,
.wizard-root textarea {
    font-family: var(--font);
}

.wizard-hidden { display: none !important; }

.wizard-root {
    width: 100%;
    min-height: 100vh;
}

/* ─── باکس اولیه انتخاب برند ─── */
.wizard-entry {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

.wizard-entry-card {
    background: var(--wz-white);
    border-radius: var(--wz-radius);
    box-shadow: var(--wz-shadow);
    padding: 1.25rem;
    width: 100%;
    max-width: 720px;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    border-top: 4px solid var(--wz-primary);
}

.wizard-entry-header {
    text-align: center;
    padding-bottom: 0.25rem;
}

.wizard-entry-title {
    margin: 0 0 0.35rem;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--wz-text);
}

.wizard-entry-subtitle {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--wz-text-muted);
    line-height: 1.6;
}

.wizard-brand-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

@media (min-width: 576px) {
    .wizard-brand-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 768px) {
    .wizard-brand-grid { grid-template-columns: repeat(5, 1fr); }
}

.wizard-brand-item,
.wizard-other-brands {
    cursor: pointer;
    background: var(--wz-white);
    border-radius: var(--wz-radius-sm);
    padding: 0.75rem 0.5rem 0.625rem;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    border: 1px solid var(--wz-border);
    min-height: 7.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
}

.wizard-brand-item:hover,
.wizard-other-brands:hover {
    transform: translateY(-2px);
    box-shadow: var(--wz-shadow-hover);
    border-color: var(--wz-primary);
}

.wizard-brand-item.selected {
    border-color: var(--wz-primary);
    background: var(--wz-primary-soft);
    box-shadow: 0 0 0 2px rgba(242, 101, 37, 0.25);
}

.wizard-brand-figure {
    width: 4.5rem;
    height: 4.5rem;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #fafafa;
    overflow: hidden;
    transition: transform 0.25s ease;
}

.wizard-brand-item:hover .wizard-brand-figure {
    animation: wz-pulse 0.6s ease;
}

@keyframes wz-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

.wizard-brand-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.35rem;
}

.wizard-brand-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--wz-primary);
    background: var(--wz-primary-soft);
}

.wizard-brand-name {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--wz-text-dark);
}

.wizard-other-brands {
    background: var(--wz-primary-soft);
    border-color: rgba(242, 101, 37, 0.35);
    justify-content: center;
}

.wizard-other-brands:hover { background: var(--wz-primary-muted); }

.wizard-other-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--wz-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    color: var(--wz-primary);
    border: 1px dashed var(--wz-primary);
}

.wizard-other-text {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--wz-primary);
}

.wizard-entry-footer { margin-top: 0.25rem; }

/* ─── فلو اصلی ─── */
.wizard-flow { padding: 0; }

.wizard-container {
    max-width: 980px;
    margin: 0 auto;
    padding: 0 0 2rem;
}

.wizard-flow-header {
    padding: 1.25rem 1rem 0;
    border-bottom: 3px solid var(--wz-primary);
    margin: 0 1rem 1rem;
    background: var(--wz-white);
    border-radius: var(--wz-radius) var(--wz-radius) 0 0;
    box-shadow: var(--wz-shadow);
}

.wizard-back-link {
    background: none;
    border: none;
    color: var(--wz-primary);
    font-family: inherit;
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.wizard-back-link:hover { color: var(--wz-primary-hover); }

.wizard-flow-heading {
    margin: 0 0 1rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.wizard-layout {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0 1rem 1rem;
}

@media (min-width: 768px) {
    .wizard-layout {
        flex-direction: row;
        align-items: flex-start;
        gap: 1rem;
    }
}

/* ─── سایدبار ─── */
.wizard-sidebar {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    flex-shrink: 0;
    scrollbar-width: none;
}

.wizard-sidebar::-webkit-scrollbar { display: none; }

@media (min-width: 768px) {
    .wizard-sidebar {
        flex-direction: column;
        width: 190px;
        min-width: 190px;
        overflow-x: visible;
        padding-bottom: 0;
    }
}

.wizard-tab {
    flex-shrink: 0;
    border-radius: var(--wz-radius-sm);
    border: 1px solid var(--wz-charcoal-200);
    background: var(--wz-white);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    min-width: 105px;
}

@media (min-width: 768px) {
    .wizard-tab {
        min-width: 0;
        width: 100%;
        margin-bottom: 0.625rem;
    }
}

.wizard-tab-body { padding: 0.5rem 0.75rem; }

@media (min-width: 768px) {
    .wizard-tab-body { padding: 0.75rem 1rem; }
}

.wizard-tab-head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin-bottom: 0.2rem;
}

@media (min-width: 768px) {
    .wizard-tab-head { justify-content: flex-start; }
}

.wizard-tab-label {
    font-size: 0.8125rem;
    white-space: nowrap;
    color: var(--wz-text-dark);
}

.wizard-tab-value {
    display: none;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--wz-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (min-width: 768px) {
    .wizard-tab-value { display: block; }
}

.wizard-tab-status {
    display: none;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--wz-primary);
}

@media (min-width: 768px) {
    .wizard-tab.is-active .wizard-tab-status { display: block; }
}

.wizard-tab-check {
    display: none;
    width: 1.125rem;
    height: 1.125rem;
    border-radius: 50%;
    background: var(--wz-primary);
    color: #fff;
    font-size: 0.625rem;
    line-height: 1.125rem;
    text-align: center;
    flex-shrink: 0;
}

.wizard-tab.is-done .wizard-tab-check { display: inline-block; }

.wizard-tab.is-done {
    border-color: var(--wz-primary);
    background: var(--wz-primary-soft);
}

.wizard-tab.is-active {
    border-color: var(--wz-primary);
    background: var(--wz-primary-muted);
    box-shadow: 0 0 0 1px rgba(242, 101, 37, 0.3);
}

.wizard-tab.is-active .wizard-tab-label { font-weight: 700; color: var(--wz-primary-dark); }

.wizard-tab.is-pending {
    border-color: var(--wz-charcoal-200);
    background: var(--wz-white);
    cursor: default;
}

.wizard-tab.is-done:not(.is-active) { cursor: pointer; }

/* ─── محتوای اصلی ─── */
.wizard-main {
    flex: 1;
    min-width: 0;
    background: var(--wz-white);
    border-radius: var(--wz-radius);
    padding: 1.25rem;
    box-shadow: var(--wz-shadow);
    border: 1px solid var(--wz-border);
}

@media (min-width: 768px) {
    .wizard-main { padding: 1.5rem; }
}

.wizard-step-title {
    margin: 0 0 1.25rem;
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--wz-text);
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--wz-primary-soft);
}

.wizard-option-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (min-width: 576px) {
    .wizard-option-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 768px) {
    .wizard-option-grid { grid-template-columns: repeat(4, 1fr); }
}

.wizard-option-card {
    border: 1px solid var(--wz-border);
    border-radius: var(--wz-radius-sm);
    background: var(--wz-white);
    padding: 0.875rem 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.15s, box-shadow 0.15s;
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--wz-text);
    min-height: 3.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wizard-option-card:hover {
    border-color: var(--wz-primary);
    background: var(--wz-primary-soft);
    transform: translateY(-1px);
    box-shadow: var(--wz-shadow-hover);
}

.wizard-option-card.selected {
    border-color: var(--wz-primary);
    background: var(--wz-primary-soft);
    box-shadow: 0 0 0 2px rgba(242, 101, 37, 0.2);
    font-weight: 700;
    color: var(--wz-primary-dark);
}

.wizard-option-card.model-card {
    font-size: 0.8125rem;
    min-height: 3.5rem;
}

.wizard-phone-panel { max-width: 440px; }

.wizard-field { margin-bottom: 1.25rem; }

.wizard-field label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--wz-text-dark);
}

.wizard-field input {
    width: 100%;
    border: 1px solid var(--wz-border);
    border-radius: var(--wz-radius-sm);
    padding: 0.875rem 1rem;
    font-family: inherit;
    font-size: 1rem;
    direction: ltr;
    text-align: left;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.wizard-field input:focus {
    outline: none;
    border-color: var(--wz-primary);
    box-shadow: 0 0 0 3px rgba(242, 101, 37, 0.15);
}

.wizard-otp-field input {
    letter-spacing: 0.35em;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
    direction: ltr;
}

.wizard-otp-hint {
    margin: 0.5rem 0 0;
    font-size: 0.8125rem;
    color: var(--wz-text-muted);
}

.wizard-link-btn {
    display: block;
    width: 100%;
    margin-top: 0.75rem;
    background: none;
    border: none;
    color: var(--wz-primary);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.wizard-link-btn:hover { color: var(--wz-primary-hover); }

.wizard-field input[readonly] {
    background: #f9fafb;
    color: var(--wz-text-muted);
}

.wizard-price-panel {
    background: linear-gradient(135deg, var(--wz-primary-soft) 0%, #fff 100%);
    border: 1px solid rgba(242, 101, 37, 0.35);
    border-radius: var(--wz-radius);
    padding: 1.125rem 1.25rem;
    margin-bottom: 1.25rem;
}

.wizard-price-label {
    font-size: 0.8125rem;
    color: var(--wz-text-muted);
    margin-bottom: 0.35rem;
}

.wizard-price-value {
    font-size: 1.1875rem;
    font-weight: 700;
    color: var(--wz-primary);
}

.wizard-price-loading {
    color: var(--wz-text-muted);
    font-weight: 400;
    font-size: 0.9375rem;
}

.wizard-auto-msg {
    margin: 1rem 0 0;
    text-align: center;
    color: var(--wz-text-muted);
    font-size: 0.9375rem;
}

.wizard-summary {
    background: #fafafa;
    border-radius: var(--wz-radius-sm);
    padding: 1rem;
    font-size: 0.875rem;
    color: var(--wz-text-muted);
    margin-bottom: 1.25rem;
    line-height: 1.9;
    border: 1px solid var(--wz-border);
}

.wizard-summary strong { color: var(--wz-text-dark); }

/* دکمه‌ها */
.wizard-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    border: none;
    border-radius: var(--wz-radius-sm);
    padding: 0.9375rem 1.5rem;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s, opacity 0.15s;
}

.wizard-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.wizard-btn-primary {
    background: var(--wz-primary);
    color: #fff;
    box-shadow: 0 4px 14px rgba(242, 101, 37, 0.35);
}

.wizard-btn-primary:hover:not(:disabled) {
    background: var(--wz-primary-hover);
    transform: translateY(-1px);
}

.wizard-btn-primary.is-success,
.wizard-btn-primary.is-success:disabled {
    background: #16a34a;
    color: #fff;
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.35);
    opacity: 1;
    cursor: default;
    transform: none;
}

.wizard-btn-arrow { font-size: 1.25rem; line-height: 1; }

.wizard-nav-row {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.wizard-btn-outline {
    background: var(--wz-white);
    border: 1px solid var(--wz-border);
    color: var(--wz-text);
    flex: 0 0 auto;
    width: auto;
    padding: 0.75rem 1.25rem;
    box-shadow: none;
    font-weight: 600;
}

.wizard-btn-outline:hover {
    border-color: var(--wz-primary);
    color: var(--wz-primary);
    background: var(--wz-primary-soft);
}

.wizard-nav-row .wizard-btn-primary { flex: 1; }

.wizard-msg {
    margin-top: 1rem;
    font-size: 0.875rem;
    min-height: 1.25rem;
}

.wizard-msg.ok { color: var(--wz-primary-dark); }
.wizard-msg.err { color: #dc2626; }

.wizard-empty {
    text-align: center;
    padding: 2rem;
    color: var(--wz-text-muted);
}

/* موفقیت */
.wizard-success-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

.wizard-success-card {
    background: var(--wz-white);
    border-radius: var(--wz-radius);
    box-shadow: var(--wz-shadow);
    padding: 2.5rem 2rem;
    text-align: center;
    max-width: 420px;
    width: 100%;
    border-top: 4px solid var(--wz-primary);
}

.wizard-success-icon {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    background: var(--wz-primary-soft);
    color: var(--wz-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1.25rem;
    border: 2px solid var(--wz-primary);
}

.wizard-success-heading {
    margin: 0 0 0.75rem;
    font-size: 1.25rem;
}

.wizard-success-text {
    color: var(--wz-text-muted);
    margin: 0 0 1.5rem;
    line-height: 1.6;
}

/* مودال */
.wizard-modal {
    position: fixed;
    inset: 0;
    z-index: 1000010;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* مودال مراحل (embed در وردپرس) */
html.wizard-scroll-lock {
    overflow: hidden;
}

.wizard-flow-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
}

.wizard-flow-overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.58);
}

.wizard-flow-overlay-panel {
    position: relative;
    background: var(--wz-white);
    border-radius: var(--wz-radius);
    width: min(100%, 980px);
    max-height: 92vh;
    overflow: auto;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
    border-top: 4px solid var(--wz-primary);
}

.wizard-flow-overlay-close {
    position: absolute;
    top: 0.65rem;
    left: 0.75rem;
    z-index: 3;
    width: 2.25rem;
    height: 2.25rem;
    border: none;
    border-radius: 50%;
    background: var(--wz-bg);
    color: var(--wz-text-muted);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.wizard-flow-overlay-close:hover {
    background: var(--wz-primary-soft);
    color: var(--wz-primary);
}

.wizard-flow-overlay .wizard-flow {
    padding: 0;
}

.wizard-flow-overlay .wizard-container {
    max-width: none;
    padding-bottom: 1.5rem;
}

.wizard-flow-overlay .wizard-success-screen {
    min-height: auto;
    padding: 2rem 1rem 2.5rem;
}

@media (max-width: 767px) {
    .wizard-flow-overlay {
        padding: 0;
        align-items: stretch;
    }

    .wizard-flow-overlay-panel {
        max-height: none;
        height: 100%;
        border-radius: 0;
    }
}

.wizard-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.wizard-modal-panel {
    position: relative;
    background: #fff;
    border-radius: var(--wz-radius);
    width: min(100%, 460px);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    border-top: 4px solid var(--wz-primary);
}

.wizard-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--wz-border);
}

.wizard-modal-head h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.wizard-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--wz-text-muted);
    line-height: 1;
}

.wizard-search {
    margin: 0.75rem 1rem 0;
    width: calc(100% - 2rem);
    border: 1px solid var(--wz-border);
    border-radius: var(--wz-radius-sm);
    padding: 0.75rem 0.875rem;
    font-family: inherit;
}

.wizard-search:focus {
    outline: none;
    border-color: var(--wz-primary);
    box-shadow: 0 0 0 3px rgba(242, 101, 37, 0.12);
}

.wizard-manufacturer-list {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0 0 1rem;
    overflow-y: auto;
    max-height: 50vh;
}

.wizard-manufacturer-list li button {
    width: 100%;
    text-align: right;
    border: none;
    background: none;
    padding: 0.75rem 1.25rem;
    font-family: inherit;
    font-size: 0.9375rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.wizard-manufacturer-list li button:hover { background: var(--wz-primary-soft); }

.wizard-mfr-logo {
    width: 2.5rem;
    height: 2.5rem;
    object-fit: contain;
    border-radius: 50%;
    background: #fafafa;
    flex-shrink: 0;
    padding: 0.2rem;
}

.wizard-mfr-logo-placeholder {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--wz-primary-soft);
    color: var(--wz-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
    flex-shrink: 0;
}

.wizard-mfr-meta {
    flex: 1;
    min-width: 0;
}

.wizard-mfr-name {
    display: block;
    font-weight: 600;
    color: var(--wz-text);
}

.wizard-mfr-count {
    display: block;
    font-size: 0.75rem;
    color: var(--wz-text-muted);
}
