/* ============================================================
   ADS — Создание/редактирование объявления
   ============================================================ */

/* ============ ОСНОВА ============ */
.ad-form-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 32px 16px 80px;
}

/* ============ ХЕДЕР ============ */
.ad-form-header {
    margin-bottom: 32px;
}

.ad-form-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 16px;
    transition: color 0.15s;
}

.ad-form-back:hover {
    color: #00AAFF;
}

.ad-form-title {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px;
    line-height: 1.2;
}

.ad-form-subtitle {
    color: #999;
    font-size: 14px;
    margin: 0;
}

/* ============ ШАГИ ============ */
.ad-form-steps {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.ad-form-step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f5f5f5;
    border-radius: 20px;
    font-size: 13px;
    color: #999;
    font-weight: 500;
    transition: all 0.2s;
}

.ad-form-step.active {
    background: #e8f4ff;
    color: #00AAFF;
}

.ad-form-step.done {
    background: #e8f9ed;
    color: #00A046;
}

.ad-form-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    font-size: 11px;
    font-weight: 700;
    color: inherit;
}

/* ============ КАРТОЧКА ============ */
.ad-form-card {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #eee;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.ad-form-section {
    margin-bottom: 32px;
}

.ad-form-section:last-child {
    margin-bottom: 0;
}

.ad-form-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 6px;
}

.ad-form-section-title i {
    color: #00AAFF;
    font-size: 20px;
}

.ad-form-section-hint {
    font-size: 13px;
    color: #999;
    margin: 0 0 16px;
}

/* ============ ПОЛЯ ============ */
.ad-form-field {
    margin-bottom: 20px;
}

.ad-form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.ad-form-required {
    color: #FF4053;
    margin-left: 2px;
}

.ad-form-hint {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

.ad-form-input,
.ad-form-select,
.ad-form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    font-size: 15px;
    color: #1a1a1a;
    background: #fff;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
}

.ad-form-input:focus,
.ad-form-select:focus,
.ad-form-textarea:focus {
    border-color: #00AAFF;
    box-shadow: 0 0 0 3px rgba(0, 170, 255, 0.12);
}

.ad-form-input.error,
.ad-form-select.error,
.ad-form-textarea.error {
    border-color: #FF4053;
}

.ad-form-textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.5;
}

.ad-form-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.ad-form-input-suffix {
    position: absolute;
    right: 16px;
    color: #999;
    font-size: 15px;
    pointer-events: none;
}

.ad-form-counter {
    display: block;
    text-align: right;
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

.ad-form-counter.warning {
    color: #FFB800;
}

.ad-form-counter.danger {
    color: #FF4053;
}

/* ============ SELECT ============ */
.ad-form-select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23999' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    padding-right: 44px;
    cursor: pointer;
}

/* ============ СОСТОЯНИЕ (radio) ============ */
.ad-form-radio-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.ad-form-radio {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s;
    background: #fff;
    user-select: none;
}

.ad-form-radio:hover {
    border-color: #d0d0d0;
}

.ad-form-radio input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #00AAFF;
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
}

.ad-form-radio-text {
    font-size: 14px;
    color: #1a1a1a;
    font-weight: 500;
}

.ad-form-radio input[type="radio"]:checked ~ .ad-form-radio-text {
    color: #00AAFF;
    font-weight: 600;
}

.ad-form-radio:has(input[type="radio"]:checked) {
    border-color: #00AAFF;
    background: #f0f8ff;
}

/* ============ ФОТО ============ */
.ad-form-photo-upload {
    position: relative;
    aspect-ratio: 1;
    border: 2px dashed #d0d0d0;
    border-radius: 12px;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.15s;
    color: #999;
    font-size: 12px;
    font-weight: 500;
}

.ad-form-photo-upload:hover {
    border-color: #00AAFF;
    background: #f0f8ff;
    color: #00AAFF;
}

.ad-form-photo-upload i {
    font-size: 24px;
}

.ad-form-photo-upload input {
    display: none;
}

.ad-form-photo-hint {
    font-size: 12px;
    color: #999;
    margin-top: 8px;
}

/* ============ КАРТА ============ */
.ad-form-map {
    height: 300px;
    border-radius: 12px;
    border: 2px solid #e8e8e8;
    overflow: hidden;
    margin-bottom: 12px;
}

/* ============ КНОПКИ ============ */
.ad-form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 32px;
    flex-wrap: wrap;
}

.ad-form-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
    text-decoration: none;
    font-family: inherit;
    white-space: nowrap;
}

.ad-form-btn-primary {
    background: #00AAFF;
    color: #fff;
    min-width: 200px;
}

.ad-form-btn-primary:hover {
    background: #0088cc;
    color: #fff;
}

.ad-form-btn-primary:disabled {
    background: #c0c0c0;
    cursor: not-allowed;
}

.ad-form-btn-secondary {
    background: #f5f5f5;
    color: #1a1a1a;
}

.ad-form-btn-secondary:hover {
    background: #e8e8e8;
    color: #1a1a1a;
}

.ad-form-btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: adFormSpin 0.8s linear infinite;
}

@keyframes adFormSpin {
    to { transform: rotate(360deg); }
}

/* ============ АЛЕРТЫ ============ */
.ad-form-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.ad-form-alert i {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.ad-form-alert-danger {
    background: #fff0f0;
    color: #cc3344;
    border-left: 4px solid #FF4053;
}

.ad-form-alert-info {
    background: #e8f4ff;
    color: #0088cc;
    border-left: 4px solid #00AAFF;
}

/* ============ АДАПТИВНОСТЬ ============ */
@media (max-width: 768px) {
    .ad-form-page {
        padding: 20px 12px 60px;
    }

    .ad-form-card {
        padding: 20px 16px;
        border-radius: 12px;
    }

    .ad-form-title {
        font-size: 24px;
    }

    .ad-form-section-title {
        font-size: 16px;
    }

    .ad-form-steps {
        gap: 6px;
    }

    .ad-form-step {
        padding: 6px 12px;
        font-size: 12px;
    }

    .ad-form-step-number {
        width: 18px;
        height: 18px;
        font-size: 10px;
    }

    .ad-form-radio-group {
        grid-template-columns: 1fr;
    }

    .ad-form-photos {
        grid-template-columns: repeat(auto-fill, 100px);
        gap: 8px;
    }

    .ad-form-actions {
        flex-direction: column-reverse;
    }

    .ad-form-btn {
        width: 100%;
        justify-content: center;
    }

    .ad-form-btn-primary {
        min-width: unset;
    }

    .ad-form-map {
        height: 220px;
    }
}
/* ============================================================
   ПОИСК АДРЕСА + КАРТА
   ============================================================ */

/* ============ ПОИСК АДРЕСА ============ */
.ad-form-address-search {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.ad-form-address-search-input {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.ad-form-address-search-input i {
    position: absolute;
    left: 16px;
    color: #999;
    font-size: 16px;
    pointer-events: none;
}

.ad-form-address-search-input input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    font-size: 15px;
    color: #1a1a1a;
    background: #fff;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
}

.ad-form-address-search-input input:focus {
    border-color: #00AAFF;
    box-shadow: 0 0 0 3px rgba(0, 170, 255, 0.12);
}

.ad-form-address-search-btn {
    padding: 12px 24px;
    background: #00AAFF;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s;
    white-space: nowrap;
    font-family: inherit;
}

.ad-form-address-search-btn:hover {
    background: #0088cc;
}

.ad-form-address-search-btn:disabled {
    background: #c0c0c0;
    cursor: not-allowed;
}

/* ============ РЕЗУЛЬТАТ АДРЕСА ============ */
.ad-form-address-result {
    margin-top: 12px;
    padding: 16px;
    background: #f0f8ff;
    border: 2px solid #d0e8ff;
    border-radius: 12px;
    animation: adFormFadeIn 0.3s ease-out;
}

.ad-form-address-result-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #d0e8ff;
}

.ad-form-address-result-header i {
    color: #00AAFF;
    font-size: 18px;
    flex-shrink: 0;
}

.ad-form-address-result-header span {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.4;
    word-break: break-word;
}

.ad-form-address-result-clear {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: #fff;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.15s;
    flex-shrink: 0;
}

.ad-form-address-result-clear:hover {
    background: #FF4053;
    color: #fff;
}

.ad-form-address-result-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ad-form-address-result-row {
    display: flex;
    gap: 8px;
    font-size: 13px;
    line-height: 1.4;
}

.ad-form-address-result-label {
    color: #666;
    min-width: 70px;
    flex-shrink: 0;
}

.ad-form-address-result-value {
    color: #1a1a1a;
    font-weight: 500;
    word-break: break-word;
}

/* ============ ПОДСКАЗКА ============ */
.ad-form-address-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: #fafafa;
    border: 2px dashed #e0e0e0;
    border-radius: 12px;
    margin-top: 12px;
    font-size: 13px;
    color: #999;
    text-align: center;
}

.ad-form-address-hint i {
    font-size: 16px;
    flex-shrink: 0;
}

/* ============ КАРТА ============ */
.ad-form-map {
    cursor: crosshair;
}

@keyframes adFormFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============ АДАПТИВНОСТЬ ============ */
@media (max-width: 768px) {
    .ad-form-address-search {
        flex-direction: column;
    }

    .ad-form-address-search-btn {
        width: 100%;
        justify-content: center;
    }

    .ad-form-address-result {
        padding: 12px;
    }

    .ad-form-address-result-row {
        flex-direction: column;
        gap: 2px;
    }

    .ad-form-address-result-label {
        min-width: auto;
        font-size: 12px;
    }
}

/* ============================================================
   ДЕТАЛЬНАЯ СТРАНИЦА ОБЪЯВЛЕНИЯ
   ============================================================ */

.ad-detail-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px 80px;
}

/* ============ ХЛЕБНЫЕ КРОШКИ ============ */
.ad-detail-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    font-size: 13px;
    color: #999;
}

.ad-detail-breadcrumb a {
    color: #666;
    text-decoration: none;
    transition: color 0.15s;
}

.ad-detail-breadcrumb a:hover {
    color: #00AAFF;
}

.ad-detail-breadcrumb i {
    font-size: 10px;
    opacity: 0.6;
}

.ad-detail-breadcrumb span {
    color: #1a1a1a;
    font-weight: 500;
}

/* ============ ОСНОВНОЙ БЛОК ============ */
.ad-detail-main {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 32px;
    margin-bottom: 40px;
}

/* ============ ГАЛЕРЕЯ ============ */
.ad-detail-gallery {
    min-width: 0;
}

.ad-detail-gallery-main {
    position: relative;
    background: #f5f5f5;
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
}

.ad-detail-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.ad-detail-gallery-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: #FFD700;
    color: #1a1a1a;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.ad-detail-gallery-sold {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(220, 53, 69, 0.95);
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    padding: 12px 32px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ad-detail-gallery-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
}

.ad-detail-gallery-thumbs::-webkit-scrollbar {
    height: 4px;
}

.ad-detail-gallery-thumbs::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

.ad-detail-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s;
    flex-shrink: 0;
    border: 2px solid transparent;
}

.ad-detail-thumb:hover {
    opacity: 0.9;
}

.ad-detail-thumb.active {
    opacity: 1;
    border-color: #00AAFF;
    box-shadow: 0 0 0 2px rgba(0, 170, 255, 0.2);
}

/* ============ ИНФО ============ */
.ad-detail-info {
    min-width: 0;
    align-self: stretch;
}

.ad-detail-title {
    font-size: 26px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
    margin: 0 0 16px;
}

.ad-detail-price {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 20px;
}

/* Мета-инфо */
.ad-detail-meta {
    padding: 16px 0;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 20px;
}

.ad-detail-meta-item {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 14px;
    color: #666;
}

.ad-detail-meta-item i {
    color: #00AAFF;
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 2px;
}

.ad-detail-meta-city {
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 2px;
}

.ad-detail-meta-address {
    font-size: 13px;
    color: #999;
}

.ad-detail-meta-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #999;
}

.ad-detail-meta-stats i {
    margin-right: 4px;
}

/* Статус */
.ad-detail-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
}

.ad-detail-status-moderation {
    background: #fff8e6;
    color: #cc8800;
}

.ad-detail-status-sold {
    background: #e8f9ed;
    color: #00A046;
}

.ad-detail-status-rejected {
    background: #fff0f0;
    color: #cc3344;
}

.ad-detail-status-archived {
    background: #f5f5f5;
    color: #666;
}

/* ============ КНОПКИ ДЕЙСТВИЙ ============ */
.ad-detail-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}

.ad-detail-actions-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.ad-detail-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.15s;
    font-family: inherit;
    white-space: nowrap;
}

.ad-detail-btn-primary {
    background: #00AAFF;
    color: #fff;
    border-color: #00AAFF;
}

.ad-detail-btn-primary:hover {
    background: #0088cc;
    border-color: #0088cc;
    color: #fff;
}

.ad-detail-btn-outline {
    background: #fff;
    color: #00AAFF;
    border-color: #00AAFF;
}

.ad-detail-btn-outline:hover {
    background: #f0f8ff;
    color: #0088cc;
}

.ad-detail-btn-warning {
    background: #FFD700;
    color: #1a1a1a;
    border-color: #FFD700;
}

.ad-detail-btn-warning:hover {
    background: #e6c200;
    color: #1a1a1a;
}

.ad-detail-btn-danger {
    background: #fff;
    color: #FF4053;
    border-color: #FF4053;
}

.ad-detail-btn-danger:hover {
    background: #FF4053;
    color: #fff;
}

.ad-detail-btn-icon {
    background: #f5f5f5;
    color: #1a1a1a;
    border-color: #f5f5f5;
}

.ad-detail-btn-icon:hover {
    background: #e8e8e8;
    color: #1a1a1a;
}

.ad-detail-btn-icon.in-cart {
    background: #e8f9ed;
    color: #00A046;
    cursor: not-allowed;
}

/* ============ ПРОДАВЕЦ ============ */
.ad-detail-seller {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #fafafa;
    border-radius: 12px;
    border: 1px solid #f0f0f0;
}

.ad-detail-seller-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #FFC107;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}

.ad-detail-seller-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ad-detail-seller-info {
    flex: 1;
    min-width: 0;
}

.ad-detail-seller-name {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.ad-detail-seller-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    margin-bottom: 4px;
}

.ad-detail-stars {
    color: #FFC107;
    font-size: 14px;
    letter-spacing: 1px;
}

.ad-detail-seller-reviews {
    color: #999;
}

.ad-detail-seller-since {
    font-size: 12px;
    color: #999;
}

/* ============ СЕКЦИИ ============ */
.ad-detail-section {
    margin-bottom: 40px;
}

.ad-detail-section-title {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
}

.ad-detail-description {
    font-size: 15px;
    color: #2c3e50;
    line-height: 1.7;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Характеристики */
.ad-detail-specs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.ad-detail-spec {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: #fafafa;
    border-radius: 10px;
    font-size: 14px;
}

.ad-detail-spec-label {
    color: #999;
}

.ad-detail-spec-value {
    color: #1a1a1a;
    font-weight: 600;
    text-align: right;
}

/* Карта */
.ad-detail-map {
    width: 100%;
    height: 350px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e8e8e8;
    background: #f5f5f5;
}

/* Похожие */
.ad-detail-similar {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.ad-detail-similar-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #f0f0f0;
    transition: all 0.2s;
}

.ad-detail-similar-card:hover {
    border-color: #00AAFF;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    text-decoration: none;
    color: inherit;
}

.ad-detail-similar-image {
    aspect-ratio: 4 / 3;
    background: #f5f5f5;
    overflow: hidden;
}

.ad-detail-similar-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.ad-detail-similar-card:hover .ad-detail-similar-image img {
    transform: scale(1.05);
}

.ad-detail-similar-body {
    padding: 12px;
}

.ad-detail-similar-price {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.ad-detail-similar-title {
    font-size: 13px;
    color: #2c3e50;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.ad-detail-similar-location {
    font-size: 12px;
    color: #999;
}

/* ============ АДАПТИВНОСТЬ ============ */
@media (max-width: 992px) {
    .ad-detail-main {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .ad-detail-title {
        font-size: 22px;
    }

    .ad-detail-price {
        font-size: 26px;
    }

    .ad-detail-gallery-main {
        aspect-ratio: 4 / 3;
        max-height: 400px;
    }
}

@media (max-width: 576px) {
    .ad-detail-page {
        padding: 16px 12px 60px;
    }

    .ad-detail-title {
        font-size: 20px;
    }

    .ad-detail-price {
        font-size: 24px;
    }

    .ad-detail-section-title {
        font-size: 18px;
    }

    .ad-detail-gallery-main {
        aspect-ratio: 1 / 1;
        max-height: 350px;
    }

    .ad-detail-thumb {
        width: 64px;
        height: 64px;
    }

    .ad-detail-map {
        height: 220px;
    }

    .ad-detail-similar {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .ad-detail-similar-body {
        padding: 10px;
    }

    .ad-detail-similar-price {
        font-size: 14px;
    }

    .ad-detail-similar-title {
        font-size: 12px;
    }

    .ad-detail-btn {
        padding: 12px 16px;
        font-size: 14px;
    }
}

/* ============================================================
   МОИ ОБЪЯВЛЕНИЯ
   ============================================================ */

.my-ads-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 16px 80px;
}

/* ============ ХЕДЕР ============ */
.my-ads-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.my-ads-title {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 6px;
}

.my-ads-subtitle {
    font-size: 14px;
    color: #999;
    margin: 0;
    max-width: 500px;
}

.my-ads-create-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    background: #00AAFF;
    color: #fff;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s, transform 0.1s;
    white-space: nowrap;
    flex-shrink: 0;
}

.my-ads-create-btn:hover {
    background: #0088cc;
    color: #fff;
    transform: translateY(-1px);
}

/* ============ СТАТИСТИКА ============ */
.my-ads-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.my-ads-stat {
    padding: 16px;
    background: #fff;
    border: 2px solid #f0f0f0;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.15s;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.my-ads-stat:hover {
    border-color: #00AAFF;
    text-decoration: none;
    color: inherit;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.my-ads-stat.active {
    border-color: #00AAFF;
    background: #f0f8ff;
}

.my-ads-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1;
    margin-bottom: 6px;
}

.my-ads-stat-label {
    font-size: 12px;
    color: #999;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.my-ads-stat-success .my-ads-stat-value { color: #00A046; }
.my-ads-stat-warning .my-ads-stat-value { color: #cc8800; }
.my-ads-stat-info .my-ads-stat-value { color: #0088cc; }

/* ============ ФИЛЬТРЫ ============ */
.my-ads-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.my-ads-filter {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    text-decoration: none;
    transition: all 0.15s;
    background: #f5f5f5;
    white-space: nowrap;
}

.my-ads-filter:hover {
    background: #e8e8e8;
    color: #1a1a1a;
    text-decoration: none;
}

.my-ads-filter.active {
    background: #1a1a1a;
    color: #fff;
}

.my-ads-filter-danger.active {
    background: #FF4053;
    color: #fff;
}

/* ============ СПИСОК ============ */
.my-ads-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.my-ads-item {
    display: grid;
    grid-template-columns: 140px 1fr auto;
    gap: 20px;
    padding: 16px;
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 16px;
    transition: all 0.15s;
    align-items: center;
}

.my-ads-item:hover {
    border-color: #e0e0e0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

/* Фото */
.my-ads-item-image {
    position: relative;
    width: 140px;
    height: 140px;
    border-radius: 12px;
    overflow: hidden;
    background: #f5f5f5;
    display: block;
    flex-shrink: 0;
}

.my-ads-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.my-ads-item:hover .my-ads-item-image img {
    transform: scale(1.05);
}

.my-ads-item-premium {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #FFD700;
    color: #1a1a1a;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    z-index: 1;
}

/* Инфо */
.my-ads-item-info {
    min-width: 0;
}

.my-ads-item-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.my-ads-item-title {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a1a;
    text-decoration: none;
    flex: 1;
    min-width: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.my-ads-item-title:hover {
    color: #00AAFF;
    text-decoration: none;
}

.my-ads-item-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.my-ads-status-active {
    background: #e8f9ed;
    color: #00A046;
}

.my-ads-status-moderation {
    background: #fff8e6;
    color: #cc8800;
}

.my-ads-status-sold {
    background: #e8f4ff;
    color: #0088cc;
}

.my-ads-status-rejected {
    background: #fff0f0;
    color: #cc3344;
}

.my-ads-status-archived {
    background: #f5f5f5;
    color: #666;
}

.my-ads-item-price {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.my-ads-item-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #999;
}

.my-ads-item-meta i {
    margin-right: 3px;
}

/* Заметка */
.my-ads-item-note {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
}

.my-ads-item-note-warning {
    background: #fff8e6;
    color: #cc8800;
}

.my-ads-item-note-danger {
    background: #fff0f0;
    color: #cc3344;
}

/* Действия */
.my-ads-item-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.my-ads-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
    white-space: nowrap;
    font-family: inherit;
    background: #f5f5f5;
    color: #1a1a1a;
}

.my-ads-action-btn:hover {
    background: #e8e8e8;
    color: #1a1a1a;
    text-decoration: none;
}

.my-ads-action-primary {
    background: #00AAFF;
    color: #fff;
}

.my-ads-action-primary:hover {
    background: #0088cc;
    color: #fff;
}

.my-ads-action-warning {
    background: #FFD700;
    color: #1a1a1a;
}

.my-ads-action-warning:hover {
    background: #e6c200;
    color: #1a1a1a;
}

.my-ads-action-more {
    width: 42px;
    height: 42px;
    padding: 0;
}

/* ============ ПАГИНАЦИЯ ============ */
.my-ads-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 32px;
    flex-wrap: wrap;
}

.my-ads-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 10px;
    background: #f5f5f5;
    color: #1a1a1a;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s;
}

.my-ads-page-link:hover {
    background: #e8e8e8;
    color: #1a1a1a;
    text-decoration: none;
}

.my-ads-page-link.active {
    background: #00AAFF;
    color: #fff;
}

/* ============ ПУСТО ============ */
.my-ads-empty {
    text-align: center;
    padding: 80px 20px;
}

.my-ads-empty-icon {
    font-size: 80px;
    color: #e0e0e0;
    margin-bottom: 16px;
}

.my-ads-empty-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px;
}

.my-ads-empty-text {
    font-size: 15px;
    color: #999;
    margin: 0 0 24px;
}

/* ============ АДАПТИВНОСТЬ ============ */
@media (max-width: 992px) {
    .my-ads-item {
        grid-template-columns: 120px 1fr;
        gap: 16px;
    }

    .my-ads-item-image {
        width: 120px;
        height: 120px;
    }

    .my-ads-item-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
        padding-top: 12px;
        border-top: 1px solid #f0f0f0;
    }
}

@media (max-width: 768px) {
    .my-ads-page {
        padding: 20px 12px 60px;
    }

    .my-ads-header {
        flex-direction: column;
        align-items: stretch;
    }

    .my-ads-title {
        font-size: 24px;
    }

    .my-ads-create-btn {
        width: 100%;
        justify-content: center;
    }

    .my-ads-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .my-ads-stat {
        padding: 12px;
    }

    .my-ads-stat-value {
        font-size: 22px;
    }

    .my-ads-stat-label {
        font-size: 10px;
    }

    .my-ads-item {
        grid-template-columns: 100px 1fr;
        gap: 12px;
        padding: 12px;
    }

    .my-ads-item-image {
        width: 100px;
        height: 100px;
    }

    .my-ads-item-title {
        font-size: 15px;
    }

    .my-ads-item-price {
        font-size: 18px;
        margin-bottom: 6px;
    }

    .my-ads-item-meta {
        gap: 10px;
        font-size: 12px;
    }

    .my-ads-item-status {
        font-size: 11px;
        padding: 3px 8px;
    }

    .my-ads-action-btn {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .my-ads-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .my-ads-stat:first-child {
        grid-column: 1 / -1;
    }

    .my-ads-item {
        grid-template-columns: 1fr;
    }

    .my-ads-item-image {
        width: 100%;
        height: 200px;
    }

    .my-ads-item-meta {
        flex-wrap: wrap;
    }
}

/* ============ TOOLBAR ============ */
.my-ads-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.my-ads-sort {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #666;
}

.my-ads-sort select {
    padding: 8px 32px 8px 12px;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    background: #fff;
    cursor: pointer;
    outline: none;
}

.my-ads-sort select:focus {
    border-color: #00AAFF;
}

/* ============ ЧЕКБОКС ============ */
.my-ads-item-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    cursor: pointer;
    flex-shrink: 0;
}

.my-ads-item-checkbox input {
    display: none;
}

.my-ads-item-checkbox span {
    width: 20px;
    height: 20px;
    border: 2px solid #d0d0d0;
    border-radius: 6px;
    position: relative;
    transition: all 0.15s;
}

.my-ads-item-checkbox input:checked + span {
    background: #00AAFF;
    border-color: #00AAFF;
}

.my-ads-item-checkbox input:checked + span::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Grid теперь: checkbox + image + info + actions */
.my-ads-item {
    grid-template-columns: 24px 140px 1fr auto;
}

/* ============ BULK ACTIONS ============ */
.my-ads-bulk {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f0f8ff;
    border: 2px solid #d0e8ff;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 14px;
}

.my-ads-bulk-btn {
    padding: 8px 14px;
    border-radius: 8px;
    border: none;
    background: #fff;
    color: #1a1a1a;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.my-ads-bulk-btn:hover {
    background: #00AAFF;
    color: #fff;
}

.my-ads-bulk-btn-danger:hover {
    background: #FF4053;
    color: #fff;
}

/* Успех для кнопки продажи */
.my-ads-action-success {
    background: #e8f9ed;
    color: #00A046;
}

.my-ads-action-success:hover {
    background: #00A046;
    color: #fff;
}

/* Адаптив */
@media (max-width: 992px) {
    .my-ads-item {
        grid-template-columns: 24px 120px 1fr;
    }
}

@media (max-width: 576px) {
    .my-ads-item {
        grid-template-columns: 24px 1fr;
    }
    .my-ads-item-image {
        grid-column: 2;
    }
    .my-ads-item-info {
        grid-column: 2;
    }
    .my-ads-item-actions {
        grid-column: 1 / -1;
    }
    .my-ads-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ============ SEARCH SUGGESTIONS ============ */
.header-search {
    position: relative;
    z-index: 10001;
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 999999 !important;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    margin-top: 4px;
}
.search-suggestion-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: #1a1a1a;
    text-decoration: none;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
}
.search-suggestion-item:last-child {
    border-bottom: none;
}
.search-suggestion-item:hover {
    background: #f8f8f8;
    color: #00AAFF;
    text-decoration: none;
}
.search-suggestion-item i {
    color: #999;
    font-size: 14px;
}
.search-suggestion-item:hover i {
    color: #00AAFF;
}

/* ============ SEARCH SUGGESTION (исправление) ============ */
.search-suggestion {
    padding: 14px 18px;
    background: #fff8e6;
    border-radius: 12px;
    font-size: 14px;
    color: #666;
    margin-bottom: 16px;
}
.search-suggestion a {
    color: #00AAFF;
    font-weight: 600;
    text-decoration: none;
}
.search-suggestion a:hover {
    text-decoration: underline;
}

/* ============ ПОИСК КАТЕГОРИЙ ============ */
.ad-cat-search {
    position: relative;
    margin-top: 8px;
}

.ad-cat-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.ad-cat-search-input-wrapper > i.bi-search {
    position: absolute;
    left: 16px;
    color: #999;
    font-size: 16px;
    pointer-events: none;
}

.ad-cat-search-input {
    width: 100%;
    padding: 14px 48px 14px 44px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 15px;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.ad-cat-search-input:focus {
    outline: none;
    border-color: #00AAFF;
    background: #fff;
}

.ad-cat-search-input::placeholder {
    color: #aaa;
}

.ad-cat-search-clear {
    position: absolute;
    right: 12px;
    background: #f0f0f0;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #666;
    font-size: 12px;
}

.ad-cat-search-clear:hover {
    background: #e0e0e0;
    color: #1a1a1a;
}

/* Результаты */
.ad-cat-search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-height: 340px;
    overflow-y: auto;
    z-index: 100;
}

.ad-cat-search-result {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.1s;
}

.ad-cat-search-result:last-child {
    border-bottom: none;
}

.ad-cat-search-result:hover,
.ad-cat-search-result.active {
    background: #f0f8ff;
}

.ad-cat-search-result-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #f0f8ff;
    color: #00AAFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.ad-cat-search-result-info {
    flex: 1;
    min-width: 0;
}

.ad-cat-search-result-name {
    font-weight: 600;
    font-size: 14px;
    color: #1a1a1a;
    margin-bottom: 2px;
}

.ad-cat-search-result-path {
    font-size: 12px;
    color: #999;
}

.ad-cat-search-result-name mark {
    background: #fff3a0;
    color: #1a1a1a;
    padding: 0 2px;
    border-radius: 3px;
}

.ad-cat-search-empty {
    padding: 24px 16px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* Выбранная категория */
.ad-cat-selected {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: #e8f9ed;
    border: 1px solid #00A046;
    border-radius: 12px;
    margin-top: 8px;
}

.ad-cat-selected > i {
    color: #00A046;
    font-size: 20px;
    flex-shrink: 0;
}

.ad-cat-selected > span {
    flex: 1;
    font-weight: 600;
    color: #1a1a1a;
    font-size: 14px;
}

.ad-cat-selected-change {
    background: none;
    border: 1px solid #00A046;
    color: #00A046;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.ad-cat-selected-change:hover {
    background: #00A046;
    color: #fff;
}

/* Популярные */
.ad-cat-popular {
    margin-top: 16px;
}

.ad-cat-popular-title {
    font-size: 13px;
    color: #999;
    margin-bottom: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ad-cat-popular-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.ad-cat-popular-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 8px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 12px;
    color: #1a1a1a;
    text-align: center;
}

.ad-cat-popular-item:hover {
    border-color: #00AAFF;
    background: #f0f8ff;
    transform: translateY(-2px);
}

.ad-cat-popular-item i {
    font-size: 22px;
    color: #00AAFF;
}

.ad-cat-popular-item span {
    font-weight: 600;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

@media (max-width: 576px) {
    .ad-cat-popular-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============ Прогресс-бар формы ============ */
.ad-form-progress {
    position: sticky;
    top: 12px;
    z-index: 50;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px 16px;
    margin: 0 0 16px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
    transition: box-shadow .2s ease;
}

.ad-form-progress.is-stuck {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.ad-form-progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.ad-form-progress-label {
    font-size: 14px;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ad-form-progress-label i {
    color: #6366f1;
}

.ad-form-progress-label strong {
    color: #111827;
    font-variant-numeric: tabular-nums;
}

.ad-form-progress-toggle {
    background: none;
    border: none;
    color: #6366f1;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    border-radius: 6px;
}

.ad-form-progress-toggle:hover {
    background: #eef2ff;
}

.ad-form-progress-toggle i {
    transition: transform .2s ease;
}

.ad-form-progress.is-open .ad-form-progress-toggle i {
    transform: rotate(180deg);
}

.ad-form-progress-bar {
    height: 8px;
    background: #f3f4f6;
    border-radius: 999px;
    overflow: hidden;
}

.ad-form-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 999px;
    transition: width .35s ease, background .2s ease;
}

.ad-form-progress.is-complete .ad-form-progress-fill {
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
}

.ad-form-progress-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease, margin-top .3s ease;
}

.ad-form-progress.is-open .ad-form-progress-list {
    max-height: 300px;
    margin-top: 12px;
}

.ad-form-progress-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #6b7280;
    padding: 5px 0;
}

.ad-form-progress-list li i {
    color: #d1d5db;
    font-size: 14px;
}

.ad-form-progress-list li.done {
    color: #10b981;
}

.ad-form-progress-list li.done i {
    color: #10b981;
}

@media (max-width: 640px) {
    .ad-form-progress {
        top: 8px;
        padding: 12px;
    }
    .ad-form-progress-label {
        font-size: 13px;
    }
}

/* ============ БАННЕР ЧЕРНОВИКА ============ */
.ad-form-draft {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 12px;
    padding: 14px 16px;
    margin: 0 0 20px;
}

.ad-form-draft-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #00AAFF;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.ad-form-draft-text {
    flex: 1;
    min-width: 0;
}

.ad-form-draft-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 2px;
}

.ad-form-draft-meta {
    font-size: 12px;
    color: #666;
}

.ad-form-draft-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.ad-form-draft-btn {
    font-size: 13px;
    padding: 7px 14px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: background .15s, color .15s;
}

.ad-form-draft-btn-restore {
    background: #00AAFF;
    color: #fff;
}

.ad-form-draft-btn-restore:hover {
    background: #008fdd;
}

.ad-form-draft-btn-delete {
    background: #fff;
    color: #666;
    border: 1px solid #e5e5e5;
}

.ad-form-draft-btn-delete:hover {
    background: #f5f5f5;
    color: #1a1a1a;
}

@media (max-width: 640px) {
    .ad-form-draft {
        flex-wrap: wrap;
        gap: 10px;
    }
    .ad-form-draft-actions {
        width: 100%;
    }
    .ad-form-draft-btn {
        flex: 1;
    }
}

/* ============ AI-ПОДСКАЗКА КАТЕГОРИИ ============ */
.ad-form-suggest {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 10px 14px;
    margin: 10px 0 4px;
    animation: adSuggestFadeIn .25s ease;
}

@keyframes adSuggestFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ad-form-suggest-icon {
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
}

.ad-form-suggest-text {
    flex: 1;
    font-size: 13px;
    color: #78350f;
    min-width: 0;
}

.ad-form-suggest-text strong {
    color: #1a1a1a;
    font-weight: 600;
}

.ad-form-suggest-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.ad-form-suggest-btn {
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 6px;
    border: none;
    background: #00AAFF;
    color: #fff;
    cursor: pointer;
    font-weight: 500;
    transition: background .15s;
}

.ad-form-suggest-btn:hover {
    background: #008fdd;
}

.ad-form-suggest-btn-close {
    background: transparent;
    color: #78350f;
    padding: 5px 8px;
}

.ad-form-suggest-btn-close:hover {
    background: rgba(120, 53, 15, 0.1);
}

@media (max-width: 640px) {
    .ad-form-suggest {
        flex-wrap: wrap;
    }
    .ad-form-suggest-text {
        flex-basis: 100%;
        order: 2;
    }
    .ad-form-suggest-actions {
        order: 3;
        margin-left: auto;
    }
    .ad-form-suggest-icon {
        order: 1;
    }
}

/* ============ LAYOUT С ПРЕДПРОСМОТРОМ ============ */
.ad-form-page {
    max-width: 1200px;   /* было 800px — переопределяем */
}

.ad-form-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 32px;
    align-items: start;
}

.ad-form-main {
    min-width: 0;
}

/* ============ ПРЕДПРОСМОТР ============ */
.ad-preview {
    position: sticky;
    top: 24px;
    align-self: start;
}

.ad-preview-label {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ad-preview-label i {
    color: #00AAFF;
    font-size: 15px;
}

.ad-preview .ad-card {
    width: 100%;
    max-width: 100%;
    height: auto;
    box-sizing: border-box;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: none;
}

.ad-preview .ad-card:hover {
    transform: none;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.ad-preview .ad-card .card-img-top {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
    background: #f5f5f5;
}

.ad-preview .ad-card .title {
    min-height: 40px;
}

.ad-preview .ad-card .price:empty::before,
.ad-preview .ad-card .title:empty::before {
    content: attr(data-placeholder);
    color: #ccc;
}

.ad-preview-hint {
    font-size: 12px;
    color: #999;
    margin-top: 12px;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    line-height: 1.4;
}

.ad-preview-hint i {
    color: #00AAFF;
    margin-top: 1px;
    flex-shrink: 0;
}

/* На планшете и мобилке — предпросмотр под формой */
@media (max-width: 1024px) {
    .ad-form-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .ad-preview {
        position: static;
        top: auto;
        max-width: 100%;
        margin-top: 8px;
        padding-top: 24px;
        border-top: 1px solid #f0f0f0;
    }

    /* Ограничим ширину карточки, чтобы на планшете не растянулась */
    .ad-preview .ad-card {
        max-width: 400px;
        margin: 0 auto;
    }

    .ad-form-page {
        max-width: 800px;
    }
}

@media (max-width: 640px) {
    .ad-preview .ad-card {
        max-width: 100%;
    }
}

/* ============ ПОДСКАЗКА СРЕДНЕЙ ЦЕНЫ ============ */
.ad-form-price-hint {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 10px;
    padding: 10px 14px;
    margin-top: 10px;
    animation: adPriceHintFadeIn .25s ease;
}

@keyframes adPriceHintFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ad-form-price-hint-icon {
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
}

.ad-form-price-hint-text {
    flex: 1;
    font-size: 13px;
    color: #065f46;
    min-width: 0;
}

.ad-form-price-hint-text strong {
    color: #1a1a1a;
    font-weight: 600;
}

.ad-form-price-hint-count {
    color: #6b7280;
    font-size: 12px;
    margin-left: 4px;
}

.ad-form-price-hint-btn {
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 6px;
    border: none;
    background: #10b981;
    color: #fff;
    cursor: pointer;
    font-weight: 500;
    transition: background .15s;
    flex-shrink: 0;
}

.ad-form-price-hint-btn:hover {
    background: #059669;
}

@media (max-width: 640px) {
    .ad-form-price-hint {
        flex-wrap: wrap;
    }
    .ad-form-price-hint-text {
        flex-basis: 100%;
        order: 2;
    }
    .ad-form-price-hint-btn {
        order: 3;
        margin-left: auto;
    }
}

/* ============ CROPPER МОДАЛКА ============ */
.ad-cropper-modal .modal-header {
    border-bottom: 1px solid #f0f0f0;
    padding: 16px 20px;
}

.ad-cropper-modal .modal-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ad-cropper-modal .modal-title i {
    color: #00AAFF;
}

.ad-cropper-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
    flex-wrap: wrap;
}

.ad-cropper-toolbar-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.ad-cropper-tool {
    width: 36px;
    height: 36px;
    border: 1px solid #e5e5e5;
    background: #fff;
    border-radius: 8px;
    color: #666;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: all .15s;
}

.ad-cropper-tool:hover {
    background: #f0f9ff;
    border-color: #00AAFF;
    color: #00AAFF;
}

.ad-cropper-tool:active {
    transform: scale(0.95);
}

.ad-cropper-ratio {
    padding: 6px 12px;
    border: 1px solid #e5e5e5;
    background: #fff;
    border-radius: 8px;
    color: #666;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all .15s;
}

.ad-cropper-ratio:hover {
    border-color: #00AAFF;
    color: #00AAFF;
}

.ad-cropper-ratio.active {
    background: #00AAFF;
    border-color: #00AAFF;
    color: #fff;
}

.ad-cropper-body {
    padding: 20px;
    background: #f5f5f5;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-cropper-body img {
    max-width: 100%;
    max-height: 60vh;
    display: block;
}

.ad-cropper-save {
    background: #00AAFF !important;
    border-color: #00AAFF !important;
    font-weight: 500;
}

.ad-cropper-save:hover {
    background: #008fdd !important;
    border-color: #008fdd !important;
}

/* ============ КАРТОЧКИ ФОТО В СЕТКЕ ============ */
.ad-form-photo {
    position: relative;
    width: 140px;
    height: 140px;
    aspect-ratio: unset;
    border-radius: 10px;
    overflow: hidden;
    background: #f5f5f5;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    transition: transform .15s, box-shadow .15s;
}

.ad-form-photo:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.ad-form-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ad-form-photo-actions {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, 0.65) 100%);
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 6px;
    gap: 4px;
    opacity: 0;
    transition: opacity .2s;
}

.ad-form-photo:hover .ad-form-photo-actions,
.ad-form-photo:focus-within .ad-form-photo-actions {
    opacity: 1;
}

.ad-form-photo-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.95);
    color: #666;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: background .15s, color .15s;
}

.ad-form-photo-btn:hover {
    background: #fff;
    color: #00AAFF;
}

.ad-form-photo-btn.remove-new:hover,
.ad-form-photo-btn.remove-existing:hover {
    background: #fff;
    color: #ef4444;
}

.ad-form-photo-btn.is-main {
    background: #00AAFF;
    color: #fff;
}

.ad-form-photo-btn.is-main:hover {
    background: #008fdd;
    color: #fff;
}

/* Плашка "Главное" */
.ad-form-photo-main-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: #00AAFF;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 7px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    z-index: 1;
}

/* На мобилке — всегда показываем кнопки */
@media (max-width: 640px) {
    .ad-form-photo {
        width: 100px;
        height: 100px;
    }
    .ad-form-photo-actions {
        opacity: 1;
    }
}


/* ============ ФИКС РАЗМЕРА КНОПКИ ЗАГРУЗКИ ============ */
.ad-form-photo-upload {
    width: 140px;
    height: 140px;
    aspect-ratio: unset;
}

@media (max-width: 640px) {
    .ad-form-photo-upload {
        width: 100px;
        height: 100px;
    }
}

/* ============ СЕТКА ФОТО (основное правило) ============ */
.ad-form-photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, 140px);
    gap: 12px;
    margin-bottom: 12px;
}

/* ============ РАСШИРЕННАЯ ГАЛЕРЕЯ ============ */
.ad-detail-gallery-main {
    cursor: zoom-in;
    position: relative;
}

/* Счётчик фото */
.ad-detail-gallery-counter {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(8px);
    z-index: 2;
    pointer-events: none;
}

.ad-detail-gallery-counter i {
    font-size: 14px;
}

/* Кнопка "Развернуть" */
.ad-detail-gallery-expand {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.95);
    color: #1a1a1a;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 14px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: all .15s;
    z-index: 2;
}

.ad-detail-gallery-expand:hover {
    background: #00AAFF;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 170, 255, 0.35);
}

.ad-detail-gallery-expand i {
    font-size: 14px;
}

/* Hover-эффект на главное фото */
.ad-detail-gallery-main:hover img {
    transform: scale(1.01);
    transition: transform .3s ease;
}

/* PhotoSwipe-кастомизация */
.pswp {
    --pswp-bg: rgba(15, 23, 42, 0.96);
}

.pswp__counter {
    font-size: 14px;
    font-weight: 500;
}

.pswp__button {
    opacity: 0.9;
}

/* Скрываем счётчик и "Развернуть" на мобилке (там работает тап) */
@media (max-width: 768px) {
    .ad-detail-gallery-expand span {
        display: none;
    }
    .ad-detail-gallery-expand {
        padding: 8px 10px;
    }
    .ad-detail-gallery-counter {
        font-size: 12px;
        padding: 5px 10px;
    }
}

/* ============ КНОПКИ ВЛАДЕЛЬЦА (выравнивание) ============ */
.ad-detail-actions form {
    display: block;
    width: 100%;
    margin: 0;
}

.ad-detail-actions form .ad-detail-btn {
    width: 100%;
    justify-content: center;
}

.ad-detail-actions > .ad-detail-btn {
    width: 100%;
    justify-content: center;
}

/* Если кнопки не должны быть на всю ширину — ограничим */
@media (min-width: 768px) {
    .ad-detail-actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
}

/* ============ STICKY ЦЕНА НА ДЕСКТОПЕ ============ */
@media (min-width: 993px) {
    .ad-detail-main { align-items: start; }
    .ad-detail-info-sticky {
        position: sticky;
        top: 20px;
        align-self: start;
    }
}

/* Улучшаем кнопки действий на десктопе */
@media (min-width: 769px) {
    .ad-detail-actions .ad-detail-btn {
        padding: 16px 24px;
        font-size: 16px;
    }

    .ad-detail-btn-primary {
        /* Кнопка "Написать" — акцентнее */
        box-shadow: 0 4px 14px rgba(0, 170, 255, 0.25);
    }

    .ad-detail-btn-primary:hover {
        box-shadow: 0 6px 20px rgba(0, 170, 255, 0.4);
        transform: translateY(-1px);
    }
}

/* Цена + тег */
.ad-detail-price-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.ad-detail-price-wrap .ad-detail-price {
    margin-bottom: 0;
}

.ad-detail-price-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: #e8f9ed;
    color: #00A046;
    font-size: 13px;
    font-weight: 600;
    border-radius: 20px;
    white-space: nowrap;
}

.ad-detail-price-tag i {
    font-size: 14px;
}

.ad-detail-price-tag-sold {
    background: #f5f5f5;
    color: #666;
}

.ad-detail-left {
    min-width: 0;
}

.ad-detail-left .ad-detail-section {
    margin-bottom: 40px;
}

.ad-detail-left .ad-detail-section:last-child {
    margin-bottom: 0;
}

/* ============ МОБИЛЬНАЯ ПАНЕЛЬ НА СТРАНИЦЕ ОБЪЯВЛЕНИЯ ============ */
.ad-mobile-bar {
    display: none;   /* показываем только на мобилке */
}

@media (max-width: 768px) {
    /* Скрываем нижнюю навигацию, когда открыто объявление */
    body.on-ad-detail .mobile-bottom-nav {
        display: none;
    }

    /* Показываем панель цены */
    .ad-mobile-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1500;
        background: #fff;
        border-top: 1px solid #e8e8e8;
        padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0));
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
    }

    /* Цена */
    .ad-mobile-bar-price {
        display: flex;
        flex-direction: column;
        gap: 2px;
        min-width: 0;
        flex: 1;
    }

    .ad-mobile-bar-price-value {
        font-size: 18px;
        font-weight: 700;
        color: #1a1a1a;
        line-height: 1.1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .ad-mobile-bar-price-status {
        font-size: 11px;
        color: #00A046;
        font-weight: 500;
    }

    .ad-mobile-bar-price-status-sold {
        color: #666;
    }

    /* Кнопки */
    .ad-mobile-bar-actions {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
    }

    .ad-mobile-bar-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 10px 14px;
        border-radius: 12px;
        font-size: 14px;
        font-weight: 600;
        text-decoration: none;
        border: none;
        cursor: pointer;
        font-family: inherit;
        transition: background 0.15s, transform 0.1s;
        white-space: nowrap;
    }

    .ad-mobile-bar-btn:active {
        transform: scale(0.97);
    }

    .ad-mobile-bar-btn-icon {
        width: 42px;
        height: 42px;
        padding: 0;
        background: #f5f5f5;
        color: #1a1a1a;
        font-size: 18px;
    }

    .ad-mobile-bar-btn-icon:hover {
        background: #e8e8e8;
    }

    .ad-mobile-bar-btn-icon .bi-heart-fill {
        color: #FF4053;
    }

    .ad-mobile-bar-btn-primary {
        background: #00AAFF;
        color: #fff;
        padding: 10px 16px;
    }

    .ad-mobile-bar-btn-primary:hover {
        background: #0088dd;
        color: #fff;
    }

    /* Добавляем отступ снизу страницы, чтобы контент не прятался за панелью */
    body.on-ad-detail .ad-detail-page {
        padding-bottom: 90px;
    }
}

/* Если пользователь не залогинен - одна кнопка "Войти" */
@media (max-width: 768px) {
    .ad-mobile-bar .ad-mobile-bar-btn-primary:only-child {
        flex: 1;
        max-width: 200px;
    }
}

/* ============ ДРУГИЕ ОБЪЯВЛЕНИЯ ПРОДАВЦА ============ */
.ad-detail-seller-ads {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.ad-detail-seller-ads-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #00AAFF;
    text-decoration: none;
    transition: gap .2s;
}

.ad-detail-seller-ads-all:hover {
    gap: 10px;
    color: #0088cc;
    text-decoration: none;
}

@media (max-width: 768px) {
    .ad-detail-seller-ads {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

/* ============ КНОПКА "ПОДЕЛИТЬСЯ" НА ОБЪЯВЛЕНИИ ============ */
.ad-detail-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    margin-top: 12px;
    background: #f0f8ff;
    color: #00AAFF;
    border: 1px solid #cce5ff;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.ad-detail-share-btn:hover {
    background: #00AAFF;
    color: #fff;
    border-color: #00AAFF;
}

.ad-detail-share-btn i {
    font-size: 16px;
}

@media (max-width: 576px) {
    .ad-detail-share-btn span {
        display: inline;
    }
}