body {
    font-family: Vazirmatn, Tahoma, sans-serif;
    background-color: #f6f8fa;
}

.card {
    border: none;
    border-radius: .75rem;
}

.card-header {
    border-radius: .75rem .75rem 0 0 !important;
}

.form-label {
    font-weight: 600;
    font-size: .9rem;
}

.price-card .display-6 {
    font-size: 2rem;
}

.otp-code-input {
    letter-spacing: .5rem;
    direction: ltr;
}

/* نمایش رنگ سولدرماسک کنار فیلد */
#color-swatch span {
    min-height: 100%;
}

/* ── کانفیگراتور PCB ─────────────────────────────────────── */
.cfg-section-header {
    background: #fff;
    display: flex;
    align-items: center;
    gap: .6rem;
}

.cfg-section-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 50%;
    background: var(--bs-primary);
    color: #fff;
    font-size: .85rem;
    font-weight: 700;
    flex-shrink: 0;
}

.cfg-field .form-label {
    margin-bottom: .1rem;
}

.cfg-field-error {
    color: var(--bs-danger);
    font-size: .8rem;
    margin-top: .25rem;
    min-height: 1rem;
}

.cfg-field-invalid .form-label {
    color: var(--bs-danger);
}

/* گزینه‌های انتخابی (دکمه‌های کارت/segmented) */
.cfg-option {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .15rem;
    padding: .55rem 1rem;
    border: 1px solid var(--bs-border-color);
    border-radius: .6rem;
    background: #fff;
    color: var(--bs-body-color);
    font-size: .9rem;
    line-height: 1.3;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, background-color .15s;
    min-width: 4.5rem;
}

.cfg-option:hover:not(:disabled):not(.is-selected) {
    border-color: var(--bs-primary);
}

.cfg-option.is-selected {
    border-color: var(--bs-primary);
    background: rgba(13, 110, 253, .07);
    box-shadow: 0 0 0 1px var(--bs-primary) inset;
    font-weight: 600;
}

.cfg-option:disabled {
    opacity: .45;
    cursor: not-allowed;
}

/* فوکوس کیبورد باید واضح باشد (accessibility) */
.cfg-option:focus-visible,
.cfg-chip:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

.cfg-option-card {
    align-items: flex-start;
    text-align: right;
    padding: .7rem 1rem;
    min-width: 9rem;
}

/* تصویر جنس برد (اختیاری — از پنل ادمین تعیین می‌شود) */
.cfg-material-img {
    width: 100%;
    max-width: 7rem;
    max-height: 4.5rem;
    object-fit: contain;
    margin-bottom: .35rem;
    border-radius: .25rem;
}

/* گزینه‌های زمان تحویل در خلاصه سفارش */
.cfg-delivery-option {
    align-items: flex-start;
    text-align: right;
    padding: .5rem .75rem;
    width: 100%;
}

.cfg-delivery-price {
    color: var(--bs-secondary-color);
    white-space: nowrap;
}

.cfg-option-title {
    font-size: .9rem;
}

.cfg-option-hint {
    font-size: .75rem;
    color: var(--bs-secondary-color);
    font-weight: 400;
}

/* گزینه رنگ با نمونه رنگ */
.cfg-option-color {
    flex-direction: row;
    gap: .5rem;
}

.cfg-swatch {
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, .2);
    flex-shrink: 0;
}

/* چیپ‌های انتخاب سریع تعداد */
.cfg-chip {
    border: 1px solid var(--bs-border-color);
    background: #fff;
    border-radius: 2rem;
    padding: .2rem .9rem;
    font-size: .85rem;
    cursor: pointer;
}

.cfg-chip:hover {
    border-color: var(--bs-primary);
}

.cfg-chip.is-selected {
    background: var(--bs-primary);
    border-color: var(--bs-primary);
    color: #fff;
}

/* پارامترهای عمومی کاتالوگ */
.cfg-generic-group:not(:empty) {
    margin-top: 1.25rem;
    border-top: 1px dashed var(--bs-border-color);
    padding-top: 1.25rem;
}

/* وقتی همهٔ فیلدهای یک گروه مخفی شدند، خط جداکننده و فاصلهٔ اضافی باقی نماند */
.cfg-generic-group.cfg-group-collapsed {
    margin-top: 0;
    border-top: none;
    padding-top: 0;
}

.cfg-required-badge {
    font-size: .65rem;
    vertical-align: middle;
}

/* خلاصه سفارش */
.cfg-summary {
    top: 1rem;
}

.cfg-summary-list li {
    padding: .3rem 0;
    border-bottom: 1px dashed #eef0f2;
}

.cfg-summary-list li:last-child {
    border-bottom: none;
}
#price-result .d-flex.align-items-baseline.gap-2 {
    min-height: 50px;
}

/* نوار شناور موبایل */
.cfg-mobile-bar {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    z-index: 1030;
    background: #fff;
    border-top: 1px solid var(--bs-border-color);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, .08);
    padding: .6rem 1rem;
}

.cfg-mobile-panel {
    position: fixed;
    bottom: 3.6rem;
    right: 0;
    left: 0;
    z-index: 1029;
    background: #fff;
    border-top: 1px solid var(--bs-border-color);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, .08);
    padding: .75rem 1rem;
    max-height: 45vh;
    overflow-y: auto;
}

.cfg-mobile-toggle .cfg-caret {
    display: inline-block;
    width: .6rem;
    height: .6rem;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    transform: rotate(-45deg);
    transition: transform .2s;
}

.cfg-mobile-toggle[aria-expanded="true"] .cfg-caret {
    transform: rotate(135deg);
}

@media (max-width: 991.98px) {
    main.container {
        padding-bottom: 4.5rem;
    }
}

/* ادیتور دیداری CMS */
#html-editor:focus {
    outline: 2px solid #86b7fe;
    outline-offset: -2px;
}

#html-editor table {
    width: 100%;
    border-collapse: collapse;
    margin: .5rem 0;
}

#html-editor td,
#html-editor th {
    border: 1px solid #dee2e6;
    padding: .35rem .5rem;
    min-width: 2.5rem;
}

#html-editor img {
    max-width: 100%;
    height: auto;
}

#html-editor blockquote {
    border-inline-start: 4px solid #dee2e6;
    padding-inline-start: 1rem;
    color: #6c757d;
}
