/* ===== Выбор категории по заголовку (создание / редактирование объявления) ===== */
.ads-title-category {
    margin: 22px 0 0;
    position: relative;
}
.ads-title-category-current {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #eef5ff;
    border: 1px solid #cfe0ff;
    color: #1d4ed8;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    line-height: 1.3;
    max-width: 100%;
}
.ads-title-category-current i {
    font-size: 16px;
}
.ads-title-category-suggest {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0 6px;
}
.ads-title-category-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #d8def0;
    background: #fff;
    color: #2d3748;
    border-radius: 20px;
    padding: 7px 14px;
    font-size: 13.5px;
    line-height: 1.4;
    cursor: pointer;
    transition: all .15s ease;
    user-select: none;
}
.ads-title-category-item:hover {
    border-color: #5a67d8;
    background: #f5f7ff;
    color: #4338ca;
}
.ads-title-category-item.is-current {
    border-color: #34a853;
    background: #f0faf3;
    color: #1b7f37;
}
.ads-title-category-item-active {
    border-color: #5a67d8 !important;
    background: #eef1ff !important;
}
.ads-title-category-toggle {
    display: inline-block;
    margin: 10px 0 0;
    font-size: 13.5px;
    color: #5a67d8;
    cursor: pointer;
    border-bottom: 1px dashed #aab4e8;
    line-height: 1.2;
}
.ads-title-category-toggle:hover {
    color: #4338ca;
    border-bottom-style: solid;
}

/* ===== Выпадающий список категорий (страница создания) ===== */
.ads-create-category-panel {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    z-index: 1300;
    background: #fff;
    border: 1px solid #e3e9f4;
    border-radius: 14px;
    box-shadow: 0 22px 48px -16px rgba(15,23,42,.24), 0 4px 14px rgba(15,23,42,.08);
    padding: 14px 14px 16px;
    max-height: 72vh;
    overflow-y: auto;
}
.ads-create-category-panel::-webkit-scrollbar,
.ads-update-category-list::-webkit-scrollbar {
    width: 8px;
}
.ads-create-category-panel::-webkit-scrollbar-thumb,
.ads-update-category-list::-webkit-scrollbar-thumb {
    background: #ccd4e6;
    border-radius: 8px;
}

/* поиск сверху открывшегося списка */
.ads-create-category-panel > .col-lg-5.col-md-6.col-sm-12.col-12 {
    flex: 0 0 100%;
    max-width: 100%;
    width: 100%;
    padding: 0;
    margin: 0 0 12px;
}
.ads-create-category-panel > .col-lg-5 > div {
    padding: 0 !important;
    background: #fff !important;
    border: 0 !important;
    border-radius: 0 !important;
}
.ads-create-category-panel .triangle-right,
.ads-create-category-panel > .col-lg-5 > .search-icon {
    display: none;
}
.ads-create-category-panel #search_term {
    width: 100%;
    height: 44px;
    padding: 0 44px 0 42px;
    border: 1px solid #d8def0 !important;
    border-radius: 10px;
    background-color: #f7f9fe !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='%2394a3b8' viewBox='0 0 24 24'%3E%3Cpath d='M15.5 14h-.79l-.28-.27a6.5 6.5 0 1 0-.7.7l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0A4.5 4.5 0 1 1 14 9.5 4.5 4.5 0 0 1 9.5 14z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 14px center;
    font-size: 14px;
    color: #1e293b;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.ads-create-category-panel #search_term:focus {
    border-color: #5a67d8 !important;
    background-color: #fff !important;
    box-shadow: 0 0 0 3px rgba(90,103,216,.15);
}
.ads-create-category-panel #modal.css-43436sd {
    top: 52px;
    left: 0;
    right: 0;
    border: 1px solid #e3e9f4;
    border-radius: 12px;
    box-shadow: 0 16px 34px -12px rgba(15,23,42,.18);
    max-height: 300px;
}
.ads-create-category-panel #modal .ads-create-subcategory-list span,
.ads-create-category-panel #modal #results span {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    margin-bottom: 2px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13.5px;
    color: #1e293b;
}
.ads-create-category-panel #modal .ads-create-subcategory-list span:hover,
.ads-create-category-panel #modal #results span:hover {
    background: #f0f3ff;
}
.ads-create-category-panel #modal .img-search {
    flex: 0 0 auto;
}
.ads-create-category-panel #modal .click-d small {
    display: block;
    color: #7c8aa5;
    font-size: 12px;
    font-weight: 400;
}

/* корневые категории — вертикальный список */
.ads-create-category-panel .ads-create-main-category {
    margin: 0;
}
.ads-create-category-panel .ads-create-main-category .row {
    flex-direction: column;
    align-items: stretch;
}
.ads-create-category-panel .ads-create-main-category [class*="col-"] {
    flex: 0 0 100%;
    max-width: 100%;
    width: 100%;
    padding: 0 !important;
}
.ads-create-category-panel .ads-create-main-category-list-item {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    margin: 0 0 4px;
    padding: 9px 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    text-align: left;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}
.ads-create-category-panel .ads-create-main-category-list-item:hover {
    background: #f5f7ff;
    border-color: #e6ebf7;
}
.ads-create-category-panel .ads-create-main-category-icon {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #f1f5fe;
    text-align: center;
}
.ads-create-category-panel .ads-create-main-category-icon img {
    height: 30px;
    width: auto;
}
.ads-create-category-panel .ads-create-main-category-icon-circle {
    display: none;
}
.ads-create-category-panel .ads-create-main-category-name {
    margin: 0;
    padding: 0;
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
}

/* подкатегории внутри списка */
.ads-create-category-panel .ads-create-subcategory {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eef1f7;
}
.ads-create-category-panel .ads-create-subcategory .h1title-2 {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 8px;
    padding: 0 !important;
}
.ads-create-category-panel .ads-create-subcategory-list {
    margin-top: 4px;
}
.ads-create-category-panel .ads-create-subcategory-list > .row {
    flex-direction: column;
}
.ads-create-category-panel .ads-create-subcategory-list .row.col-12 {
    flex: 0 0 100%;
    max-width: 100%;
    width: 100%;
}
.ads-create-category-panel .ads-create-subcategory-list span {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    margin-bottom: 2px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13.5px;
    color: #1e293b;
}
.ads-create-category-panel .ads-create-subcategory-list span:hover {
    background: #f0f3ff;
}
.ads-create-category-panel .ads-create-subcategory-prev {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #5a67d8;
    cursor: pointer;
    font-size: 14px;
    margin-right: 8px;
    vertical-align: middle;
}

/* ===== Выпадающий список категорий (страница редактирования) ===== */
.ads-update-category-box {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px 10px;
    border: 1px solid #d8def0;
    border-radius: 10px;
    padding: 12px 15px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.ads-update-category-box:hover {
    border-color: #5a67d8;
    box-shadow: 0 4px 14px rgba(90,103,216,.12);
}
.ads-update-category-box > span {
    cursor: pointer;
    font-weight: 500;
    color: #1e293b;
    flex: 1 1 auto;
    min-width: 0;
}
.ads-update-category-box:after {
    content: "⌄";
    flex: 0 0 auto;
    color: #5a67d8;
    font-size: 16px;
    line-height: 1;
    font-weight: 700;
}
.ads-update-category-list {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 1300;
    background: #fff;
    border: 1px solid #e3e9f4;
    border-radius: 12px;
    box-shadow: 0 22px 48px -16px rgba(15,23,42,.24), 0 4px 14px rgba(15,23,42,.08);
    padding: 10px;
    max-height: 60vh;
    overflow-y: auto;
    display: none;
}
.ads-update-category-list:before {
    display: none;
}
.ads-update-category-list > span {
    display: block;
    padding: 9px 12px;
    margin-bottom: 2px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #1e293b;
}
.ads-update-category-list > span:hover {
    background: #f0f3ff;
}
.ads-update-category-list > span small {
    display: block;
    color: #7c8aa5;
    font-size: 12px;
    font-weight: 400;
    margin-top: 1px;
}
.ads-update-category-list .ads-update-search-empty {
    color: #7c8aa5;
    font-size: 13.5px;
    cursor: default;
    text-align: center;
    padding: 14px 10px;
}
.ads-update-category-list .ads-update-search-empty:hover {
    background: transparent;
}

/* строка поиска внутри выпадающего списка (update) */
.ads-dropdown-search {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #fff;
    padding: 0 0 10px;
    margin-bottom: 8px;
    border-bottom: 1px solid #eef1f7;
}
.ads-dropdown-search input {
    width: 100%;
    height: 40px;
    padding: 0 14px 0 40px;
    border: 1px solid #d8def0;
    border-radius: 9px;
    background-color: #f7f9fe;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='%2394a3b8' viewBox='0 0 24 24'%3E%3Cpath d='M15.5 14h-.79l-.28-.27a6.5 6.5 0 1 0-.7.7l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0A4.5 4.5 0 1 1 14 9.5 4.5 4.5 0 0 1 9.5 14z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 13px center;
    font-size: 14px;
    color: #1e293b;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.ads-dropdown-search input:focus {
    border-color: #5a67d8;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(90,103,216,.15);
}

/* форма создания объявления открыта сразу целиком (не скрыта до выбора категории) */
.ads-create-main-data {
    display: block;
}
.ads-update-category-box-name {
    font-weight: 500;
}