/* Acharei app shell — mobile-first (listagens e hubs) */
:root {
    --ach-blue: #0073bb;
    --ach-blue-light: #e8f4fc;
    --ach-blue-dark: #005a94;
}

@media (max-width: 991.98px) {
    body.ach-app-page {
        background: #fff;
        font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
        font-size: 15px;
        color: #1a1a1a;
        padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
        max-width: 100%;
        overflow-x: hidden;
    }

    body.ach-app-page .listing-page__wrap {
        max-width: 100%;
        padding: 0;
    }

    body.ach-app-page .listing-page__main {
        padding-bottom: 0;
    }

    body.ach-app-page .header {
        height: 48px;
        padding: 0 12px;
        background: #fff;
        border-bottom: 1px solid #ebebeb;
        box-shadow: none;
    }

    body.ach-app-page .logo {
        font-size: 17px;
        font-weight: 800;
        margin: 0;
    }

    body.ach-app-page .search-form,
    body.ach-app-page .user-icons .icon {
        display: none !important;
    }

    body.ach-app-page .user-icons {
        display: flex;
        align-items: center;
        margin-left: auto;
        flex-shrink: 0;
    }

    body.ach-app-page .theme-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 40px;
        min-height: 40px;
        border: none;
        border-radius: 50%;
        background: var(--ach-blue-light);
        color: var(--ach-blue);
        font-size: 16px;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    body.ach-app-page .breadcrumbs-container {
        padding: 8px 14px;
        background: #fff;
        border-bottom: none;
    }

    body.ach-app-page .breadcrumb {
        font-size: 11px;
        margin: 0;
        padding: 0;
        flex-wrap: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.ach-app-page .listing-layout {
        display: block;
    }

    body.ach-app-page .listing-sidebar.desktop-sidebar {
        display: none !important;
    }

    body.ach-app-page .listing-results {
        background: transparent;
        border: none;
        border-radius: 0;
        padding: 0;
    }

    body.ach-app-page .mobile-filter-toggle {
        bottom: calc(72px + env(safe-area-inset-bottom, 0px) + 8px);
        z-index: 850;
    }

    body.ach-app-page.ach-anchor-visible .mobile-filter-toggle {
        bottom: calc(120px + env(safe-area-inset-bottom, 0px));
    }

    /* Hub layout */
    body.ach-hub-page .listing-layout {
        display: block;
    }

    body.ach-hub-page .ach-hub-main {
        padding: 0;
    }
}

/* Busca rápida — fixa no topo, acima da paleta de busca */
.ach-top-quick-search {
    position: sticky;
    top: 0;
    z-index: 820;
    background: #fff;
    border-bottom: 1px solid #ebebeb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.ach-quick-search {
    padding: 10px 16px 12px;
    background: transparent;
    border-bottom: none;
}

.ach-hub-page .ach-top-quick-search {
    border-bottom: 1px solid #ebebeb;
}

.ach-quick-search__label {
    display: block;
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ach-quick-search__wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.ach-quick-search__icon {
    position: absolute;
    left: 14px;
    font-size: 14px;
    color: #999;
    pointer-events: none;
}

.ach-quick-search__input {
    width: 100%;
    min-height: 48px;
    padding: 0 44px 0 40px;
    font-size: 16px;
    line-height: 1.3;
    color: #111;
    background: #f5f7f9;
    border: 1px solid #e2e6ea;
    border-radius: 12px;
    outline: none;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}

.ach-quick-search__input:focus {
    border-color: var(--ach-blue);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 115, 187, 0.12);
}

.ach-quick-search__clear {
    position: absolute;
    right: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #888;
    cursor: pointer;
    font-family: inherit;
}

.ach-quick-search__meta {
    margin: 8px 0 0;
    font-size: 12px;
    color: #666;
}

.ach-quick-search__empty {
    margin: 8px 0 0;
    font-size: 13px;
    color: #b45309;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 10px 12px;
}

body.ach-app-page .mobile-search-toggle {
    background: var(--ach-blue);
    color: #fff;
}

body.ach-app-page .mobile-search-toggle i {
    color: #fff;
}

/* Hero */
.ach-m-hero {
    padding: 16px 14px 8px;
    background: #fff;
    contain: layout style;
}

.ach-m-hero h1 {
    margin: 0 0 6px;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.25;
    color: #111;
    letter-spacing: -0.02em;
}

.ach-m-hero__meta {
    margin: 0;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

/* Grid nav */
.ach-m-grid-nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    margin: 0 14px 14px;
    padding: 1px;
    background: #ebebeb;
    border-radius: 12px;
    overflow: hidden;
    contain: layout style;
}

.ach-m-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 84px;
    padding: 12px 6px;
    font-size: 11px;
    font-weight: 600;
    color: #444;
    text-decoration: none;
    background: #fff;
    border: none;
    cursor: pointer;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

.ach-m-grid-item__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--ach-blue-light);
    color: var(--ach-blue);
    font-size: 18px;
    line-height: 1;
}

.ach-m-grid-item__label {
    line-height: 1.2;
    text-align: center;
}

.ach-m-grid-item:active .ach-m-grid-item__icon,
.ach-m-grid-item--highlight .ach-m-grid-item__icon {
    background: var(--ach-blue);
    color: #fff;
}

.ach-m-grid-item--highlight {
    color: var(--ach-blue);
}

/* Sections */
.ach-m-section {
    padding: 14px;
    border-bottom: 8px solid #f5f5f5;
    contain: layout style;
    scroll-margin-top: 56px;
}

.ach-m-section__label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #999;
}

.ach-m-section__label i {
    color: var(--ach-blue);
    font-size: 13px;
}

.ach-m-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.ach-m-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    text-decoration: none;
    background: #f5f5f5;
    border-radius: 999px;
    border: 1px solid #ebebeb;
    -webkit-tap-highlight-color: transparent;
}

.ach-m-chip__n {
    font-size: 11px;
    font-weight: 700;
    color: var(--ach-blue);
    background: var(--ach-blue-light);
    padding: 2px 6px;
    border-radius: 999px;
}

.ach-m-chip:active {
    background: var(--ach-blue-light);
    border-color: var(--ach-blue);
}

/* Navegação alfabética — cidades por estado */
.ach-alpha-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 12px;
    padding: 0;
}

.ach-alpha-nav__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
    padding: 4px 8px;
    font-size: 13px;
    font-weight: 700;
    color: #444;
    text-decoration: none;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

button.ach-alpha-nav__item {
    appearance: none;
}

.ach-alpha-nav__item.is-active {
    color: #fff;
    background: var(--ach-blue);
    border-color: var(--ach-blue);
}

.ach-alpha-nav__meta {
    margin: 0 0 10px;
    padding: 0;
}

.ach-cidades-tabs__panels {
    contain: layout style;
}

.ach-cidades-tabs__panel[hidden] {
    display: none !important;
}

/* Rodapé hub — empresas com conteúdo IA */
.ach-hub-ia-footer {
    background: #fafbfc;
}

.ach-hub-ia-footer__intro {
    margin: 0 0 10px;
    font-size: 13px;
    line-height: 1.45;
    color: #666;
}

.ach-hub-ia-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid #ebebeb;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.ach-hub-ia-list li + li {
    border-top: 1px solid #f0f0f0;
}

.ach-hub-ia-list .ach-m-info-row {
    border-bottom: none;
}

/* Últimos comentários — hubs e listagens */
.ach-ultimos-comentarios {
    background: #fff;
}

.ach-ultimos-comentarios__escopo {
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    color: #666;
}

.ach-ultimos-comentarios__intro {
    margin: 0 0 10px;
    font-size: 13px;
    line-height: 1.45;
    color: #666;
}

.ach-comentarios-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid #ebebeb;
    border-radius: 12px;
    overflow: hidden;
    background: #fafbfc;
}

.ach-comentarios-list li + li {
    border-top: 1px solid #f0f0f0;
}

.ach-comentario-card {
    display: block;
    padding: 12px 14px;
    text-decoration: none;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
}

.ach-comentario-card:active {
    background: var(--ach-blue-light);
}

.ach-comentario-card__top {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.ach-comentario-card__avatar {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    font-size: 12px;
    font-weight: 700;
    color: var(--ach-blue);
    background: var(--ach-blue-light);
    border-radius: 50%;
}

.ach-comentario-card__meta {
    flex: 1;
    min-width: 0;
}

.ach-comentario-card__autor {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #111;
    line-height: 1.3;
}

.ach-comentario-card__stars {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    color: #f5a623;
    line-height: 1;
}

.ach-comentario-card__stars .poi-stars {
    font-size: 11px;
}

.ach-comentario-card__data {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    color: #999;
    font-style: normal;
}

.ach-comentario-card__texto {
    margin: 0 0 6px;
    padding: 0;
    font-size: 13px;
    line-height: 1.45;
    color: #333;
    border: none;
}

.ach-comentario-card__empresa {
    display: block;
    font-size: 12px;
    font-weight: 600;
    font-style: normal;
    color: var(--ach-blue);
    line-height: 1.35;
}

.listing-results .ach-ultimos-comentarios {
    margin-top: 8px;
}

/* Info row (listing cards) */
.ach-m-info-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: inherit;
    min-height: 64px;
}

.ach-m-info-row__main {
    flex: 1;
    min-width: 0;
}

.ach-m-info-row__title {
    margin: 0 0 2px;
    font-size: 15px;
    font-weight: 700;
    color: #111;
    line-height: 1.3;
}

.ach-m-info-row__sub {
    margin: 0;
    font-size: 12px;
    color: #666;
    line-height: 1.35;
}

.ach-m-info-row__nota {
    color: #f5a623;
    font-weight: 700;
}

.ach-m-info-row__nota i {
    font-size: 10px;
}

.ach-m-info-row__cta {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0 12px;
    font-size: 12px;
    font-weight: 700;
    color: var(--ach-blue);
    background: var(--ach-blue-light);
    border-radius: 8px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

/* Guias scroll */
.ach-guias-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 0 14px 4px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.ach-guia-card {
    flex: 0 0 min(260px, 78vw);
    scroll-snap-align: start;
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 10px;
    padding: 12px 14px;
}

.ach-guia-card h3 {
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 6px;
    line-height: 1.35;
}

.ach-guia-card h3 a {
    color: var(--ach-blue);
    text-decoration: none;
}

.ach-guia-card__meta {
    margin: 0;
    font-size: 11px;
    color: #666;
    line-height: 1.4;
}

.ach-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px 8px;
}

.ach-section-head h2 {
    margin: 0;
    font-size: 14px;
    font-weight: 800;
    color: #111;
}

.ach-section-head a {
    font-size: 12px;
    font-weight: 600;
    color: var(--ach-blue);
    text-decoration: none;
}

/* Hub ad slot */
.ach-hub-ad {
    padding: 8px 14px 12px;
}

/* Nuvem de tags — rodapé das listagens */
.ach-tag-cloud {
    margin-top: 16px;
    padding: 14px 0 4px;
    border-top: 1px solid #f1f3f4;
}

.ach-tag-cloud__title {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 12px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #999;
}

.ach-tag-cloud__title i {
    color: var(--ach-blue);
    font-size: 13px;
}

.ach-tag-cloud__items {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    line-height: 1.4;
}

.ach-tag-cloud__tag {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 6px 12px;
    font-weight: 600;
    color: var(--ach-blue);
    text-decoration: none;
    background: var(--ach-blue-light);
    border-radius: 999px;
    border: 1px solid transparent;
    transition: background 0.15s, color 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.ach-tag-cloud__tag:hover,
.ach-tag-cloud__tag:active {
    background: var(--ach-blue);
    color: #fff;
}

.ach-tag-cloud__tag--sm {
    font-size: 11px;
}

.ach-tag-cloud__tag--md {
    font-size: 13px;
}

.ach-tag-cloud__tag--lg {
    font-size: 15px;
}

.ach-tag-cloud__tag--xl {
    font-size: 17px;
    font-weight: 700;
}

/* Related links */
.ach-related-links {
    padding: 14px;
    border-top: 8px solid #f5f5f5;
}

.ach-related-links h3 {
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #999;
}

.ach-related-links ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ach-related-links li {
    margin-bottom: 6px;
}

.ach-related-links a {
    font-size: 14px;
    font-weight: 600;
    color: var(--ach-blue);
    text-decoration: none;
}

/* Sticky bar */
.ach-m-sticky-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 900;
    display: none;
    gap: 8px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-top: 1px solid #ebebeb;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
    contain: layout style;
}

@media (max-width: 991.98px) {
    body.ach-app-page .ach-m-sticky-bar {
        display: flex;
    }
}

.ach-m-sticky-btn {
    flex: 1;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 52px;
    min-width: 0;
    padding: 6px 4px;
    font-size: 10px;
    font-weight: 700;
    border-radius: 8px;
    text-decoration: none;
    border: none;
    color: #666;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

.ach-m-sticky-btn i {
    font-size: 18px;
    color: #666;
}

.ach-m-sticky-btn--primary,
.ach-m-sticky-btn--primary i {
    color: var(--ach-blue);
}

/* Listing mobile */
@media (max-width: 991.98px) {
    body.ach-app-page .listing-results__head {
        padding: 14px 16px 12px;
        margin: 0;
        border-bottom: 8px solid #f5f5f5;
    }

    body.ach-app-page .listing-results__head h1 {
        font-size: 1.2rem;
        line-height: 1.3;
    }

    body.ach-app-page .listing-sr-top {
        padding: 0 16px 12px;
        margin: 0;
        border-bottom: 8px solid #f5f5f5;
    }

    body.ach-app-page .listing-empresas {
        border: none;
        border-radius: 0;
        background: #fff;
    }

    body.ach-app-page .listing-empresas .item-empresa {
        display: block;
        padding: 0;
        margin: 0;
        border: none;
        border-bottom: 8px solid #f5f5f5;
        border-radius: 0;
        background: #fff;
    }

    body.ach-app-page .listing-empresas .item-empresa:last-child {
        border-bottom: none;
    }

    body.ach-app-page .listing-empresas .item-empresa:hover {
        background: #fff;
    }

    .item-empresa-m {
        display: flex;
        flex-direction: column;
        gap: 14px;
        padding: 16px;
    }

    .item-empresa-m__body {
        display: flex;
        flex-direction: column;
        gap: 8px;
        min-width: 0;
    }

    .item-empresa-m__name {
        margin: 0;
        font-size: 17px;
        font-weight: 800;
        line-height: 1.35;
        color: #111;
        letter-spacing: -0.01em;
    }

    .item-empresa-m__tag {
        align-self: flex-start;
        display: inline-block;
        max-width: 100%;
        padding: 4px 10px;
        font-size: 12px;
        font-weight: 600;
        line-height: 1.3;
        color: var(--ach-blue);
        background: var(--ach-blue-light);
        border-radius: 6px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .item-empresa-m__addr {
        margin: 0;
        font-size: 14px;
        line-height: 1.45;
        color: #555;
    }

    .item-empresa-m__desc {
        margin: 0;
        font-size: 14px;
        line-height: 1.5;
        color: #666;
    }

    .item-empresa-m__cta {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: 48px;
        padding: 0 16px;
        font-size: 15px;
        font-weight: 700;
        color: #fff;
        background: var(--ach-blue);
        border-radius: 10px;
        text-decoration: none;
        -webkit-tap-highlight-color: transparent;
    }

    .item-empresa-m__cta:active {
        background: var(--ach-blue-dark);
    }

    body.ach-app-page .listing-sr-mid,
    body.ach-app-page .listing-sr-foot {
        padding: 0 16px;
    }

    body.ach-app-page .ad-box {
        margin: 0 16px 16px;
        padding: 16px;
        border-radius: 12px;
    }

    body.ach-app-page .ad-box .ad-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        padding: 0 16px;
        cursor: pointer;
        text-decoration: none;
        color: #fff;
        background: var(--ach-blue);
        border-radius: 8px;
        font-weight: 700;
    }

    body.ach-app-page .listing-pagination {
        padding: 8px 16px 16px;
    }
}

@media (max-width: 991.98px) {
    body.ach-app-page .ach-only-desktop {
        display: none !important;
    }
}

@media (min-width: 992px) {
    body.ach-app-page .ach-only-mobile {
        display: none !important;
    }
}

/* Desktop: hide app-only blocks in sidebar area duplication */
@media (min-width: 992px) {
    .ach-hub-mobile-only {
        display: none;
    }

    .ach-m-sticky-bar {
        display: none !important;
    }
}

@media (max-width: 991.98px) {
    .ach-hub-desktop-only {
        display: none !important;
    }
}

/* Dark mode */
body.dark-mode.ach-app-page {
    --ach-blue: #4da3ff;
    --ach-blue-light: #1a2d42;
    --ach-blue-dark: #93c5fd;
    background: #121212;
    color: #e8e8e8;
}

body.dark-mode.ach-app-page .header,
body.dark-mode.ach-app-page .breadcrumbs-container,
body.dark-mode.ach-app-page .ach-m-hero,
body.dark-mode.ach-app-page .ach-m-sticky-bar {
    background: #1e1e1e;
    border-color: #333;
}

body.dark-mode.ach-app-page .ach-m-section {
    border-bottom-color: #2a2a2a;
}

body.dark-mode.ach-app-page .ach-m-chip {
    background: #2a2a2a;
    border-color: #444;
    color: #e8e8e8;
}

body.dark-mode.ach-app-page .ach-m-grid-nav {
    background: #333;
}

body.dark-mode.ach-app-page .ach-m-grid-item {
    background: #1e1e1e;
    color: #ccc;
}

body.dark-mode.ach-app-page .ach-guia-card {
    background: #1e1e1e;
    border-color: #333;
}

body.dark-mode.ach-app-page .ach-tag-cloud {
    border-top-color: #333;
}

body.dark-mode.ach-app-page .ach-tag-cloud__tag {
    background: #1a2d42;
    color: #93c5fd;
}

body.dark-mode.ach-app-page .ach-top-quick-search {
    background: #1e1e1e;
    border-bottom-color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

body.dark-mode.ach-app-page .listing-results__head,
body.dark-mode.ach-app-page .listing-sr-top,
body.dark-mode.ach-app-page .listing-empresas .item-empresa {
    border-bottom-color: #2a2a2a;
}

body.dark-mode.ach-app-page .listing-empresas,
body.dark-mode.ach-app-page .listing-empresas .item-empresa {
    background: #121212;
}

body.dark-mode.ach-app-page .item-empresa-m__name {
    color: #f0f0f0;
}

body.dark-mode.ach-app-page .item-empresa-m__addr {
    color: #aaa;
}

body.dark-mode.ach-app-page .item-empresa-m__desc {
    color: #999;
}
