/* productaiadvice v1.1.1 — structure + popup fidèle à la démo */

.productaiadvice-wrap {
    display:  inline-flex;
    vertical-align: top;
    overflow: visible;
}

/* ---------------------------------------------------------- */
/*  Bouton icône                                               */
/* ---------------------------------------------------------- */
.paia-icon-btn {
    display:        flex;
    flex-direction: column;
    align-items:    center;
    gap:            10px;
    max-width:      115px;
    text-align:     center;
    cursor:         pointer;
    position:       relative;
}

.paia-circle {
    width:           78px;
    height:          78px;
    display:         flex;
    align-items:     center;
    justify-content: center;
    flex-shrink:     0;
    /* pas de bordure ni de fond — l'image occupe tout l'espace */
}

.paia-circle svg {
    width:      48px;
    height:     48px;
    transition: fill .25s, opacity .25s;
}

/* Image uploadée : remplit les dimensions du cercle */
.paia-icon-img {
    width:      78px;
    height:     78px;
    object-fit: contain;
    transition: opacity .25s;
}

.paia-icon-btn:hover .paia-icon-img,
.paia-icon-btn.paia-active .paia-icon-img {
    opacity: .8;
}

.paia-label {
    font-size:   11.5px;
    font-weight: bold;
    line-height: 1.35;
}

/* ---------------------------------------------------------- */
/*  Popup — fidèle à la démo                                  */
/* ---------------------------------------------------------- */
.paia-popup {
    display:       none;
    position:      absolute;
    bottom:        calc(100% + 16px);
    left:          50%;
    transform:     translateX(-50%);
    width:         315px;
    border:        2px solid transparent;
    border-radius: 12px;
    padding:       14px 16px;
    box-shadow:    0 8px 30px rgba(0,0,0,.18);
    z-index:       99999;
    text-align:    left;
}

.paia-popup.paia-visible { display: block; }

/* Flèche double-bordure — même valeurs que la démo (8/7, -1px) */
.paia-popup::after {
    content:   '';
    position:  absolute;
    top:       100%;
    left:      50%;
    transform: translateX(-50%);
    border:    8px solid transparent;
}

.paia-popup::before {
    content:    '';
    position:   absolute;
    top:        100%;
    left:       50%;
    transform:  translateX(-50%);
    border:     6px solid transparent;
    z-index:    1;
    margin-top: -1px;
}

/* ---------------------------------------------------------- */
/*  En-tête popup                                              */
/* ---------------------------------------------------------- */
.paia-popup-header {
    display:        flex;
    align-items:    center;
    gap:            7px;
    padding-bottom: 9px;
    margin-bottom:  10px;
    border-bottom:  1px solid #f0e6e0;   /* séparateur doux, fixe */
}

.paia-popup-header svg {
    width:       15px;
    height:      15px;
    flex-shrink: 0;
}

/* Petite image dans l'en-tête popup */
.paia-icon-img-sm {
    width:      15px;
    height:     15px;
    object-fit: contain;
    flex-shrink: 0;
}

.paia-popup-header span {
    font-size:   12px;
    font-weight: bold;
}

/* Badge modèle — à droite, style démo */
.paia-model-tag {
    font-size:   10px;
    color:       #bbb;
    margin-left: auto;
    font-style:  italic;
    font-weight: normal;
    white-space: nowrap;
}

/* ---------------------------------------------------------- */
/*  Corps popup                                                */
/* ---------------------------------------------------------- */
.paia-popup-body {
    font-size:   13px;
    line-height: 1.65;
    color:       #444;
}

/* Chargement */
.paia-loading {
    display:     flex;
    align-items: center;
    gap:         9px;
    font-size:   12.5px;
}

.paia-spinner {
    width:         15px;
    height:        15px;
    flex-shrink:   0;
    border:        2px solid rgba(0,0,0,.12);
    border-top-color: transparent;
    border-radius: 50%;
    animation:     paia-spin .75s linear infinite;
}

@keyframes paia-spin { to { transform: rotate(360deg); } }

.paia-error {
    color:      #c0392b;
    font-size:  12px;
    font-style: italic;
}

/* ---------------------------------------------------------- */
/*  Mobile : popup en dessous                                  */
/* ---------------------------------------------------------- */
@media (max-width: 767px) {
    .paia-popup {
        bottom: auto;
        top:    calc(100% + 12px);
        width:  270px;
    }
    .paia-popup::after  {
        top:              auto;
        bottom:           100%;
        border-top-color: transparent !important;
    }
    .paia-popup::before {
        top:              auto;
        bottom:           100%;
        border-top-color: transparent !important;
        margin-top:       0;
        margin-bottom:    -1px;
    }
}
