/* ============================================================================
   LUXE BOARD — Pages: ad detail, catalog, cabinet, admin
   ============================================================================ */

/* ============================================================================
   AD DETAIL — premium clean layout
   ============================================================================ */
.ad-detail { padding: var(--gap-6) 0 var(--gap-9); }

.ad-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: var(--gap-5);
    align-items: flex-start;
}

/* ===== Gallery (ленточная) ===== */
.ad-gallery-block {
    display: flex;
    gap: 12px;
    margin-bottom: var(--g-6);
}

/* Колонка превью слева (десктоп) */
.ad-thumbs-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 84px;
    flex-shrink: 0;
    max-height: 520px;
    overflow-y: auto;
    scrollbar-width: thin;
}
.ad-thumb {
    width: 84px;
    height: 64px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
    background: var(--bg-soft);
    flex-shrink: 0;
    transition: border-color var(--tr-fast);
}
.ad-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ad-thumb.active { border-color: var(--brand); }
.ad-thumb:hover { border-color: var(--brand-accent); }

.ad-gallery {
    flex: 1;
    position: relative;
    border-radius: var(--r-md);
    overflow: hidden;
    aspect-ratio: 16 / 11;
    min-width: 0;
    box-shadow: var(--shadow-card);
    max-height: 560px;
}
.ad-gallery-track {
    display: flex;
    height: 100%;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.ad-gallery-slide {
    width: calc(100% - 230px);   
    min-width: calc(100% - 230px);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-in;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: var(--r-md);
    margin-right: 10px;         
}
.ad-gallery-slide img {
    border-radius: var(--r-md);
}
.ad-gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;          
    border-radius: var(--r-md);
}
.ad-gallery-nophoto {
    width: 100%; height: 100%;
    display: grid; place-items: center;
    color: rgba(255,255,255,0.3); font-size: 64px;
}

.ad-gallery-badges {
    position: absolute; top: 14px; left: 14px;
    display: flex; gap: 8px; z-index: 3;
}
.ad-gallery-counter {
    position: absolute;
    bottom: 14px; right: 14px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 5px 13px;
    border-radius: var(--r-full);
    font-size: 13px; font-weight: 600;
    backdrop-filter: blur(8px);
    z-index: 3;
}
.ad-gallery-nav {
    position: absolute; top: 50%;
    transform: translateY(-50%);
    width: 46px; height: 46px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: var(--text);
    display: grid; place-items: center;
    box-shadow: var(--shadow-md);
    transition: all var(--tr);
    z-index: 3; border: 0; cursor: pointer;
}
.ad-gallery-nav:hover { background: var(--brand); color: #fff; }
.ad-gallery-nav-prev { left: 14px; }
.ad-gallery-nav-next { right: 14px; }
.ad-gallery-fav {
    position: absolute; top: 14px; right: 14px;
    width: 46px; height: 46px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: var(--text-soft);
    display: grid; place-items: center;
    box-shadow: var(--shadow-md);
    transition: all var(--tr);
    z-index: 3; border: 0; cursor: pointer;
}
.ad-gallery-fav:hover, .ad-gallery-fav.active { color: var(--color-danger); transform: scale(1.05); }
.ad-gallery-fav.active i { font-weight: 900; }

/* Точки (только мобилка) */
.ad-gallery-dots { display: none; }

/* ── Мобилка ── */
@media (max-width: 768px) {
        .ad-gallery-slide {
        width: 100%;
        min-width: 100%;
        margin-right: 0;
    }
    .ad-gallery-block { flex-direction: column; gap: 0; }
    .ad-thumbs-col { display: none; }
    .ad-gallery {
        border-radius: 0;
        margin: 0 calc(-1 * var(--g-4));
        width: calc(100% + 2 * var(--g-4));
        aspect-ratio: 1 / 1;
    }
    .ad-gallery-slide { cursor: default; }
    .ad-gallery-nav { display: none; }
    .ad-gallery-counter { top: 14px; right: 14px; bottom: auto; }
    .ad-gallery-dots {
        display: flex; gap: 6px; justify-content: center;
        position: absolute; bottom: 12px; left: 50%;
        transform: translateX(-50%); z-index: 3;
    }
    .ad-gallery-dot {
        width: 7px; height: 7px; border-radius: 50%;
        background: rgba(255,255,255,0.5); transition: all 0.2s;
    }
    .ad-gallery-dot.active { background: #fff; width: 20px; border-radius: 999px; }
}

/* ===== Title + description ===== */
.ad-title-block {
    background: var(--bg-elev);
    border-radius: var(--r-md);
    padding: var(--gap-6);
    margin-top: var(--gap-4);
    box-shadow: var(--shadow-card);
}
.ad-title-row {
    display: flex; justify-content: space-between;
    align-items: flex-start;
    gap: var(--gap-4);
    margin-bottom: var(--gap-4);
}
.ad-title {
    font-size: 28px; font-weight: 800;
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.ad-id {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    padding: 4px 10px;
    background: var(--bg-soft);
    border-radius: var(--r-sm);
}
.ad-meta-row {
    display: flex;
    gap: var(--gap-4);
    font-size: 13px;
    color: var(--text-muted);
    flex-wrap: wrap;
    margin-bottom: var(--gap-5);
    padding-bottom: var(--gap-4);
    border-bottom: 1px solid var(--border-soft);
}
.ad-meta-row span { display: inline-flex; align-items: center; gap: 6px; }
.ad-meta-row i { color: var(--brand); }

.ad-section-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 var(--gap-4);
    color: var(--text);
}

.ad-description-block {
    line-height: 1.7;
    font-size: 15px;
    color: var(--text);
    white-space: normal;
}

/* ===== Attributes — chips/tags style ===== */
.ad-attrs-block {
    background: var(--bg-elev);
    border-radius: var(--r-md);
    padding: var(--gap-6);
    margin-top: var(--gap-4);
    box-shadow: var(--shadow-card);
}
.ad-attrs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--gap-3);
}
.ad-attr-item {
    display: flex;
    align-items: center;
    gap: var(--gap-3);
    padding: var(--gap-3) var(--gap-4);
    background: var(--bg-soft);
    border-radius: var(--r);
    border: 1px solid var(--border-soft);
}
.ad-attr-icon {
    width: 40px; height: 40px;
    border-radius: var(--r-sm);
    background: var(--brand-soft);
    color: var(--brand);
    display: grid; place-items: center;
    font-size: 16px;
    flex-shrink: 0;
}
.ad-attr-text { display: flex; flex-direction: column; min-width: 0; }
.ad-attr-key { font-size: 12px; color: var(--text-muted); }
.ad-attr-val {
    font-weight: 600;
    color: var(--text);
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== Right sidebar: price + seller card + safe + location ===== */
.ad-side {
    display: flex; flex-direction: column; gap: var(--gap-4);
    position: sticky;
    top: calc(var(--header-h) + var(--gap-4));
}

/* Price card */
.ad-price-card {
    background: var(--bg-elev);
    border-radius: var(--r-md);
    padding: var(--gap-6);
    box-shadow: var(--shadow-card);
}
.ad-price-big {
    font-size: 36px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
    margin-bottom: var(--gap-3);
    line-height: 1.1;
}
.ad-price-badges {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-bottom: var(--gap-4);
}
.ad-price-badge {
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 12px;
    padding: 5px 12px;
    border-radius: var(--r-full);
    font-weight: 600;
}
.ad-verified-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: var(--color-success-soft);
    color: var(--color-success);
    border-radius: var(--r-full);
    font-size: 12px;
    font-weight: 600;
}

/* Seller card */
.seller-card {
    background: var(--bg-elev);
    border-radius: var(--r-md);
    padding: var(--gap-5);
    box-shadow: var(--shadow-card);
}
.seller-header {
    display: flex; align-items: flex-start; gap: var(--gap-3);
    margin-bottom: var(--gap-4);
    padding-bottom: var(--gap-4);
    border-bottom: 1px solid var(--border-soft);
}
.seller-avatar {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand), var(--brand-accent));
    color: #fff;
    font-weight: 700; font-size: 20px;
    display: grid; place-items: center;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}
.seller-avatar img { width: 100%; height: 100%; object-fit: cover; }
.seller-online-dot {
    position: absolute;
    bottom: 2px; right: 2px;
    width: 14px; height: 14px;
    background: var(--color-success);
    border: 2px solid var(--bg-elev);
    border-radius: 50%;
}

.seller-info { flex: 1; min-width: 0; }
.seller-name {
    font-weight: 700;
    font-size: 16px;
    color: var(--text);
    margin-bottom: 2px;
    display: flex; align-items: center; gap: 6px;
}
.seller-name i { color: var(--brand); font-size: 13px; }
.seller-type { font-size: 13px; color: var(--text-muted); }
.seller-rating {
    display: flex; align-items: center; gap: 6px;
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-soft);
}
.seller-rating-stars { color: var(--color-warning); }
.seller-rating-stars i { font-size: 12px; margin-right: 1px; }

.seller-actions {
    display: flex; flex-direction: column;
    gap: var(--gap-2);
}

.btn-phone {
    background: var(--brand);
    color: #fff;
    height: 56px;
    border-radius: var(--r);
    font-weight: 700;
    box-shadow: var(--shadow-brand);
    flex-direction: column;
    gap: 2px;
    padding: 0;
}
.btn-phone:hover { background: var(--brand-hover); color: #fff; }
.btn-phone-label {
    display: flex; align-items: center; gap: 8px;
    font-size: 15px;
}
.btn-phone-num { font-size: 12px; font-weight: 500; opacity: 0.9; }

.phone-revealed {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 4px;
    padding: 14px 20px;
    background: var(--color-success);
    color: #fff;
    border-radius: var(--r);
    font-weight: 700;
    font-size: 22px;
    letter-spacing: 0.02em;
    text-align: center;
}
.phone-revealed:hover { color: #fff; }
.phone-revealed-label {
    font-size: 11px;
    opacity: 0.85;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.seller-actions-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--gap-2);
}

/* Safe deal card */
.safe-card {
    background: var(--bg-elev);
    border-radius: var(--r-md);
    padding: var(--gap-5);
    box-shadow: var(--shadow-card);
}
.safe-header {
    display: flex; align-items: center; gap: var(--gap-3);
    margin-bottom: var(--gap-3);
}
.safe-icon {
    width: 44px; height: 44px;
    border-radius: var(--r-sm);
    background: var(--color-info-soft);
    color: var(--color-info);
    display: grid; place-items: center;
    font-size: 18px;
}
.safe-title { font-weight: 700; font-size: 15px; }
.safe-text {
    font-size: 13px;
    color: var(--text-soft);
    line-height: 1.55;
    margin-bottom: var(--gap-3);
}
.safe-list {
    list-style: none; padding: 0; margin: 0;
    display: flex; flex-direction: column;
    gap: 10px;
}
.safe-list li {
    display: flex; align-items: center; gap: var(--gap-2);
    font-size: 13px; color: var(--text-soft);
}
.safe-list i { color: var(--color-success); }

/* Location card */
.location-card {
    background: var(--bg-elev);
    border-radius: var(--r-md);
    padding: var(--gap-5);
    box-shadow: var(--shadow-card);
}
.location-header {
    display: flex; align-items: center; gap: var(--gap-3);
    margin-bottom: var(--gap-3);
}
.location-icon {
    width: 44px; height: 44px;
    border-radius: var(--r-sm);
    background: var(--brand-soft);
    color: var(--brand);
    display: grid; place-items: center;
    font-size: 18px;
}
.location-title { font-weight: 700; font-size: 15px; }
.location-address { font-size: 13px; color: var(--text-soft); margin-bottom: var(--gap-3); }
.location-map {
    aspect-ratio: 16 / 10;
    background: var(--bg-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 250'%3E%3Cdefs%3E%3Cpattern id='g' width='40' height='40' patternUnits='userSpaceOnUse'%3E%3Cpath d='M 40 0 L 0 0 0 40' fill='none' stroke='%23E5E7EB' stroke-width='1'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='400' height='250' fill='%23F1F3F9'/%3E%3Crect width='400' height='250' fill='url(%23g)'/%3E%3Cpath d='M 0 60 Q 100 50 200 80 T 400 70' stroke='%23D1D5DB' stroke-width='2' fill='none'/%3E%3Cpath d='M 0 140 L 200 130 L 400 150' stroke='%23D1D5DB' stroke-width='2' fill='none'/%3E%3Ccircle cx='200' cy='125' r='14' fill='%235B47E0'/%3E%3Ccircle cx='200' cy='125' r='7' fill='%23fff'/%3E%3C/svg%3E") center/cover;
    border-radius: var(--r-sm);
    margin-bottom: var(--gap-3);
}

/* ============================================================================
   CATALOG — категория с фильтрами
   ============================================================================ */
.catalog { padding: var(--gap-6) 0 var(--gap-9); }
.catalog-grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
    align-items: flex-start;
}

/* Планшет — прячем правый сайдбар */
@media (max-width: 1200px) {
    .catalog-grid {
        grid-template-columns: 260px 1fr;
    }
    .catalog-grid .right-sidebar { display: none; }
}

/* Мобилка — одна колонка */
@media (max-width: 900px) {
    .catalog-grid {
        grid-template-columns: 1fr;
    }
}
.catalog-header {
    display: flex; flex-direction: column;
    gap: var(--gap-3);
    margin-bottom: var(--gap-5);
}
.catalog-title-row {
    display: flex; justify-content: space-between;
    align-items: flex-start;
    gap: var(--gap-4);
    flex-wrap: wrap;
}
.catalog-title {
    font-size: 32px; font-weight: 800;
    margin: 0;
    letter-spacing: -0.02em;
    display: flex; align-items: center; gap: var(--gap-3);
    flex-wrap: wrap;
}
.catalog-count-pill {
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 14px;
    padding: 6px 14px;
    border-radius: var(--r-full);
    font-weight: 600;
}
.catalog-subtitle { color: var(--text-soft); font-size: 14px; margin: 4px 0 0; }

.catalog-toolbar {
    display: flex; gap: var(--gap-3);
    align-items: center; flex-wrap: wrap;
}
.view-toggle {
    display: flex; gap: 4px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 4px;
}
.view-toggle button {
    width: 36px; height: 36px;
    border-radius: var(--r-xs);
    color: var(--text-muted);
    transition: all var(--tr-fast);
    display: grid; place-items: center;
}
.view-toggle button.active { background: var(--brand-soft); color: var(--brand); }
.catalog-sort {
    padding: 10px 38px 10px 16px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
    height: 44px;
}

/* Active filter chips */
.filter-chips {
    display: flex; flex-wrap: wrap; gap: 8px;
    align-items: center;
}
.filter-chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 7px 14px;
    background: var(--brand-soft);
    color: var(--brand-text);
    border-radius: var(--r-full);
    font-size: 13px; font-weight: 500;
}
.filter-chip button { color: inherit; font-size: 12px; }
.filter-chip button:hover { color: var(--color-danger); }
.filter-clear { color: var(--brand); font-weight: 600; font-size: 13px; }

/* Filters sidebar */
.filters {
    background: var(--bg-elev);
    border-radius: var(--r-md);
    padding: var(--gap-5);
    position: sticky;
    top: calc(var(--header-h) + var(--gap-4));
    box-shadow: var(--shadow-card);
}
.filters-head {
    display: flex; justify-content: space-between;
    align-items: center;
    margin-bottom: var(--gap-5);
    padding-bottom: var(--gap-3);
    border-bottom: 1px solid var(--border-soft);
}
.filters-title { font-size: 17px; font-weight: 700; margin: 0; }
.filters-reset {
    display: inline-flex; align-items: center; gap: 4px;
    color: var(--brand); font-size: 13px; font-weight: 600;
}
.filter-group { margin-bottom: var(--gap-5); }
.filter-group:last-child { margin-bottom: 0; }
.filter-group-title {
    font-size: 14px; font-weight: 700;
    margin: 0 0 var(--gap-3);
    color: var(--text);
}
.filter-range { display: flex; gap: 6px; }
.filter-range input { flex: 1; min-width: 0; }
.filter-check {
    display: flex; align-items: center;
    gap: var(--gap-2);
    padding: 8px 0;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
    transition: color var(--tr-fast);
}
.filter-check:hover { color: var(--brand); }
.filter-check input { width: 18px; height: 18px; accent-color: var(--brand); cursor: pointer; }
.filter-check .count {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 12px;
    background: var(--bg-soft);
    padding: 2px 8px;
    border-radius: var(--r-full);
    font-weight: 500;
}

/* Pagination */
.pagination {
    display: flex; justify-content: center;
    gap: 6px;
    margin-top: var(--gap-7);
    flex-wrap: wrap;
}
.pagination a, .pagination span {
    min-width: 40px; height: 40px;
    padding: 0 14px;
    display: inline-grid; place-items: center;
    border-radius: var(--r-sm);
    background: var(--bg-elev);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-soft);
    transition: all var(--tr-fast);
    box-shadow: var(--shadow-xs);
}
.pagination a:hover { color: var(--brand); background: var(--brand-soft); }
.pagination .current { background: var(--brand); color: #fff; box-shadow: var(--shadow-brand); }
.pagination .disabled { opacity: 0.4; pointer-events: none; }

/* ============================================================================
   AUTH PAGES
   ============================================================================ */
.auth-section {
    padding: var(--gap-7) 0 var(--gap-9);
    min-height: calc(100vh - var(--header-h) - 200px);
    display: flex; align-items: center;
}
.auth-card {
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
    background: var(--bg-elev);
    border-radius: var(--r-lg);
    padding: var(--gap-7);
    box-shadow: var(--shadow-lg);
}
.auth-header { text-align: center; margin-bottom: var(--gap-6); }
.auth-logo { display: inline-flex; margin-bottom: var(--gap-4); }
.auth-logo .logo-mark { width: 64px; height: 64px; font-size: 28px; border-radius: var(--r); }
.auth-title { font-size: 28px; font-weight: 800; margin: 0 0 8px; letter-spacing: -0.02em; }
.auth-subtitle { color: var(--text-soft); margin: 0; }
.auth-form { display: flex; flex-direction: column; gap: var(--gap-3); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap-3); }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.auth-options {
    display: flex; justify-content: space-between;
    align-items: center; margin: 4px 0;
    font-size: 14px;
}
.auth-link { color: var(--brand); font-weight: 600; }
.auth-link:hover { color: var(--brand-hover); text-decoration: underline; }
.auth-footer {
    text-align: center;
    margin-top: var(--gap-5);
    padding-top: var(--gap-4);
    border-top: 1px solid var(--border-soft);
    font-size: 14px;
    color: var(--text-soft);
}
.checkbox {
    display: inline-flex; align-items: center; gap: var(--gap-2);
    cursor: pointer; user-select: none;
}
.checkbox input { width: 18px; height: 18px; accent-color: var(--brand); cursor: pointer; }
.checkbox-large { font-size: 13px; line-height: 1.5; align-items: flex-start; padding: 8px 0; }
.checkbox-large input { margin-top: 2px; flex-shrink: 0; }

/* ============================================================================
   CABINET
   ============================================================================ */
.cabinet { padding: var(--gap-6) 0 var(--gap-9); }
.cabinet-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: var(--gap-5);
    align-items: flex-start;
}
.cabinet-sidebar {
    background: var(--bg-elev);
    border-radius: var(--r-md);
    padding: var(--gap-4);
    position: sticky;
    top: calc(var(--header-h) + var(--gap-4));
    box-shadow: var(--shadow-card);
}
.cabinet-user {
    padding: var(--gap-4);
    border-radius: var(--r);
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-accent) 100%);
    color: #fff;
    text-align: center;
    margin-bottom: var(--gap-3);
}
.cabinet-user-avatar {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-weight: 700; font-size: 24px;
    display: grid; place-items: center;
    margin: 0 auto var(--gap-2);
    overflow: hidden;
}
.cabinet-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.cabinet-user-name { font-weight: 700; font-size: 15px; margin-bottom: 2px; }
.cabinet-user-email { font-size: 12px; opacity: 0.85; }
.cabinet-user-balance {
    margin-top: var(--gap-3); padding: 10px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--r-xs);
    font-size: 13px;
}
.cabinet-user-balance-label {
    opacity: 0.85; font-size: 11px;
    text-transform: uppercase; letter-spacing: 0.05em;
}
.cabinet-user-balance-value {
    font-weight: 700;
    margin-top: 2px;
    font-size: 18px;
}

.cabinet-nav { display: flex; flex-direction: column; gap: 2px; }
.cabinet-nav a {
    display: flex; align-items: center; gap: var(--gap-3);
    padding: 11px 14px;
    border-radius: var(--r-sm);
    font-size: 14px;
    color: var(--text-soft);
    transition: all var(--tr-fast);
    font-weight: 500;
}
.cabinet-nav a i { width: 18px; text-align: center; color: var(--text-muted); }
.cabinet-nav a:hover { background: var(--bg-soft); color: var(--text); }
.cabinet-nav a:hover i { color: var(--brand); }
.cabinet-nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.cabinet-nav a.active i { color: var(--brand); }
.cabinet-nav-badge {
    margin-left: auto;
    background: var(--brand);
    color: #fff;
    padding: 2px 8px;
    border-radius: var(--r-full);
    font-size: 11px;
    font-weight: 700;
}

.cabinet-main {
    background: var(--bg-elev);
    border-radius: var(--r-md);
    padding: var(--gap-6);
    box-shadow: var(--shadow-card);
}
.cabinet-header {
    display: flex; align-items: center;
    justify-content: space-between;
    gap: var(--gap-4);
    margin-bottom: var(--gap-5);
    flex-wrap: wrap;
}
.cabinet-title {
    font-size: 26px; font-weight: 800;
    margin: 0;
    letter-spacing: -0.02em;
}

@media (max-width: 900px) {
    .cabinet-grid { grid-template-columns: 1fr; }
    .cabinet-sidebar { position: static; }
}

/* Stats cards */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--gap-3);
    margin-bottom: var(--gap-5);
}
.stat-card {
    padding: var(--gap-4);
    background: var(--bg-soft);
    border-radius: var(--r);
    transition: transform var(--tr);
}
.stat-card:hover { transform: translateY(-2px); }
.stat-card-label {
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
    font-weight: 600;
}
.stat-card-value {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.stat-card-icon {
    color: var(--brand);
    margin-bottom: var(--gap-2);
    font-size: 20px;
}

/* My ads */
.my-ads { display: flex; flex-direction: column; gap: var(--gap-3); }
.my-ad {
    display: grid;
    grid-template-columns: 120px 1fr auto;
    gap: var(--gap-4);
    padding: var(--gap-3);
    background: var(--bg-soft);
    border-radius: var(--r);
    align-items: center;
    transition: all var(--tr);
}
.my-ad:hover { background: var(--bg-elev); box-shadow: var(--shadow-sm); }
.my-ad-photo {
    width: 120px; height: 90px;
    object-fit: cover;
    border-radius: var(--r-sm);
    background: var(--border);
}
.my-ad-photo-empty { display: grid; place-items: center; color: var(--text-muted); }
.my-ad-info-title { font-weight: 600; margin-bottom: 4px; font-size: 15px; }
.my-ad-info-meta {
    font-size: 13px; color: var(--text-muted);
    display: flex; gap: var(--gap-3);
    flex-wrap: wrap; align-items: center;
}
.my-ad-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--r-full);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.status-active   { background: var(--color-success-soft); color: var(--color-success); }
.status-pending  { background: var(--color-warning-soft); color: var(--color-warning); }
.status-rejected { background: var(--color-danger-soft); color: var(--color-danger); }
.status-archived { background: var(--bg-strong); color: var(--text-muted); }
.status-sold     { background: var(--color-info-soft); color: var(--color-info); }
.status-expired  { background: var(--bg-strong); color: var(--text-muted); }
.status-admin    { background: var(--color-info-soft); color: var(--color-info); }
.status-moderator { background: var(--brand-soft); color: var(--brand); }
.status-user     { background: var(--bg-strong); color: var(--text-soft); }
.status-banned   { background: var(--color-danger-soft); color: var(--color-danger); }
.status-deleted  { background: var(--bg-strong); color: var(--text-muted); }
.status-success  { background: var(--color-success-soft); color: var(--color-success); }
.status-failed   { background: var(--color-danger-soft); color: var(--color-danger); }
.status-cancelled { background: var(--bg-strong); color: var(--text-muted); }

.my-ad-actions { display: flex; gap: 6px; }
.my-ad-actions .btn { padding: 8px 12px; font-size: 13px; }

@media (max-width: 600px) {
    .my-ad { grid-template-columns: 80px 1fr; }
    .my-ad-actions { grid-column: 1 / -1; justify-content: flex-end; }
}

/* Ad form */
.ad-form { display: flex; flex-direction: column; gap: var(--gap-5); }
.form-section {
    background: var(--bg-elev);
    border-radius: var(--r);
    padding: var(--gap-5);
    border: 1px solid var(--border-soft);
}
.form-section-title {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 var(--gap-4);
    display: flex; align-items: center; gap: var(--gap-2);
}
.form-section-title i {
    color: var(--brand);
    width: 28px; height: 28px;
    background: var(--brand-soft);
    border-radius: var(--r-xs);
    display: inline-grid; place-items: center;
    font-size: 14px;
}

/* Price types */
.price-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--gap-2);
    margin-bottom: var(--gap-3);
}
.price-type-pick {
    padding: 14px;
    border: 2px solid var(--border);
    border-radius: var(--r-sm);
    background: var(--bg-elev);
    text-align: center;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--tr-fast);
    user-select: none;
}
.price-type-pick:hover { border-color: var(--brand); }
.price-type-pick.selected { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); font-weight: 600; }

/* Photo upload */
.photo-upload-zone {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: var(--gap-3);
}
.photo-upload-item {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: var(--r);
    overflow: hidden;
}
.photo-upload-item img { width: 100%; height: 100%; object-fit: cover; }
.photo-upload-remove {
    position: absolute;
    top: 6px; right: 6px;
    width: 28px; height: 28px;
    border-radius: 50%;
    background: rgba(0,0,0,0.7);
    color: #fff;
    display: grid; place-items: center;
}
.photo-upload-add {
    aspect-ratio: 1 / 1;
    border: 2px dashed var(--border-strong);
    border-radius: var(--r);
    display: grid; place-items: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--tr);
}
.photo-upload-add:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.photo-upload-add i { font-size: 28px; margin-bottom: 4px; }
.photo-upload-add span { font-size: 12px; text-align: center; padding: 0 4px; }

/* Tabs */
.tabs-row {
    display: flex; gap: 4px;
    background: var(--bg-soft);
    padding: 4px;
    border-radius: var(--r);
    margin-bottom: var(--gap-4);
    overflow-x: auto;
}
.tab-link {
    padding: 10px 18px;
    border-radius: var(--r-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-soft);
    white-space: nowrap;
    transition: all var(--tr-fast);
}
.tab-link:hover { color: var(--text); background: var(--bg-elev); }
.tab-link.active { background: var(--bg-elev); color: var(--brand); box-shadow: var(--shadow-sm); font-weight: 600; }

.inline-form { display: inline-block; }
.hide { display: none !important; }
.btn-icon-danger { color: var(--color-danger) !important; }
.btn-icon-danger:hover { background: var(--color-danger-soft); }
.form-actions { display: flex; gap: var(--gap-3); flex-wrap: wrap; padding-top: var(--gap-3); }

/* Wallet */
.wallet-balance {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-accent) 100%);
    color: #fff;
    border-radius: var(--r-md);
    padding: var(--gap-6);
    text-align: center;
    margin-bottom: var(--gap-5);
    box-shadow: var(--shadow-brand);
}
.wallet-balance-label {
    font-size: 13px; opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}
.wallet-balance-value {
    font-size: 56px;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin: 8px 0;
    line-height: 1;
}

/* Tariffs */
.tariff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--gap-3);
}
.tariff-card {
    padding: var(--gap-5);
    background: var(--bg-soft);
    border-radius: var(--r);
    border: 2px solid transparent;
    text-align: center;
    transition: all var(--tr);
}
.tariff-card:hover { border-color: var(--brand); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.tariff-icon { font-size: 28px; color: var(--brand); margin-bottom: var(--gap-2); }
.tariff-name { font-weight: 700; margin-bottom: 4px; }
.tariff-price { font-size: 24px; font-weight: 800; color: var(--brand); margin: var(--gap-2) 0; }
.tariff-duration { font-size: 12px; color: var(--text-muted); }

/* Wheel of fortune */
.wheel-stage {
    text-align: center; 
    padding: var(--gap-6) 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    }
.wheel {
    width: 380px; height: 380px;
    max-width: 90vw;
    margin: 0 auto var(--gap-5);
    position: relative;
    border-radius: 50%;
    box-shadow: 0 20px 60px var(--brand-glow);
    transition: transform 5s cubic-bezier(0.17, 0.67, 0.21, 0.99);
}
.wheel-svg { width: 100%; height: 100%; border-radius: 50%; display: block; }
.wheel-pointer {
    position: absolute;
    top: -16px; left: 50%;
    transform: translateX(-50%);
    width: 0; height: 0;
    border-left: 18px solid transparent;
    border-right: 18px solid transparent;
    border-top: 32px solid var(--brand);
    z-index: 2;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}
.wheel-spin-btn {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 100px; height: 100px;
    border-radius: 50%;
    background: var(--bg-elev);
    border: 6px solid var(--brand);
    color: var(--brand);
    font-weight: 800;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: var(--shadow-brand);
    z-index: 3;
    transition: all var(--tr);
}
.wheel-spin-btn:hover:not(:disabled) { transform: translate(-50%, -50%) scale(1.05); }
.wheel-spin-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Avatar form */
.avatar-form { display: flex; align-items: center; gap: var(--gap-4); }
.avatar-current { flex-shrink: 0; }
.avatar-img, .avatar-letter {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand), var(--brand-accent));
    color: #fff;
    font-weight: 800; font-size: 30px;
    display: grid; place-items: center;
    overflow: hidden;
}
.avatar-img { object-fit: cover; }

/* Chat */
.chat-wrap {
    display: flex; flex-direction: column;
    height: 600px;
    background: var(--bg-soft);
    border-radius: var(--r);
    overflow: hidden;
}
.chat-header {
    padding: var(--gap-3);
    border-bottom: 1px solid var(--border);
    background: var(--bg-elev);
    display: flex; align-items: center;
    gap: var(--gap-3);
}
.chat-body { flex: 1; overflow-y: auto; padding: var(--gap-4); }
.chat-msg { margin-bottom: var(--gap-3); display: flex; }
.chat-msg.mine { justify-content: flex-end; }
.chat-msg-bubble {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: var(--r);
    background: var(--bg-elev);
    box-shadow: var(--shadow-sm);
}
.chat-msg.mine .chat-msg-bubble { background: var(--brand); color: #fff; }
.chat-msg-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.chat-msg.mine .chat-msg-time { color: rgba(255,255,255,0.75); }
.chat-form {
    padding: var(--gap-3);
    border-top: 1px solid var(--border);
    display: flex; gap: var(--gap-2);
    background: var(--bg-elev);
}
.chat-form input { flex: 1; }

.conversations-list { display: flex; flex-direction: column; gap: var(--gap-2); }
.conversation-item {
    display: grid;
    grid-template-columns: 60px 1fr auto;
    gap: var(--gap-3);
    padding: var(--gap-3);
    background: var(--bg-soft);
    border-radius: var(--r);
    align-items: center;
    transition: all var(--tr);
}
.conversation-item:hover { background: var(--brand-soft); }
.conversation-item.unread {
    background: color-mix(in srgb, var(--brand) 6%, var(--bg-soft));
    border-left: 3px solid var(--brand);
}
.conversation-avatar {
    width: 50px; height: 50px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--brand);
}
.conversation-name { font-weight: 600; }
.conversation-last {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.conversation-meta {
    text-align: right;
    font-size: 12px;
    color: var(--text-muted);
}
.conversation-badge {
    background: var(--brand);
    color: #fff;
    padding: 2px 8px;
    border-radius: var(--r-full);
    font-size: 11px;
    font-weight: 700;
    margin-top: 4px;
    display: inline-block;
}

/* ============================================================================
   ADMIN PANEL
   ============================================================================ */
.admin-body { background: var(--bg-soft); }
.admin-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}
.admin-sidebar {
    background: #0F1525;
    color: #B4BAC8;
    padding: var(--gap-4);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.admin-logo {
    display: flex; align-items: center; gap: var(--gap-3);
    padding: var(--gap-2) var(--gap-3);
    margin-bottom: var(--gap-5);
    color: #fff;
    font-weight: 800;
    font-size: 18px;
}
.admin-nav { display: flex; flex-direction: column; gap: 2px; }
.admin-nav-group { margin-bottom: var(--gap-4); }
.admin-nav-group-title {
    font-size: 10px;
    text-transform: uppercase;
    color: #6B7280;
    padding: var(--gap-2) var(--gap-3) 6px;
    letter-spacing: 0.08em;
    font-weight: 700;
}
.admin-nav a {
    display: flex; align-items: center; gap: var(--gap-3);
    padding: 10px 12px;
    border-radius: var(--r-sm);
    color: #B4BAC8;
    font-size: 14px;
    transition: all var(--tr-fast);
}
.admin-nav a i { width: 18px; text-align: center; color: #6B7280; transition: color var(--tr-fast); }
.admin-nav a:hover { background: rgba(255,255,255,0.05); color: #fff; }
.admin-nav a:hover i { color: var(--brand-accent); }
.admin-nav a.active { background: var(--brand); color: #fff; box-shadow: var(--shadow-brand); }
.admin-nav a.active i { color: #fff; }

.admin-main { padding: var(--gap-5); min-width: 0; }
.admin-topbar {
    background: var(--bg-elev);
    border-radius: var(--r);
    padding: var(--gap-3) var(--gap-5);
    display: flex; align-items: center;
    justify-content: space-between;
    gap: var(--gap-3);
    margin-bottom: var(--gap-4);
    box-shadow: var(--shadow-sm);
}
.admin-page-title { font-size: 22px; font-weight: 800; margin: 0; letter-spacing: -0.02em; }
.admin-card {
    background: var(--bg-elev);
    border-radius: var(--r);
    padding: var(--gap-5);
    margin-bottom: var(--gap-4);
    box-shadow: var(--shadow-sm);
}
.admin-card-title { font-size: 17px; font-weight: 700; margin: 0 0 var(--gap-4); }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table thead th {
    background: var(--bg-soft);
    color: var(--text-muted);
    font-weight: 700;
    text-align: left;
    padding: 12px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-soft);
}
.table tbody td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border-soft);
    vertical-align: middle;
}
.table tbody tr:hover { background: var(--bg-soft); }

.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
    position: absolute; inset: 0;
    background: var(--border-strong);
    border-radius: 24px;
    cursor: pointer;
    transition: background var(--tr);
}
.switch-slider::before {
    content: "";
    position: absolute;
    width: 18px; height: 18px;
    left: 3px; top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform var(--tr);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.switch input:checked + .switch-slider { background: var(--brand); }
.switch input:checked + .switch-slider::before { transform: translateX(20px); }

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--gap-4);
}
.module-card {
    padding: var(--gap-5);
    background: var(--bg-soft);
    border: 2px solid var(--border-soft);
    border-radius: var(--r);
    transition: all var(--tr);
}
.module-card-on {
    border-color: var(--brand);
    background: linear-gradient(135deg, var(--brand-soft), var(--bg-soft) 80%);
}
.module-card-head { display: flex; align-items: center; gap: var(--gap-3); margin-bottom: var(--gap-3); }
.module-card-icon {
    width: 44px; height: 44px;
    border-radius: var(--r-sm);
    background: var(--bg-elev);
    color: var(--brand);
    display: grid; place-items: center;
    font-size: 18px;
    flex-shrink: 0;
}
.module-card-on .module-card-icon { background: var(--brand); color: #fff; }
.module-card-name { font-weight: 700; font-size: 15px; }
.module-card-version { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.module-card-desc { color: var(--text-soft); font-size: 13px; margin: var(--gap-2) 0; line-height: 1.5; }
.module-card-code, .module-card-meta {
    font-size: 11px; color: var(--text-muted);
    display: block; margin-top: 6px;
}
.module-card-head > form, .module-card-head > .switch { margin-left: auto; }
.badge-core {
    margin-left: auto;
    padding: 4px 10px;
    background: var(--brand-soft);
    color: var(--brand);
    border-radius: var(--r-full);
    font-size: 11px;
    font-weight: 700;
}
.color-dot {
    display: inline-block;
    width: 14px; height: 14px;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 4px;
    border: 1px solid var(--border);
}

@media (max-width: 900px) {
    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar { position: static; height: auto; }
    .ad-detail-grid { grid-template-columns: 1fr; }
    .ad-side { position: static; }
    .catalog-grid { grid-template-columns: 1fr; }
}

/* Page */
.page-content {
    background: var(--bg-elev);
    border-radius: var(--r-lg);
    padding: var(--gap-7);
    box-shadow: var(--shadow-card);
    line-height: 1.7;
}
.page-content h1, .page-content h2, .page-content h3 {
    margin-top: var(--gap-5);
    margin-bottom: var(--gap-3);
}
.page-content h1:first-child { margin-top: 0; }
.page-content p { margin-bottom: var(--gap-3); }
.page-content a { color: var(--brand); }
.page-content a:hover { text-decoration: underline; }






/* ============================================================================
   Categories list page (/categories)
   ============================================================================ */
.cats-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--gap-5);
}

.cats-list-card {
    background: var(--bg-elev);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: box-shadow var(--tr), transform var(--tr);
    border: 1px solid var(--border-soft);
}
.cats-list-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
}

.cats-list-head {
    display: flex;
    align-items: center;
    gap: var(--gap-3);
    padding: var(--gap-4) var(--gap-5);
    border-bottom: 1px solid var(--border-soft);
    transition: background var(--tr-fast);
    color: var(--text);
}
.cats-list-head:hover { background: var(--brand-soft); color: var(--text); }

.cats-list-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--r);
    background: var(--brand-soft);
    color: var(--brand);
    display: grid;
    place-items: center;
    font-size: 22px;
    flex-shrink: 0;
    transition: all var(--tr);
}
.cats-list-head:hover .cats-list-icon {
    background: var(--brand);
    color: #fff;
}

.cats-list-info { flex: 1; min-width: 0; }
.cats-list-name {
    font-weight: 700;
    font-size: 16px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cats-list-count {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

.cats-list-arrow {
    color: var(--text-muted);
    font-size: 12px;
    flex-shrink: 0;
    transition: transform var(--tr);
}
.cats-list-head:hover .cats-list-arrow {
    transform: translateX(3px);
    color: var(--brand);
}

.cats-list-subs {
    padding: var(--gap-2) var(--gap-5);
    display: flex;
    flex-direction: column;
}

.cats-list-sub {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    font-size: 14px;
    color: var(--text-soft);
    border-bottom: 1px solid var(--border-soft);
    transition: color var(--tr-fast);
    gap: var(--gap-3);
}
.cats-list-sub:last-child { border-bottom: 0; }
.cats-list-sub:hover { color: var(--brand); }

.cats-list-sub-count {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-soft);
    padding: 3px 10px;
    border-radius: var(--r-full);
    flex-shrink: 0;
    min-width: 32px;
    text-align: center;
}

.cats-list-more {
    color: var(--brand);
    font-weight: 600;
    font-size: 13px;
    border-bottom: 0 !important;
    padding-top: var(--gap-3) !important;
}

@media (max-width: 768px) {
    .cats-list-grid { grid-template-columns: 1fr; }
}



/* Списочный вид каталога */
.ads-grid.ads-list-view {
    grid-template-columns: 1fr !important;
}
.ads-grid.ads-list-view .ad-card {
    flex-direction: row;
}
.ads-grid.ads-list-view .ad-card-photo {
    width: 240px;
    flex-shrink: 0;
    aspect-ratio: 4 / 3;
}
.ads-grid.ads-list-view .ad-card-body {
    flex: 1;
}

/* На мобилке списочный вид тоже работает — перебиваем 2 колонки */
@media (max-width: 768px) {
    .ads-grid.ads-list-view {
        grid-template-columns: 1fr !important;
    }
    .ads-grid.ads-list-view .ad-card {
        flex-direction: row;
    }
    .ads-grid.ads-list-view .ad-card-photo {
        width: 130px;
        aspect-ratio: 1 / 1;
    }
    .ads-grid.ads-list-view .ad-card-title {
        font-size: 14px;
    }
}






/* Кнопка "Фильтры" — только на мобилке */
.filter-toggle-btn { display: none; }

@media (max-width: 900px) {
    .filter-toggle-btn { display: inline-flex; }

    /* Фильтр скрыт по умолчанию, выезжает снизу */
    .filters {
        position: fixed !important;
        bottom: 0; left: 0; right: 0;
        top: auto !important;
        z-index: 180;
        max-height: 85vh;
        overflow-y: auto;
        border-radius: 20px 20px 0 0 !important;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
        box-shadow: 0 -8px 32px rgba(0,0,0,0.2);
        margin: 0 !important;
    }
    .filters.open { transform: translateY(0); }

    .filters-overlay {
        position: fixed; inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 179;
        display: none;
    }
    .filters-overlay.open { display: block; }
}



.photo-main-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: var(--brand);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    z-index: 2;
}
.photo-upload-item { position: relative; }






/* ============================================================================
   Подкатегории на странице категории (как Популярные на главной)
   ============================================================================ */
.cat-subcats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: var(--g-6);
}

.cat-subcat {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    min-height: 108px;
    padding: 16px;
    border-radius: 16px;
    background: var(--bg-soft);
    overflow: hidden;
    position: relative;
    transition: all 0.2s;
    color: var(--text);
}
.cat-subcat:hover {
    background: var(--brand-soft);
    transform: translateY(-2px);
    color: var(--text);
}

.cat-subcat-name {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.25;
    max-width: 60%;
    position: relative;
    z-index: 2;
}

.cat-subcat-img {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 80px;
    height: 80px;
    display: grid;
    place-items: center;
    z-index: 1;
}
.cat-subcat-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.cat-subcat-img i {
    font-size: 40px;
    color: var(--brand);
    opacity: 0.85;
}

.cat-subcat-all {
    align-items: center;
    justify-content: center;
}
.cat-subcat-all .cat-subcat-name {
    max-width: 100%;
    color: var(--brand);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Адаптив */
@media (max-width: 1100px) {
    .cat-subcats { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 768px) {
    .cat-subcats {
        grid-auto-flow: column;
        grid-template-columns: none;
        grid-auto-columns: 150px;
        grid-template-rows: 1fr 1fr;
        overflow-x: auto;
        scrollbar-width: none;
        margin: 0 calc(-1 * var(--g-4)) var(--g-5);
        padding: 0 var(--g-4);
    }
    .cat-subcats::-webkit-scrollbar { display: none; }
    .cat-subcat {
        min-height: 92px;
        padding: 12px;
    }
    .cat-subcat-name { font-size: 13px; }
    .cat-subcat-img { width: 56px; height: 56px; }
    .cat-subcat-img i { font-size: 28px; }
}





/* ============================================================================
   Горизонтальный фильтр-бар над объявлениями
   ============================================================================ */
.filter-bar {
    background: var(--bg-elev);
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(20,24,43,0.04);
}
.filter-bar-head { display: none; }   /* шапка только на мобилке */

.filter-bar-fields {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}
.filter-bar-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.filter-bar-field > label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}
.filter-bar-field .form-select,
.filter-bar-field .form-input {
    height: 42px;
    min-width: 150px;
}
.filter-bar-price .filter-range {
    display: flex;
    align-items: center;
    gap: 8px;
}
.filter-bar-price .form-input { min-width: 90px; width: 90px; }
.filter-range-sep { color: var(--text-muted); }

.filter-bar-checkbox {
    justify-content: flex-end;
    padding-bottom: 10px;
}
.filter-bar-checkbox .filter-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
}

.filter-bar-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
    padding-bottom: 0;
}
.filter-bar-actions .btn { height: 42px; }

/* Панель чипов + сортировка */
.catalog-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.catalog-bar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}
.catalog-bar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}
.filter-toggle-btn { display: none; }   /* кнопка только на мобилке */

/* ── Планшет — сворачиваем поля фильтра компактнее ── */
@media (max-width: 1100px) {
    .filter-bar-field .form-select,
    .filter-bar-field .form-input { min-width: 120px; }
}

/* ── Мобилка — фильтр-бар прячется, открывается снизу по кнопке ── */
@media (max-width: 900px) {
    .filter-toggle-btn { display: inline-flex; }

    .filter-bar {
        position: fixed;
        bottom: 0; left: 0; right: 0;
        top: auto;
        z-index: 180;
        max-height: 85vh;
        overflow-y: auto;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
        box-shadow: 0 -8px 32px rgba(0,0,0,0.2);
        margin: 0;
    }
    .filter-bar.open { transform: translateY(0); }

    .filter-bar-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 16px;
        padding-bottom: 12px;
        border-bottom: 1px solid var(--border-soft);
    }
    .filter-bar-title {
        font-size: 18px; font-weight: 700;
        display: flex; align-items: center; gap: 8px; margin: 0;
    }
    .filter-bar-close {
        width: 36px; height: 36px;
        border-radius: 50%;
        background: var(--bg-soft);
        border: 0; cursor: pointer;
        font-size: 16px;
    }

    .filter-bar-fields { flex-direction: column; align-items: stretch; }
    .filter-bar-field { width: 100%; }
    .filter-bar-field .form-select,
    .filter-bar-field .form-input { min-width: 0; width: 100%; }
    .filter-bar-price .form-input { width: 100%; }
    .filter-bar-actions { margin-left: 0; flex-direction: column; }
    .filter-bar-actions .btn { width: 100%; }

    .filters-overlay {
        position: fixed; inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 179; display: none;
    }
    .filters-overlay.open { display: block; }
}






