/* ===== Индикатор ошибки на табе ===== */

.nav-link {
    position: relative;
}

.tab-error-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #dc3545;
    border-radius: 50%;
    margin-left: 6px;
    vertical-align: middle;
    animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ===== Summernote WYSIWYG ===== */

.note-editor.note-frame {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    overflow: hidden;
}

.note-editor .note-toolbar {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 4px 8px;
}

.note-editor .note-toolbar .note-btn {
    font-size: 0.8125rem;
    padding: 4px 8px;
    border-color: transparent;
    background: transparent;
}

.note-editor .note-toolbar .note-btn:hover {
    background: #e9ecef;
}

.note-editor .note-toolbar .note-btn.active {
    background: #FF007B;
    color: #fff;
}

.note-editor .note-editing-area .note-editable {
    padding: 0.75rem;
    font-size: 0.9rem;
    min-height: 120px;
}

.note-editor .note-statusbar {
    display: none;
}

/* Ошибка валидации — подсветка рамки Summernote */
.has-error .note-editor.note-frame {
    border-color: #dc3545;
}

/* Ошибка валидации для кастомных блоков, у которых нет ActiveField-обёртки
   (logo/logo_short в _tab-image, form_fields в _tab-fields).
   Класс has-error им навешивается прямо в шаблоне по $model->hasErrors(). */
.image-upload-card.has-error,
.form-fields-builder.has-error {
    border: 1px solid #dc3545;
    border-radius: 0.5rem;
    padding: 12px;
    background: #fff5f5;
}

.image-upload-card.has-error::after,
.form-fields-builder.has-error::after {
    content: 'Поле обязательно для публикации';
    display: block;
    margin-top: 8px;
    color: #dc3545;
    font-size: 0.82rem;
}

/* ===== Прогресс заполнения для публикации (Instagram-stories style) ===== */
.offer-publish-progress {
    margin-bottom: 12px;
}

.offer-publish-progress-bar {
    display: flex;
    gap: 3px;
    height: 5px;
}

.offer-publish-progress-seg {
    flex: 1;
    height: 100%;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 999px;
    transition: background-color 0.2s ease;
}

.offer-publish-progress-seg.is-filled {
    background: #FF007B;
}

.offer-publish-progress.is-complete .offer-publish-progress-seg.is-filled {
    background: #0d9f5f;
}

.offer-publish-progress-meta {
    margin-top: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #8b8fa3;
    font-variant-numeric: tabular-nums;
}

.offer-publish-progress-label {
    color: #8b8fa3;
}

.offer-publish-progress.is-complete .offer-publish-progress-percent {
    color: #0d9f5f;
    font-weight: 600;
}

/* ===== Гео-дерево ===== */

.geo-regions-list {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 0.75rem;
    background: #fff;
}

.geo-region {
    margin-bottom: 2px;
}

.geo-region-header {
    display: flex;
    align-items: center;
    padding: 4px 0;
}

.geo-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    cursor: pointer;
    color: #666;
    flex-shrink: 0;
    transition: color 0.15s;
}

.geo-toggle:hover {
    color: #FF007B;
}

.geo-toggle .fa {
    transition: transform 0.2s;
}

.geo-toggle.open .fa {
    transform: rotate(90deg);
}

.geo-region-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95rem;
    user-select: none;
}

.geo-cities {
    padding-left: 42px;
}

.geo-city-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 0;
    margin: 0;
    cursor: pointer;
    font-size: 0.9rem;
    user-select: none;
}

.geo-city-label:hover {
    color: #FF007B;
}

/* Кастомные чекбоксы в стиле проекта */
.geo-tree .form-check-input:checked {
    background-color: #FF007B;
    border-color: #FF007B;
}

.geo-tree .form-check-input:focus {
    border-color: #FF007B;
    box-shadow: 0 0 0 0.2rem rgba(255, 0, 123, 0.25);
}

.geo-tree .form-check-input:indeterminate {
    background-color: #FF007B;
    border-color: #FF007B;
}

/* ── Поиск города ──────────────────────────────────────────────────────── */
.geo-search-input {
    /* flex: 1 1 0 — занимает остаток ширины после кнопок справа.
       min-width: 0 необходим, чтобы input мог сжиматься
       (для form-control default min-width = auto, что блокирует сжатие). */
    flex: 1 1 0;
    min-width: 0;
}

/* В тулбаре кнопки в одну строку без переноса текста */
.geo-toolbar .btn {
    white-space: nowrap;
    flex-shrink: 0;
}

/* Подсветка найденных совпадений (только когда фильтр активен) */
.geo-city-label.geo-city-match {
    background-color: #fff3e0;
    border-radius: 4px;
    padding-left: 4px;
    padding-right: 4px;
}

/* ===== Конструктор полей формы ===== */

.form-fields-builder {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    background: #fff;
    overflow: hidden;
}

/* Шапка-таблица */
.ff-header,
.ff-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 8px;
}

.ff-header {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding-top: 8px;
    padding-bottom: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Строка поля */
.ff-row {
    padding-top: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.1s;
}

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

.ff-row:hover {
    background: #fafafa;
}

/* Колонки */
.ff-col-drag {
    width: 20px;
    flex-shrink: 0;
    text-align: center;
}

.ff-col-title {
    flex: 3;
    min-width: 0;
}

.ff-col-type {
    flex: 2;
    min-width: 0;
}

.ff-col-key {
    flex: 2;
    min-width: 0;
}

.ff-col-placeholder {
    flex: 3;
    min-width: 0;
}

.ff-col-flags {
    width: 36px;
    flex-shrink: 0;
    text-align: center;
}

.ff-col-actions {
    width: 28px;
    flex-shrink: 0;
    text-align: center;
}

/* Drag handle */
.ff-drag-handle {
    cursor: grab;
    color: #ccc;
    user-select: none;
    font-size: 0.75rem;
}

.ff-drag-handle:hover {
    color: #999;
}

.ff-drag-handle:active {
    cursor: grabbing;
}

/* Инпуты внутри строки */
.ff-row .form-control-sm,
.ff-row .form-select-sm {
    font-size: 0.82rem;
    padding: 3px 6px;
    border-color: #e8e8e8;
}

.ff-row .form-control-sm:focus,
.ff-row .form-select-sm:focus {
    border-color: #FF007B;
    box-shadow: none;
}

/* Ключ — моноширинный */
.ff-key {
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 0.8rem !important;
    color: #6f42c1;
}

/* Кнопка удаления */
.ff-remove {
    color: #ccc;
    padding: 2px 4px;
    line-height: 1;
    border: none;
    font-size: 0.85rem;
}

.ff-remove:hover {
    color: #dc3545;
}

/* Кнопка добавления */
.form-fields-builder #ff-add-field {
    border: none;
    border-top: 1px dashed #dee2e6;
    border-radius: 0;
    margin: 0;
    padding: 10px;
    font-size: 0.85rem;
    color: #888;
}

.form-fields-builder #ff-add-field:hover {
    background: #f8f9fa;
    color: #FF007B;
}

/* Сбрасываем нативные :focus/:active стили Bootstrap btn-outline-secondary,
   из-за которых после клика кнопка «залипала» тёмным до повторного hover. */
.form-fields-builder #ff-add-field:focus,
.form-fields-builder #ff-add-field:focus-visible,
.form-fields-builder #ff-add-field:active,
.form-fields-builder #ff-add-field.active {
    background: transparent;
    color: #888;
    box-shadow: none;
    border: none;
    border-top: 1px dashed #dee2e6;
    border-radius: 0;
}

/* Если одновременно :hover и :focus — оставляем hover-стиль */
.form-fields-builder #ff-add-field:hover:focus,
.form-fields-builder #ff-add-field:hover:focus-visible,
.form-fields-builder #ff-add-field:hover:active {
    background: #f8f9fa;
    color: #FF007B;
}

/* Drag states */
.ff-row.ff-dragging {
    opacity: 0.3;
}

.ff-row.ff-drag-over {
    box-shadow: 0 -2px 0 0 #FF007B inset;
}

/* Чекбоксы */
.form-fields-builder .form-check-input {
    cursor: pointer;
    margin: 0;
}

.form-fields-builder .form-check-input:checked {
    background-color: #FF007B;
    border-color: #FF007B;
}

.form-fields-builder .form-check-input:focus {
    border-color: #FF007B;
    box-shadow: none;
}

/* Валидация */
.ff-invalid {
    border-color: #dc3545 !important;
    background-color: #fff5f5 !important;
}

/* Пустое состояние */
#ff-empty {
    padding: 30px 10px;
}

#ff-empty .fa {
    color: #ccc;
}

/* ===== Загрузка изображений ===== */

.image-upload-card {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    background: #fff;
    text-align: center;
}

.image-upload-card h6 {
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.image-preview {
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #e0e0e0;
    border-radius: 0.375rem;
    background: #fafafa;
    padding: 1rem;
}

.image-preview img {
    max-height: 200px;
    max-width: 100%;
    object-fit: contain;
    border-radius: 4px;
}

.image-placeholder {
    color: #ccc;
    text-align: center;
}

.image-placeholder p {
    margin: 0.5rem 0 0;
    font-size: 0.85rem;
}

.image-upload-btn,
.image-remove-btn {
    margin: 2px;
}

/* Cropper модалка */
.cropper-container-wrapper {
    max-height: 500px;
    overflow: hidden;
}

/* Брендовый цвет для рамки кропа */
.cropper-view-box {
    outline-color: #FF007B !important;
}

.cropper-point {
    background-color: #FF007B !important;
}

.cropper-line {
    background-color: #FF007B !important;
}

/* Colorpicker */
.color-picker-section h6 {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-control-color {
    width: 42px;
    height: 36px;
    padding: 2px;
    cursor: pointer;
    border-radius: 0.375rem;
}

/* ===== Счётчики символов ===== */

.char-counter {
    font-size: 0.75rem;
    color: #999;
    text-align: right;
    margin-top: 4px;
}

.char-counter-warning {
    color: #e67e22;
}

.char-counter-danger {
    color: #dc3545;
    font-weight: 600;
}

/* ===== Список офферов (карточки) ===== */

.offers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

.offer-card {
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.offer-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.offer-card-header {
    position: relative;
    /* Высота шапки = ширина / 3, как соотношение сторон лого (300×100, 3:1).
       Так лого с object-fit: cover заполняет блок без обрезки и пустот. */
    aspect-ratio: 3 / 1;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.offer-logo,
.offer-logo img {
    width: 100%;
    height: 100%;
}

.offer-logo img {
    object-fit: cover;
    display: block;
}

.offer-logo-placeholder {
    color: #ccc;
    font-size: 3rem;
}

.offer-status-badge {
    position: absolute;
    top: 0.625rem;
    right: 0.625rem;
    padding: 0.2rem 0.6rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
}

.offer-type-icon {
    position: absolute;
    top: 0.625rem;
    left: 0.625rem;
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    background: rgba(255, 255, 255, 0.85);
    color: #6c757d;
    font-size: 0.8rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.badge-draft {
    background: #e9ecef;
    color: #6c757d;
}

.badge-published {
    background: #d1fae5;
    color: #065f46;
}

.badge-paused {
    background: #fef3c7;
    color: #92400e;
}

.offer-card-body {
    padding: 1rem 1.125rem 0.5rem;
    flex: 1;
}

.offer-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.375rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.offer-id-lg {
    font-size: 0.875rem;
    color: #aaa;
}

.offer-id {
    font-size: 0.75rem;
    font-weight: 400;
    color: #aaa;
}

.offer-description {
    font-size: 0.8125rem;
    color: #6c757d;
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.offer-card-footer {
    padding: 0.75rem 1.125rem;
    border-top: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.offer-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8125rem;
    color: #6c757d;
}

.offer-geo i,
.offer-date i {
    margin-right: 0.2rem;
}

.offer-actions {
    display: flex;
    gap: 0.375rem;
}

.offer-actions .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
    line-height: 1;
    min-width: 2rem;
    min-height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 576px) {
    .offers-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== CRM Picker (воронка / этап) ===== */

.crm-picker-row {
    display: flex;
    gap: 24px;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-top: 12px;
}

.crm-picker-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.crm-picker-label {
    font-size: 13px;
    color: #6c757d;
    white-space: nowrap;
}

.crm-picker-link {
    font-size: 13px;
    color: #0d6efd;
    text-decoration: none;
    border-bottom: 1px dashed #0d6efd;
    cursor: pointer;
    transition: color 0.15s;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
}

.crm-picker-link:hover {
    color: #0a58ca;
    border-bottom-color: #0a58ca;
}

.crm-picker-link.has-value {
    color: #212529;
    border-bottom-color: #adb5bd;
    font-weight: 500;
}

.crm-picker-link.has-value:hover {
    color: #0d6efd;
    border-bottom-color: #0d6efd;
}

#modal-pipeline-pick .list-group-item,
#modal-status-pick .list-group-item {
    cursor: pointer;
    padding: 10px 16px;
    font-size: 14px;
    border: none;
    border-radius: 6px;
    margin-bottom: 2px;
    transition: background 0.15s;
}

#modal-pipeline-pick .list-group-item:hover,
#modal-status-pick .list-group-item:hover {
    background: #e9ecef;
}

#modal-pipeline-pick .list-group-item.active,
#modal-status-pick .list-group-item.active {
    background: #0d6efd;
    color: #fff;
}

/* ───────────────────────────────────────────────────────────────────────────
   Страница предпросмотра оффера (используется и на /offers/show?id=X,
   и внутри spi-slider при ajax-загрузке).
   ─────────────────────────────────────────────────────────────────────────── */

.offer-show {
    color: #2d3142;
}

/* ── Шапка ─────────────────────────────────────────────────────────────── */

.offer-show-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.offer-show-header-main {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.offer-show-logo {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 12px;
    overflow: hidden;
    background: #f7f8fc;
    border: 1px solid #eef0f5;
    display: grid;
    place-items: center;
}

.offer-show-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.offer-show-logo-ph {
    color: #c8cad4;
    font-size: 1.6rem;
}

.offer-show-titlebox {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.offer-show-id {
    font-size: 0.78rem;
    font-weight: 600;
    color: #8b8fa3;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.offer-show-title {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.6px;
    line-height: 1.2;
    color: #2d3142;
    word-break: break-word;
}

.offer-show-header-meta {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
    color: #8b8fa3;
    font-size: 0.85rem;
}

.offer-show-header-meta .dash-badge i {
    margin-right: 4px;
}

.offer-show-dot {
    color: #c8cad4;
}

.offer-show-date i {
    margin-right: 4px;
    color: #b0b3c2;
}

.offer-show-header-actions {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* ── Сетка карточек ────────────────────────────────────────────────────── */

.offer-show-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.offer-show-card {
    background: #fff;
    border: 1px solid #eef0f5;
    border-radius: 16px;
    padding: 18px 20px;
}

.offer-show-card-wide {
    grid-column: 1 / -1;
}

.offer-show-card-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #8b8fa3;
    margin-bottom: 12px;
}

/* ── dl-таблица label / value ─────────────────────────────────────────── */

.offer-show-dl {
    margin: 0;
    display: grid;
    grid-template-columns: 140px 1fr;
    row-gap: 10px;
    column-gap: 16px;
    font-size: 0.9rem;
}

.offer-show-dl dt {
    color: #8b8fa3;
    font-weight: 500;
    line-height: 1.4;
}

.offer-show-dl dd {
    margin: 0;
    color: #2d3142;
    word-break: break-word;
    line-height: 1.4;
}

/* ── Утилиты ──────────────────────────────────────────────────────────── */

.offer-show-mono {
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 0.85rem;
    color: #2d3142;
}

.offer-show-muted {
    color: #b0b3c2;
}

.offer-show-muted-block {
    font-size: 0.88rem;
    padding: 6px 0;
}

.offer-show-color-swatch {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid #e8eaed;
    vertical-align: middle;
    margin-right: 6px;
}

/* ── Описание ─────────────────────────────────────────────────────────── */

.offer-show-desc-short {
    font-size: 0.95rem;
    color: #4b5563;
    margin: 0 0 8px;
    line-height: 1.5;
}

.offer-show-desc-full {
    font-size: 0.9rem;
    color: #4b5563;
    line-height: 1.55;
}

.offer-show-desc-full :first-child { margin-top: 0; }
.offer-show-desc-full :last-child  { margin-bottom: 0; }

/* ── Collapsible (условия, JSON) ──────────────────────────────────────── */

.offer-show-collapsible {
    margin: 0;
}

.offer-show-collapsible summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    user-select: none;
}

.offer-show-collapsible summary::-webkit-details-marker {
    display: none;
}

.offer-show-collapsible summary .offer-show-card-label {
    margin-bottom: 0;
}

.offer-show-chevron {
    color: #8b8fa3;
    transition: transform 0.18s ease;
}

.offer-show-collapsible[open] .offer-show-chevron {
    transform: rotate(180deg);
}

.offer-show-collapsible-body {
    margin-top: 14px;
}

.offer-show-collapsible-body h6 {
    font-size: 0.78rem;
    font-weight: 700;
    color: #8b8fa3;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 6px;
}

.offer-show-text {
    font-size: 0.88rem;
    color: #4b5563;
    line-height: 1.5;
}

.offer-show-rawbox {
    margin: 6px 0 0;
    background: #1f2230;
    color: #e8eaf6;
    border-radius: 10px;
    padding: 14px 16px;
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 0.78rem;
    line-height: 1.5;
    overflow-x: auto;
    max-height: 320px;
    overflow-y: auto;
    white-space: pre;
}

/* ── Кликабельный URL оффера-ссылки ───────────────────────────────────── */

.offer-show-link-url {
    color: #5c6bc0;
    text-decoration: none;
    word-break: break-all;
    border-bottom: 1px dashed transparent;
    transition: border-color 0.15s, color 0.15s;
}

.offer-show-link-url:hover {
    color: #3d49b5;
    border-bottom-color: #5c6bc0;
}

.offer-show-link-url-icon {
    font-size: 0.78em;
    margin-left: 4px;
    color: #8b8fa3;
}

/* ── Компактная таблица полей формы ───────────────────────────────────── */

.offer-show-fields-table {
    width: 100%;
    font-size: 0.88rem;
    border-collapse: collapse;
}

.offer-show-fields-table th {
    text-align: left;
    color: #8b8fa3;
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 8px 8px;
    border-bottom: 1px solid #eef0f5;
}

.offer-show-fields-table td {
    padding: 8px;
    border-bottom: 1px solid #f4f5f9;
    color: #2d3142;
    vertical-align: middle;
}

.offer-show-fields-table tbody tr:last-child td {
    border-bottom: none;
}

.offer-show-fields-req {
    color: #ef5350;
    font-weight: 700;
    margin-left: 2px;
}

/* ── Карточка в листинге — кликабельность через spi-slider ────────────── */

.offer-card[data-spi-slider] {
    cursor: pointer;
}

/* ── Адаптив ──────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
    .offer-show-grid {
        grid-template-columns: 1fr;
    }
    .offer-show-dl {
        grid-template-columns: 120px 1fr;
    }
    .offer-show-header {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 540px) {
    .offer-show-dl {
        grid-template-columns: 1fr;
        row-gap: 4px;
    }
    .offer-show-dl dt {
        margin-top: 6px;
    }
    .offer-show-header-main {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Список незаполненных обязательных полей в модалке #publishErrorModal */
.publish-error-missing {
    padding-left: 1.25rem;
    font-size: 0.9rem;
    color: #2d3142;
}

.publish-error-missing li {
    margin-bottom: 2px;
}

.publish-error-missing:empty {
    display: none;
}

/* ===== Превью-блок (правая колонка формы create/update) ===== */
.offer-preview-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.offer-preview-head {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    padding: 0 2px;
}

.offer-preview-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #2d3142;
}

.offer-preview-modes .btn {
    font-size: 0.78rem;
    padding: 4px 10px;
    line-height: 1.2;
    border-color: #d1d5db;
    color: #6b7280;
    background: #e5e7eb;
}

.offer-preview-modes .btn.active {
    background: #fff;
    color: #1f2937;
    border-color: #d1d5db;
}

.offer-preview-modes .btn i {
    margin-right: 4px;
    font-size: 0.85rem;
}

.offer-preview-frame-wrap {
    background: #fbe1ec; /* совпадает с фоном превью — нет белой вспышки до загрузки */
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(20, 20, 50, 0.06);
    height: calc(100vh - 140px);
    min-height: 540px;
    max-height: 900px;
}

#offer-preview-frame {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}
