/* ==========================================================================
   detail-logement.css - Page de détail d'un logement (locataire)
   Thème : --role-color: #059669 (vert locataire)
   ========================================================================== */

/* ── Topbar retour ───────────────────────────────────────────────────────── */
.dl-topbar {
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* ── Bouton favori (topbar) ──────────────────────────────────────────────── */
.dl-fav-form { display: flex; }
.dl-fav-btn {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .5rem 1rem .5rem .85rem;
    background: #f1f5f9;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: .875rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}
.dl-fav-btn svg { width: 1.1rem; height: 1.1rem; flex-shrink: 0; color: #ef4444; }
.dl-fav-btn:hover {
    background: #fff5f5;
    border-color: #ef4444;
    color: #ef4444;
}
.dl-fav-btn--on {
    background: #fff5f5;
    border-color: #ef4444;
    color: #ef4444;
}

.dl-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 1rem 0.5rem 0.75rem;
    background: #f1f5f9;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.12s;
}
.dl-back-btn svg { width: 1rem; height: 1rem; flex-shrink: 0; }
.dl-back-btn:hover {
    background: var(--role-color-light, #ecfdf5);
    border-color: var(--role-color, #059669);
    color: var(--role-color-dark, #047857);
    transform: translateX(-2px);
}

/* ── Galerie ─────────────────────────────────────────────────────────────── */
.dl-gallery {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: #0f172a;
    margin-bottom: 1.5rem;
    max-width: 580px;
    margin-left: auto;
    margin-right: auto;
}

.dl-gallery__main {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #1e293b;
    cursor: zoom-in;
}

.dl-gallery__main-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.2s;
}

.dl-gallery__zoom-hint {
    position: absolute;
    bottom: 10px;
    left: 12px;
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255,255,255,.75);
    background: rgba(0,0,0,.35);
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    pointer-events: none;
}

.dl-gallery__count {
    position: absolute;
    bottom: 10px;
    right: 12px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
    background: rgba(0,0,0,.45);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    pointer-events: none;
}

.dl-gallery__strip {
    display: flex;
    gap: 0.4rem;
    padding: 0.5rem;
    overflow-x: auto;
    background: #f1f5f9;
    scrollbar-width: thin;
}

.dl-gallery__thumb {
    flex: 0 0 90px;
    height: 60px;
    object-fit: cover;
    border-radius: 7px;
    border: 2.5px solid transparent;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.15s, border-color 0.15s;
}
.dl-gallery__thumb:hover { opacity: 0.85; }
.dl-gallery__thumb.is-active {
    border-color: var(--role-color, #059669);
    opacity: 1;
}

.dl-no-photo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 2.5rem 1rem;
    text-align: center;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    margin-bottom: 1.5rem;
    color: #94a3b8;
    font-size: 0.9rem;
}
.dl-no-photo svg { color: #94a3b8; }

/* ── Titre + badges ──────────────────────────────────────────────────────── */
.dl-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.dl-title-left {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.dl-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0;
    line-height: 1.25;
}

.dl-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.dl-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.dl-badge--type   { background: #f0fdf4; color: #15803d; border: 1px solid #86efac; }
.dl-badge--loc    { background: #eff6ff; color: #1d4ed8; border: 1px solid #93c5fd; }
.dl-badge--meuble { background: var(--role-color, #059669); color: #fff; }

.dl-localisation {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    flex-shrink: 0;
    margin-top: 0.2rem;
}
.dl-localisation svg {
    width: 15px;
    height: 15px;
    color: var(--role-color, #059669);
    flex-shrink: 0;
}

/* ── Cartes prix ─────────────────────────────────────────────────────────── */
.dl-prices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.dl-price-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.9rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.dl-price-card--main {
    background: var(--role-color-light, #ecfdf5);
    border-color: var(--role-color-mid, #a7f3d0);
}
.dl-price-card--dispo {
    background: #eff6ff;
    border-color: #93c5fd;
}

.dl-price-card__label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.dl-price-card__value {
    font-size: 1.2rem;
    font-weight: 800;
    color: #1e293b;
}
.dl-price-card--main .dl-price-card__value { color: var(--role-color-dark, #047857); }
.dl-price-card--dispo .dl-price-card__value { color: #1d4ed8; }
.dl-price-card__value--sm { font-size: 1rem; }
.dl-price-card__per {
    font-size: 0.72rem;
    font-weight: 500;
    color: #94a3b8;
    margin-left: 0.15rem;
}

/* ── Sections ────────────────────────────────────────────────────────────── */
.dl-section {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1.25rem 1.4rem;
    margin-bottom: 1rem;
}

.dl-sections {
    display: grid;
    gap: 0;
}

.dl-section__title {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--role-color, #059669);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin: 0 0 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--role-color-light, #ecfdf5);
}

/* Description */
.dl-description {
    font-size: 0.92rem;
    color: #334155;
    line-height: 1.75;
    margin: 0;
}

/* ── Grille caractéristiques ─────────────────────────────────────────────── */
.dl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
}

.dl-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.dl-item--wide { grid-column: 1 / -1; }

.dl-item__label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.dl-item__val {
    font-size: 0.92rem;
    font-weight: 600;
    color: #1e293b;
}

/* DPE / GES */
.dl-dpe {
    display: inline-block;
    font-weight: 800;
    font-size: 0.85rem;
    padding: 0.15rem 0.55rem;
    border-radius: 5px;
    color: #fff;
}
.dl-dpe--a { background: #15803d; }
.dl-dpe--b { background: #22c55e; }
.dl-dpe--c { background: #86efac; color: #166534; }
.dl-dpe--d { background: #fbbf24; color: #78350f; }
.dl-dpe--e { background: #f97316; }
.dl-dpe--f { background: #ef4444; }
.dl-dpe--g { background: #7f1d1d; }

/* ── Chips équipements ───────────────────────────────────────────────────── */
.dl-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.dl-chip {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    background: var(--role-color-light, #ecfdf5);
    color: var(--role-color-dark, #047857);
    border: 1px solid var(--role-color-mid, #a7f3d0);
}

/* ── Règles ──────────────────────────────────────────────────────────────── */
.dl-regles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.dl-regle {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    font-size: 0.83rem;
    font-weight: 600;
    border: 1px solid;
}
.dl-regle--ok  { background: #f0fdf4; color: #15803d; border-color: #86efac; }
.dl-regle--non { background: #fef2f2; color: #b91c1c; border-color: #fca5a5; }
.dl-regle__icon { font-size: 1rem; }

/* ── Carte propriétaire ──────────────────────────────────────────────────── */
.dl-proprio {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.dl-proprio__avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2.5px solid var(--role-color-mid, #a7f3d0);
    flex-shrink: 0;
}
.dl-proprio__info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.dl-proprio__nom {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.dl-proprio__verif {
    font-size: 0.72rem;
    font-weight: 700;
    background: var(--role-color, #059669);
    color: #fff;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    letter-spacing: 0.03em;
}
.dl-proprio__meta {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0;
}

/* ── Résumé avis sous le titre ───────────────────────────────────────────── */
.dl-title-avis {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.1rem;
}

.dl-title-avis__note {
    font-size: 0.875rem;
    font-weight: 700;
    color: #1e293b;
}

.dl-title-avis__sep {
    color: #cbd5e1;
    font-size: 0.85rem;
}

.dl-title-avis__link {
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--role-color, #059669);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.15s;
}

.dl-title-avis__link:hover {
    color: var(--role-color-dark, #047857);
}

/* ── Avis ────────────────────────────────────────────────────────────────── */
.dl-avis-note-globale {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #f59e0b;
    margin-left: 0.5rem;
    text-transform: none;
    letter-spacing: 0;
}

.dl-avis-count {
    font-size: 0.75rem;
    font-weight: 500;
    color: #94a3b8;
}

.dl-avis-empty {
    font-size: 0.875rem;
    color: #94a3b8;
    margin: 0;
    font-style: italic;
}

.dl-avis-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dl-avis-card {
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 10px;
    padding: 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.dl-avis-card__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dl-avis-card__avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e8f0;
    flex-shrink: 0;
}

.dl-avis-card__meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.dl-avis-card__nom {
    font-size: 0.875rem;
    font-weight: 700;
    color: #1e293b;
}

.dl-avis-card__date {
    font-size: 0.72rem;
    color: #94a3b8;
    font-weight: 500;
}

.dl-avis-card__stars {
    flex-shrink: 0;
}

.dl-avis-card__texte {
    font-size: 0.855rem;
    color: #475569;
    line-height: 1.6;
    margin: 0;
}

/* Étoiles */
.dl-stars {
    display: inline-flex;
    gap: 1px;
    color: #f59e0b;
}

.dl-stars svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* ── Lightbox ────────────────────────────────────────────────────────────── */
.dl-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0,0,0,.9);
    align-items: center;
    justify-content: center;
}
.dl-lightbox.is-open { display: flex; }

.dl-lightbox__img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    user-select: none;
}
.dl-lightbox__close {
    position: absolute;
    top: 1rem; right: 1.25rem;
    background: none; border: none;
    color: #fff; font-size: 2rem;
    line-height: 1; cursor: pointer;
    opacity: 0.75; transition: opacity 0.15s;
}
.dl-lightbox__close:hover { opacity: 1; }

.dl-lightbox__arrow {
    position: absolute;
    top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,.12);
    border: none; color: #fff;
    font-size: 1.75rem;
    width: 3rem; height: 3rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
}
.dl-lightbox__arrow:hover { background: rgba(255,255,255,.25); }
.dl-lightbox__arrow--prev { left: 1.25rem; }
.dl-lightbox__arrow--next { right: 1.25rem; }

.dl-lightbox__counter {
    position: absolute;
    bottom: 1.25rem; left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,.65);
    font-size: 0.85rem; font-weight: 600;
}

/* ── Section contact propriétaire ───────────────────────────────────────── */
.dl-section--contact {
    border-color: var(--role-color-mid, #a7f3d0);
    background: var(--role-color-light, #ecfdf5);
}

/* Flash messages */
.dl-contact-flash {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
}
.dl-contact-flash--ok {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #15803d;
}
.dl-contact-flash--err {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #b91c1c;
}

/* Déjà contacté */
.dl-contact-deja {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.85rem 1rem;
}
.dl-contact-deja svg {
    width: 18px;
    height: 18px;
    color: var(--role-color, #059669);
    flex-shrink: 0;
}
.dl-contact-deja__link {
    font-weight: 700;
    color: var(--role-color, #059669);
    text-decoration: underline;
    text-underline-offset: 2px;
    margin-left: auto;
    transition: color 0.15s;
}
.dl-contact-deja__link:hover { color: var(--role-color-dark, #047857); }

/* Formulaire */
.dl-contact-form {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.dl-contact-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.dl-contact-textarea {
    width: 100%;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    padding: 0.75rem 0.9rem;
    font-size: 0.9rem;
    font-family: inherit;
    color: #1e293b;
    background: #fff;
    resize: vertical;
    min-height: 130px;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}
.dl-contact-textarea:focus {
    outline: none;
    border-color: var(--role-color, #059669);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
}

.dl-contact-counter {
    font-size: 0.72rem;
    color: #94a3b8;
    text-align: right;
    font-weight: 500;
}

.dl-contact-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--role-color, #059669);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, transform 0.12s;
    align-self: flex-start;
}
.dl-contact-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.dl-contact-btn:hover {
    background: var(--role-color-dark, #047857);
    transform: translateY(-1px);
}
.dl-contact-btn:active { transform: translateY(0); }

/* ── Menu 3 points (signalement) ──────────────────────────────────────────── */
.dot-menu { position: relative; }
.dot-menu__btn {
    background: none; border: none; cursor: pointer;
    padding: 6px 8px; border-radius: 6px; line-height: 1;
    color: #64748b; display: flex; align-items: center;
    transition: background .15s, color .15s;
}
.dot-menu__btn:hover { background: #f1f5f9; color: #1e293b; }
.dot-menu__dropdown {
    display: none; position: absolute;
    left: 0; top: calc(100% + 4px);
    background: #fff; border: 1px solid #e2e8f0;
    border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.12);
    min-width: 190px; z-index: 200;
    overflow: hidden;
}
.dot-menu.is-open .dot-menu__dropdown { display: block; }
.dot-menu__item {
    display: flex; align-items: center; gap: 8px;
    padding: 11px 14px; font-size: .85rem; color: #374151;
    text-decoration: none; white-space: nowrap;
    transition: background .1s;
}
.dot-menu__item:hover { background: #fef2f2; color: #ef4444; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .dl-gallery__main { aspect-ratio: 4 / 3; }
    .dl-prices  { grid-template-columns: repeat(2, 1fr); }
    .dl-grid    { grid-template-columns: repeat(2, 1fr); }
    .dl-title   { font-size: 1.2rem; }
    .dl-title-row { flex-direction: column; }
}
