/**
 * Frontend CSS — Annuaire Pro Belgique
 *
 * Variables : utilise les CSS custom properties de Bricks Builder.
 * Pas d'Automatic.css, pas de CoreFramework.
 * Fallback défini localement pour compatibilité hors-Bricks.
 *
 * @package AnnuairePro
 */

/* =========================================================================
   Variables locales (fallback si Bricks n'est pas actif)
   ========================================================================= */
:root {
    --apb-primary:       #185FA5;
    --apb-primary-dark:  #0C447C;
    --apb-primary-light: #EBF3FB;
    --apb-accent:        #E6892A;
    --apb-accent-dark:   #C96F15;
    --apb-bg:            #F7F8FA;
    --apb-danger:        #dc2626;
    --apb-success:       #059669;
    --apb-warning:       #E6892A;
    --apb-muted:         #6b7280;
    --apb-border:        #e5e7eb;
    --apb-radius:        8px;
    --apb-radius-sm:     4px;
    --apb-radius-lg:     12px;
    --apb-space-xs:      .25rem;
    --apb-space-sm:      .5rem;
    --apb-space-md:      1rem;
    --apb-space-lg:      1.5rem;
    --apb-space-xl:      2rem;
    --apb-shadow:        0 2px 8px rgba(0,0,0,.08);
    --apb-shadow-lg:     0 8px 24px rgba(0,0,0,.12);
    --apb-font:          system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* =========================================================================
   Reset minimal
   ========================================================================= */
.apb-form *,
.apb-card *,
.apb-badges *,
.apb-contact-form * {
    box-sizing: border-box;
}

/* =========================================================================
   Boutons
   ========================================================================= */
.apb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .5rem 1.25rem;
    border-radius: var(--apb-radius);
    font-size: .9375rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: 2px solid transparent;
    transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
    white-space: nowrap;
    line-height: 1.4;
}
.apb-btn:disabled { opacity: .55; cursor: not-allowed; }

.apb-btn--primary {
    background: var(--apb-primary);
    color: #fff;
    border-color: var(--apb-primary);
}
.apb-btn--primary:hover:not(:disabled) {
    background: var(--apb-primary-dark);
    border-color: var(--apb-primary-dark);
}
.apb-btn--outline {
    background: transparent;
    color: var(--apb-primary);
    border-color: var(--apb-primary);
}
.apb-btn--outline:hover:not(:disabled) {
    background: var(--apb-primary-light);
}
.apb-btn--ghost {
    background: transparent;
    color: var(--apb-muted);
    border-color: var(--apb-border);
}
.apb-btn--ghost:hover:not(:disabled) {
    background: #f9fafb;
    color: #374151;
}
.apb-btn--danger {
    background: var(--apb-danger);
    color: #fff;
    border-color: var(--apb-danger);
}
.apb-btn--link {
    background: none;
    border: none;
    color: var(--apb-primary);
    padding: 0;
    text-decoration: underline;
    font-weight: 400;
    cursor: pointer;
}
.apb-btn--sm { padding: .3rem .75rem; font-size: .8125rem; }
.apb-btn--lg { padding: .75rem 2rem; font-size: 1.0625rem; }

/* =========================================================================
   Notices / alertes
   ========================================================================= */
.apb-notice {
    padding: .75rem 1rem;
    border-radius: var(--apb-radius);
    margin-bottom: var(--apb-space-md);
    font-size: .9rem;
    border-left: 4px solid var(--apb-muted);
    background: #f9fafb;
    color: #374151;
}
.apb-notice--info  { border-color: var(--apb-primary); background: var(--apb-primary-light); color: #1e40af; }
.apb-notice--ok    { border-color: var(--apb-success); background: #f0fdf4; color: #166534; }
.apb-notice--error { border-color: var(--apb-danger);  background: #fef2f2; color: #991b1b; }
.apb-notice--warn  { border-color: var(--apb-warning); background: #fffbeb; color: #92400e; }

/* =========================================================================
   Formulaires
   ========================================================================= */
.apb-form__field {
    margin-bottom: var(--apb-space-md);
}
.apb-form__field label,
.apb-label {
    display: block;
    font-weight: 600;
    font-size: .875rem;
    color: #374151;
    margin-bottom: .3rem;
}
.apb-form__field input,
.apb-form__field textarea,
.apb-form__field select {
    width: 100%;
    padding: .55rem .9rem;
    border: 1px solid var(--apb-border);
    border-radius: var(--apb-radius-sm);
    font-size: .9375rem;
    color: #111827;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
    font-family: var(--apb-font);
}
.apb-form__field input:focus,
.apb-form__field textarea:focus,
.apb-form__field select:focus {
    outline: none;
    border-color: var(--apb-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.apb-form__field input[readonly] {
    background: #f9fafb;
    color: var(--apb-muted);
}
.apb-optional { font-weight: 400; color: var(--apb-muted); font-size: .8rem; }
.apb-field-error { color: var(--apb-danger); font-size: .8rem; margin-top: .2rem; }

/* =========================================================================
   Cartes de profil
   ========================================================================= */
.apb-pro-card {
    background: #fff;
    border: 1px solid var(--apb-border);
    border-radius: var(--apb-radius-lg);
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
    display: flex;
    flex-direction: column;
}
.apb-pro-card:hover {
    box-shadow: var(--apb-shadow-lg);
    transform: translateY(-2px);
}
.apb-pro-card--premium {
    border-color: var(--apb-warning);
    box-shadow: 0 0 0 1px var(--apb-warning);
}
.apb-pro-card__photo {
    aspect-ratio: 16/9;
    object-fit: cover;
    width: 100%;
    background: #f3f4f6;
}
.apb-pro-card__body {
    padding: var(--apb-space-md);
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .4rem;
}
.apb-pro-card__titre {
    font-size: 1.0625rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
}
.apb-pro-card__titre a { color: inherit; text-decoration: none; }
.apb-pro-card__titre a:hover { color: var(--apb-primary); }
.apb-pro-card__meta {
    font-size: .8125rem;
    color: var(--apb-muted);
    display: flex;
    flex-wrap: wrap;
    gap: .25rem .75rem;
    align-items: center;
}
.apb-pro-card__note {
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    font-weight: 600;
    color: var(--apb-warning);
    font-size: .875rem;
}
.apb-pro-card__desc {
    font-size: .875rem;
    color: #4b5563;
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}
.apb-pro-card__footer {
    padding: .75rem var(--apb-space-md);
    border-top: 1px solid var(--apb-border);
    display: flex;
    justify-content: flex-end;
}

/* =========================================================================
   Grille de profils
   ========================================================================= */
.apb-pro-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--apb-space-lg);
}

/* =========================================================================
   Badges
   ========================================================================= */
.apb-badges {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin: .5rem 0;
}
.apb-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .2rem .6rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
    background: color-mix(in srgb, var(--apb-badge-color) 15%, white);
    color: var(--apb-badge-color);
    border: 1px solid color-mix(in srgb, var(--apb-badge-color) 30%, white);
}
.apb-badge__icon svg { display: block; }

/* =========================================================================
   Étoiles (avis)
   ========================================================================= */
.apb-stars {
    display: inline-flex;
    gap: .1rem;
    color: var(--apb-warning);
    font-size: 1.1rem;
}
.apb-stars__empty { color: #d1d5db; }

/* =========================================================================
   Barre de progression (score complétude)
   ========================================================================= */
.apb-progress {
    background: #e5e7eb;
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
    margin: .5rem 0;
}
.apb-progress__bar {
    height: 100%;
    background: var(--apb-primary);
    border-radius: 999px;
    transition: width .4s ease;
}
.apb-progress__bar--ok     { background: var(--apb-success); }
.apb-progress__bar--warn   { background: var(--apb-warning); }
.apb-progress__bar--danger { background: var(--apb-danger); }

/* =========================================================================
   Pagination
   ========================================================================= */
.apb-pagination {
    margin-top: var(--apb-space-xl);
    display: flex;
    justify-content: center;
}
.apb-pagination__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: .3rem;
    flex-wrap: wrap;
}
.apb-pagination__list a,
.apb-pagination__list span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 .5rem;
    border: 1px solid var(--apb-border);
    border-radius: var(--apb-radius-sm);
    text-decoration: none;
    color: #374151;
    font-size: .9rem;
    transition: background .15s, border-color .15s;
}
.apb-pagination__list a:hover { background: var(--apb-primary-light); border-color: var(--apb-primary); color: var(--apb-primary); }
.apb-pagination__list .current span,
.apb-pagination__list [aria-current] {
    background: var(--apb-primary);
    border-color: var(--apb-primary);
    color: #fff;
}

/* =========================================================================
   Formulaire de contact
   ========================================================================= */
.apb-contact-form {
    background: #fff;
    border: 1px solid var(--apb-border);
    border-radius: var(--apb-radius-lg);
    padding: var(--apb-space-lg);
    max-width: 560px;
}
.apb-contact-form__login-required {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    align-items: flex-start;
}
.apb-form__messages { margin-bottom: var(--apb-space-md); }

/* =========================================================================
   Avis clients
   ========================================================================= */
.apb-avis {
    border: 1px solid var(--apb-border);
    border-radius: var(--apb-radius);
    padding: var(--apb-space-md);
    margin-bottom: var(--apb-space-md);
    background: #fff;
}
.apb-avis__header {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .5rem;
    flex-wrap: wrap;
}
.apb-avis__auteur { font-weight: 700; }
.apb-avis__date { color: var(--apb-muted); font-size: .8rem; }
.apb-avis__texte { color: #374151; line-height: 1.6; }
.apb-avis__service { font-size: .8rem; color: var(--apb-muted); font-style: italic; margin-top: .4rem; }
.apb-avis__reponse {
    margin-top: .75rem;
    padding: .75rem;
    background: #f8fafc;
    border-left: 3px solid var(--apb-primary);
    border-radius: 0 var(--apb-radius-sm) var(--apb-radius-sm) 0;
    font-size: .875rem;
}
.apb-avis__reponse-label { font-weight: 700; color: var(--apb-primary); margin-bottom: .25rem; }

/* Rating stars input */
.apb-rating-input { display: flex; flex-direction: row-reverse; gap: .2rem; }
.apb-rating-input input[type="radio"] { display: none; }
.apb-rating-input label {
    font-size: 1.75rem;
    color: #d1d5db;
    cursor: pointer;
    transition: color .1s;
}
.apb-rating-input input:checked ~ label,
.apb-rating-input label:hover,
.apb-rating-input label:hover ~ label { color: var(--apb-warning); }

/* =========================================================================
   Téléphone masqué
   ========================================================================= */
.apb-telephone {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}
.apb-telephone__masque {
    font-family: monospace;
    letter-spacing: .05em;
    color: var(--apb-muted);
}
.apb-telephone__link {
    color: #111827;
    text-decoration: none;
    font-weight: 600;
}
.apb-telephone__link:hover { color: var(--apb-primary); text-decoration: underline; }

/* =========================================================================
   Page géo-locale
   ========================================================================= */
.apb-geo-page-header { margin-bottom: var(--apb-space-xl); }
.apb-geo-page-header h1 { font-size: 2rem; margin-bottom: .5rem; }
.apb-geo-page-header .apb-geo-meta { color: var(--apb-muted); font-size: .9rem; }
.apb-geo-page__resultats-count { color: var(--apb-muted); margin-bottom: var(--apb-space-lg); }

/* =========================================================================
   Recherche IA
   ========================================================================= */
.apb-recherche-ia { max-width: 720px; margin: 0 auto; }
.apb-recherche-ia__input-wrap { display: flex; gap: .5rem; }
.apb-recherche-ia__input {
    flex: 1;
    padding: .65rem 1rem;
    border: 2px solid var(--apb-border);
    border-radius: var(--apb-radius);
    font-size: 1rem;
    transition: border-color .15s;
}
.apb-recherche-ia__input:focus { outline: none; border-color: var(--apb-primary); }

/* =========================================================================
   Hero single profil
   ========================================================================= */
.apb-hero {
    background: var(--apb-bg);
    border-radius: var(--apb-radius-lg);
    padding: var(--apb-space-xl);
    margin-bottom: var(--apb-space-xl);
}
.apb-hero__inner {
    display: flex;
    gap: var(--apb-space-xl);
    align-items: flex-start;
}
.apb-hero__photo-col {
    position: relative;
    flex-shrink: 0;
}
.apb-hero__photo {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: var(--apb-radius-lg);
    border: 3px solid #fff;
    box-shadow: var(--apb-shadow);
}
.apb-hero__photo--placeholder {
    width: 140px;
    height: 140px;
    background: var(--apb-primary);
    border-radius: var(--apb-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2.5rem;
    font-weight: 800;
}
.apb-hero__premium-ribbon {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--apb-accent), var(--apb-accent-dark));
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    padding: .2rem .75rem;
    border-radius: 999px;
    white-space: nowrap;
}
.apb-hero__content { flex: 1; min-width: 0; }
.apb-hero__badges  { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .75rem; }
.apb-hero__nom     { font-size: 1.75rem; font-weight: 800; color: #111827; margin: 0 0 .5rem; }
.apb-hero__localisation {
    display: flex; align-items: center; gap: .35rem;
    color: var(--apb-muted); font-size: .9rem; margin-bottom: .5rem;
}
.apb-hero__note {
    display: flex; align-items: center; gap: .4rem;
    font-size: .9rem; margin-bottom: 1rem;
}
.apb-hero__nb-avis { color: var(--apb-muted); font-size: .85rem; }
.apb-hero__cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: .75rem; }
.apb-btn--whatsapp { background: #25d366; color: #fff; border-color: #25d366; }
.apb-btn--whatsapp:hover { background: #1ebe5d; }
.apb-hero__reseaux { display: flex; gap: .5rem; margin-top: .5rem; }
.apb-reseau {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2rem; height: 2rem;
    background: #f3f4f6; border-radius: 6px;
    color: #374151; font-size: .8rem; font-weight: 700;
    text-decoration: none; transition: background .15s;
}
.apb-reseau:hover { background: var(--apb-primary-light); color: var(--apb-primary); }

/* =========================================================================
   Infos profil
   ========================================================================= */
.apb-infos__section {
    margin-bottom: var(--apb-space-xl);
    padding-bottom: var(--apb-space-xl);
    border-bottom: 1px solid var(--apb-border);
}
.apb-infos__section:last-child { border-bottom: none; }
.apb-infos__titre {
    font-size: 1.125rem; font-weight: 700;
    color: #111827; margin: 0 0 var(--apb-space-md);
}
.apb-infos__desc { line-height: 1.7; color: #374151; }
.apb-infos__dl { display: flex; flex-direction: column; gap: .6rem; }
.apb-infos__row { display: flex; gap: 1rem; }
.apb-infos__row dt {
    width: 180px; flex-shrink: 0;
    font-weight: 600; color: #374151; font-size: .9rem;
}
.apb-infos__row dd { color: #4b5563; font-size: .9rem; }

/* Tags services */
.apb-tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.apb-tag {
    padding: .25rem .75rem;
    background: var(--apb-primary-light);
    color: var(--apb-primary);
    border-radius: 999px;
    font-size: .82rem; font-weight: 600;
}

/* =========================================================================
   Galerie photos (single profil)
   ========================================================================= */
.apb-galerie__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: .75rem;
}
.apb-galerie__item { display: block; border-radius: var(--apb-radius); overflow: hidden; }
.apb-galerie__img  { width: 100%; aspect-ratio: 4/3; object-fit: cover; transition: transform .2s; }
.apb-galerie__item:hover .apb-galerie__img { transform: scale(1.04); }

/* =========================================================================
   Carte pro (archive)
   ========================================================================= */
.apb-pro-card__photo-wrap { display: block; overflow: hidden; }
.apb-pro-card__photo { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.apb-pro-card__photo--placeholder {
    width: 100%; aspect-ratio: 4/3;
    background: var(--apb-primary);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 2.5rem; font-weight: 800;
}
.apb-pro-card__badges { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .4rem; }
.apb-pro-card__commune { font-size: .8rem; color: var(--apb-muted); margin: 0; }
.apb-pro-card__note { display: flex; align-items: center; gap: .3rem; font-size: .85rem; }
.apb-pro-card__nb-avis { color: var(--apb-muted); font-size: .8rem; }
.apb-pro-card__tarif { font-size: .78rem; color: var(--apb-muted); margin: 0; font-style: italic; }

/* Badges colorés */
.apb-badge--premium { --apb-badge-color: #E6892A; }
.apb-badge--vies    { --apb-badge-color: #059669; }
.apb-badge--cat     { --apb-badge-color: #185FA5; }
.apb-badge--exp     { --apb-badge-color: #7c3aed; }

/* =========================================================================
   Archive — titre + compteur
   ========================================================================= */
.apb-archive__titre { font-size: 1.75rem; font-weight: 800; margin: 0 0 .5rem; }
.apb-archive__count { color: var(--apb-muted); font-size: .9rem; margin-bottom: 1.5rem; }
.apb-archive__vide  { text-align: center; padding: 3rem 1rem; }
.apb-archive__vide p { color: var(--apb-muted); margin-bottom: 1rem; }

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 768px) {
    .apb-hero__inner { flex-direction: column; }
    .apb-hero__photo, .apb-hero__photo--placeholder { width: 100px; height: 100px; }
    .apb-hero__nom { font-size: 1.4rem; }
    .apb-infos__row { flex-direction: column; gap: .2rem; }
    .apb-infos__row dt { width: auto; }
}
@media (max-width: 640px) {
    .apb-pro-grid { grid-template-columns: 1fr; }
    .apb-contact-form { padding: var(--apb-space-md); }
    .apb-recherche-ia__input-wrap { flex-direction: column; }
    .apb-btn--lg { width: 100%; }
    .apb-hero { padding: var(--apb-space-md); }
    .apb-hero__cta { flex-direction: column; }
    .apb-galerie__grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}
