/* Estimation du prix sur les cartes d'annonces : complète pour un utilisateur connecté à son compte client,
   message « Connectez-vous… » pour les autres (.tv-lcar__estimate--login).
   CarListingEstimate, colonnes estimated_* (partials/car-card-listing.blade.php). Placée avant la ville et les boutons.
   2 lignes : libellé + montant + badge (fiabilité + écart), puis barre dégradée avec curseur au prix affiché.
   Couleurs du site (--primary-color, --primary-color-rgb) ; rouge / vert / gris seulement pour le verdict. */
.tv-lcar__estimate {
    margin: 0 0 10px;
    padding: 10px 12px 9px;
    border: 1px solid rgba(var(--primary-color-rgb, 130, 180, 64), .18);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(var(--primary-color-rgb, 130, 180, 64), .1) 0%, rgba(var(--primary-color-rgb, 130, 180, 64), .03) 100%);
    color: var(--heading-color, #050b20);
    font-size: 12px;
    line-height: 1.3;
    container-type: inline-size;
}

/* Pages liste et accueil : car-list.css / home.css imposent « * { font-size: 16px; line-height: 26px } » */
.tv-lcar__estimate * {
    font-size: inherit;
    line-height: inherit;
}

.tv-lcar__estimate svg {
    flex: none;
}

/* Texte pour les lecteurs d'écran (la classe Bootstrap est retirée des CSS allégés) */
.tv-lcar__estimate .visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.tv-lcar__estimate-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

/* Ligne 1 : ↗ PRIX DU MARCHÉ ESTIMÉ  97 000 DH ............ [▂▄▆ +34 %] */
.tv-lcar__estimate-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #4a7a1c;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
    white-space: nowrap;
}

.tv-lcar__estimate-label svg {
    width: 15px;
    height: 15px;
    color: var(--primary-color, #82b440);
}

.tv-lcar__estimate-price {
    margin-right: auto;
    color: var(--heading-color, #050b20);
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -.01em;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Badge : fiabilité (barres) + écart. Plus cher (rouge), moins cher (vert du site), dans la moyenne (gris) */
.tv-lcar__estimate-gap {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.tv-lcar__estimate-gap.is-high {
    background: #fde8e7;
    color: #c4320a;
}

.tv-lcar__estimate-gap.is-low {
    background: rgba(var(--primary-color-rgb, 130, 180, 64), .18);
    color: #3f6b14;
}

.tv-lcar__estimate-gap.is-fair {
    background: rgba(255, 255, 255, .75);
    color: #344054;
}

/* Fiabilité : 3 barres de hauteur croissante, remplies selon le niveau */
.tv-lcar__estimate-dots {
    display: inline-flex;
    align-items: flex-end;
    gap: 1px;
    height: 11px;
}

.tv-lcar__estimate-dots i {
    display: block;
    width: 3px;
    border-radius: 1px;
    background: currentColor;
    opacity: .25;
}

.tv-lcar__estimate-dots i:nth-child(1) { height: 5px; }
.tv-lcar__estimate-dots i:nth-child(2) { height: 8px; }
.tv-lcar__estimate-dots i:nth-child(3) { height: 11px; }

.tv-lcar__estimate-dots.is-level-1 i:nth-child(-n+1),
.tv-lcar__estimate-dots.is-level-2 i:nth-child(-n+2),
.tv-lcar__estimate-dots.is-level-3 i:nth-child(-n+3) {
    background: #f79009;
    opacity: 1;
}

/* Ligne 2 : 82 000 DH  [══════●══════]  107 000 DH */
.tv-lcar__estimate-scale {
    margin-top: 8px;
    color: #475467;
    font-size: 10.5px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.tv-lcar__estimate-bar {
    position: relative;
    flex: 1;
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(var(--primary-color-rgb, 130, 180, 64), .25) 0%, var(--primary-color, #82b440) 100%);
}

/* Curseur : prix affiché */
.tv-lcar__estimate-marker {
    position: absolute;
    top: 50%;
    left: var(--price);
    width: 14px;
    height: 14px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: var(--primary-color, #82b440);
    box-shadow: 0 1px 4px rgba(16, 24, 40, .25);
    transform: translate(-50%, -50%);
}

/* Bloc étroit (petits téléphones) : le libellé passe seul sur la première ligne */
@container (max-width: 290px) {
    .tv-lcar__estimate-row:not(.tv-lcar__estimate-scale) {
        flex-wrap: wrap;
        row-gap: 2px;
    }

    .tv-lcar__estimate-label {
        flex-basis: 100%;
    }
}

/* Non connecté : une ligne cliquable vers la connexion, au-dessus du lien qui couvre la carte */
.tv-lcar__estimate--login {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #3f6b14;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: border-color .2s ease, background-color .2s ease;
}

.tv-lcar__estimate--login span {
    flex: 1;
    min-width: 0;
    /* car-list.css / home.css : « * { color: #1c1c1c; font-weight: 400 } » */
    color: inherit;
    font-weight: inherit;
}

.tv-lcar__estimate--login svg {
    width: 15px;
    height: 15px;
    color: var(--primary-color, #82b440);
}

.tv-lcar__estimate--login svg:last-child {
    width: 14px;
    height: 14px;
    transition: transform .2s ease;
}

.tv-lcar__estimate--login:hover,
.tv-lcar__estimate--login:focus-visible {
    border-color: rgba(var(--primary-color-rgb, 130, 180, 64), .45);
    background: rgba(var(--primary-color-rgb, 130, 180, 64), .14);
    color: #2f5410;
}

.tv-lcar__estimate--login:hover svg:last-child {
    transform: translateX(2px);
}
