:root {
    --bg: #f4f6fb;
    --card: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e2e8f0;
    --primary: #1d4ed8;
    --primary-dark: #1e40af;
    --accent: #f97316;
    --success: #047857;
    --danger: #dc2626;
    --radius: 14px;
    --shadow: 0 2px 10px rgba(15, 23, 42, .06);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.2; }

.container { width: min(1200px, 100% - 32px); margin: 0 auto; }
.main { min-height: 60vh; padding: 24px 0 48px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }

/* ---------- шапка ---------- */
.site-header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}
.header-row {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 14px 0;
}
.logo {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -.5px;
    color: var(--text);
    white-space: nowrap;
}
.logo span { color: var(--primary); }
.search {
    flex: 1;
    display: flex;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 999px;
    overflow: hidden;
    background: #f8fafc;
}
.search input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    padding: 11px 16px;
    font-size: 15px;
    outline: none;
}
.search button {
    border: 0;
    background: var(--primary);
    color: #fff;
    padding: 0 20px;
    font-weight: 600;
    cursor: pointer;
}
.search button:hover { background: var(--primary-dark); }
.user-nav { display: flex; align-items: center; gap: 14px; font-size: 15px; }
.logout-form { margin: 0; }
.cat-nav {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    padding: 0 0 12px;
    font-size: 14px;
    scrollbar-width: none;
}
.cat-nav a { color: var(--muted); white-space: nowrap; }
.cat-nav a:hover { color: var(--primary); }

/* ---------- кнопки ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 10px 18px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none !important;
    transition: background .15s, border-color .15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: #fff; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: #cbd5e1; }
.btn-danger { background: #fef2f2; color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { background: #fee2e2; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 14px 26px; font-size: 17px; }
.btn-block { width: 100%; }
.link-btn {
    background: none;
    border: 0;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    padding: 0;
}
.link-btn:hover { color: var(--primary); text-decoration: underline; }

/* ---------- главная ---------- */
.hero {
    background: linear-gradient(120deg, #1e3a8a, #1d4ed8 55%, #3b82f6);
    color: #fff;
    border-radius: 20px;
    padding: 56px 40px;
    margin: 8px 0 32px;
    box-shadow: var(--shadow);
}
.hero h1 { font-size: clamp(28px, 4vw, 42px); margin: 0 0 12px; }
.hero-sub { color: #c7d7fe; margin: 0 0 24px; font-size: 18px; }
.hero .btn-primary { background: #fff; color: var(--primary-dark); }
.hero .btn-primary:hover { background: #eef2ff; }

.section { margin: 32px 0; }
.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 16px;
}
.section-head h2 { margin: 0; font-size: 22px; }
.section-link { font-size: 14px; }

.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}
.cat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--text);
    transition: transform .12s, box-shadow .12s;
}
.cat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }
.cat-card__icon { font-size: 28px; }
.cat-card__name { font-weight: 600; }
.cat-card__count { color: var(--muted); font-size: 13px; }

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
}
.item-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    color: var(--text);
    display: flex;
    flex-direction: column;
    transition: transform .12s, box-shadow .12s;
}
.item-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }
.item-card__img {
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, #e0e7ff, #f1f5f9);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.item-card__img img { width: 100%; height: 100%; object-fit: cover; }
.item-card__ph { font-size: 42px; opacity: .8; }
.item-card__body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; }
.item-card__price { font-weight: 800; font-size: 18px; }
.item-card__title {
    font-size: 14px;
    line-height: 1.35;
    max-height: 2.7em;
    overflow: hidden;
}
.item-card__meta { color: var(--muted); font-size: 12px; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 14px;
    color: var(--text);
}
.chip:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }

.empty-state {
    background: var(--card);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
}
.empty-state h2 { margin-top: 0; }

/* ---------- каталог ---------- */
.breadcrumbs { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs span { margin: 0 4px; }
.page-title { font-size: 28px; margin: 8px 0 16px; }
.seo-text { color: var(--muted); max-width: 820px; margin-bottom: 16px; font-size: 15px; }
.subcats { margin-bottom: 20px; }

.catalog-layout { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start; }
.filters {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    position: sticky;
    top: 96px;
}
.filter-block { margin-bottom: 14px; }
.filter-label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.filters select, .filters input, .sort-form select {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    background: #fff;
}
.price-range { display: flex; gap: 8px; }
.filter-actions { display: flex; gap: 8px; margin-top: 16px; }
.filter-actions .btn { flex: 1; padding: 9px 10px; font-size: 14px; }
.catalog-main { min-width: 0; }
.catalog-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.catalog-count { color: var(--muted); font-size: 14px; }
.sort-form select { width: auto; padding: 8px 10px; }

.pagination { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 24px; }
.page {
    display: inline-block;
    min-width: 36px;
    text-align: center;
    padding: 7px 10px;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: #fff;
    font-size: 14px;
    color: var(--text);
}
.page:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.page.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-dots { padding: 7px 4px; color: var(--muted); }

/* ---------- страница объявления ---------- */
.ad-layout { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.listing-main { min-width: 0; }
.ad-gallery {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 18px;
}
.ad-gallery__main { aspect-ratio: 4 / 3; background: #f1f5f9; display: flex; align-items: center; justify-content: center; }
.ad-gallery__main img { width: 100%; height: 100%; object-fit: contain; }
.ad-gallery__ph { aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; font-size: 72px; background: linear-gradient(135deg, #e0e7ff, #f8fafc); }
.ad-gallery__thumbs { display: flex; gap: 8px; padding: 10px; overflow-x: auto; }
.gallery-thumb { border: 2px solid transparent; border-radius: 10px; padding: 0; background: none; cursor: pointer; width: 76px; height: 60px; overflow: hidden; }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb.is-active { border-color: var(--primary); }
.listing-head { margin-bottom: 20px; }
.listing-head h1 { font-size: 28px; margin: 0 0 8px; }
.listing-price { font-size: 32px; font-weight: 800; margin-bottom: 10px; }
.listing-meta { display: flex; flex-wrap: wrap; gap: 16px; color: var(--muted); font-size: 14px; }
.ad-props, .ad-desc {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
}
.ad-props h2, .ad-desc h2 { font-size: 19px; margin: 0 0 14px; }
.ad-props dl { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px 20px; }
.ad-prop { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--border); padding-bottom: 8px; }
.ad-prop dt { color: var(--muted); }
.ad-prop dd { margin: 0; font-weight: 600; text-align: right; }
.ad-desc p { margin: 0; white-space: pre-line; }
.listing-owner-actions { display: flex; gap: 10px; margin: 16px 0; }

.listing-side { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 14px; }
.seller-card, .safe-tip {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}
.seller-name { font-weight: 700; font-size: 18px; }
.seller-note { color: var(--muted); font-size: 13px; margin-top: 12px; }
.phone-box { margin-top: 14px; }
.phone-value { font-size: 20px; font-weight: 700; margin-top: 10px; }
.safe-tip strong { display: block; margin-bottom: 6px; }
.safe-tip p { margin: 0; color: var(--muted); font-size: 14px; }

/* ---------- формы ---------- */
.form-card, .admin-panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}
.form { display: flex; flex-direction: column; gap: 16px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: #334155; }
.form input, .form select, .form textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font: inherit;
    font-weight: 400;
    background: #fff;
}
.form textarea { resize: vertical; }
.form .checkbox { flex-direction: row; align-items: center; gap: 8px; }
.form .checkbox input { width: auto; }
.form-row.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { display: flex; gap: 10px; margin-top: 6px; }
.existing-images { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.existing-image { position: relative; width: 110px; height: 84px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.existing-image img { width: 100%; height: 100%; object-fit: cover; }
.img-del {
    position: absolute; top: 4px; right: 4px; width: 22px; height: 22px;
    border-radius: 50%; border: 0; background: rgba(15, 23, 42, .7); color: #fff;
    cursor: pointer; line-height: 1;
}
.city-results {
    position: relative;
    z-index: 10;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-top: 4px;
    max-height: 220px;
    overflow-y: auto;
    font-weight: 400;
}
.city-results div { padding: 9px 12px; cursor: pointer; font-size: 14px; }
.city-results div:hover { background: #f1f5f9; }

.auth-wrap { display: flex; justify-content: center; padding: 24px 0; }
.auth-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; width: min(420px, 100%); }
.auth-card h1 { margin: 0 0 4px; }
.auth-alt { margin: 18px 0 0; font-size: 14px; color: var(--muted); }

/* ---------- кабинет ---------- */
.account-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.account-head h1 { margin: 0; }

.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { background: #f8fafc; font-size: 13px; color: var(--muted); font-weight: 600; }
.table tr:last-child td { border-bottom: 0; }
.table-compact th, .table-compact td { padding: 8px 10px; }
.status { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.status-active { background: #ecfdf5; color: var(--success); }
.status-pending { background: #fffbeb; color: #b45309; }
.status-blocked { background: #fef2f2; color: var(--danger); }
.status-draft { background: #f1f5f9; color: var(--muted); }
.inline { display: inline; margin: 0; }

/* ---------- сервисное ---------- */
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }
.alert-success { background: #ecfdf5; color: var(--success); border: 1px solid #a7f3d0; }
.alert-error { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.alert-info { background: #eff6ff; color: var(--primary-dark); border: 1px solid #bfdbfe; }

.site-footer { background: #0f172a; color: #cbd5e1; margin-top: 40px; padding: 32px 0 20px; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
.footer-brand { font-size: 20px; font-weight: 800; color: #fff; margin-bottom: 6px; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: #cbd5e1; font-size: 14px; }
.footer-bottom { margin-top: 24px; padding-top: 16px; border-top: 1px solid #1e293b; color: #64748b; font-size: 13px; }

.error-page { text-align: center; padding: 60px 20px; }
.error-code { font-size: 72px; font-weight: 800; color: var(--primary); line-height: 1; }

@media (max-width: 980px) {
    .catalog-layout, .ad-layout { grid-template-columns: 1fr; }
    .filters, .listing-side { position: static; }
    .header-row { flex-wrap: wrap; }
    .search { order: 3; flex-basis: 100%; }
    .user-nav { margin-left: auto; }
}
@media (max-width: 560px) {
    .hero { padding: 36px 22px; }
    .form-row.two { grid-template-columns: 1fr; }
    .listing-price { font-size: 26px; }
    .cat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- бейджи продвижения ---------- */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
    margin-right: 4px;
}
.badge-top { background: #dbeafe; color: #1d4ed8; }
.badge-urgent { background: #fee2e2; color: #b91c1c; }
.badge-recommended { background: #fef3c7; color: #92400e; }
.badge-color { background: #ede9fe; color: #6d28d9; }
.item-card__badges {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
}
.item-card { position: relative; }
.item-card.is-color { border-color: #c4b5fd; box-shadow: 0 0 0 1px #c4b5fd inset; }
.listing-badges { margin-bottom: 8px; }

/* ---------- жалоба ---------- */
.complaint-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin: 16px 0;
}
.complaint-box summary { cursor: pointer; color: var(--muted); font-size: 14px; }

/* ---------- блог ---------- */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.blog-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    color: var(--text);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.blog-card h2 { font-size: 18px; margin: 0; }
.blog-card p { margin: 0; font-size: 14px; }
.blog-card:hover { box-shadow: var(--shadow); text-decoration: none; }
.blog-post { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; max-width: 820px; margin: 0 auto 20px; }
.blog-post h1 { margin-top: 0; }
.blog-content { margin-top: 18px; line-height: 1.7; }

/* ---------- продвижение ---------- */
.promote-ad { margin-bottom: 18px; }
.services-list { display: flex; flex-direction: column; gap: 10px; }
.service-row {
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: space-between;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    flex-wrap: wrap;
}
.service-name { font-weight: 600; }
.service-price { font-weight: 800; white-space: nowrap; margin-left: auto; }
.desc-tools { display: flex; align-items: center; gap: 10px; margin-top: 6px; }

/* ---------- админка: доп. элементы ---------- */
.form-inline { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.form-inline label { min-width: 180px; }
.filter-cats { margin-top: 6px; }
.cat-checks { max-height: 220px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; padding: 10px; }
.cat-checks label { font-weight: 400; font-size: 13px; }
.admin-images { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-images img { width: 110px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.admin-actions-row { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.ai-answer { background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; padding: 14px; font-size: 14px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- чат ---------- */
.chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 12px;
}
.chat-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 60vh;
    overflow-y: auto;
}
.chat-msg { display: flex; justify-content: flex-start; }
.chat-msg.is-mine { justify-content: flex-end; }
.chat-bubble {
    max-width: 75%;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.5;
}
.chat-msg.is-mine .chat-bubble { background: #dbeafe; }
.chat-time { font-size: 11px; color: #64748b; margin-top: 4px; }
.chat-form { display: flex; gap: 10px; margin-top: 12px; align-items: flex-end; }
.chat-form textarea {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font: inherit;
    resize: vertical;
}
.dialogs {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px;
}
.dialog-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    color: var(--text);
}
.dialog-item:hover { background: #f8fafc; text-decoration: none; }
.dialog-title { font-weight: 600; }
.dialog-last { font-size: 13px; margin-top: 2px; }
.unread-badge {
    display: inline-block;
    background: #dc2626;
    color: #fff;
    border-radius: 999px;
    font-size: 11px;
    padding: 1px 7px;
    font-weight: 700;
}

/* ---------- магазины ---------- */
.shop-banner { border-radius: var(--radius); overflow: hidden; margin-bottom: 18px; max-height: 240px; }
.shop-banner img { width: 100%; display: block; object-fit: cover; }
.shop-head { display: flex; align-items: center; gap: 16px; }
.shop-logo {
    width: 84px; height: 84px; border-radius: 16px; background: #eef2ff; flex: none;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
    font-size: 34px; font-weight: 800; color: #4f46e5;
}
.shop-logo img { width: 100%; height: 100%; object-fit: cover; }
.shop-head h1 { margin: 0 0 4px; }
.shop-desc { margin: 16px 0; line-height: 1.6; }
.shop-contacts { display: flex; gap: 18px; flex-wrap: wrap; margin: 12px 0 24px; color: var(--muted); font-size: 14px; }
.verified-badge {
    display: inline-block; background: #dcfce7; color: #15803d; border-radius: 999px;
    font-size: 11px; font-weight: 700; padding: 2px 8px; vertical-align: middle; margin-left: 6px;
}
.account-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- сторис ---------- */
.stories-ribbon { margin: 24px 0 8px; }
.stories-row { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 10px; }
.story-circle { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: none; color: var(--text); }
.story-thumb {
    width: 74px; height: 74px; border-radius: 50%; overflow: hidden; display: block;
    border: 3px solid #6366f1; box-shadow: 0 0 0 2px #fff inset;
}
.story-thumb img { width: 100%; height: 100%; object-fit: cover; }
.story-user { font-size: 12px; color: var(--muted); max-width: 78px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.story-view {
    max-width: 460px; margin: 0 auto; background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
}
.story-image img { width: 100%; display: block; }
.story-caption { padding: 14px 18px; font-size: 15px; }
.story-meta { padding: 0 18px 18px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------- безопасные сделки ---------- */
.deals-list { display: flex; flex-direction: column; gap: 12px; }
.deal-card {
    display: flex; gap: 16px; justify-content: space-between; flex-wrap: wrap;
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px;
}
.deal-title { font-weight: 600; }
.deal-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.deal-amount { font-weight: 800; white-space: nowrap; }
.deal-status { font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.deal-status.status-pending { background: #fef3c7; color: #92400e; }
.deal-status.status-confirmed { background: #dbeafe; color: #1d4ed8; }
.deal-status.status-completed { background: #dcfce7; color: #15803d; }
.deal-status.status-canceled { background: #f1f5f9; color: #64748b; }
.deal-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- баннеры ---------- */
.site-banner-wrap { margin: 18px 0; display: flex; flex-direction: column; gap: 10px; }
.site-banner { display: block; border-radius: var(--radius); overflow: hidden; }
.site-banner img { display: block; width: 100%; height: auto; }
.listing-side .site-banner-wrap { margin-top: 14px; }

/* ============================================================
   РЕДИЗАЙН: тёмная верхняя панель, компактная шапка,
   компактные категории, тёмный футер.
   ============================================================ */
:root { --green: #16a34a; --green-dark: #15803d; }

.top-bar { background: #1f2430; color: #cbd5e1; font-size: 13px; }
.top-bar__inner { display: flex; align-items: center; justify-content: space-between; height: 38px; gap: 16px; }
.top-bar__links { display: flex; gap: 20px; overflow-x: auto; scrollbar-width: none; }
.top-bar__links a, .top-bar__right a { color: #cbd5e1; white-space: nowrap; }
.top-bar__links a:hover, .top-bar__right a:hover { color: #fff; text-decoration: none; }

.site-header { position: sticky; top: 0; z-index: 50; background: #fff; border-bottom: 1px solid var(--border); }
.header-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 800; letter-spacing: -.3px; }
.logo__mark {
    width: 32px; height: 32px; border-radius: 9px; background: var(--primary); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 800;
}
.catalog-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--primary); color: #fff; border-radius: 10px;
    padding: 9px 14px; font-weight: 600; font-size: 14px; white-space: nowrap;
}
.catalog-btn:hover { background: var(--primary-dark); text-decoration: none; }
.search { flex: 1; min-width: 200px; border: 1px solid var(--border); border-radius: 10px; background: #f8fafc; }
.search input { padding: 9px 14px; font-size: 14px; }
.search button { padding: 0 18px; font-size: 14px; }
.user-nav { gap: 12px; font-size: 13px; }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: var(--green-dark); }

.cat-nav { padding: 0 0 8px; gap: 14px; font-size: 13px; }
.is-home .cat-nav { display: none; }
.main { padding: 16px 0 40px; }

.home-head { margin: 4px 0 14px; }
.home-head h1 { font-size: clamp(21px, 2.4vw, 28px); margin: 0 0 3px; }
.home-head p { margin: 0; font-size: 14px; }

.section { margin: 20px 0; }
.section-head { margin-bottom: 10px; }
.section-head h2 { font-size: 19px; }

.cat-grid { grid-template-columns: repeat(6, 1fr); gap: 10px; }
.cat-card {
    flex-direction: row; align-items: center; justify-content: flex-start;
    gap: 8px; padding: 10px 12px; min-height: 54px; border-radius: 12px;
    background: #fff;
}
.cat-card__name { order: 1; font-size: 13px; font-weight: 600; line-height: 1.25; max-height: 2.5em; overflow: hidden; }
.cat-card__icon { order: 2; margin-left: auto; font-size: 21px; line-height: 1; }
.cat-card__count { display: none; }
.cat-card:hover { transform: none; box-shadow: 0 4px 14px rgba(15, 23, 42, .08); }

.items-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.item-card { border: 0; border-radius: 12px; box-shadow: 0 1px 3px rgba(15, 23, 42, .08); }
.item-card__price { font-size: 17px; }
.item-card__body { padding: 10px 12px 12px; }

.trust-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 24px 0; }
.trust-item {
    display: flex; align-items: center; gap: 10px;
    background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px;
}
.trust-item > span { font-size: 22px; }
.trust-item strong { display: block; font-size: 13px; }
.trust-item small { color: var(--muted); font-size: 12px; }

.site-footer { background: #1f2430; color: #cbd5e1; margin-top: 32px; padding: 26px 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr 1.2fr; gap: 22px; }
.footer-brand { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 800; font-size: 18px; margin-bottom: 8px; }
.footer-brand-col p { color: #94a3b8; font-size: 13px; margin: 0; line-height: 1.5; }
.footer-col h4 { color: #fff; font-size: 14px; margin: 0 0 10px; }
.footer-col a { display: block; color: #cbd5e1; font-size: 13px; margin: 0 0 7px; }
.footer-col a:hover { color: #fff; text-decoration: none; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 22px; padding: 14px 0; color: #94a3b8; font-size: 12px; }

.shops-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.shop-tile {
    display: flex; align-items: center; gap: 12px;
    background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px;
    color: var(--text);
}
.shop-tile:hover { box-shadow: 0 4px 14px rgba(15, 23, 42, .08); text-decoration: none; }
.shop-tile__logo {
    width: 48px; height: 48px; border-radius: 12px; background: #eef2ff; overflow: hidden;
    display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--primary); flex: none;
}
.shop-tile__logo img { width: 100%; height: 100%; object-fit: cover; }
.shop-tile__name { font-weight: 600; }

.info-page { max-width: 820px; }
.info-page h1 { margin-top: 0; }
.info-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 20px 0; }
.info-step { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.info-step__num {
    display: inline-flex; width: 28px; height: 28px; border-radius: 50%;
    background: var(--primary); color: #fff; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px; margin-bottom: 8px;
}
.info-step h3 { margin: 0 0 6px; font-size: 15px; }
.info-step p { margin: 0; color: var(--muted); font-size: 13px; }

@media (max-width: 1000px) {
    .cat-grid { grid-template-columns: repeat(4, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .trust-strip { grid-template-columns: 1fr 1fr; }
    .info-steps { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .header-row { flex-wrap: wrap; }
    .search { order: 10; flex-basis: 100%; min-width: 100%; }
    .catalog-btn { display: none; }
    .hide-sm { display: none; }
    .cat-grid { grid-template-columns: repeat(3, 1fr); }
    .cat-card__icon { display: none; }
    .user-nav .btn { padding: 8px 12px; font-size: 13px; }
    .top-bar__links { gap: 14px; }
}
@media (max-width: 460px) {
    .cat-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr; }
    .trust-strip { grid-template-columns: 1fr; }
    .logo { font-size: 18px; }
}

/* ---------- логотип ---------- */
.logo-img { width: 30px; height: 30px; object-fit: contain; border-radius: 8px; background: #fff; }
.footer-brand .logo-img { width: 28px; height: 28px; }

/* ---------- словесный логотип ---------- */
.logo-word { font-weight: 800; letter-spacing: -.4px; }
.logo-word em { font-style: normal; color: var(--primary); }
.footer-brand .logo-word { font-size: 18px; }

/* ---------- фильтры на мобильных: свернуть ---------- */
.filters-toggle { display: none; }
.filters-toggle-label { display: none; }
@media (max-width: 900px) {
    .catalog-layout { display: flex; flex-direction: column; }
    .catalog-main { order: 1; }
    .filters { order: 2; }
    .filters-toggle-label {
        display: inline-flex; align-items: center; gap: 8px;
        background: #fff; border: 1px solid var(--border); border-radius: 10px;
        padding: 10px 14px; font-weight: 600; cursor: pointer; margin-bottom: 12px;
    }
    .filters-body { display: none; }
    .filters-toggle:checked ~ .filters-body { display: block; }
}

/* ---------- блог: обложки ---------- */
.blog-cover { width: 100%; max-height: 420px; object-fit: cover; border-radius: 12px; margin: 14px 0 18px; }
.blog-card__img { width: 100%; height: 160px; object-fit: cover; border-radius: 10px; margin-bottom: 10px; }

/* ---------- баннеры: компактная высота ---------- */
.site-banner img { height: 230px; object-fit: cover; }
@media (max-width: 640px) {
    .site-banner img { height: 150px; }
}
