/* ====== ویزارد مرحله‌به‌مرحله‌ی ثبت آگهی ====== */
.wizard-container {
    max-width: 780px;
    margin: 30px auto;
    background: var(--card-bg);
    padding: 32px;
    border-radius: var(--radius);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(212, 175, 55, 0.3);
}
.info-box {
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.4);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 22px;
}

.wizard-progress { height: 8px; background: #E2E8F0; border-radius: 8px; overflow: hidden; }
.wizard-progress-bar { height: 100%; width: 0; background: var(--gold-gradient); border-radius: 8px; transition: width 0.4s ease; }
.wizard-label { margin: 10px 0 18px; font-size: 0.9rem; color: var(--text-muted); font-weight: 600; }

/* ناحیه‌ی مراحل: بیرون‌زدگی پنل‌ها پنهان می‌شود تا اسکرول افقی ایجاد نشود */
.wizard-viewport { position: relative; overflow: hidden; padding: 4px; min-height: 260px; }
.step-panel { display: none; }
.step-panel.active { display: block; }

/* راست ← بیرون می‌رود، چپ ← وارد می‌شود */
.step-panel.exit-right { animation: wizExitRight 0.23s ease-in forwards; }
.step-panel.exit-left  { animation: wizExitLeft 0.23s ease-in forwards; }
.step-panel.enter-left  { animation: wizEnterLeft 0.33s ease-out; }
.step-panel.enter-right { animation: wizEnterRight 0.33s ease-out; }
@keyframes wizExitRight  { to { transform: translateX(110%);  opacity: 0; } }
@keyframes wizExitLeft   { to { transform: translateX(-110%); opacity: 0; } }
@keyframes wizEnterLeft  { from { transform: translateX(-110%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes wizEnterRight { from { transform: translateX(110%);  opacity: 0; } to { transform: none; opacity: 1; } }

.step-title { font-size: 1.3rem; color: var(--primary-color); margin-bottom: 6px; }
.step-subtitle { margin-bottom: 18px; font-size: 0.92rem; }
.step-panel .field:first-of-type { margin-top: 16px; }

/* انتخاب دسته‌بندی */
.category-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 8px; }
.category-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    padding: 18px 12px;
    background: #F8FAFC;
    border: 2px solid var(--border);
    border-radius: 14px;
    cursor: pointer;
    transition: 0.25s;
}
.category-card:hover { border-color: var(--gold-solid); transform: translateY(-2px); }
.category-card input { position: absolute; opacity: 0; pointer-events: none; }
.category-card:has(input:checked) { border-color: var(--gold-solid); background: rgba(212, 175, 55, 0.12); }
.cat-icon { font-size: 2rem; }
.category-card b { color: var(--primary-color); }
.category-card small { color: var(--text-muted); font-size: 0.78rem; line-height: 1.5; }

/* فیلدها */
.field { margin-bottom: 22px; }
.field-label { display: block; margin-bottom: 9px; font-weight: 700; color: var(--primary-color); }
.field-label .optional { color: var(--text-muted); font-weight: 400; }

.input-box { position: relative; display: flex; align-items: center; }
.input-box input, .input-box textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    background: #F8FAFC;
    outline: none;
    transition: 0.25s;
}
.input-box input:focus, .input-box textarea:focus { border-color: var(--gold-solid); box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2); }
.input-box .unit { position: absolute; left: 14px; color: var(--text-muted); font-size: 0.85rem; pointer-events: none; }
.input-box input[inputmode="numeric"] { direction: ltr; text-align: right; padding-left: 80px; }

.price-helper { display: block; min-height: 20px; margin-top: 6px; font-size: 0.85rem; color: #8A6A12; font-weight: 600; }

/* چیپ‌های انتخابی */
.chip-group { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
    display: inline-block;
    padding: 9px 18px;
    border: 1px solid var(--border);
    border-radius: 30px;
    background: #F8FAFC;
    font-weight: 600;
    font-size: 0.95rem;
    transition: 0.2s;
}
.chip:hover span { border-color: var(--gold-solid); }
.chip input:checked + span { background: var(--primary-color); color: var(--gold-solid); border-color: var(--primary-color); }
.chip input:focus-visible + span { box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.4); }

.field.has-error .input-box input, .field.has-error .input-box textarea { border-color: #DC2626; }
.field-error { margin-top: 7px; color: #B91C1C; font-size: 0.85rem; font-weight: 600; }

/* دکمه‌های پایین */
.wizard-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; padding-top: 18px; border-top: 1px solid #EEF2F6; }
.wizard-actions button { min-width: 140px; }
.wizard-actions #wiz-next, .wizard-actions #wiz-submit { margin-inline-start: auto; }

/* ---------- عکس‌ها ---------- */
.drop-zone {
    width: 100%;
    padding: 34px 20px;
    border: 2px dashed rgba(212, 175, 55, 0.6);
    border-radius: var(--radius);
    text-align: center;
    background: rgba(212, 175, 55, 0.05);
    transition: 0.3s;
    position: relative;
    color: var(--text-muted);
}
.drop-zone.dragover { background: rgba(212, 175, 55, 0.18); border-color: var(--gold-solid); }
.hidden-input { position: absolute; width: 100%; height: 100%; top: 0; left: 0; opacity: 0; cursor: pointer; }
.photo-note { margin: 8px 0; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; margin-top: 8px; }
.photo-item { position: relative; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; border: 2px solid var(--gold-solid); background: #E2E8F0; }
.photo-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-item.is-removed { border-color: #CBD5E1; }
.photo-item.is-removed img { opacity: 0.3; filter: grayscale(1); }
.photo-remove {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(220, 38, 38, 0.92);
    color: #fff;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.photo-item.is-removed .photo-remove { background: var(--primary-color); }
.photo-remove:hover { transform: scale(1.1); }
.photo-cover {
    position: absolute;
    bottom: 0;
    right: 0;
    left: 0;
    background: rgba(15, 23, 42, 0.8);
    color: var(--gold-solid);
    font-size: 0.72rem;
    text-align: center;
    padding: 2px 0;
}

/* دسته‌بندی امکانات */
.chip-sections { display: flex; flex-direction: column; gap: 14px; }
.chip-section { background: #F8FAFC; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px 12px; }
.chip-section-title { margin: 0 0 8px; font-size: 0.95rem; color: var(--primary-color); }
.chip-section .chip-group { gap: 8px; }

/* پیام بالای نقشه‌ی انتخاب موقعیت تقریبی */
.map-notice { display: flex; flex-direction: column; gap: 4px; background: #FEF2F2; border: 1px solid #FECACA; border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; color: #7F1D1D; }
.map-note { margin: 0 0 6px; }

/* ---------- ابزارهای افزودن عکس (گالری / دوربین / پوشه / چسباندن) ---------- */
.photo-manager .drop-zone { cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 20px; }
.photo-manager .drop-zone-icon { font-size: 2rem; line-height: 1; }
.photo-manager .drop-zone-text { font-weight: 700; color: var(--primary-color); }
.pb-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.pb-btn {
    flex: 1 1 130px; min-height: 46px; padding: 10px 14px; border-radius: 12px; cursor: pointer;
    border: 1.5px solid rgba(212, 175, 55, 0.7); background: #fff; color: var(--primary-color);
    font: inherit; font-weight: 700; transition: transform 0.15s, background 0.2s;
}
.pb-btn:hover { background: rgba(212, 175, 55, 0.12); }
.pb-btn:active { transform: scale(0.97); }
.pb-btn.pb-primary { background: var(--gold-gradient); border-color: transparent; }

/* لپ‌تاپ/ماوس: ناحیه‌ی رها کردن + پوشه؛ بدون دکمه‌ی دوربین */
@media (hover: hover) and (pointer: fine) { .pb-camera { display: none; } .pb-btn { flex: 0 1 auto; min-width: 150px; } }
/* موبایل/لمسی: دکمه‌های بزرگ؛ بدون ناحیه‌ی رها کردن و بدون پوشه */
@media (hover: none), (pointer: coarse) {
    .photo-manager .drop-zone, .pb-folder { display: none; }
    .pb-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .pb-camera { grid-column: 1 / -1; min-height: 58px; font-size: 1.1rem; }
}

/* ---------- دوربین پشت‌سرهم ---------- */
.cam-overlay { position: fixed; inset: 0; z-index: 10000; background: #000; display: flex; flex-direction: column; direction: rtl; }
.cam-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.cam-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.cam-flash.go { animation: camFlash 0.25s ease-out; }
@keyframes camFlash { from { opacity: 0.8; } to { opacity: 0; } }
.cam-top, .cam-bottom { position: absolute; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; z-index: 1; }
.cam-top { top: 0; padding-top: max(14px, env(safe-area-inset-top)); background: linear-gradient(rgba(0, 0, 0, 0.6), transparent); }
.cam-bottom { bottom: 0; padding-bottom: max(22px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(0, 0, 0, 0.65)); }
.cam-close { width: 44px; height: 44px; border-radius: 50%; border: none; background: rgba(255, 255, 255, 0.22); color: #fff; font-size: 1.2rem; cursor: pointer; }
.cam-counter { color: #fff; font-size: 0.9rem; font-weight: 700; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6); }
.cam-thumb { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; border: 2px solid #fff; }
.cam-thumb[hidden] { display: block; visibility: hidden; }
.cam-shutter { width: 76px; height: 76px; border-radius: 50%; border: 4px solid #fff; background: transparent; padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.cam-shutter-dot { width: 58px; height: 58px; border-radius: 50%; background: #fff; transition: transform 0.1s; }
.cam-shutter:active .cam-shutter-dot { transform: scale(0.85); }
.cam-shutter:disabled { opacity: 0.35; }
.cam-done { min-width: 76px; height: 44px; border-radius: 22px; border: none; padding: 0 16px; font: inherit; font-weight: 800; background: rgba(255, 255, 255, 0.25); color: #fff; cursor: pointer; }
.cam-done.is-ready { background: var(--gold-solid); color: #0F172A; }
