/* ===== Общие стили для view.php ===== */

.post {
    background-color: #fff;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: 'Inter', Arial, sans-serif;
}

/* ===== Хлебные крошки ===== */

.ad-breadcrumbs {
    font-size: 14px;
    color: #555;
    margin-bottom: 10px;
}

.ad-breadcrumbs a {
    text-decoration: none;
    color: #2a9d8f;
}

.ad-breadcrumbs a:hover {
    text-decoration: underline;
}

/* ===== Заголовок и цена ===== */

.post h1 {
    font-size: 24px;
    margin-bottom: 10px;
}

.ad-price {
    font-size: 22px;
    font-weight: 600;
    color: #2a9d8f;
    margin-bottom: 15px;
}

/* ===== Галерея ===== */

.ad-gallery {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

/* Основное фото */
.ad-gallery-main {
    flex: 1;
}

.ad-gallery-main-image {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
}

/* Миниатюры */
.ad-gallery-thumbs {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 100px;
}

.ad-gallery-thumb {
    width: 100px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color .2s ease, transform .2s ease;
    flex-shrink: 0;
}

.ad-gallery-thumb:hover {
    border-color: #2a9d8f;
    transform: scale(1.02);
}

/* ===== Текст объявления ===== */

.ad-content {
    font-size: 16px;
    line-height: 1.6;
    margin-top: 10px;
}

/* ===== Кнопка звонка ===== */

.call-button {
    display: inline-block;
    padding: 12px 18px;
    background: #2a9d8f;
    color: #fff;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    margin: 15px 0;
    transition: background .2s ease;
}

.call-button:hover {
    background: #238576;
}

/* ===== Автор ===== */

.ad-author {
    margin-top: 10px;
    font-size: 14px;
}

.ad-author a {
    color: #2a9d8f;
    text-decoration: none;
}

.ad-author a:hover {
    text-decoration: underline;
}

/* ===== Теги ===== */

.post-tags {
    margin-top: 10px;
}

.post-tags .tag-item {
    display: inline-block;
    background: #f1f1f1;
    color: #333;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 13px;
    margin-right: 5px;
    text-decoration: none;
}

.post-tags .tag-item:hover {
    background: #e6e6e6;
}

/* ===== Дата ===== */

.post-date {
    font-size: 13px;
    color: #777;
    text-align: right;
    margin-top: 20px;
}

/* =====================================================
   LIGHTBOX (просмотр фото)
===================================================== */

.image-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.image-lightbox.active {
    display: flex;
}

.lightbox-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 36px;
    color: #fff;
    cursor: pointer;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 50px;
    color: #fff;
    cursor: pointer;
    padding: 10px;
    user-select: none;
}

.lightbox-nav.prev {
    left: 20px;
}

.lightbox-nav.next {
    right: 20px;
}

/* ===== Специфический стиль для страницы объявления ===== */

.post-view {
    background-color: #fff;
    /* по необходимости можно убрать, если уже в .post */
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    font-family: 'Inter', Arial, sans-serif;
}

.post-view .ad-breadcrumbs {
    font-size: 14px;
    color: #555;
    margin-bottom: 10px;
}

.post-view .post-tags {
    margin-top: 10px;
    padding: 0;
    font-size: 13px;
}

.post-view .ad-content {
    font-size: 16px;
    line-height: 1.6;
    margin-top: 10px;
}

.post-view .ad-price {
    font-size: 22px;
    font-weight: 600;
    color: #2a9d8f;
    margin-bottom: 15px;
}

.post-view .ad-author {
    margin-top: 10px;
    font-size: 14px;
}

.post-view .ad-author a {
    color: #2a9d8f;
    text-decoration: none;
}

.post-view .ad-author a:hover {
    text-decoration: underline;
}

/* ===== Форма обратного звонка ===== */

.callback-form-container {
    margin-top: 10px;
    max-width: 300px;
}

.callback-form {
    display: flex;
    gap: 5px;
}

.callback-form input {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.callback-form button {
    padding: 6px 12px;
    background-color: #df0b00;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.callback-form button:hover {
    background-color: #bc0900;
}

/* Сообщение */



.callback-message {
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
    opacity: 1;
    transition: opacity 2s ease;
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}


/* Анимация появления и исчезновения */
@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(-10px); }
    10% { opacity: 1; transform: translateY(0); }
    90% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-10px); }
}

