/* ============================================================
   Valkhan Tech - Cookie Consent Banner & Preferences Panel
   Paleta de cores em sincronia com blog.less
   ============================================================ */

/* ── Animação de entrada ─────────────────────────────────── */
@keyframes vtkSlideUp {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

@keyframes vtkFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Banner (barra inferior) ─────────────────────────────── */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9998;
    background: #1b2d5b;
    color: #fff;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, .3);
    animation: vtkSlideUp .35s ease;
}

.cookie-banner__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 24px;
    flex-wrap: wrap;
    max-width: 1320px;
    margin: 0 auto;
}

.cookie-banner__text {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .9rem;
    flex: 1 1 220px;
    line-height: 1.5;
}

.cookie-banner__text .fa-cookie-bite {
    font-size: 1.35rem;
    color: #33C3F3;
    flex-shrink: 0;
}

.cookie-banner__link {
    color: #33C3F3;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cookie-banner__link:hover {
    color: #fff;
}

.cookie-banner__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

/* ── Botões compartilhados ────────────────────────────────── */
.cookie-banner__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: background .2s ease, border-color .2s ease, color .2s ease;
    white-space: nowrap;
    line-height: 1.2;
    text-decoration: none;
}

/* Primário — aceitar todos / salvar */
.cookie-banner__btn--primary {
    background: #33C3F3;
    color: #1b2d5b;
    border-color: #33C3F3;
}

.cookie-banner__btn--primary:hover {
    background: #20b0e0;
    border-color: #20b0e0;
    color: #fff;
}

/* Secundário — recusar opcionais */
.cookie-banner__btn--secondary {
    background: transparent;
    color: #fff;
    border-color: rgba(255, 255, 255, .4);
}

.cookie-banner__btn--secondary:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, .1);
}

/* Outline — personalizar */
.cookie-banner__btn--outline {
    background: transparent;
    color: #33C3F3;
    border-color: #33C3F3;
}

.cookie-banner__btn--outline:hover {
    background: rgba(51, 195, 243, .15);
}

/* ── Painel de preferências ─────────────────────────────── */
.cookie-panel {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: vtkFadeIn .25s ease;
}

.cookie-panel__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.cookie-panel__box {
    position: relative;
    background: #fff;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 16px 16px 0 0;
    display: flex;
    flex-direction: column;
    animation: vtkSlideUp .3s ease;
    outline: none;
}

@media (min-width: 576px) {
    .cookie-panel {
        align-items: center;
    }

    .cookie-panel__box {
        border-radius: 16px;
        margin: 16px;
    }
}

/* Cabeçalho do painel */
.cookie-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}

.cookie-panel__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1b2d5b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cookie-panel__title .fa-sliders-h {
    color: #33C3F3;
    font-size: 1rem;
}

.cookie-panel__close {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 1rem;
    padding: 6px 8px;
    border-radius: 8px;
    transition: background .2s, color .2s;
    line-height: 1;
}

.cookie-panel__close:hover {
    background: #f3f4f6;
    color: #1b2d5b;
}

/* Corpo do painel */
.cookie-panel__body {
    padding: 20px 24px;
    flex: 1;
}

.cookie-panel__desc {
    font-size: .875rem;
    color: #6b7280;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* ── Categoria de cookie ─────────────────────────────────── */
.cookie-category {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
    transition: border-color .2s;
}

.cookie-category:hover {
    border-color: #d1d5db;
}

.cookie-category__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.cookie-category__info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .9rem;
    font-weight: 600;
    color: #1f2937;
}

.cookie-category__badge {
    font-size: .68rem;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 50px;
    background: #d1fae5;
    color: #065f46;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.cookie-category__desc {
    font-size: .8rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.55;
}

/* ── Toggle switch ────────────────────────────────────────── */
.cookie-toggle {
    flex-shrink: 0;
    position: relative;
}

.cookie-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-toggle label {
    display: block;
    width: 46px;
    height: 26px;
    background: #d1d5db;
    border-radius: 50px;
    cursor: pointer;
    transition: background .25s;
    position: relative;
    user-select: none;
}

.cookie-toggle label::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform .25s;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
}

.cookie-toggle input:checked + label {
    background: #33C3F3;
}

.cookie-toggle input:checked + label::after {
    transform: translateX(20px);
}

.cookie-toggle--disabled label {
    cursor: not-allowed;
    opacity: .75;
}

.cookie-toggle input:checked:disabled + label {
    background: #34d399;
}

.cookie-toggle input:focus-visible + label {
    box-shadow: 0 0 0 3px rgba(51, 195, 243, .35);
    outline: none;
}

/* ── Rodapé do painel ─────────────────────────────────────── */
.cookie-panel__footer {
    padding: 16px 24px 20px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    position: sticky;
    bottom: 0;
    background: #fff;
}

/* ── Responsivo — mobile ─────────────────────────────────── */
@media (max-width: 575px) {
    .cookie-banner__bar {
        flex-direction: column;
        align-items: flex-start;
        padding: 14px 16px;
        gap: 12px;
    }

    .cookie-banner__actions {
        width: 100%;
        justify-content: flex-end;
    }

    .cookie-panel__body {
        padding: 16px;
    }

    .cookie-panel__header,
    .cookie-panel__footer {
        padding-left: 16px;
        padding-right: 16px;
    }
}
