/* =========================================================
   e-Serviços Amambai — Serviços / Consultas
   Lista de serviços, consultas e detalhe do serviço
========================================================= */

/* =========================================================
   ESTRUTURA PRINCIPAL
========================================================= */

.services-page,
.service-detail {
    max-width: var(--container);
    margin: 0 auto;
    padding: 72px 22px;
}

.services-page__header,
.service-detail__header {
    max-width: 820px;
    margin-bottom: 34px;
}

.services-page__header h1,
.service-detail__header h1 {
    margin: 14px 0 12px;

    color: var(--color-primary-deep);
    font-size: clamp(2.1rem, 4vw, 3.4rem);
    line-height: 1.06;
    font-weight: 900;
    letter-spacing: -0.035em;
}

.services-page__header p,
.service-detail__header p {
    margin: 0;

    color: var(--color-muted);
    font-size: 1.02rem;
    line-height: 1.75;
}

/* =========================================================
   TOPO MOBILE — PADRÃO NOVA.HTML
========================================================= */

.services-mobile-topline {
    display: none;
}

.services-desktop-chip {
    display: inline-flex;
}

/* =========================================================
   GRID DE SERVIÇOS
========================================================= */

.services-page__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 22px;
}

/* =========================================================
   CARD PREMIUM — PADRÃO HOME
========================================================= */

.service-card--premium {
    position: relative;
    overflow: hidden;

    min-height: 340px;
    padding: 24px;
    border-radius: 30px;

    display: flex;
    flex-direction: column;

    background:
        radial-gradient(circle at top right, rgba(15, 91, 181, 0.11), transparent 34%),
        linear-gradient(180deg, #ffffff, #f8fbff);
    border: 1px solid rgba(191, 211, 234, 0.92);

    box-shadow:
        0 18px 42px rgba(7, 42, 83, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 0.84);

    transition:
        transform 0.26s ease,
        box-shadow 0.26s ease,
        border-color 0.26s ease;
}

.service-card--premium:hover {
    transform: translateY(-6px);
    border-color: rgba(15, 91, 181, 0.35);

    box-shadow:
        0 28px 58px rgba(7, 42, 83, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.90);
}

.service-card__shine {
    position: absolute;
    inset: 0;
    z-index: 1;

    pointer-events: none;

    background:
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.62),
            rgba(255, 255, 255, 0) 42%
        );
}

.service-card--premium::after {
    content: "";
    position: absolute;
    right: -54px;
    top: -54px;
    z-index: 1;

    width: 150px;
    height: 150px;
    border-radius: 999px;

    background: rgba(15, 91, 181, 0.08);
}

.service-card__top,
.service-card__content,
.service-card__link {
    position: relative;
    z-index: 2;
}

.service-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;

    margin-bottom: 22px;
}

.service-card--premium .service-card__icon {
    width: 58px;
    height: 58px;
    flex: 0 0 58px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 20px;

    color: #ffffff;
    background: linear-gradient(135deg, #0f5bb5, #073f7d);

    box-shadow:
        0 14px 28px rgba(7, 42, 83, 0.20),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.service-card--premium .service-card__icon svg {
    width: 26px;
    height: 26px;
    stroke-width: 2.4;
}

.service-card__badge {
    min-height: 30px;
    padding: 0 12px;

    display: inline-flex;
    align-items: center;

    border-radius: 999px;
    border: 1px solid rgba(15, 91, 181, 0.14);

    color: #0f5bb5;
    background: rgba(15, 91, 181, 0.09);

    font-size: 0.73rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.035em;
    white-space: nowrap;
}

.service-card__content {
    flex: 1;
}

.service-card__category {
    display: block;
    margin-bottom: 8px;

    color: var(--color-primary);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.045em;
}

.service-card--premium h2 {
    margin: 0 0 12px;

    color: var(--color-primary-deep);
    font-size: 1.32rem;
    line-height: 1.16;
    font-weight: 900;
}

.service-card--premium p {
    margin: 0;

    color: var(--color-muted);
    font-size: 0.96rem;
    line-height: 1.68;
}

/* =========================================================
   BOTÃO DO CARD
========================================================= */

.service-card--premium .service-card__link {
    width: 100%;
    min-height: 52px;
    margin-top: 24px;
    padding: 0 8px 0 18px;
    box-sizing: border-box;

    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;

    overflow: hidden;
    isolation: isolate;

    border-radius: 999px;
    text-decoration: none;

    color: #ffffff;
    background: linear-gradient(135deg, #0f5bb5, #073f7d);

    box-shadow:
        0 14px 30px rgba(7, 42, 83, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.20);

    font-size: 0.96rem;
    font-weight: 900;
    letter-spacing: -0.01em;

    transition:
        transform 0.22s ease,
        box-shadow 0.22s ease,
        filter 0.22s ease;
}

.service-card--premium .service-card__link::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;

    background:
        linear-gradient(
            120deg,
            transparent 18%,
            rgba(255, 255, 255, 0.20) 46%,
            transparent 72%
        );

    transform: translateX(-120%);
    transition: transform 0.72s ease;
}

.service-card--premium .service-card__link:hover::before {
    transform: translateX(120%);
}

.service-card--premium .service-card__link:hover {
    transform: translateY(-2px);
    filter: brightness(1.04);

    box-shadow:
        0 18px 38px rgba(7, 42, 83, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.service-card__link-label,
.service-card__link-icon {
    position: relative;
    z-index: 1;
}

.service-card__link-label {
    min-width: 0;

    display: inline-flex;
    align-items: center;

    line-height: 1.2;
}

.service-card__link-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 999px;

    color: #073f7d;
    background: rgba(255, 255, 255, 0.92);

    transition:
        transform 0.24s ease,
        background 0.24s ease,
        box-shadow 0.24s ease;
}

.service-card__link-icon svg {
    width: 19px;
    height: 19px;
    stroke-width: 2.5;
}

.service-card--premium .service-card__link:hover .service-card__link-icon {
    transform: translateX(2px);
}

/* =========================================================
   VARIAÇÕES DOS CARDS
========================================================= */

/* Card verde — solicitação com protocolo */
.service-card--solicitar .service-card__icon,
.service-card--solicitar .service-card__link {
    background: linear-gradient(135deg, #10b981, #047857);
}

.service-card--solicitar .service-card__badge {
    color: #047857;
    background: rgba(16, 185, 129, 0.11);
    border-color: rgba(16, 185, 129, 0.20);
}

.service-card--solicitar .service-card__link-icon {
    color: #047857;
}

/* Card azul — mapa/consulta */
.service-card--mapa .service-card__icon,
.service-card--mapa .service-card__link {
    background: linear-gradient(135deg, #0f5bb5, #073f7d);
}

.service-card--mapa .service-card__badge {
    color: #0f5bb5;
    background: rgba(15, 91, 181, 0.09);
    border-color: rgba(15, 91, 181, 0.14);
}

.service-card--mapa .service-card__link-icon {
    color: #073f7d;
}

/* Card neutro — informativo */
.service-card--padrao .service-card__icon,
.service-card--padrao .service-card__link {
    background: linear-gradient(135deg, #475569, #1e293b);
}

.service-card--padrao .service-card__badge {
    color: #475569;
    background: rgba(71, 85, 105, 0.10);
    border-color: rgba(71, 85, 105, 0.18);
}

.service-card--padrao .service-card__link-icon {
    color: #1e293b;
}

/* Consulta de CEP, caso exista na base */
.service-card--cep .service-card__icon,
.service-card--cep .service-card__link {
    background: linear-gradient(135deg, #0f5bb5, #073f7d);
}

.service-card--cep .service-card__badge {
    color: #0f5bb5;
    background: rgba(15, 91, 181, 0.09);
    border-color: rgba(15, 91, 181, 0.14);
}

.service-card--cep .service-card__link-icon {
    color: #073f7d;
}

/* =========================================================
   DESTAQUE DOS CARDS COM PROTOCOLO
========================================================= */

.service-card--featured,
.service-card--order-iluminacao,
.service-card--order-reparo-via,
.service-card--order-lotes-lixo {
    position: relative;
    border-color: rgba(16, 185, 129, 0.34);
}

.service-card--featured::before,
.service-card--order-iluminacao::before,
.service-card--order-reparo-via::before,
.service-card--order-lotes-lixo::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;

    pointer-events: none;

    border-radius: inherit;
    border: 2px solid rgba(16, 185, 129, 0.14);

    box-shadow:
        0 0 0 7px rgba(16, 185, 129, 0.035),
        0 20px 40px rgba(16, 185, 129, 0.08);
}

.service-card--order-iluminacao .service-card__icon,
.service-card--order-reparo-via .service-card__icon,
.service-card--order-lotes-lixo .service-card__icon,
.service-card--order-iluminacao .service-card__link,
.service-card--order-reparo-via .service-card__link,
.service-card--order-lotes-lixo .service-card__link {
    background: linear-gradient(135deg, #10b981, #047857);
}

.service-card--order-iluminacao .service-card__badge,
.service-card--order-reparo-via .service-card__badge,
.service-card--order-lotes-lixo .service-card__badge {
    color: #047857;
    background: rgba(16, 185, 129, 0.11);
    border-color: rgba(16, 185, 129, 0.20);
}

.service-card--order-iluminacao .service-card__link-icon,
.service-card--order-reparo-via .service-card__link-icon,
.service-card--order-lotes-lixo .service-card__link-icon {
    color: #047857;
}

/* =========================================================
   ORDEM DOS CARDS
========================================================= */

.services-page__grid > .service-card {
    order: 500;
}

.services-page__grid > .service-card--order-iluminacao {
    order: 10;
}

.services-page__grid > .service-card--order-reparo-via {
    order: 20;
}

.services-page__grid > .service-card--order-lotes-lixo {
    order: 30;
}

.services-page__grid > .service-card--order-farmacias {
    order: 40;
}

.services-page__grid > .service-card--order-cep {
    order: 50;
}

.services-page__grid > .service-card--order-vilas {
    order: 60;
}

.services-page__grid > .service-card--order-default {
    order: 500;
}

/* =========================================================
   DETALHE DO SERVIÇO
========================================================= */

.service-detail__back {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    margin-bottom: 28px;

    color: var(--color-primary-dark);
    font-weight: 800;
    text-decoration: none;

    transition:
        color 0.2s ease,
        transform 0.2s ease;
}

.service-detail__back:hover {
    color: var(--color-primary);
    transform: translateX(-2px);
}

.service-detail__back svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.4;
}

.service-detail__title {
    display: flex;
    align-items: center;
    gap: 18px;

    margin-bottom: 18px;
}

.service-detail__icon {
    width: 58px;
    height: 58px;
    flex: 0 0 58px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 18px;

    color: #ffffff;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
}

.service-detail__icon svg {
    width: 30px;
    height: 30px;
    stroke-width: 2.4;
}

.service-detail__title span {
    display: inline-block;
    margin: 0 0 6px;

    color: var(--color-primary);
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.service-detail__title h1 {
    margin: 0;
}

.service-detail__status {
    width: fit-content;
    margin-top: 10px;
    padding: 8px 13px;

    display: inline-flex;
    align-items: center;

    border-radius: 999px;

    background: var(--color-accent);
    color: var(--color-primary-dark);

    font-size: 0.78rem;
    font-weight: 800;
}

.service-detail__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.service-detail__card {
    padding: 24px;

    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.service-detail__card > svg {
    width: 32px;
    height: 32px;

    margin-bottom: 16px;

    color: var(--color-primary);
}

.service-detail__card h2 {
    margin: 0 0 10px;

    color: var(--color-primary-deep);
    font-size: 1.2rem;
}

.service-detail__card p {
    margin: 0;

    color: var(--color-muted);
    line-height: 1.7;
}

.service-detail__actions {
    margin-top: 30px;

    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

/* =========================================================
   BOTÕES AUXILIARES
========================================================= */

.btn-light {
    background: #ffffff;
    color: var(--color-primary-dark);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.btn-light:hover {
    background: var(--color-accent);
    transform: translateY(-2px);
}

.btn-disabled {
    opacity: 0.65;
    cursor: not-allowed;
    pointer-events: none;
}

/* =========================================================
   ACESSIBILIDADE
========================================================= */

.service-card__link:focus-visible,
.service-detail__back:focus-visible,
.btn-light:focus-visible,
.request-back:focus-visible {
    outline: 3px solid rgba(8, 115, 196, 0.36);
    outline-offset: 3px;
}

/* =========================================================
   RESPONSIVO — TABLET
========================================================= */

@media (max-width: 1080px) {
    .services-page__grid,
    .service-detail__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* =========================================================
   RESPONSIVO — MOBILE
========================================================= */

@media (max-width: 768px) {
    .services-page,
    .service-detail {
        padding: 58px 16px;
    }

    .services-page__header {
        padding-top: 0 !important;
        margin-bottom: 28px;
    }

    .services-mobile-topline {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 10px;

        margin: 0 0 18px 0;
    }

    .services-desktop-chip {
        display: none !important;
    }

    .services-mobile-topline .request-back {
        display: inline-flex;
        align-items: center;
        gap: 7px;

        color: #003f78;

        font-size: 0.88rem;
        font-weight: 850;
        line-height: 1;
        text-decoration: none;
        white-space: nowrap;

        transition:
            color 0.18s ease,
            transform 0.18s ease;
    }

    .services-mobile-topline .request-back svg {
        width: 17px;
        height: 17px;
        flex-shrink: 0;

        stroke-width: 2.5;
    }

    .services-mobile-topline .request-back:hover {
        color: #005ca8;
        transform: translateX(-2px);
    }

    .services-mobile-topline .section-chip {
        margin: 0 !important;
        white-space: nowrap;
    }

    .services-page__header h1,
    .service-detail__header h1 {
        font-size: clamp(1.9rem, 9vw, 2.55rem);
    }

    .services-page__grid,
    .service-detail__grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .service-card--premium {
        min-height: 0;
        padding: 21px;
        border-radius: 24px;
    }

    .service-card__top {
        margin-bottom: 18px;
    }

    .service-card--premium .service-card__icon {
        width: 52px;
        height: 52px;
        flex-basis: 52px;

        border-radius: 18px;
    }

    .service-card--premium .service-card__icon svg {
        width: 23px;
        height: 23px;
    }

    .service-card--premium h2 {
        font-size: 1.2rem;
    }

    .service-card--premium .service-card__link {
        min-height: 52px;
        padding: 0 8px 0 16px;

        font-size: 0.94rem;
    }

    .service-card__link-icon {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }

    .service-card__link-icon svg {
        width: 17px;
        height: 17px;
    }

    .service-detail__title {
        align-items: flex-start;
    }

    .service-detail__icon {
        width: 52px;
        height: 52px;
        flex-basis: 52px;

        border-radius: 16px;
    }

    .service-detail__actions {
        flex-direction: column;
    }

    .service-detail__actions .btn {
        width: 100%;
    }
}

@media (max-width: 460px) {
    .service-card__top {
        flex-direction: column;
    }

    .service-card__badge {
        width: fit-content;
    }

    .service-card--premium .service-card__link {
        width: 100%;
        gap: 8px;

        font-size: 0.9rem;
    }

    .service-detail__title {
        flex-direction: column;
    }
}

@media (max-width: 420px) {
    .services-mobile-topline {
        gap: 8px;
        margin-bottom: 16px;
    }

    .services-mobile-topline .request-back {
        gap: 6px;
        font-size: 0.84rem;
    }

    .services-mobile-topline .request-back svg {
        width: 16px;
        height: 16px;
    }

    .services-mobile-topline .section-chip {
        padding-left: 10px;
        padding-right: 10px;

        font-size: 0.66rem;
    }
}

/* =========================================================
   REDUÇÃO DE MOVIMENTO
========================================================= */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}