/* ============================================================
   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-photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.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 {
    position: relative;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    background: #f0f0f0;
}

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

.ad-form-photo-actions {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s;
}

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

.ad-form-photo-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s;
    padding: 0;
}

.ad-form-photo-btn:hover {
    background: #FF4053;
}

.ad-form-photo-main {
    position: absolute;
    bottom: 6px;
    left: 6px;
    background: #00AAFF;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
}

.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, minmax(90px, 1fr));
        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;
    }
}

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

/* ============================================================
   ПОИСК АДРЕСА + КАРТА
   ============================================================ */

/* ============ ПОИСК АДРЕСА ============ */
.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;
}

.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;
}