/**
 * GLCD Sales — styles front (fiche + archive biens en vente).
 * Reutilise les variables du theme GLCD pour le support dark/light.
 */

.glcd-bv-single,
.glcd-bv-archive {
    max-width: var(--container-max-width, 1200px);
    margin: 0 auto;
    padding: 2rem 1.25rem 4rem;
    color: var(--color-text, #222);
}

/* ---------- Boutons ---------- */
.glcd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .7rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background .2s, color .2s, border-color .2s;
}
.glcd-btn--primary {
    background: var(--color-primary, #2f6f4f);
    color: #fff;
}
.glcd-btn--primary:hover { background: var(--color-primary-dark, #265a40); }
.glcd-btn--ghost {
    background: transparent;
    color: var(--color-primary, #2f6f4f);
    border-color: var(--color-border, #d7d7d7);
}
.glcd-btn--ghost:hover { border-color: var(--color-primary, #2f6f4f); }
.glcd-btn--whatsapp {
    background: #25d366;
    color: #fff;
}
.glcd-btn--whatsapp:hover { background: #1ebe5b; }

/* ---------- Galerie ---------- */
.glcd-bv-gallery { margin-bottom: 2rem; }
.glcd-bv-gallery__main {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: var(--color-bg-muted, #eee);
}
.glcd-bv-gallery__main-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.glcd-bv-gallery__thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: .5rem;
    margin-top: .6rem;
}
.glcd-bv-gallery__thumb {
    padding: 0;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: none;
    aspect-ratio: 1 / 1;
}
.glcd-bv-gallery__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.glcd-bv-gallery__thumb.is-active { border-color: var(--color-primary, #2f6f4f); }

.glcd-bv-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: .35rem .75rem;
    border-radius: 6px;
    font-size: .8rem;
    font-weight: 700;
    color: #fff;
    background: var(--color-warning, #d68a00);
}
.glcd-bv-badge--offer { background: var(--color-warning, #d68a00); }

/* ---------- Layout fiche ---------- */
.glcd-bv__layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 2.5rem;
    align-items: start;
}
@media (max-width: 900px) {
    .glcd-bv__layout { grid-template-columns: 1fr; }
}

.glcd-bv__tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .75rem; }
.glcd-bv-tag {
    font-size: .8rem;
    font-weight: 600;
    padding: .25rem .6rem;
    border-radius: 999px;
    background: var(--color-bg-alt, #f2f2f2);
    color: var(--color-text, #222);
}
.glcd-bv-tag--muted { color: var(--color-text-muted, #777); }

.glcd-bv__title {
    font-family: var(--font-family-heading, inherit);
    font-size: clamp(1.6rem, 3vw, 2.3rem);
    margin: 0 0 .4rem;
    color: var(--color-primary, #134f5c);
}
.glcd-bv__location { color: var(--color-text-muted, #777); margin: 0 0 .25rem; }
.glcd-bv__ref { font-size: .85rem; color: var(--color-text-light, #999); margin: 0; }

/* ---------- Specs ---------- */
.glcd-bv__specs {
    list-style: none;
    margin: 1.5rem 0;
    padding: 1.25rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 1rem;
    background: var(--color-bg-alt, #f7f7f7);
    border-radius: 12px;
}
.glcd-bv__spec { text-align: center; }
/* Les chiffres portent le dore de la cigogne, les intitules restent discrets. */
.glcd-bv__spec-value { display: block; font-size: 1.4rem; font-weight: 700; color: var(--color-accent, #bf9000); }
.glcd-bv__spec-label { display: block; font-size: .8rem; color: var(--color-text-muted, #777); margin-top: .15rem; }

.glcd-bv__section { margin: 2rem 0; }
.glcd-bv__section h2 {
    font-family: var(--font-family-heading, inherit);
    font-size: 1.3rem;
    margin: 0 0 1rem;
    padding-bottom: .5rem;
    color: var(--color-primary, #134f5c);
    border-bottom: 1px solid var(--color-border-light, #eee);
    position: relative;
}
/* Filet dore sous l'amorce du titre : rappel de la cigogne. */
.glcd-bv__section h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 48px;
    height: 2px;
    background: var(--color-accent, #bf9000);
}
.glcd-bv__description { line-height: 1.7; }

.glcd-bv__features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: .6rem;
}
.glcd-bv__feature { display: flex; align-items: center; gap: .5rem; }
.glcd-bv__feature svg { color: var(--color-primary, #2f6f4f); flex: 0 0 auto; }

/* ---------- DPE / GES ---------- */
.glcd-bv-energy { display: flex; flex-wrap: wrap; gap: 2rem; }
.glcd-bv-gauge { flex: 1 1 280px; }
.glcd-bv-gauge__title { font-weight: 600; margin: 0 0 .6rem; }
.glcd-bv-gauge__scale { display: flex; flex-direction: column; gap: 3px; }
.glcd-bv-gauge__step {
    position: relative;
    display: flex;
    align-items: center;
    padding: .3rem .6rem;
    font-weight: 700;
    color: #1a1a1a;
    border-radius: 4px;
    width: 38%;
    opacity: .55;
    transition: opacity .2s;
}
.glcd-bv-gauge__step:nth-child(1) { width: 38%; }
.glcd-bv-gauge__step:nth-child(2) { width: 46%; }
.glcd-bv-gauge__step:nth-child(3) { width: 54%; }
.glcd-bv-gauge__step:nth-child(4) { width: 62%; }
.glcd-bv-gauge__step:nth-child(5) { width: 70%; }
.glcd-bv-gauge__step:nth-child(6) { width: 78%; }
.glcd-bv-gauge__step:nth-child(7) { width: 86%; }
.glcd-bv-gauge__step.is-active { opacity: 1; box-shadow: 0 0 0 2px var(--color-text, #222); }
.glcd-bv-gauge__value {
    position: absolute;
    left: calc(100% + .6rem);
    white-space: nowrap;
    font-style: normal;
    font-weight: 600;
    font-size: .85rem;
    color: var(--color-text, #222);
}

/* ---------- Plan & visite ---------- */
.glcd-bv__plan-tour { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.glcd-bv__plan { display: inline-block; max-width: 220px; text-align: center; text-decoration: none; color: var(--color-text-muted, #777); }
.glcd-bv__plan img { border-radius: 8px; border: 1px solid var(--color-border-light, #eee); }

/* ---------- Carte ---------- */
.glcd-bv__map-note { font-size: .85rem; color: var(--color-text-muted, #777); margin: -.5rem 0 .8rem; }
.glcd-map-container { border-radius: 12px; overflow: hidden; }
.glcd-map-container--large { height: 380px; }

/* ---------- Sidebar prix ---------- */
.glcd-bv__sidebar { position: sticky; top: 1.5rem; display: flex; flex-direction: column; gap: 1.25rem; }
@media (max-width: 900px) { .glcd-bv__sidebar { position: static; } }

.glcd-bv-pricebox {
    background: var(--color-bg-elevated, #fff);
    border: 1px solid var(--color-border, #e2e2e2);
    border-radius: 14px;
    padding: 1.5rem;
}
.glcd-bv-pricebox__price {
    font-family: var(--font-family-heading, inherit);
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-accent, #bf9000);
    margin: 0;
}
.glcd-bv-pricebox__fees { font-size: .85rem; color: var(--color-text-muted, #777); margin: .25rem 0 0; }
.glcd-bv-pricebox__charges { list-style: none; margin: 1rem 0 0; padding: 1rem 0 0; border-top: 1px solid var(--color-border-light, #eee); }
.glcd-bv-pricebox__charges li { display: flex; justify-content: space-between; gap: 1rem; padding: .3rem 0; font-size: .9rem; }
.glcd-bv-pricebox__charges span { color: var(--color-text-muted, #777); }

/* ---------- Agent ---------- */
.glcd-bv-agent {
    background: var(--color-bg-alt, #f7f7f7);
    border-radius: 14px;
    padding: 1.5rem;
}
.glcd-bv-agent__heading { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; color: var(--color-primary, #134f5c); margin: 0 0 .9rem; }
.glcd-bv-agent__id { display: flex; align-items: center; gap: .9rem; margin-bottom: 1rem; }
.glcd-bv-agent__photo { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.glcd-bv-agent__name { font-weight: 700; margin: 0; }
.glcd-bv-agent__role { font-size: .85rem; color: var(--color-text-muted, #777); margin: .1rem 0 0; }
.glcd-bv-agent__actions { display: flex; flex-direction: column; gap: .6rem; }
.glcd-bv-agent__actions .glcd-btn { width: 100%; }

/* ---------- Archive : entete + filtres ---------- */
.glcd-bv-archive__head { margin-bottom: 1.5rem; }
.glcd-bv-archive__title { font-family: var(--font-family-heading, inherit); margin: 0 0 .25rem; color: var(--color-primary, #134f5c); }
.glcd-bv-archive__count { color: var(--color-text-muted, #777); margin: 0; }

.glcd-bv-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    padding: 1.25rem;
    margin-bottom: 2rem;
    background: var(--color-bg-alt, #f7f7f7);
    border-radius: 12px;
}
.glcd-bv-filters__field { display: flex; flex-direction: column; gap: .3rem; }
.glcd-bv-filters__field label { font-size: .8rem; font-weight: 600; color: var(--color-text-muted, #777); }
.glcd-bv-filters select,
.glcd-bv-filters input[type="number"] {
    padding: .55rem .7rem;
    border: 1px solid var(--color-border, #d7d7d7);
    border-radius: 8px;
    background: var(--color-bg, #fff);
    color: var(--color-text, #222);
    font: inherit;
}
.glcd-bv-filters__price { display: flex; align-items: center; gap: .4rem; }
.glcd-bv-filters__price input { width: 100px; }
.glcd-bv-filters__actions { display: flex; align-items: center; gap: .75rem; margin-left: auto; }
.glcd-bv-filters__reset { color: var(--color-text-muted, #777); text-decoration: underline; font-size: .9rem; }

/* ---------- Grille de cartes ---------- */
.glcd-bv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}
.glcd-bv-card {
    background: var(--color-bg-elevated, #fff);
    border: 1px solid var(--color-border-light, #ececec);
    border-radius: 14px;
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
}
.glcd-bv-card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(0,0,0,.12); }
.glcd-bv-card__link { text-decoration: none; color: inherit; display: block; }
.glcd-bv-card__media { position: relative; aspect-ratio: 4 / 3; background: var(--color-bg-muted, #eee); }
.glcd-bv-card__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.glcd-bv-card__img--placeholder { background: var(--color-bg-muted, #eee); }
.glcd-bv-card__type {
    position: absolute; bottom: .6rem; left: .6rem;
    background: rgba(0,0,0,.6); color: #fff;
    font-size: .75rem; font-weight: 600;
    padding: .2rem .55rem; border-radius: 5px;
}
.glcd-bv-card__body { padding: 1rem 1.1rem 1.2rem; }
.glcd-bv-card__price { font-size: 1.3rem; font-weight: 800; color: var(--color-accent, #bf9000); margin: 0 0 .25rem; }
.glcd-bv-card__title { font-size: 1.05rem; margin: 0 0 .4rem; line-height: 1.3; }
.glcd-bv-card__location { display: flex; align-items: center; gap: .3rem; color: var(--color-text-muted, #777); font-size: .9rem; margin: 0 0 .7rem; }
.glcd-bv-card__specs { list-style: none; display: flex; flex-wrap: wrap; gap: .75rem; margin: 0; padding: 0; font-size: .9rem; color: var(--color-text-muted, #777); }
.glcd-bv-card__specs strong { color: var(--color-text, #222); }

/* ---------- Pagination ---------- */
.glcd-bv-pagination { display: flex; justify-content: center; gap: .4rem; margin-top: 2.5rem; }
.glcd-bv-pagination .page-numbers {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 40px; height: 40px; padding: 0 .6rem;
    border-radius: 8px; text-decoration: none;
    border: 1px solid var(--color-border, #d7d7d7);
    color: var(--color-text, #222);
}
.glcd-bv-pagination .page-numbers.current { background: var(--color-primary, #2f6f4f); color: #fff; border-color: var(--color-primary, #2f6f4f); }

.glcd-bv-empty { text-align: center; padding: 3rem 1rem; }
.glcd-bv-empty p { color: var(--color-text-muted, #777); margin-bottom: 1rem; }

/* ---------- Mode sombre ----------
   Le theme ne bascule pas --color-primary / --color-accent en dark : le vert
   #134f5c et le dore #bf9000 y passent sous le seuil de lisibilite. On reprend
   les variantes claires, celles que le theme annonce deja via
   --color-primary-rgb / --color-accent-rgb dans son bloc [data-theme="dark"]. */
[data-theme="dark"] .glcd-bv__title,
[data-theme="dark"] .glcd-bv__section h2,
[data-theme="dark"] .glcd-bv-agent__heading,
[data-theme="dark"] .glcd-bv-archive__title {
    color: var(--brand-green-light, #1d6d80);
}
[data-theme="dark"] .glcd-bv__spec-value,
[data-theme="dark"] .glcd-bv-pricebox__price,
[data-theme="dark"] .glcd-bv-card__price {
    color: var(--brand-gold-light, #e0a900);
}
[data-theme="dark"] .glcd-bv__section h2::after {
    background: var(--brand-gold-light, #e0a900);
}
