@import "reset.css";

/* =====================================================
   BANNER DE COOKIES
===================================================== */

.cookie-banner {
    position: fixed;
    right: 20px;
    left: auto;
    bottom: 20px;

    background: var(--corBranca);
    border-radius: 16px;

    padding: 24px;
    width: 40%;

    box-shadow: 0 8px 35px rgba(0, 0, 0, 0.18);

    z-index: 9999;

    opacity: 0;
    visibility: hidden;
    transform: translateY(30px);

    transition:
        opacity 0.3s ease,
        transform 0.3s ease,
        visibility 0.3s ease;
}


/* Banner visível */

.cookie-banner.ativo {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}


/* =====================================================
   CONTEÚDO DO BANNER
===================================================== */

.cookie-banner-conteudo {
    max-width: 1000px;
    margin: 0 auto;

}


/* =====================================================
   TEXTO
===================================================== */

.cookie-banner-texto {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.cookie-icone {
    font-size: 1.5rem;
    line-height: 1;
}

.cookie-banner-texto h2 {
    margin: 0 0 4px;

    color: var(--azulEscuro);

    font-size: 1.1rem;
    font-weight: 700;
}

.cookie-banner-texto p {
    margin: 0;

    color: var(--corTexto);

    font-size: 0.8rem;
    line-height: 1.4;
}


/* =====================================================
   LINKS
===================================================== */

.cookie-links {
    display: flex;
    align-items: center;
    gap: 5px;

    margin-top: 8px;
}

.cookie-links a {
    color: var(--corTexto);

    font-size: 0.85rem;
    font-weight: 600;

    text-decoration: underline;
}

.cookie-links a:hover {
    color: var(--laranjaForte);
}


/* =====================================================
   AÇÕES
===================================================== */

.cookie-acoes {
    display: flex;
    justify-content: flex-end;
    align-items: center;

    flex-wrap: wrap;

    gap: 5px;

    margin-top: 12px;
}


/* =====================================================
   BOTÕES
===================================================== */

.cookie-btn {
    border: none;

    padding: 7px 10px;

    border-radius: 7px;

    font-size: 0.9rem;
    font-weight: 500;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.2s ease,
        opacity 0.2s ease;
}

.cookie-btn:hover {
    transform: translateY(-1px);
    color: var(--corTexto);
    background-color: var(--laranjaForte);
}

.cookie-btn-principal {
    background: var(--azulEscuro);
    color: var(--corBranca);
}

.cookie-btn-principal:hover {
    opacity: 0.9;
}

.cookie-btn-secundario {
    background: #eeeeee;
    color: #333;
}

.cookie-btn-secundario:hover {
    background: #e2e2e2;
}

.cookie-btn-preferencias {
    background: transparent;

    border: 1px solid #d5d5d5;

    color: var(--azulEscuro);
}


/* =====================================================
   MODAL DE PREFERÊNCIAS
===================================================== */

.cookie-modal {
    position: fixed;

    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    z-index: 10000;

    opacity: 0;
    visibility: hidden;

    transition:
        opacity 0.3s ease,
        visibility 0.3s ease;
}

.cookie-modal.ativo {
    opacity: 1;
    visibility: visible;
}


/* =====================================================
   OVERLAY
===================================================== */

.cookie-modal-overlay {
    position: absolute;

    inset: 0;

    background: rgba(0, 0, 0, 0.55);

    backdrop-filter: blur(3px);
}


/* =====================================================
   CONTEÚDO DO MODAL
===================================================== */

.cookie-modal-conteudo {
    position: relative;

    width: 100%;
    max-width: 650px;

    max-height: 90vh;

    overflow-y: auto;

    background: var(--corBranca);

    border-radius: 16px;

    padding: 28px;

    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.25);

    transform: translateY(20px);

    transition: transform 0.3s ease;
}

.cookie-modal.ativo .cookie-modal-conteudo {
    transform: translateY(0);
}


/* =====================================================
   CABEÇALHO DO MODAL
===================================================== */

.cookie-modal-cabecalho {
    display: flex;

    justify-content: space-between;
    align-items: flex-start;

    gap: 20px;

    padding-bottom: 20px;

    border-bottom: 1px solid #eeeeee;
}

.cookie-modal-cabecalho h2 {
    margin: 0 0 7px;

    color: var(--azulEscuro);

    font-size: 1.4rem;
}

.cookie-modal-cabecalho p {
    margin: 0;

    color: #666;

    font-size: 0.9rem;
    line-height: 1.5;
}


/* =====================================================
   BOTÃO FECHAR
===================================================== */

.cookie-fechar {
    width: 35px;
    height: 35px;

    flex-shrink: 0;

    border: none;

    background: #f2f2f2;

    border-radius: 50%;

    color: #444;

    font-size: 1.5rem;

    line-height: 1;

    cursor: pointer;
}

.cookie-fechar:hover {
    background: #e5e5e5;
}


/* =====================================================
   CATEGORIAS
===================================================== */

.cookie-categorias {
    display: flex;
    flex-direction: column;

    gap: 15px;

    margin-top: 20px;
}

.cookie-categoria {
    display: flex;

    justify-content: space-between;
    align-items: center;

    gap: 20px;

    padding: 17px;

    background: #f8f8f8;

    border: 1px solid #eeeeee;

    border-radius: 10px;
}

.cookie-categoria-info {
    flex: 1;
}

.cookie-categoria h3 {
    margin: 0 0 5px;

    color: var(--azulEscuro);

    font-size: 1rem;
}

.cookie-categoria p {
    margin: 0;

    color: #666;

    font-size: 0.85rem;

    line-height: 1.5;
}


/* =====================================================
   SWITCH
===================================================== */

.cookie-switch {
    position: relative;

    width: 46px;
    height: 25px;

    flex-shrink: 0;
}

.cookie-switch input {
    display: none;
}

.cookie-switch span {
    position: absolute;

    inset: 0;

    background: #ccc;

    border-radius: 30px;

    cursor: pointer;

    transition: background 0.2s ease;
}

.cookie-switch span::before {
    content: "";

    position: absolute;

    width: 19px;
    height: 19px;

    left: 3px;
    top: 3px;

    background: #fff;

    border-radius: 50%;

    transition: transform 0.2s ease;
}

.cookie-switch input:checked + span {
    background: var(--azulEscuro);
}

.cookie-switch input:checked + span::before {
    transform: translateX(21px);
}

.cookie-switch input:disabled + span {
    cursor: not-allowed;

    opacity: 0.8;
}


/* =====================================================
   RODAPÉ DO MODAL
===================================================== */

.cookie-modal-rodape {
    display: flex;

    justify-content: space-between;
    align-items: center;

    gap: 15px;

    margin-top: 25px;

    padding-top: 20px;

    border-top: 1px solid #eeeeee;
}

.cookie-modal-rodape a {
    color: var(--azulEscuro);

    font-size: 0.85rem;

    font-weight: 600;

    text-decoration: underline;
}


/* =====================================================
   BOTÃO FIXO PARA ALTERAR PREFERÊNCIAS
===================================================== */

.abrir-preferencias-cookies {
    position: fixed;

    left: 20px;
    bottom: 20px;

    display: none;

    border: none;

    padding: 10px 15px;

    background: var(--azulEscuro);

    color: var(--corBranca);

    border-radius: 8px;

    font-family: inherit;

    font-size: 0.8rem;
    font-weight: 600;

    cursor: pointer;

    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);

    z-index: 9998;
}

.abrir-preferencias-cookies.visivel {
    display: block;
}



/* =====================================================
   RESPONSIVO — TABLET
===================================================== */

@media (max-width: 768px) {

    .cookie-banner {
        left: 12px;
        right: 12px;
        bottom: 12px;

        width: auto;
        padding: 18px;
        border-radius: 14px;
    }

    .cookie-banner-conteudo {
        max-width: none;
    }

    .cookie-banner-texto {
        gap: 10px;
    }

    .cookie-icone {
        font-size: 1.5rem;
        flex-shrink: 0;
    }

    .cookie-banner-texto h2 {
        font-size: 1.05rem;
    }

    .cookie-banner-texto p {
        font-size: 0.85rem;
        line-height: 1.5;
    }

    .cookie-links {
        flex-wrap: wrap;
        gap: 8px;
    }

    .cookie-links a {
        font-size: 0.8rem;
    }

    .cookie-acoes {
        justify-content: stretch;
        flex-direction: column;
        gap: 8px;
        margin-top: 15px;
    }

    .cookie-acoes .cookie-btn {
        width: 100%;
        min-height: 42px;
        padding: 10px 12px;
    }


    /* =================================================
       MODAL
    ================================================= */

    .cookie-modal {
        padding: 10px;
        align-items: flex-end;
    }

    .cookie-modal-conteudo {
        width: 100%;
        max-width: none;
        max-height: 92vh;

        padding: 20px;

        border-radius: 16px 16px 0 0;

        transform: translateY(30px);
    }

    .cookie-modal.ativo .cookie-modal-conteudo {
        transform: translateY(0);
    }

    .cookie-modal-cabecalho {
        gap: 12px;
        padding-bottom: 16px;
    }

    .cookie-modal-cabecalho h2 {
        font-size: 1.25rem;
    }

    .cookie-modal-cabecalho p {
        font-size: 0.85rem;
        line-height: 1.5;
    }

    .cookie-fechar {
        width: 34px;
        height: 34px;

        font-size: 1.3rem;
    }


    /* =================================================
       CATEGORIAS
    ================================================= */

    .cookie-categorias {
        gap: 10px;
        margin-top: 16px;
    }

    .cookie-categoria {
        align-items: flex-start;
        gap: 15px;

        padding: 14px;
    }

    .cookie-categoria h3 {
        font-size: 0.95rem;
    }

    .cookie-categoria p {
        font-size: 0.8rem;
        line-height: 1.45;
    }


    /* =================================================
       SWITCH
    ================================================= */

    .cookie-switch {
        width: 46px;
        height: 25px;
        margin-top: 2px;
    }


    /* =================================================
       RODAPÉ
    ================================================= */

    .cookie-modal-rodape {
        flex-direction: column;
        align-items: stretch;

        gap: 12px;

        margin-top: 20px;
        padding-top: 16px;
    }

    .cookie-modal-rodape a {
        text-align: center;
        font-size: 0.8rem;
    }

    .cookie-modal-rodape .cookie-btn {
        width: 100%;
        min-height: 42px;
    }
}


/* =====================================================
   RESPONSIVO — MOBILE PEQUENO
===================================================== */

@media (max-width: 480px) {

    .cookie-banner {
        left: 8px;
        right: 8px;
        bottom: 8px;

        padding: 15px;

        border-radius: 12px;
    }

    .cookie-banner-texto {
        gap: 8px;
    }

    .cookie-icone {
        font-size: 1.3rem;
    }

    .cookie-banner-texto h2 {
        font-size: 1rem;
    }

    .cookie-banner-texto p {
        font-size: 0.8rem;
        line-height: 1.45;
    }

    .cookie-links {
        margin-top: 10px;
        gap: 6px;
    }

    .cookie-links a {
        font-size: 0.75rem;
    }

    .cookie-acoes {
        margin-top: 12px;
        gap: 7px;
    }

    .cookie-btn {
        min-height: 40px;
        padding: 9px 10px;
        font-size: 0.82rem;
    }


    /* =================================================
       MODAL MOBILE
    ================================================= */

    .cookie-modal {
        padding: 0;
    }

    .cookie-modal-conteudo {
        max-height: 95vh;

        padding: 16px;

        border-radius: 16px 16px 0 0;
    }

    .cookie-modal-cabecalho {
        gap: 8px;
        padding-bottom: 14px;
    }

    .cookie-modal-cabecalho h2 {
        font-size: 1.1rem;
        margin-bottom: 5px;
    }

    .cookie-modal-cabecalho p {
        font-size: 0.78rem;
        line-height: 1.45;
    }

    .cookie-fechar {
        width: 30px;
        height: 30px;

        font-size: 1.15rem;
    }


    /* =================================================
       CATEGORIAS
    ================================================= */

    .cookie-categorias {
        gap: 8px;
        margin-top: 14px;
    }

    .cookie-categoria {
        padding: 12px;

        gap: 10px;

        border-radius: 9px;
    }

    .cookie-categoria h3 {
        font-size: 0.88rem;
        margin-bottom: 4px;
    }

    .cookie-categoria p {
        font-size: 0.75rem;
        line-height: 1.4;
    }


    /* =================================================
       SWITCH MOBILE
    ================================================= */

    .cookie-switch {
        width: 42px;
        height: 23px;
    }

    .cookie-switch span::before {
        width: 17px;
        height: 17px;

        left: 3px;
        top: 3px;
    }

    .cookie-switch input:checked + span::before {
        transform: translateX(19px);
    }


    /* =================================================
       RODAPÉ
    ================================================= */

    .cookie-modal-rodape {
        margin-top: 16px;
        padding-top: 14px;
        gap: 8px;
    }

    .cookie-modal-rodape .cookie-btn {
        min-height: 42px;
    }


    /* =================================================
       BOTÃO PREFERÊNCIAS
    ================================================= */

    .abrir-preferencias-cookies {
        left: 8px;
        bottom: 8px;

        padding: 9px 12px;

        font-size: 0.75rem;

        border-radius: 7px;
    }
}


/* =====================================================
   TELAS MUITO PEQUENAS
===================================================== */

@media (max-width: 360px) {

    .cookie-banner {
        padding: 13px;
    }

    .cookie-banner-texto {
        gap: 6px;
    }

    .cookie-icone {
        display: none;
    }

    .cookie-banner-texto h2 {
        font-size: 0.95rem;
    }

    .cookie-banner-texto p {
        font-size: 0.76rem;
    }

    .cookie-links a {
        font-size: 0.7rem;
    }

    .cookie-modal-conteudo {
        padding: 14px;
    }

    .cookie-categoria {
        padding: 10px;
    }

    .cookie-categoria p {
        font-size: 0.72rem;
    }
}

.cookie-banner {
    left: 20px;
    right: auto;
    bottom: 20px;
    width: min(560px, calc(100vw - 40px));
    max-height: min(70dvh, 560px);
    overflow-y: auto;
    border: 1px solid rgba(17, 34, 64, 0.12);
    border-radius: 8px;
    color: var(--corPrincipal, #112240);
}

.cookie-banner[hidden],
.cookie-modal:not([open]) {
    display: none !important;
}

.cookie-banner-texto {
    display: block;
}

.cookie-banner-texto h2,
.cookie-modal-cabecalho h2,
.cookie-categoria h3 {
    color: var(--corPrincipal, #112240);
}

.cookie-banner-texto p,
.cookie-modal-cabecalho p,
.cookie-categoria p {
    color: #39465a;
}

.cookie-acoes {
    gap: 8px;
}

.cookie-btn {
    min-height: 40px;
}

.cookie-btn-principal {
    background: var(--corPrincipal, #112240);
    color: #ffffff;
}

.cookie-btn-principal:hover {
    background: #1b3763;
    color: #ffffff;
}

.cookie-btn-preferencias {
    border-color: rgba(17, 34, 64, 0.3);
    color: var(--corPrincipal, #112240);
}

.cookie-modal[open] {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    padding: 20px;
    border: 0;
    background: transparent;
    color: var(--corPrincipal, #112240);
    opacity: 1;
    visibility: visible;
}

.cookie-modal::backdrop {
    background: rgba(17, 34, 64, 0.56);
    backdrop-filter: blur(2px);
}

.cookie-modal-conteudo {
    width: min(100%, 650px);
    max-height: min(90dvh, 760px);
    overflow-y: auto;
    border-radius: 8px;
}

.cookie-modal-rodape {
    align-items: flex-start;
}

.cookie-modal-acoes {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.cookie-modal-rodape a {
    color: var(--corPrincipal, #112240);
}

.cookie-switch input {
    position: absolute;
    display: block;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.cookie-switch input:disabled {
    cursor: not-allowed;
}

.cookie-switch span {
    pointer-events: none;
}

.cookie-switch input:focus-visible + span {
    outline: 3px solid #f37839;
    outline-offset: 3px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.mapa-consentimento {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    background: #f2f4f6;
    color: var(--corPrincipal, #112240);
    text-align: center;
}

.mapa-consentimento[hidden],
.mapa iframe[hidden] {
    display: none !important;
}

.mapa-consentimento p {
    max-width: 440px;
    margin: 0;
    line-height: 1.5;
}

.mapa-consentimento button,
.mapa-consentimento a {
    color: var(--corPrincipal, #112240);
    font: inherit;
    font-weight: 700;
}

.mapa-consentimento button {
    padding: 9px 14px;
    border: 1px solid var(--corPrincipal, #112240);
    border-radius: 6px;
    background: #ffffff;
    cursor: pointer;
}

@media (min-width: 769px) and (max-width: 1200px) {
    .cookie-banner {
        width: min(560px, calc(100vw - 40px));
    }
}

@media (max-width: 768px) {
    .cookie-banner {
        left: 12px;
        right: 12px;
        bottom: max(12px, env(safe-area-inset-bottom));
        width: auto;
        max-height: min(72dvh, 580px);
        padding: 16px;
        border-radius: 8px;
    }

    .cookie-acoes {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cookie-acoes .cookie-btn-principal {
        grid-column: 1 / -1;
    }

    .cookie-modal[open] {
        align-items: flex-end;
        height: 100dvh;
        padding: 0 0 max(12px, env(safe-area-inset-bottom));
    }

    .cookie-modal-conteudo {
        max-height: 92dvh;
        margin-bottom: 8px;
        padding: 18px;
        border-radius: 12px 12px 0 0;
    }

    .cookie-modal-rodape {
        flex-direction: column;
        align-items: stretch;
    }

    .cookie-modal-acoes {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cookie-modal-acoes .cookie-btn-principal {
        grid-column: 1 / -1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cookie-banner,
    .cookie-modal,
    .cookie-modal-conteudo,
    .cookie-btn {
        transition: none;
    }
}

.cookie-btn:hover {
    transform: none;
}

.cookie-banner,
.cookie-modal,
.cookie-modal-conteudo,
.cookie-btn {
    transition: none !important;
}
