/* =========================================================
   ICI DAR BOUAZZA — DÉTAIL D'UNE ANNONCE
   Design premium rouge / noir, entièrement responsive
========================================================= */

.annonce-page {
    --ad-primary: #f3073e;
    --ad-primary-dark: #d90435;
    --ad-primary-soft: rgba(243, 7, 62, 0.09);
    --ad-dark: #161616;
    --ad-text: #363636;
    --ad-muted: #737373;
    --ad-border: #e9e9ec;
    --ad-surface: #ffffff;
    --ad-background: #f6f7f9;
    --ad-whatsapp: #20bd5a;
    --ad-radius: 22px;
    --ad-shadow: 0 14px 45px rgba(20, 20, 30, 0.08);
    --ad-shadow-hover: 0 20px 55px rgba(20, 20, 30, 0.13);

    position: relative;
    padding: 38px 0 78px;
    color: var(--ad-text);
    background:
        radial-gradient(circle at 100% 0%, rgba(243, 7, 62, 0.075), transparent 27%),
        radial-gradient(circle at 0% 45%, rgba(20, 20, 30, 0.035), transparent 25%),
        var(--ad-background);
}

.annonce-page *,
.annonce-page *::before,
.annonce-page *::after {
    box-sizing: border-box;
}

/* Fil d'Ariane */
.annonce-breadcrumb {
    display: flex;
    align-items: center;
    min-height: 46px;
    margin: 0 0 24px;
    padding: 11px 17px;
    overflow: hidden;
    color: var(--ad-muted);
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(233, 233, 236, 0.95);
    border-radius: 14px;
    box-shadow: 0 7px 24px rgba(20, 20, 30, 0.04);
    font-size: 13px;
    white-space: nowrap;
    backdrop-filter: blur(10px);
}

.annonce-breadcrumb a {
    color: #5f5f64;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s ease;
}

.annonce-breadcrumb a:hover {
    color: var(--ad-primary);
}

.annonce-breadcrumb span:last-child {
    overflow: hidden;
    color: #929297;
    text-overflow: ellipsis;
}

/* Cartes principales */
.annonce-main-card,
.annonce-info-card,
.annonce-contact-card,
.annonce-sidebar {
    background: var(--ad-surface);
    border: 1px solid var(--ad-border);
    border-radius: var(--ad-radius);
    box-shadow: var(--ad-shadow);
}

.annonce-main-card {
    overflow: hidden;
}

/* Galerie */
.annonce-gallery {
    position: relative;
    min-height: 300px;
    overflow: hidden;
    background: linear-gradient(135deg, #e9e9eb, #f4f4f5);
}

.annonce-gallery::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 32%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.30), transparent);
    pointer-events: none;
}

.annonce-main-image {
    display: block;
    width: 100%;
    height: 540px;
    object-fit: cover;
    object-position: center;
    transition: opacity 0.22s ease, transform 0.6s ease;
}

.annonce-main-card:hover .annonce-main-image {
    transform: scale(1.012);
}

.annonce-price {
    position: absolute;
    right: 22px;
    bottom: 22px;
    z-index: 2;
    padding: 11px 19px;
    color: #fff;
    background: linear-gradient(135deg, #ff174f, var(--ad-primary-dark));
    border: 1px solid rgba(255, 255, 255, 0.30);
    border-radius: 50px;
    box-shadow: 0 10px 27px rgba(243, 7, 62, 0.34);
    font-size: 20px;
    font-weight: 850;
    letter-spacing: -0.2px;
    backdrop-filter: blur(8px);
}

/* Miniatures */
.annonce-thumbnails {
    display: flex;
    gap: 11px;
    padding: 16px 18px;
    overflow-x: auto;
    background: #fff;
    border-bottom: 1px solid var(--ad-border);
    scrollbar-color: #c8c8cc transparent;
    scrollbar-width: thin;
}

.annonce-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.annonce-thumbnails::-webkit-scrollbar-thumb {
    background: #c8c8cc;
    border-radius: 10px;
}

.annonce-thumbnail {
    position: relative;
    flex: 0 0 96px;
    width: 96px;
    height: 73px;
    padding: 0;
    overflow: hidden;
    background: #efeff1;
    border: 3px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    opacity: 0.72;
    transition: border-color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.annonce-thumbnail:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.annonce-thumbnail.active {
    border-color: var(--ad-primary);
    box-shadow: 0 5px 15px rgba(243, 7, 62, 0.20);
    opacity: 1;
}

.annonce-thumbnail img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.annonce-thumbnail:focus-visible,
.btn-annonce-whatsapp:focus-visible,
.btn-annonce-phone:focus-visible,
.recente-annonce:focus-visible {
    outline: 3px solid rgba(243, 7, 62, 0.28);
    outline-offset: 3px;
}

/* Contenu de l'annonce */
.annonce-content {
    padding: 34px 36px 40px;
}

.annonce-title {
    max-width: 900px;
    margin: 0 0 11px;
    color: var(--ad-dark);
    font-size: clamp(29px, 3.7vw, 44px);
    font-weight: 850;
    line-height: 1.16;
    letter-spacing: -0.8px;
}

.annonce-date {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #818187;
    font-size: 13.5px;
    font-weight: 600;
}

.annonce-date::before {
   content: "";
    width: 8px;
    height: 8px;
    background: #397304;
    border-radius: 50%;
    box-shadow: 0 0 0 4px #19875421;
}

.annonce-content hr {
    margin: 25px 0 !important;
    border: 0;
    border-top: 1px solid var(--ad-border);
    opacity: 1;
}

.annonce-content h2 {
    position: relative;
    margin-bottom: 20px !important;
    padding-left: 15px;
    color: var(--ad-dark);
    font-size: 22px;
    font-weight: 850 !important;
}

.annonce-content h2::before {
    content: "";
    position: absolute;
    top: 2px;
    bottom: 2px;
    left: 0;
    width: 4px;
    background: var(--ad-primary);
    border-radius: 10px;
}

/* Caractéristiques */
.annonce-features {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.annonce-feature {
    position: relative;
    min-height: 94px;
    padding: 19px 18px;
    overflow: hidden;
    background: linear-gradient(145deg, #fafafa, #f5f5f6);
    border: 1px solid #e9e9eb;
    border-radius: 16px;
    transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.annonce-feature::after {
    content: "";
    position: absolute;
    top: -25px;
    right: -25px;
    width: 65px;
    height: 65px;
    background: var(--ad-primary-soft);
    border-radius: 50%;
}

.annonce-feature:hover {
    transform: translateY(-3px);
    border-color: rgba(243, 7, 62, 0.22);
    box-shadow: 0 10px 25px rgba(20, 20, 30, 0.07);
}

.annonce-feature small {
    display: block;
    margin-bottom: 6px;
    color: #85858a;
    font-size: 12px;
    font-weight: 750;
    letter-spacing: 0.45px;
    text-transform: uppercase;
}

.annonce-feature strong {
    position: relative;
    z-index: 1;
    color: var(--ad-dark);
    font-size: 18px;
    font-weight: 850;
}

.annonce-description {
    color: #46464b;
    font-size: 16.5px;
    line-height: 1.9;
    overflow-wrap: anywhere;
}

/* Colonne latérale */
.sticky-sidebar {
    position: sticky;
    top: 98px;
}

.annonce-contact-card,
.annonce-sidebar {
    padding: 26px;
}

.annonce-sidebar-title {
    position: relative;
    margin: 0 0 22px;
    padding: 0 0 14px;
    color: var(--ad-dark);
    font-size: 21px;
    font-weight: 850;
    line-height: 1.25;
}

.annonce-sidebar-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 4px;
    background: linear-gradient(90deg, var(--ad-primary), #ff668a);
    border-radius: 10px;
}

.annonce-contact-card p {
    color: #5f5f64;
    line-height: 1.6;
}

.annonce-contact-card p strong {
    color: var(--ad-dark);
}

/* Boutons de contact */
.btn-annonce-whatsapp,
.btn-annonce-phone {
    display: flex;
    width: 100%;
    min-height: 52px;
    align-items: center;
    justify-content: center;
    padding: 13px 17px;
    border-radius: 13px;
    font-size: 14.5px;
    font-weight: 800;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    transition: transform 0.23s ease, box-shadow 0.23s ease, background 0.23s ease;
}

.btn-annonce-whatsapp {
    color: #fff;
    background: linear-gradient(135deg, #25d366, #16ae4e);
    border: 1px solid #20ba58;
    box-shadow: 0 9px 24px rgba(32, 189, 90, 0.23);
}

.btn-annonce-whatsapp:hover {
    color: #fff;
    background: linear-gradient(135deg, #20c65e, #119b43);
    box-shadow: 0 13px 29px rgba(32, 189, 90, 0.31);
    transform: translateY(-2px);
}

.btn-annonce-phone {
    margin-top: 11px;
    color: var(--ad-dark);
    background: #fff;
    border: 1px solid #dcdce0;
    box-shadow: 0 5px 16px rgba(20, 20, 30, 0.04);
}

.btn-annonce-phone:hover {
    color: var(--ad-primary);
    background: #fffafb;
    border-color: rgba(243, 7, 62, 0.42);
    box-shadow: 0 9px 22px rgba(243, 7, 62, 0.10);
    transform: translateY(-2px);
}

/* Dernières annonces */
.recente-annonce {
    display: flex;
    gap: 13px;
    align-items: center;
    margin: 0 -9px;
    padding: 12px 9px;
    color: inherit;
    border-bottom: 1px solid #eeeeef;
    border-radius: 12px;
    text-decoration: none;
    transition: background 0.22s ease, transform 0.22s ease;
}

.recente-annonce:last-child {
    border-bottom-color: transparent;
}

.recente-annonce:hover {
    background: #faf7f8;
    transform: translateX(3px);
}

.recente-annonce-image {
    flex: 0 0 92px;
    width: 92px;
    height: 76px;
    object-fit: cover;
    background: #ededee;
    border: 1px solid #e4e4e6;
    border-radius: 11px;
}

.recente-annonce > div {
    min-width: 0;
}

.recente-annonce-title {
    display: -webkit-box;
    margin-bottom: 6px;
    overflow: hidden;
    color: #28282c;
    font-size: 14.5px;
    font-weight: 780;
    line-height: 1.4;
    transition: color 0.2s ease;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.recente-annonce:hover .recente-annonce-title {
    color: var(--ad-primary);
}

.recente-annonce-price {
    color: var(--ad-primary);
    font-size: 14px;
    font-weight: 850;
}

.annonce-sidebar .text-muted {
    font-size: 13px;
}

/* Alertes */
.annonce-page .alert {
    border: 0;
    border-radius: 13px;
    font-size: 14px;
}

/* Tablette */
@media (max-width: 1199.98px) {
    .annonce-main-image {
        height: 470px;
    }

    .annonce-contact-card,
    .annonce-sidebar {
        padding: 22px;
    }

    .recente-annonce-image {
        flex-basis: 82px;
        width: 82px;
        height: 70px;
    }
}

@media (max-width: 991.98px) {
    .annonce-page {
        padding-top: 28px;
    }

    .sticky-sidebar {
        position: static;
    }

    .annonce-main-image {
        height: 430px;
    }

    .annonce-contact-card {
        margin-top: 5px;
    }
}

/* Mobile */
@media (max-width: 767.98px) {
    .annonce-page {
        padding: 20px 0 52px;
    }

    .annonce-breadcrumb {
        margin-bottom: 17px;
        padding: 10px 13px;
        border-radius: 11px;
        font-size: 12px;
    }

    .annonce-main-card,
    .annonce-info-card,
    .annonce-contact-card,
    .annonce-sidebar {
        border-radius: 17px;
    }

    .annonce-main-image {
        height: 330px;
    }

    .annonce-price {
        right: 14px;
        bottom: 14px;
        padding: 9px 14px;
        font-size: 17px;
    }

    .annonce-thumbnails {
        gap: 8px;
        padding: 12px;
    }

    .annonce-thumbnail {
        flex-basis: 80px;
        width: 80px;
        height: 62px;
        border-radius: 9px;
    }

    .annonce-content {
        padding: 23px 20px 28px;
    }

    .annonce-title {
        font-size: 29px;
        letter-spacing: -0.45px;
    }

    .annonce-features {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .annonce-feature {
        min-height: 80px;
        padding: 15px 16px;
    }

    .annonce-description {
        font-size: 15.5px;
        line-height: 1.82;
    }

    .annonce-contact-card,
    .annonce-sidebar {
        padding: 21px;
    }
}

@media (max-width: 479.98px) {
    .annonce-main-image {
        height: 270px;
    }

    .annonce-title {
        font-size: 26px;
    }

    .annonce-breadcrumb .mx-2 {
        margin-right: 0.35rem !important;
        margin-left: 0.35rem !important;
    }

    .recente-annonce-image {
        flex-basis: 78px;
        width: 78px;
        height: 66px;
    }
}

/* Réduction des animations si demandée par l'utilisateur */
@media (prefers-reduced-motion: reduce) {
    .annonce-page *,
    .annonce-page *::before,
    .annonce-page *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

.annonce-views {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
    padding: 7px 12px;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    font-size: 0.875rem;
    line-height: 1;
}

.annonce-views i {
    color: #078a3c;
    font-size: 1rem;
}

.annonce-views strong {
    color: #0f172a;
    font-weight: 700;
}

@media (max-width: 575.98px) {
    .annonce-views {
        padding: 6px 10px;
        font-size: 0.8125rem;
    }
}

.annonce-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 16px;
}

.annonce-meta-row .annonce-date {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #818187;
    font-size: 13.5px;
    font-weight: 600;
}

.annonce-views {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    gap: 8px;
    margin: 0;
    padding: 7px 12px;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    font-size: 0.875rem;
    line-height: 1;
}

.annonce-views i {
    color: #078a3c;
    font-size: 1rem;
}

.annonce-views strong {
    color: #0f172a;
    font-weight: 700;
}

@media (max-width: 575.98px) {
    .annonce-meta-row {
        gap: 10px;
    }

    .annonce-meta-row .annonce-date {
        font-size: 12.5px;
    }

    .annonce-views {
        padding: 6px 10px;
        font-size: 0.8125rem;
    }
}
