/* ═══════════════════════════════════════════════════════════
   📱 PÁGINA INICIAL NO CELULAR
   Ajustes de todas as seções da home em telas de até 576px.
   Carregado só no index.html, depois dos estilos de cada seção.
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 576px) {

    /* ──────────────────────────────────────────────
       Espaçamento entre as seções
       ────────────────────────────────────────────── */
    .top-prestadores-section,
    .categorias-section,
    .ultimos-section {
        padding: 1.75rem 0;
        margin: 0;
    }

    .section-alt.py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    /* ──────────────────────────────────────────────
       Cabeçalhos: título à esquerda, "Ver todos" pequeno à direita
       ────────────────────────────────────────────── */
    .top-header,
    .cat-header,
    .ultimos-header,
    .destaque-header {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 0.75rem !important;
        margin-bottom: 1rem !important;
    }

    .top-header .section-title,
    .cat-header .section-title,
    .ultimos-header .section-title {
        font-size: 1.35rem;
        line-height: 1.2;
    }

    /* Selo sempre em linha própria, acima do título */
    .top-eyebrow,
    .cat-eyebrow,
    .ultimos-eyebrow {
        display: flex;
        width: fit-content;
        margin-bottom: 6px;
    }

    .cat-subtitle {
        margin: 4px 0 0;
        font-size: 0.8rem;
    }

    .top-see-all,
    .cat-see-all,
    .ultimos-see-all,
    .destaque-see-all {
        flex-shrink: 0;
        padding: 6px 12px !important;
        font-size: 0.78rem !important;
        border-radius: 100px;
    }

    /* Destaques: ícone menor e sem o selo PREMIUM solto */
    .destaque-header > div:first-child {
        gap: 0.75rem !important;
        min-width: 0;
    }

    .destaque-icon-box {
        padding: 9px;
        border-radius: 12px;
    }

    .destaque-icon-box i {
        font-size: 1.3rem;
    }

    .destaque-title {
        font-size: 1.35rem;
        line-height: 1.2;
    }

    .destaque-header p.small {
        font-size: 0.78rem;
    }

    .destaque-premium-badge {
        display: none;
    }

    /* ──────────────────────────────────────────────
       Estatísticas: cards mais baixos (ícone ao lado do número)
       ────────────────────────────────────────────── */
    .stats-section {
        padding: 1.25rem 0 0.5rem;
    }

    .stat-item {
        flex-direction: row;
        align-items: center;
        gap: 0.65rem;
        padding: 0.8rem 0.75rem;
    }

    .stat-icon {
        width: 38px;
        height: 38px;
        border-radius: 10px;
        flex-shrink: 0;
    }

    .stat-icon i {
        font-size: 0.9rem;
    }

    .stat-number {
        font-size: 1.25rem;
        margin-bottom: 0;
    }

    .stat-label {
        font-size: 0.62rem;
        line-height: 1.25;
        margin: 0;
    }

    /* ──────────────────────────────────────────────
       Top Prestadores: carrossel arrastável em vez de 10 cards empilhados
       ────────────────────────────────────────────── */
    .top-grid {
        display: flex;
        gap: 12px;
        max-width: none;
        margin: 0 -12px;
        padding: 14px 12px 8px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-padding-left: 12px;
        scrollbar-width: none;
    }

    .top-grid::-webkit-scrollbar {
        display: none;
    }

    .top-card {
        flex: 0 0 66%;
        scroll-snap-align: start;
        padding: 1.6rem 0.9rem 0.9rem;
    }

    .top-avatar {
        width: 64px;
        height: 64px;
    }

    .top-stats {
        padding: 0.55rem 0;
    }

    .top-services {
        display: none;
    }

    /* ──────────────────────────────────────────────
       Categorias: 3 por linha, compactas
       ────────────────────────────────────────────── */
    .cat-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .cat-card {
        padding: 0.85rem 0.35rem 0.75rem;
        border-radius: 14px;
    }

    .cat-icon {
        width: 38px;
        height: 38px;
        border-radius: 11px;
        margin-bottom: 0.45rem;
    }

    .cat-icon i {
        font-size: 0.9rem;
    }

    .cat-name {
        font-size: 0.72rem;
        line-height: 1.2;
        margin-bottom: 2px;
    }

    .cat-count {
        font-size: 0.62rem;
    }

    /* ──────────────────────────────────────────────
       Últimos serviços: 2 por linha, cards compactos
       ────────────────────────────────────────────── */
    #servicos-container {
        --bs-gutter-x: 0.6rem;
        --bs-gutter-y: 0.6rem;
    }

    /* Os cards têm altura fixa de 320–340px no CSS da seção: aqui ficam do tamanho do conteúdo */
    .recent-card {
        display: flex !important;
        flex-direction: column;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        border-radius: 14px !important;
    }

    .recent-card .card-img-top {
        height: 104px !important;
        min-height: 104px !important;
        max-height: 104px !important;
    }

    .recent-card .card-img-top i,
    .recent-card .card-img-top.recent-placeholder i {
        font-size: 1.9rem;
    }

    .recent-card .card-body {
        position: static !important;
        flex: 1;
        gap: 0 !important;
        padding: 0.6rem !important;
        display: flex;
        flex-direction: column;
    }

    .recent-card .badge.bg-secondary {
        font-size: 0.58rem;
        padding: 3px 8px !important;
        margin-bottom: 0.35rem !important;
        align-self: flex-start;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .recent-card .card-title {
        font-size: 0.8rem;
        line-height: 1.25;
        margin-bottom: 0.3rem !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        height: auto !important;
        min-height: 2.5em !important;
        max-height: 2.5em !important;
    }

    .recent-card .card-text {
        font-size: 0.7rem !important;
        margin-bottom: 0.3rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .recent-card .nota-servico {
        font-size: 0.68rem;
        margin-bottom: 0.25rem;
    }

    .recent-card .nota-servico-estrelas i {
        font-size: 0.6rem;
    }

    .recent-card .nota-servico-total {
        display: none;
    }

    .recent-card .card-body > .d-flex {
        margin-top: auto !important;
        padding-top: 0.45rem !important;
        gap: 0.35rem !important;
        min-height: 0 !important;
        max-height: none !important;
        flex-wrap: nowrap !important;
    }

    .recent-card .price {
        font-size: 0.92rem;
    }

    .recent-card .card-body > .d-flex .text-muted.small {
        font-size: 0.7rem;
    }

    .recent-card .btn-outline-primary {
        display: inline-flex;
        align-items: center;
        padding: 4px 12px !important;
        font-size: 0.72rem !important;
        line-height: 1.2;
    }

    /* Mostra 8 de início; o botão "Mostrar mais" libera o resto aos poucos */
    #servicos-container .servico-item.ultimos-oculto {
        display: none !important;
    }

    .ultimos-mostrar-mais {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        margin-top: 1rem;
        padding: 0.7rem 1rem;
        border: 1.5px solid #e2e8f0;
        border-radius: 14px;
        background: #ffffff;
        color: #0b2b5c;
        font-weight: 700;
        font-size: 0.85rem;
    }

    .ultimos-section.tem-ocultos #load-more-container {
        display: none;
    }

    /* ──────────────────────────────────────────────
       Depoimentos: carrossel arrastável
       ────────────────────────────────────────────── */
    .depo-header {
        margin-bottom: 1.25rem;
    }

    .depo-row {
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        --bs-gutter-x: 0.75rem;
        --bs-gutter-y: 0;
        padding-bottom: 6px;
    }

    .depo-row::-webkit-scrollbar {
        display: none;
    }

    .depo-row > [class*="col"] {
        flex: 0 0 82%;
        max-width: 82%;
        scroll-snap-align: start;
    }

    .depo-row .testimonial-card {
        height: 100%;
    }

    /* ──────────────────────────────────────────────
       Como funciona: passos compactos, ícone ao lado do texto
       ────────────────────────────────────────────── */
    .how-it-works .text-center.mb-5 {
        margin-bottom: 1.5rem !important;
    }

    .hiw-step-card {
        display: grid;
        grid-template-columns: 50px 1fr;
        column-gap: 14px;
        align-items: center;
        text-align: left;
        padding: 1rem 2.25rem 1rem 1rem;
    }

    .hiw-step-icon {
        grid-row: 1 / span 2;
        width: 50px;
        height: 50px;
        margin: 0;
    }

    .hiw-step-icon i {
        font-size: 1.15rem;
    }

    .hiw-step-title {
        font-size: 1rem;
        margin: 0 0 2px;
        align-self: end;
    }

    .hiw-step-desc {
        font-size: 0.8rem;
        line-height: 1.45;
        margin: 0;
        align-self: start;
    }

    .hiw-step-tags {
        display: none;
    }

    .hiw-step-number {
        top: 10px;
        right: 10px;
    }

    /* ──────────────────────────────────────────────
       Planos: um embaixo do outro, com espaço para os selos
       ────────────────────────────────────────────── */
    .planos-section .row.g-2 {
        --bs-gutter-y: 1.75rem;
    }

    .plano-card {
        padding: 1.75rem 1.25rem 1.25rem;
    }

    .plano-destaque {
        padding-top: 2.25rem;
    }
}

/* Botão "Mostrar mais" dos últimos serviços só existe no celular */
@media (min-width: 577px) {
    .ultimos-mostrar-mais {
        display: none;
    }
}
