
/* =========================================================
   ROOT VARIABLES (settes fra backend)
   ========================================================= */
:root {
    --sccb-bg: var(--sccb-banner-bg, #111827);
    --sccb-text: var(--sccb-banner-text, #ffffff);

    --sccb-btn-bg: var(--sccb-btn-primary-bg, #10b981);
    --sccb-btn-text: var(--sccb-btn-primary-text, #ffffff);
    --sccb-btn-border: var(--sccb-btn-primary-border, #10b981);
}


/* =========================================================
   COOKIE BANNER BASE
   ========================================================= */
#sccb-banner {
    position: fixed;
    left: 0;
    right: 0;
    background: var(--sccb-bg);
    color: var(--sccb-text);
    display: none;
    z-index: 100000;
    box-sizing: border-box;
    animation: sccb-slide-up 0.35s ease-out;
}

#sccb-banner .sccb-banner-text {
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

/* =========================================================
   BANNER POSITIONS
   ========================================================= */
#sccb-banner[data-position="bottom_bar"],
#sccb-banner[data-position="top_bar"] {
    padding: 16px 32px;
}

/* Full width layout: Tekst venstre, knapper høyre */
#sccb-banner[data-position="bottom_bar"] .sccb-bar-inner,
#sccb-banner[data-position="top_bar"] .sccb-bar-inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

#sccb-banner[data-position="bottom_bar"] { bottom: 0; }
#sccb-banner[data-position="top_bar"] { top: 0; }

/* Tekst til venstre */
#sccb-banner[data-position="bottom_bar"] .sccb-banner-text,
#sccb-banner[data-position="top_bar"] .sccb-banner-text {
    flex: 1;
    margin: 0;
}

/* Knapper til høyre */
#sccb-banner[data-position="bottom_bar"] .sccb-buttons,
#sccb-banner[data-position="top_bar"] .sccb-buttons {
    margin-top: 0;
    flex-shrink: 0;
}

#sccb-banner[data-position="bottom_left"],
#sccb-banner[data-position="bottom_right"] {
    position: fixed;
    width: 390px;
    max-width: 90%;
    padding: 24px;
    border-radius: 10px;
    box-sizing: border-box;
    left: auto;
    right: auto;
}

#sccb-banner[data-position="bottom_left"] {
    bottom: 24px;
    left: 24px;
    right: auto;
}

#sccb-banner[data-position="bottom_right"] {
    bottom: 24px;
    right: 24px;
    left: auto;
}

/* =========================================================
   CENTER BOX – DEN FØRSTE COOKIEBANNEREN (JUSTERT)
   ========================================================= */
#sccb-banner[data-position="center_box"] {
    width: 460px;              /* ⬅ større boks */
    max-width: 94%;
    padding: 34px 38px;        /* ⬅ mer luft rundt tekst */
    border-radius: 12px;
    display: none;
    flex-direction: column;
    box-sizing: border-box;

    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* =========================================================
   BANNER BUTTONS (BASE / SECONDARY – URØRT)
   ========================================================= */
.sccb-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 22px; /* litt luft fra tekst */
}

.sccb-buttons button {
    border: 1px solid rgba(255,255,255,0.6);
    background: transparent;
    color: var(--sccb-btn-text);
    padding: 8px 14px;   /* IKKE endret */
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

/* =========================================================
   PRIMARY BUTTONS (arver backend-farger)
   ========================================================= */
#sccb-accept-all,
#sccb-save-settings,
.sccb-primary {
    background: var(--sccb-btn-bg);
    color: var(--sccb-btn-text);
    border-color: var(--sccb-btn-bg);
}

/* Hover for primary */
#sccb-accept-all:hover,
#sccb-save-settings:hover,
.sccb-primary:hover {
    opacity: 0.9;
}

/* =========================================================
   REOPEN BUTTON (cookie-ikon – PRIMARY)
   ========================================================= */
#sccb-reopen-button {
    position: fixed;
    bottom: 22px;
    left: 22px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--sccb-btn-bg);
    color: var(--sccb-btn-text);
    border: none;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100003;
}

/* Hover reopen */
#sccb-reopen-button:hover {
    opacity: 0.9;
}


#sccb-reopen-button img {
    width: 28px;
    height: 28px;
}

body.sccb-consent-given #sccb-reopen-button {
    display: flex;
}

body.sccb-settings-open #sccb-reopen-button {
    display: none;
}

/* =========================================================
   SETTINGS BACKDROP
   ========================================================= */
#sccb-settings-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 100001;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}

#sccb-settings-backdrop.sccb-backdrop-open {
    opacity: 1;
    pointer-events: auto;
}

/* =========================================================
   SETTINGS PANEL
   ========================================================= */
#sccb-settings-panel {
    display: none;
    position: fixed;
    width: 480px;
    max-width: 95%;
    background: #ffffff;
    padding: 25px;
    border-radius: 12px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(.85);
    transition: all .25s ease;
    z-index: 100002;
    max-height: 90vh;
    overflow-y: auto;
}

#sccb-settings-panel.sccb-settings-open {
    display: block;
    transform: translate(-50%, -50%) scale(1);
}

/* =========================================================
   SETTINGS HEADER / TABS
   ========================================================= */
#sccb-settings-panel h2 {
    margin: 0 0 18px;
    font-size: 24px;
    line-height: 1.3;
}

.sccb-settings-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
}

.sccb-settings-tab-button {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #f3f4f6;
    cursor: pointer;
}

.sccb-settings-tab-button.sccb-tab-active {
    background: var(--sccb-btn-bg);
    color: var(--sccb-btn-text);
    border-color: var(--sccb-btn-bg);
}

/* =========================================================
   CATEGORY ROWS
   ========================================================= */
.sccb-consent-category {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

.sccb-consent-category:last-child {
    border-bottom: none;
}

/* =========================================================
   CATEGORY HEADER
   ========================================================= */
.sccb-consent-category-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sccb-cookie-toggle {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    position: relative;
}

.sccb-cookie-toggle::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    border-style: solid;
    border-width: 4px 0 4px 6px;
    border-color: transparent transparent transparent #000;
}

.sccb-cookie-toggle[aria-expanded="true"] {
    transform: rotate(90deg);
}

.sccb-consent-category-title {
    margin: 0;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.3;
}

/* =========================================================
   COOKIE LIST
   ========================================================= */
.sccb-cookie-list {
    display: none;
    margin: 6px 0 0 22px;
    padding-left: 18px;
    font-size: 12px;
    line-height: 1.4;
    opacity: 0.9;
}

.sccb-cookie-list li {
    margin: 0;
    list-style: disc;
    word-break: break-all;
}

.sccb-cookie-list.sccb-cookie-list-open {
    display: block;
}

/* =========================================================
   TOGGLE SWITCH
   ========================================================= */
.sccb-toggle {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 22px;
    flex: 0 0 auto;
}

.sccb-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.sccb-toggle-slider {
    position: absolute;
    inset: 0;
    cursor: pointer;
    background-color: #4b5563;
    border-radius: 999px;
    transition: background-color 0.2s ease;
}

.sccb-toggle-slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 2px;
    top: 2px;
    background-color: #ffffff;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.sccb-toggle input:checked + .sccb-toggle-slider {
    background-color: var(--sccb-btn-bg);
}

.sccb-toggle input:checked + .sccb-toggle-slider::before {
    transform: translateX(24px);
}

/* =========================================================
   SETTINGS FOOTER
   ========================================================= */
.sccb-settings-buttons {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
}

.sccb-settings-buttons button {
    background: var(--sccb-btn-bg);
    color: var(--sccb-btn-text);
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
}

/* =========================================================
   SETTINGS TABS
   ========================================================= */
#sccb-tab-categories,
#sccb-tab-policy {
    display: none;
}

#sccb-tab-categories.sccb-tab-open,
#sccb-tab-policy.sccb-tab-open {
    display: block;
}

/* =========================================================
   COOKIE POLICY – TYPOGRAFI
   ========================================================= */
#sccb-tab-policy {
    font-size: 14px;
    line-height: 1.6;
    color: #111827;
}

#sccb-tab-policy p {
    font-size: 16px;
    line-height: 1.6;
    margin: 0 0 10px 0;
}

#sccb-tab-policy ul,
#sccb-tab-policy ol {
    font-size: 16px;
    line-height: 1.6;
    margin: 8px 0 12px 18px;
}

#sccb-tab-policy li {
    margin-bottom: 6px;
}

/* =========================================================
   COOKIE POLICY – COLLAPSIBLE SERVICES DROPDOWN
   ========================================================= */
.sccb-collapsible {
    margin-top: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.sccb-collapsible > summary {
    list-style: none;
    cursor: pointer;
    padding: 10px 12px;
    background: #f9fafb;
    color: #111827;
    font-weight: 700;
    position: relative;
    border-bottom: 1px solid #e5e7eb;
    transition: background-color .15s ease, color .15s ease;
}

.sccb-collapsible > summary::-webkit-details-marker {
    display: none;
}

.sccb-collapsible > summary::after {
    content: "▾";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%) rotate(0deg);
    transition: transform .2s ease;
    color: #111827;
    font-size: 13px;
}

.sccb-collapsible[open] > summary::after {
    transform: translateY(-50%) rotate(180deg);
}

.sccb-collapsible > summary:hover,
.sccb-collapsible > summary:focus {
    background: #f3f4f6;
}

.sccb-collapsible .sccb-collapsible-content {
    padding: 12px;
}

.sccb-collapsible .sccb-collapsible-content p {
    margin: 0 0 8px 0;
    color: #374151;
}

.sccb-collapsible .sccb-collapsible-content ul {
    margin: 6px 0 0 18px;
}

/* =========================================================
   ANIMATION
   ========================================================= */
@keyframes sccb-slide-up {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   MOBILE RESPONSIVE
   ========================================================= */
@media (max-width: 768px) {
    /* Stabl knappene vertikalt på mobil */
    .sccb-buttons {
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }
    
    /* Lik bredde på alle knapper */
    .sccb-buttons button {
        width: 100%;
        padding: 12px 16px;
    }
    
    /* Juster center box på mobil */
    #sccb-banner[data-position="center_box"] {
        padding: 24px 20px;
        width: 94%;
    }
}

/* =========================================================
   SETTINGS ACTION BUTTONS (SAVE / CLOSE)
   ========================================================= */



