/* IDD Cookies - iddigital.pt */

.idd-hidden { display: none !important; }

#idd-cookies-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    z-index: 99998;
}

/* ---------- Banner ---------- */
.idd-cookies-banner {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 99999;
    background: var(--idd-bg, #ffffff);
    color: var(--idd-text, #1a1a1a);
    box-shadow: 0 -2px 20px rgba(0, 0, 0, .15);
    border-top: 3px solid var(--idd-accent, #2b3a67);
    padding: 18px 20px;
    font-size: 14px;
    line-height: 1.5;
}
.idd-cookies-banner.idd-pos-bottom { bottom: 0; }
.idd-cookies-banner.idd-pos-top {
    top: 0;
    border-top: none;
    border-bottom: 3px solid var(--idd-accent, #2b3a67);
    box-shadow: 0 2px 20px rgba(0, 0, 0, .15);
}
.idd-cookies-banner.idd-pos-center {
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%);
    max-width: 560px;
    width: calc(100% - 40px);
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .3);
}

.idd-cb-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}
.idd-pos-center .idd-cb-inner { flex-direction: column; align-items: stretch; }

.idd-cb-text { flex: 1 1 380px; }
.idd-cb-title { margin: 0 0 6px; font-size: 16px; font-weight: 700; }
.idd-cb-desc { margin: 0; color: #444; }
.idd-cb-link { color: var(--idd-accent, #2b3a67); text-decoration: underline; }

.idd-cb-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.idd-pos-center .idd-cb-actions { justify-content: stretch; }
.idd-pos-center .idd-cb-actions .idd-btn { flex: 1 1 auto; }

/* ---------- Botões: igual destaque para Aceitar e Rejeitar ---------- */
.idd-btn {
    cursor: pointer;
    border: 2px solid var(--idd-accent, #2b3a67);
    border-radius: 6px;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    transition: opacity .15s ease, background .15s ease;
    min-width: 110px;
    text-align: center;
}
/* Primário = mesmo peso visual; usado por Aceitar E Rejeitar */
.idd-btn-primary {
    background: var(--idd-accent, #2b3a67);
    color: var(--idd-btn-text, #ffffff);
}
.idd-btn-primary:hover { opacity: .88; }
/* Secundário = "Personalizar" (ação neutra, menos dominante por design honesto) */
.idd-btn-secondary {
    background: transparent;
    color: var(--idd-accent, #2b3a67);
}
.idd-btn-secondary:hover { background: rgba(43, 58, 103, .08); }

/* ---------- Modal de preferências ---------- */
.idd-cookies-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.idd-modal-card {
    background: var(--idd-bg, #ffffff);
    color: var(--idd-text, #1a1a1a);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 12px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, .35);
}
.idd-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid #eee;
}
.idd-modal-head h2 { margin: 0; font-size: 18px; }
.idd-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #888;
}
.idd-modal-close:hover { color: var(--idd-text, #1a1a1a); }

.idd-modal-body { padding: 8px 22px; }
.idd-cat { padding: 16px 0; border-bottom: 1px solid #f0f0f0; }
.idd-cat:last-child { border-bottom: none; }
.idd-cat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.idd-cat-name { font-weight: 600; font-size: 15px; }
.idd-cat-desc { margin: 6px 0 0; color: #555; font-size: 13px; }

.idd-modal-foot {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
    padding: 18px 22px;
    border-top: 1px solid #eee;
}

/* ---------- Toggle switch ---------- */
.idd-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    flex: 0 0 auto;
}
.idd-switch input { opacity: 0; width: 0; height: 0; }
.idd-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #ccc;
    border-radius: 26px;
    transition: .2s;
}
.idd-slider:before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: .2s;
}
.idd-switch input:checked + .idd-slider { background: var(--idd-accent, #2b3a67); }
.idd-switch input:checked + .idd-slider:before { transform: translateX(20px); }
.idd-switch.idd-disabled .idd-slider { background: var(--idd-accent, #2b3a67); opacity: .5; cursor: not-allowed; }

/* ---------- Botão flutuante reabrir ---------- */
.idd-cookies-reopen {
    position: fixed;
    left: 18px;
    bottom: 18px;
    z-index: 99997;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    background: var(--idd-accent, #2b3a67);
    color: var(--idd-btn-text, #fff);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
}
.idd-cookies-reopen:hover { opacity: .9; }

/* ---------- Responsivo ---------- */
@media (max-width: 600px) {
    .idd-cb-inner { flex-direction: column; align-items: stretch; }
    .idd-cb-actions { justify-content: stretch; }
    .idd-cb-actions .idd-btn { flex: 1 1 auto; min-width: 0; }
    .idd-modal-foot { flex-direction: column-reverse; }
    .idd-modal-foot .idd-btn { width: 100%; }
}
