/* =========================================================
   CAMU SERVICES — DÉTAIL ANNONCE
========================================================= */

.explorer-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 30px 20px 60px;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
}

.back-button:hover {
    color: var(--primary);
}


/* ==============================
   CHARGEMENT
================================ */

.detail-loading,
.detail-error {
    background: var(--card);
    border-radius: 16px;
    padding: 50px 20px;
    text-align: center;
    box-shadow: var(--shadow);
}

.detail-loading i,
.detail-error > i {
    font-size: 40px;
    margin-bottom: 15px;
}

.detail-error h2 {
    margin-bottom: 10px;
}


/* ==============================
   DÉTAIL
================================ */

.ad-detail {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
    gap: 25px;
}


/* ==============================
   GALERIE
================================ */

.ad-gallery {
    background: var(--card);
    border-radius: 18px;
    padding: 15px;
    box-shadow: var(--shadow);
}

.main-photo-wrapper {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
    border-radius: 14px;
    background: #f2f2f2;
}

.main-photo-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, .6);
    color: white;
    cursor: pointer;
}

.gallery-arrow:hover {
    background: rgba(0, 0, 0, .8);
}

.gallery-prev {
    left: 15px;
}

.gallery-next {
    right: 15px;
}


.photo-thumbnails {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin-top: 12px;
    padding-bottom: 3px;
}

.photo-thumbnail {
    width: 75px;
    height: 65px;
    flex: 0 0 75px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
}

.photo-thumbnail.active {
    border-color: var(--primary);
}

.photo-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* ==============================
   INFORMATIONS
================================ */

.ad-information {
    background: var(--card);
    border-radius: 18px;
    padding: 25px;
    box-shadow: var(--shadow);
    height: fit-content;
}

.ad-category {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 12px;
}

.ad-information h1 {
    font-size: 30px;
    line-height: 1.2;
    margin-bottom: 18px;
}

.ad-price {
    font-size: 28px;
    font-weight: 900;
    margin-bottom: 18px;
}

.ad-location,
.ad-date {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    margin-bottom: 10px;
}

.ad-location i {
    color: var(--primary);
}


/* ==============================
   ACTIONS
================================ */

.ad-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 25px;
}

.whatsapp-button,
.favorite-button {
    width: 100%;
    border: none;
    border-radius: 10px;
    padding: 14px 18px;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
}

.whatsapp-button {
    background: #25D366;
    color: white;
}

.whatsapp-button:hover {
    background: #1ebe5d;
}

.favorite-button {
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--border);
}

.favorite-button.active {
    color: var(--primary);
    background: var(--primary-light);
}


/* ==============================
   CARDS
================================ */

.detail-card {
    grid-column: 1 / -1;
    background: var(--card);
    border-radius: 18px;
    padding: 25px;
    box-shadow: var(--shadow);
}

.detail-card h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 20px;
}

.detail-card h2 i {
    color: var(--primary);
}

#adDescription {
    white-space: pre-line;
    line-height: 1.7;
    color: var(--text);
}


/* ==============================
   VENDEUR
================================ */

.seller-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.seller-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 25px;
}

.seller-info h3 {
    margin-bottom: 4px;
}

.seller-info p {
    color: var(--muted);
    font-size: 13px;
}

.profile-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    border-radius: 9px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    font-weight: 700;
}


/* ==============================
   SIGNALER
================================ */

.report-section {
    grid-column: 1 / -1;
    text-align: center;
    padding: 10px;
}

.report-button {
    border: none;
    background: transparent;
    color: #888;
    cursor: pointer;
    font-size: 13px;
}

.report-button:hover {
    color: #d32f2f;
}


/* ==============================
   UTILITAIRE
================================ */

.hidden {
    display: none !important;
}


/* ==============================
   MOBILE
================================ */

@media (max-width: 800px) {

    .explorer-container {
        padding: 20px 15px 40px;
    }

    .ad-detail {
        grid-template-columns: 1fr;
    }

    .main-photo-wrapper {
        height: 350px;
    }

    .ad-information h1 {
        font-size: 24px;
    }

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

    .detail-card {
        grid-column: auto;
    }

    .report-section {
        grid-column: auto;
    }
}


@media (max-width: 480px) {

    .main-photo-wrapper {
        height: 280px;
    }

    .ad-gallery {
        padding: 8px;
    }

    .ad-information,
    .detail-card {
        padding: 18px;
    }

    .gallery-arrow {
        width: 38px;
        height: 38px;
    }

    .photo-thumbnail {
        width: 65px;
        height: 55px;
        flex-basis: 65px;
    }
}
