/**
 * A-Z Byg Cookie Consent — Styles
 * Developed by LynBro ApS — https://lynbro.dk
 */

/* ── Overlay ── */
.azbyg-cb {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
}

.azbyg-cb__overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

/* ── Dialog ── */
.azbyg-cb__dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    background: #ffffff;
    border-radius: 1.25rem 1.25rem 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
    padding: 2rem 1.75rem 1.5rem;
    animation: azbyg-cb-slide-up 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 640px) {
    .azbyg-cb {
        align-items: center;
    }
    .azbyg-cb__dialog {
        border-radius: 1.25rem;
        margin: 1rem;
        max-width: 520px;
    }
}

@keyframes azbyg-cb-slide-up {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Icon ── */
.azbyg-cb__icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* ── Typography ── */
.azbyg-cb__title {
    font-family: 'Manrope', 'Inter', sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    color: #1b1c1c;
    margin: 0 0 0.75rem;
    line-height: 1.3;
}

.azbyg-cb__text {
    font-size: 0.9rem;
    color: #44474e;
    line-height: 1.6;
    margin: 0 0 0.5rem;
}

.azbyg-cb__text--small {
    font-size: 0.8rem;
    color: #74777f;
    margin-bottom: 1.25rem;
}

.azbyg-cb__text a {
    color: #d32f2f;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.azbyg-cb__text a:hover {
    color: #b71c1c;
}

/* ── Buttons ── */
.azbyg-cb__buttons {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 1rem;
}

@media (min-width: 400px) {
    .azbyg-cb__buttons {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }
}

.azbyg-cb__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    font-family: 'Manrope', 'Inter', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    border-radius: 0.75rem;
    padding: 0.8rem 1.5rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.azbyg-cb__btn--primary {
    background: #d32f2f;
    color: #fff;
    flex: 1;
    min-width: 0;
}

.azbyg-cb__btn--primary:hover {
    background: #b71c1c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.3);
}

.azbyg-cb__btn--primary:active {
    transform: scale(0.97);
}

.azbyg-cb__btn--secondary {
    background: #f7f3f2;
    color: #1b1c1c;
    border: 1px solid #e6e2e1;
    flex: 1;
    min-width: 0;
}

.azbyg-cb__btn--secondary:hover {
    background: #e6e2e1;
    transform: translateY(-1px);
}

.azbyg-cb__btn--link {
    background: transparent;
    color: #74777f;
    padding: 0.5rem 0.75rem;
    font-size: 0.825rem;
    text-decoration: underline;
    text-underline-offset: 2px;
    width: 100%;
}

@media (min-width: 400px) {
    .azbyg-cb__btn--link {
        width: auto;
    }
}

.azbyg-cb__btn--link:hover {
    color: #d32f2f;
}

/* ── Cookie Categories (settings view) ── */
.azbyg-cb__categories {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1rem 0;
}

.azbyg-cb__cat {
    background: #f7f3f2;
    border-radius: 0.875rem;
    padding: 1rem;
    border: 1px solid #e6e2e1;
}

.azbyg-cb__cat-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.azbyg-cb__cat-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.azbyg-cb__cat-info strong {
    font-family: 'Manrope', 'Inter', sans-serif;
    font-size: 0.95rem;
    color: #1b1c1c;
}

.azbyg-cb__cat-desc {
    font-size: 0.8rem;
    color: #74777f;
    line-height: 1.55;
    margin: 0.5rem 0 0;
    padding-left: 3.25rem;
}

/* ── Badge ── */
.azbyg-cb__badge--required {
    background: #e6e2e1;
    color: #44474e;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}

/* ── Toggle Switch ── */
.azbyg-cb__toggle {
    position: relative;
    display: inline-flex;
    cursor: pointer;
    flex-shrink: 0;
}

.azbyg-cb__toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.azbyg-cb__toggle-track {
    width: 44px;
    height: 24px;
    background: #c0c4cc;
    border-radius: 999px;
    position: relative;
    transition: background 0.25s ease;
}

.azbyg-cb__toggle-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.azbyg-cb__toggle input:checked + .azbyg-cb__toggle-track {
    background: #d32f2f;
}

.azbyg-cb__toggle input:checked + .azbyg-cb__toggle-track::after {
    transform: translateX(20px);
}

.azbyg-cb__toggle-track--locked {
    background: #a0a4ab !important;
    opacity: 0.7;
    cursor: not-allowed;
}

.azbyg-cb__toggle-track--locked::after {
    transform: translateX(20px);
}

/* ── Closing animation ── */
.azbyg-cb--closing .azbyg-cb__dialog {
    animation: azbyg-cb-slide-down 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.azbyg-cb--closing .azbyg-cb__overlay {
    animation: azbyg-cb-fade-out 0.25s ease forwards;
}

@keyframes azbyg-cb-slide-down {
    to {
        opacity: 0;
        transform: translateY(40px);
    }
}

@keyframes azbyg-cb-fade-out {
    to {
        opacity: 0;
    }
}
