/* ==========================================================================
   Fiche annonce — refonte 2026
   Prefixe : ld-   |   Depend des variables de app.css
   ========================================================================== */

.ld {
    padding-top: 22px;
    padding-bottom: 70px;
}

.ld [hidden],
.ld-lightbox[hidden],
.ld-share-menu[hidden] {
    display: none !important;
}

/* ---------- Fil d'Ariane ---------- */
.ld-crumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 18px;
    font-size: 13px;
    color: var(--text-muted);
}

.ld-crumbs a {
    color: var(--text-secondary);
    font-weight: 600;
}

.ld-crumbs a:hover {
    color: var(--primary);
}

.ld-crumbs svg {
    flex-shrink: 0;
}

.ld-crumbs span[aria-current] {
    max-width: 38ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--secondary);
    font-weight: 600;
}

/* ---------- Bandeau de moderation ---------- */
.ld-banner {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 18px;
    padding: 14px 18px;
    font-size: 14px;
    line-height: 1.5;
    color: #9a3412;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 14px;
}

.ld-banner svg {
    flex-shrink: 0;
    margin-top: 2px;
}

/* ---------- Grille ---------- */
.ld-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 32px;
    align-items: start;
}

.ld-main {
    min-width: 0;
}

/* ---------- Galerie ---------- */
.ld-gallery {
    position: relative;
    height: 480px;
    overflow: hidden;
    border-radius: 22px;
    background: var(--secondary);
    box-shadow: var(--shadow-md);
}

.ld-gallery-bg {
    position: absolute;
    inset: -30px;
    background-size: cover;
    background-position: center;
    filter: blur(28px) brightness(0.75);
    transform: scale(1.1);
    transition: background-image 0.3s;
}

.ld-gallery-img {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: zoom-in;
    transition: opacity 0.2s;
}

.ld-gallery-empty {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
}

.ld-nav {
    position: absolute;
    top: 50%;
    z-index: 3;
    width: 44px;
    height: 44px;
    margin-top: -22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: var(--secondary);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.15s, background 0.15s;
}

.ld-nav:hover {
    background: #fff;
    transform: scale(1.06);
}

.ld-nav-prev { left: 16px; }
.ld-nav-next { right: 16px; }

.ld-counter {
    position: absolute;
    right: 16px;
    bottom: 16px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 12.5px;
    font-weight: 700;
    color: #fff;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    border-radius: var(--radius-full);
}

.ld-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    overflow-x: auto;
    padding: 4px 2px 8px;
    scrollbar-width: thin;
}

.ld-thumb {
    flex: 0 0 auto;
    width: 92px;
    height: 68px;
    padding: 0;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: 12px;
    background: var(--bg-app);
    opacity: 0.7;
    cursor: pointer;
    transition: all 0.15s;
}

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

.ld-thumb:hover {
    opacity: 1;
}

.ld-thumb.is-active {
    opacity: 1;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(254, 120, 85, 0.2);
}

/* ---------- Cartes de contenu ---------- */
.ld-card {
    margin-top: 24px;
    padding: 28px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.ld-card-title {
    margin-bottom: 16px;
    font-size: 18px;
    font-weight: 800;
    color: var(--secondary);
}

/* ---------- En-tete de l'annonce ---------- */
.ld-head {
    margin-top: 24px;
}

.ld-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.ld-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 700;
    border-radius: var(--radius-full);
    background: var(--secondary-light);
    color: var(--secondary);
}

.ld-tag-primary {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.ld-tag-ok {
    background: #ecfdf5;
    color: #047857;
}

.ld-tag-warn {
    background: #fff7ed;
    color: #c2410c;
}

.ld-tag-off {
    background: #fef2f2;
    color: #b91c1c;
}

.ld-title {
    font-size: 30px;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--secondary);
}

.ld-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-top: 12px;
    font-size: 14px;
    color: var(--text-secondary);
}

.ld-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ld-meta svg {
    color: var(--text-muted);
}

.ld-price-inline {
    display: none;
    margin-top: 14px;
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
}

/* ---------- Chiffres cles ---------- */
.ld-facts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 24px;
}

.ld-fact {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 16px;
}

.ld-fact-ico {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    background: var(--primary-light);
    border-radius: 12px;
}

.ld-fact small {
    display: block;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-muted);
}

.ld-fact strong {
    display: block;
    font-size: 14.5px;
    color: var(--secondary);
}

/* ---------- Description ---------- */
.ld-desc {
    white-space: pre-line;
    font-size: 15.5px;
    line-height: 1.75;
    color: var(--text-secondary);
}

/* ---------- Colonne laterale ---------- */
.ld-side {
    position: sticky;
    top: 92px;
    display: grid;
    gap: 16px;
}

.ld-panel {
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    box-shadow: var(--shadow-md);
}

.ld-price-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.ld-price {
    margin: 4px 0 20px;
    font-family: var(--font-heading);
    font-size: 34px;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--primary);
}

.ld-price small {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0;
}

/* Vendeur */
.ld-seller {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    margin-bottom: 18px;
    background: var(--bg-app);
    border-radius: 16px;
}

.ld-seller-avatar {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    background: var(--secondary);
    border-radius: 50%;
    overflow: hidden;
}

.ld-seller-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
}

.ld-seller strong {
    display: block;
    font-size: 15px;
    color: var(--secondary);
}

.ld-seller small {
    display: block;
    margin-top: 2px;
    font-size: 12.5px;
    color: var(--text-muted);
}

.ld-pro {
    display: block;
    margin-bottom: 18px;
    padding: 16px;
    color: #fff;
    background: var(--secondary);
    border-radius: 16px;
    transition: transform 0.18s;
}

.ld-pro:hover {
    color: #fff;
    transform: translateY(-2px);
}

.ld-pro-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ld-pro .ld-seller-avatar {
    background: var(--primary);
}

.ld-pro strong {
    color: #fff;
}

.ld-pro small {
    color: rgba(255, 255, 255, 0.7);
}

.ld-pro-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 6px;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #3a2a00;
    background: var(--gold, #e6a417);
    border-radius: var(--radius-full);
    vertical-align: middle;
}

.ld-pro-link {
    display: block;
    margin-top: 12px;
    padding-top: 12px;
    font-size: 12.5px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

/* Boutons de contact */
.ld-cta {
    display: grid;
    gap: 10px;
}

.ld-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    height: 52px;
    padding: 0 20px;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 700;
    border: 1.5px solid var(--border);
    border-radius: 16px;
    background: #fff;
    color: var(--secondary);
    cursor: pointer;
    transition: all 0.18s;
}

.ld-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.ld-btn-wa {
    color: #fff !important;
    background: var(--whatsapp);
    border-color: var(--whatsapp);
    box-shadow: 0 8px 20px rgba(37, 211, 102, 0.3);
}

.ld-btn-wa:hover {
    background: var(--whatsapp-dark);
    border-color: var(--whatsapp-dark);
    transform: translateY(-1px);
}

.ld-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.ld-chip-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 62px;
    padding: 8px 4px;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    background: #fff;
    border: 1.5px solid var(--border-light);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.15s;
}

.ld-chip-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.ld-chip-btn.is-active {
    color: #ef4444;
    background: #fef2f2;
    border-color: #fca5a5;
}

.ld-chip-btn.active {
    color: #fff;
    border-color: var(--primary);
}

/* Partage */
.ld-share {
    position: relative;
    display: flex;
}

.ld-share .ld-chip-btn {
    width: 100%;
}

.ld-share-menu {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    z-index: 20;
    width: 210px;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
}

.ld-share-menu a,
.ld-share-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    color: var(--text-main);
    background: none;
    border: none;
    border-radius: 10px;
    cursor: pointer;
}

.ld-share-menu a:hover,
.ld-share-menu button:hover {
    background: var(--bg-app);
    color: var(--primary-dark);
}

/* Conseils */
.ld-safe {
    padding: 18px 20px;
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--secondary-light);
    border-radius: 18px;
}

.ld-safe strong {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--secondary);
}

.ld-safe ul {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 4px;
}

.ld-report {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
}

.ld-report:hover {
    color: #dc2626;
}

/* ---------- Autres annonces ---------- */
.ld-related {
    margin-top: 56px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
}

.ld-related h2 {
    margin-bottom: 22px;
    font-size: 22px;
    color: var(--secondary);
}

.ld-related-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
}

/* ---------- Visionneuse plein ecran ---------- */
.ld-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(8, 15, 30, 0.94);
}

.ld-lightbox img {
    max-width: 94vw;
    max-height: 88vh;
    object-fit: contain;
    border-radius: 8px;
}

.ld-lightbox .ld-nav-prev { left: 24px; }
.ld-lightbox .ld-nav-next { right: 24px; }

.ld-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.ld-lightbox-count {
    position: absolute;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-full);
}

/* ---------- Toast ---------- */
.ld-toast {
    position: fixed;
    left: 50%;
    bottom: 96px;
    z-index: 10001;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: var(--secondary);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg);
    transform: translate(-50%, 20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s;
}

.ld-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ---------- Barre d'action mobile ---------- */
.ld-sticky {
    display: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
    .ld-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .ld-side {
        position: static;
        margin-top: 24px;
    }

    .ld-gallery {
        height: 380px;
    }

    .ld-related-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .ld {
        padding-top: 12px;
        padding-bottom: 110px;
    }

    .ld-title {
        font-size: 24px;
    }

    .ld-price-inline {
        display: block;
    }

    /* le prix est repris dans la barre fixe : on masque le gros prix du panneau */
    .ld-panel .ld-price-label,
    .ld-panel .ld-price {
        display: none;
    }

    .ld-gallery {
        height: 300px;
        margin-left: -20px;
        margin-right: -20px;
        border-radius: 0;
    }

    .ld-nav {
        width: 38px;
        height: 38px;
        margin-top: -19px;
    }

    .ld-thumb {
        width: 76px;
        height: 56px;
    }

    .ld-card {
        padding: 20px;
    }

    .ld-facts {
        grid-template-columns: 1fr 1fr;
    }

    .ld-crumbs span[aria-current] {
        max-width: 22ch;
    }

    .ld-sticky {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 90;
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, 0.97);
        backdrop-filter: blur(10px);
        border-top: 1px solid var(--border);
        box-shadow: 0 -6px 20px rgba(26, 50, 85, 0.08);
    }

    .ld-sticky-price {
        min-width: 0;
        flex: 1;
        font-family: var(--font-heading);
        font-size: 17px;
        font-weight: 800;
        line-height: 1.2;
        color: var(--primary);
    }

    .ld-sticky-price small {
        display: block;
        font-family: var(--font-sans);
        font-size: 11px;
        font-weight: 600;
        color: var(--text-muted);
    }

    .ld-sticky .ld-btn {
        height: 48px;
        padding: 0 16px;
    }

    .ld-sticky .ld-btn-call {
        width: 48px;
        padding: 0;
    }

    .ld-related-grid {
        gap: 12px;
    }

    .ld-lightbox .ld-nav-prev { left: 8px; }
    .ld-lightbox .ld-nav-next { right: 8px; }
}

@media (max-width: 480px) {
    .ld-related-grid {
        grid-template-columns: 1fr 1fr;
    }

}

/* Telephone : 2 colonnes, donc 4 annonces (pas de carte seule sur la derniere ligne) */
@media (max-width: 768px) {
    .ld-related-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ld-related-grid > :nth-child(5) {
        display: none;
    }
}

/* ---------- Pieces : points cles, onglets, conditions ---------- */
.ld-keyfacts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.ld-key {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--primary-light);
    border: 1px solid #fcd9cd;
    border-radius: 14px;
    min-width: 0;
}

.ld-key-ico {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-dark);
    background: #fff;
    border-radius: 10px;
}

.ld-key small {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.ld-key strong {
    display: block;
    font-size: 14px;
    color: var(--secondary);
    overflow-wrap: anywhere;
}

.ld-tablist {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
    padding-bottom: 2px;
    overflow-x: auto;
    border-bottom: 1px solid var(--border);
    scrollbar-width: none;
}

.ld-tablist::-webkit-scrollbar {
    display: none;
}

.ld-tab {
    flex-shrink: 0;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -3px;
    cursor: pointer;
}

.ld-tab:hover {
    color: var(--secondary);
}

.ld-tab.is-active {
    color: var(--primary-dark);
    border-bottom-color: var(--primary);
}

.ld-tab:focus-visible,
.ld-tabpanel:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
    border-radius: 8px;
}

.ld-tabpanel[hidden] {
    display: none;
}

.ld-tabpanel .ld-facts {
    margin: 0;
}

.ld-terms {
    display: grid;
    gap: 12px;
    margin: 0 0 14px;
}

.ld-terms > div {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.ld-terms dt {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 120px;
    font-weight: 700;
    color: var(--secondary);
}

.ld-terms dd {
    margin: 0;
    color: var(--text-main);
}

.ld-terms-note {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.ld-safe-yes {
    color: var(--secondary);
}
