/* =========================================================
   Cookie Consent – Frontend
   ========================================================= */

#ccm-banner,
#ccm-modal {
    box-sizing: border-box;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.55;
}

#ccm-banner *,
#ccm-modal * {
    box-sizing: border-box;
}

/* ---------------------------------------------------------
   Banner
   --------------------------------------------------------- */

#ccm-banner {
    position: fixed;
    z-index: 99998;
    top: 1rem;
    right: 1rem;
    width: min(420px, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    background: #fff;
    color: rgb(var(--tertiary-rgb, 0 63 122));
    border-radius: 6px;
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.18);
    padding: 1.75rem;
    display: none;
}

#ccm-banner.is-visible {
    display: block;
}

#ccm-banner-text p {
    margin: 0 0 1em;
}

#ccm-banner-text p:last-child {
    margin-bottom: 0;
}

#ccm-banner-text a {
    color: rgb(var(--secondary-rgb, 0 164 213));
    text-decoration: underline;
}

.ccm-banner-actions {
    margin-top: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.ccm-banner-actions-row {
    display: flex;
    gap: 0.6rem;
}

.ccm-banner-actions-row .ccm-btn {
    flex: 1 1 0;
}

@media (max-width: 600px) {
    #ccm-banner {
        top: auto;
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-height: 70vh;
        border-radius: 12px 12px 0 0;
    }
}

/* ---------------------------------------------------------
   Buttons / Toggles (shared)
   --------------------------------------------------------- */

.ccm-btn {
    font: inherit;
    font-weight: 700;
    border: 0;
    border-radius: 4px;
    padding: 0.7em 1.2em;
    cursor: pointer;
    background: #ddd;
    color: rgb(var(--tertiary-rgb, 0 63 122));
    transition: background-color 0.15s ease;
}

.ccm-btn:hover,
.ccm-btn:focus-visible {
    background: #cfcfcf;
}

.ccm-btn-accept {
    width: 100%;
}

.ccm-toggle {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    flex: 0 0 auto;
}

.ccm-toggle input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.ccm-toggle-slider {
    position: absolute;
    inset: 0;
    background: #ccc;
    border-radius: 999px;
    transition: background-color 0.15s ease;
}

.ccm-toggle-slider::before {
    content: "";
    position: absolute;
    left: 3px;
    top: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.15s ease;
}

.ccm-toggle input:checked + .ccm-toggle-slider {
    background: rgb(var(--secondary-rgb, 0 164 213));
}

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

.ccm-toggle input:disabled + .ccm-toggle-slider {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ---------------------------------------------------------
   Settings modal
   --------------------------------------------------------- */

#ccm-modal {
    position: fixed;
    z-index: 99999;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

#ccm-modal.is-visible {
    display: flex;
}

.ccm-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.ccm-modal-dialog {
    position: relative;
    background: #fff;
    color: #333;
    width: min(640px, 100%);
    max-height: 85vh;
    overflow-y: auto;
    border-radius: 6px;
    padding: 1.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

.ccm-modal-title {
    margin: 0 0 1rem;
    font-size: 1.25rem;
}

.ccm-tabs {
    display: flex;
    border-bottom: 2px solid #eee;
    margin-bottom: 1.25rem;
}

.ccm-tab {
    font: inherit;
    font-weight: 700;
    background: transparent;
    border: 0;
    border-bottom: 3px solid transparent;
    padding: 0.6em 1.1em;
    cursor: pointer;
    color: #555;
    margin-bottom: -2px;
}

.ccm-tab.is-active {
    color: rgb(var(--secondary-rgb, 0 164 213));
    border-bottom-color: rgb(var(--secondary-rgb, 0 164 213));
}

.ccm-category {
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}

.ccm-category:last-child {
    border-bottom: 0;
}

.ccm-category-title {
    margin: 0 0 0.5rem;
    color: rgb(var(--primary-rgb, 223 3 19));
    font-size: 1.05rem;
}

.ccm-category-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
}

.ccm-category-desc {
    margin: 0;
    flex: 1 1 auto;
}

.ccm-cookie-group {
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
}

.ccm-cookie-group:last-child {
    border-bottom: 0;
}

.ccm-cookie-list {
    margin: 0.4rem 0 0;
    padding-left: 1.2rem;
}

.ccm-cookie-empty {
    color: #888;
    list-style: none;
    padding-left: 0;
    margin-left: -1.2rem;
}

.ccm-modal-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 0.6rem;
}

@media (max-width: 480px) {
    .ccm-category-row {
        flex-direction: column;
        gap: 0.75rem;
    }

    .ccm-modal-actions {
        flex-direction: column;
    }
}
