/**
 * Profil public professionnel — [apb_profil_public]
 *
 * ═══════════════════════════════════════════════════════════════════════════
 *  PERSONNALISATION FACILE — variables CSS à surcharger dans Bricks /
 *  Advanced Themer / CSS global :
 *
 *   .apb-profil {
 *       --apbp-primary:       #185FA5;   Couleur principale (hero, liens)
 *       --apbp-primary-dk:    #0C447C;   Hover couleur principale
 *       --apbp-accent:        #E6892A;   Bouton CTA principal
 *       --apbp-accent-dk:     #C96F15;   Hover CTA
 *       --apbp-hero-bg:       linear-gradient(135deg, #185FA5 0%, #0C447C 100%);
 *       --apbp-card-radius:   16px;      Arrondi des cartes
 *       --apbp-card-shadow:   0 4px 18px rgba(0,0,0,.09);
 *       --apbp-font:          system-ui, sans-serif;
 *       --apbp-font-size:     15px;
 *       --apbp-star-color:    #F59E0B;   Couleur des étoiles
 *       --apbp-chip-bg:       #EBF3FB;   Fond chips catégorie/méta
 *       --apbp-chip-color:    #185FA5;   Texte chips
 *       --apbp-service-bg:    #F0FDF4;   Fond chips service
 *       --apbp-service-color: #15803D;   Texte chips service
 *   }
 * ═══════════════════════════════════════════════════════════════════════════
 *
 * @package AnnuairePro
 */

/* =========================================================================
   Variables CSS par défaut (toutes surchargeables via Bricks / CSS global)
   ========================================================================= */
.apb-profil {
    /* Couleurs */
    --apbp-primary:          #185FA5;
    --apbp-primary-dk:       #0C447C;
    --apbp-accent:           #E6892A;
    --apbp-accent-dk:        #C96F15;
    --apbp-text:             #1A1A2E;
    --apbp-muted:            #6B7280;
    --apbp-border:           #E2E6EA;
    --apbp-surface:          #FFFFFF;
    --apbp-bg:               #F7F8FA;
    --apbp-success:          #047857;   /* WCAG AA */
    --apbp-wa-color:         #25D366;

    /* Hero */
    --apbp-hero-bg:          linear-gradient(135deg, #185FA5 0%, #0C447C 100%);
    --apbp-hero-text:        #FFFFFF;
    --apbp-hero-muted:       rgba(255,255,255,.75);
    --apbp-hero-border:      rgba(255,255,255,.18);

    /* Cartes */
    --apbp-card-bg:          #FFFFFF;
    --apbp-card-radius:      16px;
    --apbp-card-shadow:      0 2px 12px rgba(0,0,0,.07), 0 1px 3px rgba(0,0,0,.05);
    --apbp-card-shadow-hover:0 6px 24px rgba(0,0,0,.11);
    --apbp-card-padding:     28px;

    /* Typo */
    --apbp-font:             system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --apbp-font-size:        15px;
    --apbp-line-height:      1.65;

    /* Étoiles */
    --apbp-star-color:       #F59E0B;
    --apbp-star-empty:       #D1D5DB;

    /* Chips méta */
    --apbp-chip-bg:          rgba(255,255,255,.18);
    --apbp-chip-color:       #FFFFFF;
    --apbp-chip-border:      rgba(255,255,255,.3);
    /* Chips dans les cards (hors hero) */
    --apbp-chip-card-bg:     #EBF3FB;
    --apbp-chip-card-color:  #185FA5;
    --apbp-chip-cat-bg:      #185FA5;
    --apbp-chip-cat-color:   #FFFFFF;
    --apbp-service-bg:       #F0FDF4;
    --apbp-service-color:    #15803D;
    --apbp-service-border:   #BBF7D0;

    /* Disponibilités */
    --apbp-dispo-on-bg:      #D1FAE5;
    --apbp-dispo-on-color:   #065F46;
    --apbp-dispo-off-bg:     #F3F4F6;
    --apbp-dispo-off-color:  #9CA3AF;

    /* Mise en page */
    --apbp-gap:              24px;
    --apbp-transition:       .18s ease;

    /* Application */
    box-sizing: border-box;
    font-family: var(--apbp-font);
    font-size:   var(--apbp-font-size);
    line-height: var(--apbp-line-height);
    color:       var(--apbp-text);
    background:  var(--apbp-bg);
    border-radius: var(--apbp-card-radius);
    overflow:    hidden;
}
.apb-profil * { box-sizing: border-box; }

/* =========================================================================
   HERO
   ========================================================================= */
.apb-profil__hero {
    background:  var(--apbp-hero-bg);
    color:       var(--apbp-hero-text);
    padding:     40px 32px 36px;
}
.apb-profil__hero-inner {
    display:     flex;
    gap:         28px;
    align-items: flex-start;
    max-width:   1100px;
    margin:      0 auto;
}

/* Colonne avatar */
.apb-profil__avatar-col {
    flex-shrink: 0;
    position:    relative;
    width:       110px;
}

/* Override taille lg pour le hero */
.apb-profil__avatar-col .apb-avatar--lg,
.apb-profil__avatar-col .apb-avatar {
    width:          110px;
    height:         110px;
    border-radius:  50%;
    border:         3px solid rgba(255,255,255,.6);
    box-shadow:     0 4px 16px rgba(0,0,0,.25);
    font-size:      36px;
    background:     rgba(255,255,255,.15);
    color:          #fff;
}
.apb-profil__avatar-col .apb-avatar__img {
    width:          100%;
    height:         100%;
    object-fit:     cover;
    border-radius:  50%;
}
.apb-profil__premium-badge {
    position:       absolute;
    bottom:         -4px;
    right:          -4px;
    background:     var(--apbp-accent);
    color:          #fff;
    font-size:      11px;
    font-weight:    700;
    padding:        3px 7px 3px 5px;
    border-radius:  20px;
    display:        flex;
    align-items:    center;
    gap:            3px;
    border:         2px solid #fff;
    white-space:    nowrap;
}

/* Infos principales */
.apb-profil__hero-info {
    flex:           1;
    min-width:      0;
}
.apb-profil__nom {
    font-size:      clamp(22px, 3vw, 30px);
    font-weight:    800;
    color:          var(--apbp-hero-text);
    margin:         0 0 4px;
    line-height:    1.2;
    letter-spacing: -.3px;
}
.apb-profil__slogan {
    font-size:      15px;
    color:          var(--apbp-hero-muted);
    margin:         0 0 12px;
    font-style:     italic;
}

/* Chips méta dans le hero */
.apb-profil__meta-chips {
    display:        flex;
    flex-wrap:      wrap;
    gap:            7px;
    margin-bottom:  14px;
}
.apb-profil__meta-chips .apb-chip {
    background:     var(--apbp-chip-bg);
    color:          var(--apbp-chip-color);
    border:         1px solid var(--apbp-chip-border);
    font-size:      12.5px;
    font-weight:    600;
    padding:        4px 10px;
    border-radius:  20px;
    display:        inline-flex;
    align-items:    center;
    gap:            5px;
    -webkit-font-smoothing: antialiased;
}
.apb-profil__meta-chips .apb-chip--cat {
    background:     rgba(255,255,255,.35);
    border-color:   rgba(255,255,255,.5);
    font-weight:    700;
}
.apb-profil__meta-chips .apb-chip--clientele {
    background:     rgba(230,137,42,.25);
    border-color:   rgba(230,137,42,.5);
    font-weight:    600;
}

/* Rating */
.apb-profil__rating-row {
    display:        flex;
    align-items:    center;
    gap:            8px;
    margin-bottom:  12px;
    flex-wrap:      wrap;
}
.apb-stars {
    display:        inline-flex;
    gap:            2px;
}
.apb-star {
    font-size:      18px;
    line-height:    1;
}
.apb-star--full  { color: var(--apbp-star-color); }
.apb-star--half  { color: var(--apbp-star-color); opacity: .6; }
.apb-star--empty { color: var(--apbp-star-empty); filter: brightness(2); }

.apb-profil__note-val {
    font-size:  16px;
    font-weight:700;
    color:      var(--apbp-hero-text);
}
.apb-profil__avis-link {
    font-size:  13px;
    color:      var(--apbp-hero-muted);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color var(--apbp-transition);
}
.apb-profil__avis-link:hover { color: #fff; }
.apb-profil__avis-link--empty { text-decoration: none; font-style: italic; }

/* Badges dans le hero */
.apb-profil__hero-badges {
    display:        flex;
    flex-wrap:      wrap;
    gap:            7px;
    margin-top:     4px;
}

/* CTA column */
.apb-profil__hero-cta {
    flex-shrink:    0;
    display:        flex;
    flex-direction: column;
    gap:            10px;
    min-width:      190px;
    max-width:      220px;
    align-items:    stretch;
}

/* Boîte tarif */
.apb-profil__tarif-box {
    background:     rgba(255,255,255,.15);
    border:         1px solid rgba(255,255,255,.25);
    border-radius:  12px;
    padding:        12px 16px;
    text-align:     center;
    backdrop-filter:blur(6px);
}
.apb-profil__tarif-label {
    display:        block;
    font-size:      11px;
    font-weight:    600;
    color:          var(--apbp-hero-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom:  2px;
}
.apb-profil__tarif-price {
    font-size:      28px;
    font-weight:    800;
    color:          #fff;
    line-height:    1.1;
}
.apb-profil__tarif-price small {
    font-size:      15px;
    font-weight:    600;
    opacity:        .8;
}
.apb-profil__tarif-max {
    display:        block;
    font-size:      11px;
    color:          var(--apbp-hero-muted);
    margin-top:     3px;
}
.apb-profil__tarif-box--devis {
    display:        flex;
    align-items:    center;
    justify-content:center;
    gap:            7px;
    font-weight:    700;
    font-size:      15px;
    color:          #fff;
}

/* Boutons hero */
.apb-profil__btn-contact,
.apb-profil__btn-tel,
.apb-profil__btn-wa {
    width:          100%;
    justify-content:center;
    border-radius:  10px;
    font-size:      14px;
}
.apb-profil__btn-contact {
    padding:        13px 16px;
    font-size:      15px;
}
.apb-profil__btn-tel {
    color:          #fff !important;
    border-color:   rgba(255,255,255,.5) !important;
    background:     rgba(255,255,255,.12);
    backdrop-filter:blur(4px);
}
.apb-profil__btn-tel:hover {
    background:     rgba(255,255,255,.22);
    border-color:   #fff !important;
}
.apb-profil__btn-wa {
    background:     var(--apbp-wa-color);
    color:          #fff !important;
    border-color:   var(--apbp-wa-color);
    font-weight:    700;
}
.apb-profil__btn-wa:hover { background: #1da851; filter: brightness(1.05); }

/* =========================================================================
   CORPS 2 COLONNES
   ========================================================================= */
.apb-profil__body {
    display:        grid;
    grid-template-columns: 1fr 340px;
    gap:            var(--apbp-gap);
    padding:        28px 24px 40px;
    max-width:      1100px;
    margin:         0 auto;
    align-items:    start;
}

/* =========================================================================
   CARTES (main + sidebar)
   ========================================================================= */
.apb-profil__card {
    background:     var(--apbp-card-bg);
    border-radius:  var(--apbp-card-radius);
    box-shadow:     var(--apbp-card-shadow);
    padding:        var(--apbp-card-padding);
    transition:     box-shadow var(--apbp-transition);
    border:         1px solid var(--apbp-border);
    overflow:       hidden;
}
.apb-profil__card + .apb-profil__card { margin-top: var(--apbp-gap); }
.apb-profil__main .apb-profil__card:hover,
.apb-profil__sidebar .apb-profil__card:hover {
    box-shadow: var(--apbp-card-shadow-hover);
}
.apb-profil__card--admin {
    border-left:    4px solid var(--apbp-primary);
    background:     #EBF3FB;
}

/* Titre de carte */
.apb-profil__card-title {
    font-size:      var(--apbp-title-size, 18px);
    font-weight:    var(--apbp-title-weight, 700);
    color:          var(--apbp-text);
    margin:         0 0 18px;
    display:        flex;
    align-items:    center;
    gap:            8px;
    padding-bottom: 14px;
    border-bottom:  2px solid var(--apbp-border);
    line-height:    1.3;
}
.apb-profil__card-title svg {
    color:          var(--apbp-primary);
    flex-shrink:    0;
}

/* Sidebar sticky (formulaire contact) */
.apb-profil__card--sticky {
    position:       sticky;
    top:            20px;
    background:     var(--apbp-contact-bg, var(--apbp-primary));
    border-color:   var(--apbp-primary-dk);
    color:          var(--apbp-contact-text, #fff);
    border-radius:  var(--apbp-contact-radius, var(--apbp-card-radius, 16px));
    padding:        var(--apbp-contact-padding, var(--apbp-card-padding, 28px));
    overflow:       visible;
}
.apb-profil__card--sticky .apb-profil__card-title {
    color:          #fff;
    border-bottom-color: rgba(255,255,255,.2);
}
.apb-profil__card--sticky .apb-profil__card-title svg {
    color:          rgba(255,255,255,.8);
}

/* =========================================================================
   SECTION DESCRIPTION
   ========================================================================= */
.apb-profil__description {
    color:          var(--apbp-text);
    line-height:    1.8;
    font-size:      15px;
}
.apb-profil__description p { margin: 0 0 1em; }
.apb-profil__description p:last-child { margin: 0; }

/* =========================================================================
   CHIPS — Services
   ========================================================================= */
.apb-profil__service-chips {
    display:        flex;
    flex-wrap:      wrap;
    gap:            8px;
}
.apb-chip {
    display:        inline-flex;
    align-items:    center;
    gap:            5px;
    padding:        5px 12px;
    border-radius:  20px;
    font-size:      13px;
    font-weight:    600;
    line-height:    1;
    white-space:    nowrap;
    transition:     transform var(--apbp-transition), box-shadow var(--apbp-transition);
}
.apb-chip--service {
    background:     var(--apbp-service-bg);
    color:          var(--apbp-service-color);
    border:         1px solid var(--apbp-service-border);
}
.apb-chip--service:hover {
    transform:      translateY(-1px);
    box-shadow:     0 3px 8px rgba(0,0,0,.1);
}

/* =========================================================================
   DISPONIBILITÉS
   ========================================================================= */
.apb-dispos {
    display:        flex;
    gap:            6px;
    flex-wrap:      wrap;
}
.apb-dispo-chip {
    display:        inline-flex;
    align-items:    center;
    justify-content:center;
    width:          44px;
    height:         36px;
    border-radius:  8px;
    font-size:      12px;
    font-weight:    700;
    transition:     transform var(--apbp-transition);
}
.apb-dispo-chip--on {
    background:     var(--apbp-dispo-on-bg);
    color:          var(--apbp-dispo-on-color);
    border:         1.5px solid rgba(5,150,105,.2);
}
.apb-dispo-chip--off {
    background:     var(--apbp-dispo-off-bg);
    color:          var(--apbp-dispo-off-color);
    border:         1.5px solid var(--apbp-border);
}

/* =========================================================================
   LISTE INFOS PRATIQUES
   ========================================================================= */
.apb-profil__info-list {
    list-style:     none;
    padding:        0;
    margin:         0;
    display:        flex;
    flex-direction: column;
    gap:            10px;
}
.apb-profil__info-list li {
    display:        flex;
    gap:            10px;
    align-items:    flex-start;
    font-size:      14px;
    line-height:    1.3;
}
.apb-info-icon {
    font-size:      16px;
    flex-shrink:    0;
    width:          22px;
    text-align:     center;
    margin-top:     1px;
}
.apb-profil__info-list strong {
    display:        block;
    font-size:      11px;
    font-weight:    700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color:          var(--apbp-muted);
    margin-bottom:  0;
    line-height:    1.2;
}
.apb-profil__info-link {
    color:          var(--apbp-primary);
    text-decoration:none;
    font-weight:    600;
    transition:     color var(--apbp-transition);
}
.apb-profil__info-link:hover { color: var(--apbp-primary-dk); text-decoration: underline; }

/* =========================================================================
   SCORE ADMIN
   ========================================================================= */
.apb-profil__score { display: flex; align-items: center; gap: 12px; }
.apb-score-bar {
    flex:           1;
    height:         8px;
    background:     var(--apbp-border);
    border-radius:  4px;
    overflow:       hidden;
}
.apb-score-bar__fill {
    height:         100%;
    background:     var(--apbp-primary);
    border-radius:  4px;
    transition:     width .5s ease;
}
.apb-score-bar__label {
    font-size:      13px;
    font-weight:    700;
    color:          var(--apbp-primary);
    white-space:    nowrap;
}

/* =========================================================================
   GALERIE — ajustements dans le contexte profil
   ========================================================================= */
.apb-profil__card .apb-galerie {
    margin-top:     4px;
}
.apb-profil__card .apb-galerie__item {
    border-radius:  10px;
    overflow:       hidden;
    aspect-ratio:   4/3;
    display:        block;
}
.apb-profil__card .apb-galerie__img {
    width:          100%;
    height:         100%;
    object-fit:     cover;
    transition:     transform .3s ease;
}
.apb-profil__card .apb-galerie__item:hover .apb-galerie__img {
    transform:      scale(1.04);
}

/* =========================================================================
   FORMULAIRE CONTACT (dans la sidebar bleue)
   ========================================================================= */

/* Rendre le wrapper du formulaire transparent (il a souvent background:white) */
.apb-profil__card--sticky .apb-contact-form,
.apb-profil__card--sticky .apb-contact-form__form,
.apb-profil__card--sticky form {
    background:  transparent !important;
    box-shadow:  none !important;
    border:      none !important;
    padding:     0 !important;
    margin:      0 !important;
}

/* Labels blancs */
.apb-profil__card--sticky .apb-contact-form label,
.apb-profil__card--sticky .apb-contact-form .apb-form__field label,
.apb-profil__card--sticky .apb-form__label {
    color:       rgba(255,255,255,.85) !important;
    font-size:   13px;
    font-weight: 600;
    display:     block;
    margin-bottom: 4px;
}

/* Espacement entre champs */
.apb-profil__card--sticky .apb-form__field {
    margin-bottom: 12px !important;
}
.apb-profil__card--sticky .apb-contact-form input,
.apb-profil__card--sticky .apb-contact-form textarea,
.apb-profil__card--sticky .apb-contact-form select {
    background:     rgba(255,255,255,.12) !important;
    border-color:   rgba(255,255,255,.3) !important;
    color:          #fff !important;
    border-radius:  8px;
}
.apb-profil__card--sticky .apb-contact-form input::placeholder,
.apb-profil__card--sticky .apb-contact-form textarea::placeholder {
    color: rgba(255,255,255,.45) !important;
}
.apb-profil__card--sticky .apb-contact-form input:focus-visible,
.apb-profil__card--sticky .apb-contact-form textarea:focus-visible {
    background:     rgba(255,255,255,.2) !important;
    border-color:   rgba(255,255,255,.6) !important;
    outline:        none;
    box-shadow:     0 0 0 3px rgba(255,255,255,.15) !important;
}
.apb-profil__card--sticky .apb-btn--primary,
.apb-profil__card--sticky .apb-contact-form [type="submit"] {
    background:     var(--apbp-accent) !important;
    border-color:   var(--apbp-accent) !important;
    color:          #fff !important;
    width:          100%;
    white-space:    normal !important;
    word-break:     break-word;
    text-align:     center;
    overflow:       hidden;
    text-overflow:  ellipsis;
    max-width:      100%;
}
.apb-profil__card--sticky .apb-btn--primary:hover,
.apb-profil__card--sticky .apb-contact-form [type="submit"]:hover {
    background:     var(--apbp-accent-dk) !important;
}

/* =========================================================================
   LEAFLET MAP dans le profil
   ========================================================================= */
.apb-profil__card .apb-map-container,
.apb-profil__card #apb-map {
    border-radius:  10px;
    overflow:       hidden;
    margin-top:     4px;
    height:         220px !important;
}

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 900px) {
    .apb-profil__body {
        grid-template-columns: 1fr;
        padding: 20px 16px 32px;
    }
    /* Sidebar passe sous la colonne principale */
    .apb-profil__card--sticky {
        position: static;
    }
}

@media (max-width: 700px) {
    .apb-profil__hero {
        padding: 28px 20px 24px;
    }
    .apb-profil__hero-inner {
        flex-wrap: wrap;
        gap: 18px;
    }
    .apb-profil__hero-cta {
        width: 100%;
        max-width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
    }
    .apb-profil__btn-contact { flex: 1 0 100%; }
    .apb-profil__btn-tel,
    .apb-profil__btn-wa     { flex: 1; }
    .apb-profil__tarif-box  { width: 100%; }

    .apb-profil__nom { font-size: 22px; }
    .apb-profil__card { padding: 20px 18px; }
    .apb-profil__card-title { font-size: 16px; }
}

@media (max-width: 480px) {
    .apb-profil__hero-inner { gap: 14px; }
    .apb-profil__avatar-col { width: 80px; }
    .apb-profil__avatar-col .apb-avatar { width: 80px; height: 80px; font-size: 26px; }
    .apb-profil__card { padding: 16px 14px; }
    .apb-dispo-chip { width: 38px; height: 32px; font-size: 11px; }
    /* Fix débordement texte mobile */
    .apb-profil__info-list li { font-size: 14px; }
    .apb-profil__info-list strong { font-size: 11px; }
    .apb-profil__meta-chips .apb-chip { font-size: 11.5px; padding: 4px 8px; }
    .apb-profil__nom { font-size: 20px; }
}

/* Anti-débordement global profil */
.apb-profil { overflow-x: hidden; max-width: 100vw; }
.apb-profil__body { overflow-x: hidden; padding-left: 16px; padding-right: 16px; }
.apb-profil__info-list li span { overflow-wrap: break-word; word-break: break-word; min-width: 0; }
.apb-profil__card { overflow: hidden; }
.apb-profil__hero-cta { overflow: hidden; }
/* Fix chips catégories débordement mobile */
.apb-profil__meta-chips { flex-wrap: wrap; max-width: 100%; }
.apb-profil__meta-chips .apb-chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apb-profil__hero-meta { max-width: 100%; overflow: hidden; }
@media (max-width: 480px) {
    .apb-profil__body { padding-left: 12px; padding-right: 12px; }
    /* Tarif box — réduire font-size sur mobile */
    .apb-profil__tarif-price { font-size: 22px; }
    .apb-profil__tarif-price small { font-size: 13px; }
    /* Hero CTA — boutons empilés */
    .apb-profil__hero-cta .apb-profil__btn-contact,
    .apb-profil__hero-cta .apb-profil__btn-tel,
    .apb-profil__hero-cta .apb-profil__btn-wa,
    .apb-profil__hero-cta .apb-profil__btn-fav {
        width: 100%;
        justify-content: center;
    }
}

/* ── 360px — ultra-petits écrans ── */
@media (max-width: 360px) {
    .apb-profil__nom { font-size: 18px; }
    .apb-profil__tarif-price { font-size: 20px; }
    .apb-profil__avatar-col { width: 64px; }
    .apb-profil__avatar-col .apb-avatar { width: 64px; height: 64px; font-size: 22px; }
}
