/* Carrossel dos cards de empresa (company-inner), coração de favoritar,
   avaliações internas (google-rating: clamp, histograma, fotos, lightbox).
   Extraído de v2/layouts/main.blade.php — vivia inline no <head> porque
   dentro do root Vue das páginas <style>/<script> são engolidos. */

.card-carousel-wrap { position: relative; overflow: hidden; border-radius: inherit; }
.card-carousel { overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.card-carousel::-webkit-scrollbar { display: none; }
.card-car-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%; border: 0; padding: 0; background: rgba(255,255,255,.92); box-shadow: 0 1px 4px rgba(0,0,0,.3); display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; transition: opacity .15s; z-index: 2; }
.card-car-prev { left: 6px; }
.card-car-next { right: 6px; }
.card-carousel-wrap:hover .card-car-btn { opacity: 1; }
.card-car-btn i { font-size: 18px; color: #333; }
/* Mobile: só as bolinhas de posição (sempre visíveis); sem setas. */
@media (max-width: 767.98px) {
    .card-car-btn { display: none; }
}
.card-car-dots { position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; z-index: 2; pointer-events: none; }
.card-car-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.55); box-shadow: 0 0 2px rgba(0,0,0,.4); }
.card-car-dot.on { background: #fff; }
/* selo ouro/prata (:before sem z-index) acima do carrossel (wrap relative + botões z2) */
.company-card[class*=stamp-]:before { z-index: 3; }
/* main.css fixa .details em image-height+16px; com a linha da avaliação
   o conteúdo estourava o card no mobile — cresce com o conteúdo. */
.company-card .details { height: auto; min-height: calc(var(--image-height) + 16px); }
.company-card .image { align-self: center; }
@media (max-width: 767.98px) {
    .company-card .details { padding-top: 12px; padding-bottom: 12px; }
}
.estrelas-input { display: inline-flex; flex-direction: row-reverse; font-size: 28px; }
.estrelas-input input { display: none; }
.estrelas-input label { color: #d7d7d7; cursor: pointer; padding: 0 2px; }
.estrelas-input input:checked ~ label, .estrelas-input label:hover, .estrelas-input label:hover ~ label { color: #f5a623; }
.estrelas-input--sm { font-size: 18px; }

/* Coração de favoritar: card (canto sup. direito da imagem, mesmo plano
   do selo ouro/prata) e botão maior do detalhe. */
.company-card .image { position: relative; }
.tp-fav-btn {
    position: absolute; top: 6px; right: 6px; z-index: 3; width: 30px; height: 30px;
    border-radius: 50%; border: 0; padding: 0; background: rgba(255,255,255,.85);
    box-shadow: 0 1px 4px rgba(0,0,0,.25); display: flex; align-items: center;
    justify-content: center; cursor: pointer; transition: transform .1s;
}
.tp-fav-btn:hover { transform: scale(1.08); }
.tp-fav-btn i { font-size: 18px; color: #9aa1ab; }
.tp-fav-btn.on i { color: #c51d25; }
.tp-fav-btn-detail {
    display: inline-flex; align-items: center; gap: 8px; border: 1.5px solid #e8b6b8;
    background: #fff; color: #c51d25; border-radius: 10px; padding: 10px 18px;
    font-size: 14.5px; font-weight: 700; cursor: pointer;
    transition: background .12s, color .12s, border-color .12s;
}
.tp-fav-btn-detail:hover { background: #fdf3f3; }
.tp-fav-btn-detail.on { background: #c51d25; color: #fff; border-color: #c51d25; }
.tp-fav-btn-detail--compact { padding: 0; width: 42px; height: 42px; border-radius: 50%; justify-content: center; flex-shrink: 0; }
.tp-fav-btn-detail--compact i { font-size: 20px; }
.tp-fav-btn-detail i { font-size: 18px; }
.tp-avaliar-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fff; color: #c51d25; border: 1.5px solid #e8b6b8;
    padding: 8px 14px; border-radius: 100px;
    font-size: 14px; font-weight: 700; line-height: 1;
    text-decoration: none; white-space: nowrap;
    transition: background .12s, color .12s, border-color .12s;
}
.tp-avaliar-btn:hover { background: #fdf3f3; color: #c51d25; border-color: #d99a9d; }
.tp-avaliar-btn i { font-size: 16px; }

/* Nota média + estrelas ao lado do coração / botão Avaliar. */
.tp-nota-resumo {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 100px;
    padding: 7px 12px; line-height: 1; text-decoration: none; white-space: nowrap;
    transition: border-color .12s;
}
.tp-nota-resumo:hover { border-color: #cbd0d6; }
.tp-nota-resumo__valor { font-size: 15px; font-weight: 700; color: #1f2937; }
.tp-nota-resumo__stars { display: inline-flex; color: #f5a623; font-size: 14px; letter-spacing: -1px; }
.tp-nota-resumo__total { font-size: 12.5px; color: #6b7280; }

/* Mobile: nota + coração + Avaliar saem da linha do nome e viram faixa
   própria, senão o nome da empresa fica com 2 palavras por linha. */
@media (max-width: 767.98px) {
    /* `!important` porque as utilitárias .d-flex/.align-items-end do layout
       já vêm com !important e venceriam estas regras. */
    .tp-header-acoes {
        width: 100%; margin-left: 0 !important; margin-top: 12px;
        flex-direction: row !important; align-items: center !important;
        justify-content: flex-end; gap: 8px;
    }
    /* Dissolve o wrapper de Avaliar+coração (que só existe pro empilhamento
       do desktop) pra que os 3 itens dividam o mesmo gap do pai. */
    .tp-header-acoes > div:last-child {
        display: contents !important;
    }
    /* VIP: nota na esquerda, Avaliar no meio, coração na direita. */
    .tp-acoes-linha {
        justify-content: space-between !important;
    }
    /* Mesma altura nos 3, senão as pílulas (31/35/42px) ficam desencontradas.
       Vale pro header da ficha comum e pra faixa mobile do layout VIP. */
    :is(.tp-header-acoes, .tp-acoes-linha) :is(.tp-nota-resumo, .tp-avaliar-btn, .tp-fav-btn-detail--compact) {
        height: 40px;
    }
    :is(.tp-header-acoes, .tp-acoes-linha) .tp-fav-btn-detail--compact {
        width: 40px;
    }
    /* Nome ocupa a sobra da linha da logo e quebra em várias linhas em vez
       de descer pra baixo dela quando é longo. */
    .tp-header-nome {
        flex: 1 1 0;
        min-width: 0;
    }
    .tp-header-nome h1 {
        overflow-wrap: anywhere;
    }
}

/* Clamp de 10 linhas + "Ver mais" nos cards de avaliação (google-rating.blade.php). */
.gr-text-wrap .gr-more-cb { display: none; }
.gr-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 10;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.gr-more-cb:checked ~ .gr-clamp {
    -webkit-line-clamp: unset;
    overflow: visible;
}
.gr-more-toggle {
    display: none; /* revelado por JS só quando há overflow */
    margin-top: 2px; cursor: pointer; text-align: center;
    color: #c51d25; line-height: 1;
}
.gr-text-wrap.has-overflow .gr-more-toggle { display: block; }
.gr-more-toggle i { font-size: 22px; display: inline-block; transition: transform .15s linear; }
.gr-more-cb:checked ~ .gr-more-toggle i { transform: rotate(180deg); }

/* Breakdown de notas (nota geral + histograma + médias por critério)
   das avaliações internas (google-rating.blade.php). */
.gr-dist-row { gap: 8px; margin-bottom: 6px; }
.gr-dist-label { width: 68px; flex-shrink: 0; }
.gr-dist-count { width: 32px; text-align: right; flex-shrink: 0; }
.gr-dist-track, .gr-crit-track {
    display: block; height: 8px; border-radius: 100px;
    background: #eceff1; overflow: hidden; flex-grow: 1;
}
.gr-dist-fill, .gr-crit-fill {
    display: block; height: 100%; border-radius: 100px;
    background: #1f8a3b;
}
/* Botão pequeno "Editar" dentro do card da própria avaliação. */
.gr-edit-mine {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 12px; font-weight: 700; color: #c51d25;
    text-decoration: none; padding: 3px 8px; border-radius: 100px;
    border: 1px solid #f0c9cb; background: #fdf3f3; line-height: 1;
}
.gr-edit-mine:hover { background: #fdeaea; color: #a5171e; }
.gr-edit-mine i { font-size: 13px; }

/* Chips de subcategorias (HorizontalLinks) no mobile: a lista interna
   é um flex-item dimensionado por max-content, então ignorava a largura
   da coluna e empurrava o scroll horizontal da página. */
@media (max-width: 991.98px) {
    .submenu .horizontal-links { width: 100%; }
    .submenu #horizontal-links-list { flex: 1 1 100%; min-width: 0; }
}

/* Nenhum elemento pode gerar scroll horizontal da página (faixa branca
   lateral no mobile). `clip` (não `hidden`) não cria contexto de scroll,
   então position:sticky e os carrosséis seguem funcionando. */
html, body { overflow-x: clip; }

/* Faixa de fotos das avaliações internas (google-rating.blade.php). */
.gr-foto {
    display: block; width: 100%; aspect-ratio: 1 / 1;
    border-radius: 12px; overflow: hidden; border: 1px solid #e0e0e0;
    cursor: zoom-in;
}
.gr-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Lightbox das fotos dos clientes (overlay vanilla montado no body pelo
   ficha.js; desacoplado do Vue). */
.gr-lb {
    position: fixed; inset: 0; z-index: 2147483000; display: none;
    align-items: center; justify-content: center; background: rgba(0,0,0,.88);
}
.gr-lb.on { display: flex; }
.gr-lb img { max-width: 92vw; max-height: 88vh; object-fit: contain; border-radius: 8px; user-select: none; }
.gr-lb button {
    position: absolute; border: 0; cursor: pointer; color: #fff;
    background: rgba(255,255,255,.14); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.gr-lb button:hover { background: rgba(255,255,255,.28); }
.gr-lb-close { top: 18px; right: 18px; width: 44px; height: 44px; font-size: 26px; line-height: 1; }
.gr-lb-prev, .gr-lb-next { top: 50%; transform: translateY(-50%); width: 50px; height: 50px; }
.gr-lb-prev i, .gr-lb-next i { font-size: 30px; }
.gr-lb-prev { left: 16px; }
.gr-lb-next { right: 16px; }
@media (max-width: 640px) {
    .gr-lb-prev { left: 6px; }
    .gr-lb-next { right: 6px; }
}

/* Pop do coração ao favoritar (estilo Instagram): bounce no ícone + mini
   partículas irradiando do glifo. Os spans .tp-fav-part são criados e
   removidos pelo ficha.js a cada marcação. */
.tp-fav-btn i, .tp-fav-btn-detail i { position: relative; }
.tp-fav-anim i { animation: tp-fav-pop .45s cubic-bezier(.17, .89, .32, 1.49); }
@keyframes tp-fav-pop {
    0% { transform: scale(1); }
    25% { transform: scale(.7); }
    60% { transform: scale(1.35); }
    100% { transform: scale(1); }
}
.tp-fav-part {
    position: absolute; left: 50%; top: 50%; width: 5px; height: 5px;
    margin: -2.5px 0 0 -2.5px; border-radius: 50%; background: #c51d25;
    pointer-events: none; opacity: .9;
    animation: tp-fav-burst .55s ease-out forwards;
}
/* No detalhe o botão fica vermelho quando marcado — partícula branca. */
.tp-fav-btn-detail.on .tp-fav-part { background: #fff; }
@keyframes tp-fav-burst {
    to { transform: translate(var(--tp-dx), var(--tp-dy)) scale(.15); opacity: 0; }
}
