/* ==========================================================================
   Pop-up « Appeler le vendeur » des cartes annonce (partials/car-card-listing.blade.php)
   Ouvert par js/car-card-listing.js au clic sur le bouton téléphone d'une carte.
   ========================================================================== */
html.tv-call-open {
    overflow: hidden;
}

/* Le thème fixe couleur et taille sur tous les éléments (* { color; font-size }) : ici tout hérite */
.tv-call * {
    color: inherit;
    font-size: inherit;
}

.tv-call {
    width: min(380px, calc(100% - 32px));
    max-width: none;
    margin: auto; /* le thème met * { margin: 0 } : on rétablit le centrage du <dialog> */
    padding: 0;
    border: 0;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 24px 64px rgba(15, 23, 42, .28);
    color: #334155;
    font-family: inherit;
}

.tv-call[open] {
    animation: tv-call-in .2s ease-out;
}

.tv-call::backdrop {
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(3px);
}

@keyframes tv-call-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(.98);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.tv-call__box {
    position: relative;
    padding: 28px 24px 24px;
    text-align: center;
}

.tv-call__close {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f1f5f9;
    color: #0f172a;
    cursor: pointer;
    transition: background-color .2s ease;
}

.tv-call__close:hover {
    background: #e2e8f0;
}

.tv-call__close svg {
    width: 18px;
    height: 18px;
}

.tv-call__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: 14px;
    border-radius: 50%;
    background: rgba(var(--primary-color-rgb, 152, 188, 42), .14);
    color: var(--primary-color, #98bc2a);
}

.tv-call__icon svg {
    width: 26px;
    height: 26px;
}

.tv-call .tv-call__title {
    margin: 0 0 4px;
    color: #0f172a;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
}

.tv-call .tv-call__car {
    margin: 0 0 18px;
    overflow: hidden;
    color: #64748b;
    font-size: .85rem;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tv-call .tv-call__number {
    display: block;
    margin: 0 0 18px;
    padding: 14px 12px;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    color: #0f172a;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: .04em;
    line-height: 1.2;
    user-select: all;
}

.tv-call.is-loading .tv-call__number {
    color: #94a3b8;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0;
}

.tv-call.is-error .tv-call__number {
    border-color: #fecaca;
    background: #fef2f2;
    color: #b91c1c;
    font-size: .95rem;
    font-weight: 600;
    letter-spacing: 0;
}

.tv-call__actions {
    display: grid;
    gap: 8px;
}

.tv-call .tv-call__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: .95rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}

.tv-call__btn svg {
    width: 18px;
    height: 18px;
}

.tv-call .tv-call__btn--call {
    background: var(--primary-color, #98bc2a);
    color: #fff;
}

.tv-call .tv-call__btn--call:hover {
    filter: brightness(.92);
    color: #fff;
}

/* Tant que le numéro n'est pas chargé : bouton d'appel inactif */
.tv-call.is-loading .tv-call__btn--call,
.tv-call.is-error .tv-call__btn--call {
    opacity: .5;
    pointer-events: none;
}

.tv-call .tv-call__btn--copy {
    border-color: #e2e8f0;
    background: #fff;
    color: #0f172a;
}

.tv-call .tv-call__btn--copy:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.tv-call.is-loading .tv-call__btn--copy,
.tv-call.is-error .tv-call__btn--copy {
    display: none;
}

.tv-call .tv-call__note {
    margin: 14px 0 0;
    color: #94a3b8;
    font-size: .75rem;
    line-height: 1.4;
}

@media (max-width: 575px) {
    /* Panneau collé en bas de l'écran sur mobile */
    .tv-call {
        width: 100%;
        margin: auto 0 0;
        border-radius: 18px 18px 0 0;
    }

    .tv-call[open] {
        animation-name: tv-call-sheet;
    }

    .tv-call__box {
        padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    }
}

@keyframes tv-call-sheet {
    from {
        transform: translateY(100%);
    }

    to {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tv-call[open] {
        animation: none;
    }
}

/* Autres numéros de l'annonce (fixe) */
.tv-call__others {
    margin: 16px 0 0;
    padding-top: 14px;
    border-top: 1px solid #e2e8f0;
    text-align: left;
}

.tv-call__others[hidden] {
    display: none;
}

.tv-call .tv-call__others-title {
    margin: 0 0 8px;
    color: #64748b;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.tv-call__others ul {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tv-call__others li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.tv-call__others li span {
    color: #64748b;
    font-size: .85rem;
    font-weight: 600;
}

.tv-call .tv-call__others li a {
    color: #0f172a;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
}

.tv-call .tv-call__others li a:hover {
    color: var(--primary-color, #98bc2a);
}
