/* ===== Витрины рекламодателя (ТЗ-06): список и конструктор ===== */

/* ── Список ── */

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

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

.sc-card { display: flex; flex-direction: column; gap: 10px; }

.sc-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.sc-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #2d3142;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sc-card-host { display: flex; align-items: center; gap: 6px; min-width: 0; }

.sc-host-link {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    color: #e6005a;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sc-host-link:hover { text-decoration: underline; color: #c40050; }
.sc-host-link.is-off { color: #8b8fa3; }
.sc-host-link i { font-size: 11px; margin-left: 2px; }

.sc-card-meta { font-size: 13px; color: #6b7280; }
.sc-card-meta b { color: #2d3142; }
.sc-card-meta i { margin-right: 3px; color: #8b8fa3; }

.sc-card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

/* ── Создание ── */

.sc-steps { padding-left: 1.2rem; margin: 0; color: #4b5563; font-size: 14px; }
.sc-steps li { margin-bottom: 8px; }

.sc-slug-group .input-group-text {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    color: #6b7280;
    background: #f8f9fb;
}

#sc-slug-hint.is-ok { color: #00897b; }
#sc-slug-hint.is-bad { color: #c62828; }

/* ── Конструктор: шапка ── */

.sc-update-meta { display: flex; align-items: center; gap: 10px; margin-top: 4px; }

.sc-tab-count {
    display: inline-block;
    min-width: 18px;
    padding: 0 5px;
    margin-left: 4px;
    border-radius: 9px;
    background: #eef0f5;
    color: #6b7280;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
}

.sc-builder .form-label { font-weight: 600; font-size: 0.85rem; color: #2d3142; }

.sc-radio-row { display: flex; gap: 10px; flex-wrap: wrap; }

.sc-radio-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    background: #fff;
}

.sc-radio-option:has(input:checked) { border-color: #e6005a; background: #fff4f8; }

/* ── Оформление ── */

.sc-colors {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

@media (max-width: 767px) {
    .sc-colors { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.sc-color-label { display: block; font-size: 12px; font-weight: 600; color: #2d3142; margin-bottom: 4px; }
.sc-color-row { display: flex; gap: 6px; align-items: center; }
.sc-color-picker { width: 38px; height: 31px; padding: 2px; flex-shrink: 0; }
.sc-color-hex { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.sc-color-hint { font-size: 11px; color: #8b8fa3; margin-top: 3px; }

.sc-file-card {
    border: 1px solid #eef0f5;
    border-radius: 12px;
    padding: 12px;
    background: #fafbfc;
}

.sc-file-card-logo { display: flex; gap: 14px; align-items: flex-start; }
.sc-file-card-logo .sc-file-actions { flex: 1 1 auto; }

.sc-file-title { font-size: 13px; font-weight: 600; color: #2d3142; margin-bottom: 8px; }
.sc-file-title .text-muted { font-weight: 400; font-size: 12px; }

.sc-file-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eceff3;
    background-image: linear-gradient(45deg, #e3e6ea 25%, transparent 25%, transparent 75%, #e3e6ea 75%),
                      linear-gradient(45deg, #e3e6ea 25%, transparent 25%, transparent 75%, #e3e6ea 75%);
    background-size: 16px 16px;
    background-position: 0 0, 8px 8px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
}

.sc-file-preview img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.sc-file-preview-logo { width: 160px; height: 72px; flex-shrink: 0; margin-bottom: 0; }
.sc-file-preview-logo img { max-height: 52px; }
.sc-file-preview-bg_desktop { aspect-ratio: 16 / 9; }
.sc-file-preview-bg_mobile { aspect-ratio: 9 / 16; max-height: 260px; }
.sc-file-preview-bg_desktop img,
.sc-file-preview-bg_mobile img { width: 100%; height: 100%; object-fit: cover; }

.sc-file-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #9aa0ad;
    font-size: 12px;
}

.sc-file-placeholder i { font-size: 22px; }
.sc-file-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.sc-file-actions .form-text { flex-basis: 100%; margin-top: 2px; }

/* ── Офферы ── */

.sc-offers-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }

.sc-offer-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid #eef0f5;
    border-radius: 12px;
    background: #fff;
}

.sc-offer-item.is-checked { border-color: #f7c2d6; background: #fff8fb; }
.sc-offer-item.is-unpublished { opacity: 0.75; }
.sc-offer-item.sortable-ghost { opacity: 0.4; }
.sc-offer-item.sortable-chosen { box-shadow: 0 6px 18px rgba(20, 20, 50, 0.12); }

.sc-offer-handle { color: #c3c7d1; cursor: grab; padding: 4px; flex-shrink: 0; }
.sc-offer-handle:active { cursor: grabbing; }
.sc-offer-check { margin: 0; display: flex; }
.sc-offer-check input { margin: 0; cursor: pointer; }

.sc-offer-logo {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    overflow: hidden;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sc-offer-logo img { width: 100%; height: 100%; object-fit: cover; }
.sc-offer-logo-ph { font-weight: 700; color: #8b8fa3; }
.sc-offer-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sc-offer-title { font-size: 14px; font-weight: 600; color: #2d3142; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-offer-id { color: #9aa0ad; font-weight: 400; font-size: 12px; }
.sc-offer-sub { font-size: 12px; color: #6b7280; }

/* ── Футер и пиксели ── */

.sc-docs { display: flex; flex-direction: column; gap: 6px; }
.sc-doc-row { display: flex; gap: 6px; align-items: center; }
.sc-doc-row .sc-doc-title { flex: 0 0 38%; }
.sc-doc-row .sc-doc-url { flex: 1 1 auto; min-width: 0; }
.sc-doc-row .btn { flex-shrink: 0; }

/* ── Превью ── */

.sc-preview-wrap { display: flex; flex-direction: column; gap: 10px; }

.sc-preview-head { display: flex; align-items: center; gap: 14px; padding: 0 2px; }
.sc-preview-title { font-size: 0.95rem; font-weight: 700; color: #2d3142; }

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

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

.sc-preview-frame-wrap {
    background: #eff1f4;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(20, 20, 50, 0.06);
    height: calc(100vh - 170px);
    min-height: 540px;
    max-height: 900px;
    display: flex;
    justify-content: center;
}

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

/* Телефон: узкая рамка по центру, как реальный экран */
.sc-preview-frame-wrap.is-mobile { background: #dfe3ea; padding: 14px 0; }
.sc-preview-frame-wrap.is-mobile #sc-preview-frame { width: 390px; max-width: 100%; border-radius: 22px; }

.sc-preview-note { font-size: 12px; color: #8b8fa3; padding: 0 2px; }
.sc-preview-note a { color: #e6005a; }
