/* Perfil da empresa (pages/empresa.php): camada de refinamento sobre o <style> da página.
   Legibilidade do topo, barra de ações, navegação entre seções, contatos com botões
   de 44 px e contraste mínimo de 4,5:1 nos textos. */

:root {
    --rating-star: #b45309;
    --perfil-verde: #0f7a41;
    --perfil-azul: #0a4fb8;
    --perfil-texto-2: #475569;
}

/* ===== TOPO / CAPA ===== */
.hero-cover .overlay {
    /* escurece a base, onde ficam nome, endereço e nota, seja qual for a capa */
    background: linear-gradient(180deg,
            rgba(8, 12, 28, 0.38) 0%,
            rgba(8, 12, 28, 0.12) 26%,
            rgba(8, 12, 28, 0.58) 60%,
            rgba(8, 12, 28, 0.92) 100%);
}

.hero-info h1 {
    font-weight: 800;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.hero-address,
.hero-address span {
    color: rgba(255, 255, 255, 0.94);
}

.hero-rating .stars i {
    color: #fbbf24;
}

.hero-rating .stars i.empty {
    color: rgba(255, 255, 255, 0.45);
}

.hero-rating,
.hero-rating span {
    color: #fff;
}

.hero-rating .count {
    color: rgba(255, 255, 255, 0.88);
}

.hero-logo {
    background: #fff;
    padding: 6px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.hero-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.badge {
    font-size: 13px;
    border: 1px solid rgba(255, 255, 255, 0.28);
}

.badge-success {
    background: #047857;
    color: #fff;
}

.badge-danger {
    background: #b91c1c;
    color: #fff;
}

/* ===== BARRA DE AÇÕES ===== */
.actions-card {
    justify-content: flex-start;
    gap: 8px;
    padding: 10px;
}

.action-btn {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 12px;
    white-space: nowrap;
}

.action-btn i {
    font-size: 16px;
}

.action-btn--primary {
    background: var(--perfil-azul);
    color: #fff;
}

.action-btn--primary:hover {
    background: #083d8f;
}

.action-btn--whatsapp {
    background: var(--perfil-verde);
    color: #fff;
}

.action-btn--whatsapp:hover {
    background: #0b6a38;
}

.action-btn--default {
    background: #fff;
    color: #1e293b;
    box-shadow: inset 0 0 0 1px var(--border);
}

.action-btn--default:hover {
    background: #f1f5f9;
}

.action-btn:focus-visible,
.perfil-nav a:focus-visible,
.contato-btn:focus-visible {
    outline: 3px solid #1d4ed8;
    outline-offset: 2px;
}

/* Neste perfil quem fica fixo é a navegação entre seções: o cabeçalho de 200+ px rola junto com a página
   e devolve a tela ao conteúdo (no celular e no desktop). */
.sticky-header-container {
    position: relative !important;
}

/* ===== NAVEGAÇÃO ENTRE SEÇÕES ===== */
.perfil-nav {
    position: sticky;
    top: var(--perfil-nav-top, 0px);
    z-index: 900;
    margin-top: 16px;
    background: #fff;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.perfil-nav ul {
    max-width: 1024px;
    margin: 0 auto;
    padding: 0 12px;
    list-style: none;
    display: flex;
    gap: 2px;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
}

.perfil-nav ul::-webkit-scrollbar {
    display: none;
}

.perfil-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 0 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--perfil-texto-2);
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    scroll-snap-align: center;
    transition: color 0.15s, border-color 0.15s;
}

.perfil-nav a:hover {
    color: var(--fg);
}

.perfil-nav a[aria-current="true"] {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.content-grid {
    margin-top: 8px;
}

.section-card[id] {
    scroll-margin-top: calc(var(--perfil-nav-top, 0px) + 64px);
}

/* ===== CONTATO ===== */
.contato-label {
    font-size: 12px;
    color: var(--perfil-texto-2);
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.contato-linha {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 12px;
}

.contato-numero {
    font-size: 16px;
    font-weight: 700;
    color: var(--fg);
    font-variant-numeric: tabular-nums;
}

.contato-acoes {
    display: flex;
    gap: 8px;
}

.contato-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    min-width: 44px;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    transition: background-color 0.15s;
}

.contato-btn--ligar {
    color: var(--perfil-azul);
    background: #fff;
    box-shadow: inset 0 0 0 1.5px var(--perfil-azul);
}

.contato-btn--ligar:hover {
    background: #eef4ff;
}

.contato-btn--wa {
    color: #fff;
    background: var(--perfil-verde);
}

.contato-btn--wa:hover {
    background: #0b6a38;
}

/* ===== TOQUE, LEITURA E CONTRASTE ===== */
.btn.btn-outline-primary.flex-fill,
.btn.btn-outline-secondary.flex-fill {
    min-height: 44px;
}

.social-link {
    min-height: 44px;
    color: #334155;
}

.horario-row.hoje {
    color: #166534;
    transform: none;
    box-shadow: none;
}

.horario-row.hoje-fechado {
    color: #b91c1c;
}

.horario-row.fechado {
    opacity: 1;
    color: #64748b;
}

/* ===== CELULAR ===== */
@media (max-width: 768px) {
    /* hidden no html/body cria um contêiner de rolagem e quebra o position: sticky da navegação */
    html,
    body {
        overflow-x: clip;
    }

    .hero-cover {
        height: 300px;
    }

    .hero-badges {
        top: 12px;
    }

    .hero-info {
        padding: 16px;
    }

    .hero-info-inner {
        flex-direction: row;
        align-items: flex-end;
        gap: 12px;
    }

    .hero-logo {
        margin: 0 !important;
        width: 76px;
        height: 76px;
        flex: none;
        border-radius: 14px;
    }

    .hero-text {
        text-align: left;
        min-width: 0;
    }

    .hero-info h1 {
        font-size: 24px;
        line-height: 1.15;
    }

    .hero-text .hero-address {
        font-size: 13px;
        margin-top: 4px;
    }

    .hero-text .hero-address span {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* Ligar e WhatsApp já estão na barra fixa de baixo: aqui ficam só as outras ações */
    .actions-bar {
        margin-top: 12px;
    }

    .action-btn--primary,
    .action-btn--whatsapp {
        display: none;
    }

    .actions-card:not(:has(.action-btn--default)) {
        display: none;
    }

    .actions-card {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        padding: 8px;
        gap: 8px;
    }

    .actions-card::-webkit-scrollbar {
        display: none;
    }

    .action-btn {
        flex: none;
        padding: 0 14px;
        font-size: 14px;
        gap: 8px;
    }

    .action-btn i {
        font-size: 16px;
    }

    .perfil-nav {
        margin-top: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .perfil-nav a {
        transition: none;
    }

    html {
        scroll-behavior: auto !important;
    }
}

/* ===== ÍCONES (Lucide) ===== */
.action-btn svg {
    width: 18px;
    height: 18px;
    flex: none;
}

.contato-btn svg {
    width: 16px;
    height: 16px;
    flex: none;
}

/* ===== AVISO DE HORÁRIO (abrindo / fechando) ===== */
.perfil-alerta-wrap {
    max-width: 1024px;
    margin: 12px auto 0;
    padding: 0 16px;
}

.perfil-alerta {
    --al-cor: #047857;
    --al-fundo: #ecfdf5;
    --al-borda: #a7f3d0;
    --al-texto: #064e3b;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 8px 12px 14px;
    background: var(--al-fundo);
    border: 1.5px solid var(--al-borda);
    border-radius: 14px;
    color: var(--al-texto);
}

.perfil-alerta--fecha {
    --al-cor: #b42318;
    --al-fundo: #fef3f2;
    --al-borda: #fecdca;
    --al-texto: #7a271a;
}

.perfil-alerta-icone {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--al-cor);
    color: #fff;
}

.perfil-alerta-icone svg {
    width: 24px;
    height: 24px;
}

.perfil-alerta-corpo {
    flex: 1;
    min-width: 0;
}

.perfil-alerta-titulo {
    margin: 0;
    font-size: 17px;
    line-height: 1.25;
    font-weight: 600;
}

.perfil-alerta-titulo strong {
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.perfil-alerta-sub {
    margin: 2px 0 0;
    font-size: 14px;
    color: color-mix(in srgb, var(--al-texto) 82%, #fff);
}

.perfil-alerta-barra {
    height: 6px;
    margin-top: 8px;
    border-radius: 3px;
    background: color-mix(in srgb, var(--al-cor) 18%, #fff);
    overflow: hidden;
}

.perfil-alerta-barra span {
    display: block;
    height: 100%;
    width: 100%;
    border-radius: 3px;
    background: var(--al-cor);
    transform-origin: left center;
    transform: scaleX(var(--p, 0));
    transition: transform 1s linear;
}

.perfil-alerta-fechar {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--al-texto);
    cursor: pointer;
}

.perfil-alerta-fechar:hover {
    background: color-mix(in srgb, var(--al-cor) 12%, transparent);
}

.perfil-alerta-fechar:focus-visible {
    outline: 3px solid #1d4ed8;
    outline-offset: 2px;
}

.perfil-alerta-fechar svg {
    width: 20px;
    height: 20px;
}

@media (min-width: 769px) {
    .perfil-alerta-titulo {
        font-size: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .perfil-alerta-barra span {
        transition: none;
    }
}