/* ===== Cookie Consent Backdrop ===== */
.cc-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 99999998;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    transition: opacity 0.3s ease;
}

/* ===== Cookie Consent Banner ===== */
.cc-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999999;
    animation: ccSlideUp 0.4s ease-out;
}

@keyframes ccSlideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cc-banner-inner {
    background: var(--sm-white, #fff);
    border-top: 3px solid var(--sm-primary, #2e4c6d);
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.15);
    max-height: 85vh;
    overflow-y: auto;
}

/* ===== Main Content ===== */
.cc-main {
    padding: 28px 40px 24px;
    max-width: 1400px;
    margin: 0 auto;
}

.cc-title {
    font-family: var(--sm-heading-font, 'Raleway', sans-serif);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--sm-heading, #2d465e);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cc-title i {
    font-size: 1.35rem;
    color: var(--sm-primary, #2e4c6d);
}

.cc-body p {
    font-size: 0.875rem;
    line-height: 1.7;
    color: var(--sm-default, #212529);
    margin-bottom: 10px;
}

.cc-body a {
    color: var(--sm-primary, #2e4c6d);
    font-weight: 600;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.cc-body a:hover {
    color: var(--sm-primary-hover, #3b5f88);
}

/* ===== Action Buttons ===== */
.cc-actions,
.cc-settings-actions-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.cc-settings-actions-top {
    padding: 20px 40px 0;
    max-width: 1400px;
    margin: 0 auto;
}

.cc-actions-right {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cc-btn {
    font-family: var(--sm-heading-font, 'Raleway', sans-serif);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    padding: 10px 24px;
    border-radius: 6px;
    transition: all 0.25s ease;
    white-space: nowrap;
    cursor: pointer;
}

.cc-btn-accept {
    background-color: var(--sm-primary, #2e4c6d);
    border: 2px solid var(--sm-primary, #2e4c6d);
    color: var(--sm-white, #fff);
}

.cc-btn-accept:hover {
    background-color: var(--sm-primary-hover, #3b5f88);
    border-color: var(--sm-primary-hover, #3b5f88);
    color: var(--sm-white, #fff);
}

.cc-btn-reject {
    background-color: var(--sm-primary, #2e4c6d);
    border: 2px solid var(--sm-primary, #2e4c6d);
    color: var(--sm-white, #fff);
}

.cc-btn-reject:hover {
    background-color: var(--sm-primary-hover, #3b5f88);
    border-color: var(--sm-primary-hover, #3b5f88);
    color: var(--sm-white, #fff);
}

.cc-btn-manage {
    background-color: transparent;
    border: 2px solid var(--sm-primary, #2e4c6d);
    color: var(--sm-primary, #2e4c6d);
}

.cc-btn-manage:hover {
    background-color: var(--sm-primary, #2e4c6d);
    color: var(--sm-white, #fff);
}

/* ===== Settings Panel ===== */
.cc-settings {
    padding-bottom: 24px;
}

.cc-settings-actions-bottom {
    text-align: center;
    padding: 18px 40px 6px;
    max-width: 1400px;
    margin: 0 auto;
}

.cc-settings-actions-bottom .cc-btn {
    min-width: 220px;
}

/* ===== Category (Accordion) ===== */
.cc-category {
    max-width: 1400px;
    margin: 12px auto 0;
    padding: 0 40px;
}

.cc-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f5f7f9;
    border: 1px solid #e2e6ea;
    border-radius: 8px;
    padding: 14px 20px;
    cursor: pointer;
    transition: background 0.2s ease;
    user-select: none;
}

.cc-category-header:hover {
    background: #edf0f4;
}

.cc-category-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--sm-heading-font, 'Raleway', sans-serif);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--sm-heading, #2d465e);
}

.cc-expand-icon {
    font-size: 0.85rem;
    transition: transform 0.3s ease;
    color: var(--sm-primary, #2e4c6d);
}

.cc-category-header.cc-expanded .cc-expand-icon {
    transform: rotate(45deg);
}

.cc-category-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cc-lock-icon {
    font-size: 1rem;
    color: #8a9bb0;
}

/* ===== Toggle Switch ===== */
.cc-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.cc-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cc-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #c5cdd6;
    transition: background-color 0.3s ease;
    border-radius: 26px;
}

.cc-slider::before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: var(--sm-white, #fff);
    transition: transform 0.3s ease;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.cc-switch input:checked + .cc-slider {
    background-color: var(--sm-primary, #2e4c6d);
}

.cc-switch input:checked + .cc-slider::before {
    transform: translateX(22px);
}

.cc-switch input:disabled + .cc-slider {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ===== Category Body ===== */
.cc-category-body {
    background: #fafbfc;
    border: 1px solid #e2e6ea;
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 20px 24px;
    animation: ccFadeIn 0.25s ease;
}

@keyframes ccFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.cc-category-body p {
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--sm-default, #212529);
    margin-bottom: 12px;
}

/* ===== Cookie Table ===== */
.cc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    margin-top: 12px;
}

.cc-table thead th {
    background: var(--sm-primary, #2e4c6d);
    color: var(--sm-white, #fff);
    font-family: var(--sm-heading-font, 'Raleway', sans-serif);
    font-weight: 600;
    padding: 10px 14px;
    text-align: left;
    white-space: nowrap;
}

.cc-table thead th:first-child {
    border-radius: 6px 0 0 0;
}

.cc-table thead th:last-child {
    border-radius: 0 6px 0 0;
}

.cc-table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid #e8ecf0;
    color: var(--sm-default, #212529);
    vertical-align: top;
}

.cc-table tbody tr:last-child td {
    border-bottom: none;
}

.cc-table tbody tr:nth-child(even) {
    background: #f2f5f8;
}

.cc-table tbody tr:hover {
    background: color-mix(in srgb, var(--sm-primary, #2e4c6d), transparent 92%);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .cc-main {
        padding: 20px 20px 16px;
    }

    .cc-title {
        font-size: 1.1rem;
    }

    .cc-body p {
        font-size: 0.82rem;
    }

    .cc-actions,
    .cc-settings-actions-top {
        flex-direction: column;
        align-items: stretch;
    }

    .cc-settings-actions-top {
        padding: 16px 20px 0;
    }

    .cc-actions-right {
        justify-content: stretch;
    }

    .cc-actions-right .cc-btn {
        flex: 1;
        text-align: center;
    }

    .cc-btn-manage {
        text-align: center;
    }

    .cc-category {
        padding: 0 20px;
    }

    .cc-category-header {
        padding: 12px 14px;
    }

    .cc-category-label {
        font-size: 0.85rem;
    }

    .cc-category-body {
        padding: 16px 14px;
    }

    .cc-settings-actions-bottom {
        padding: 16px 20px 6px;
    }

    /* Responsive table: stacked layout on small screens */
    .cc-table thead {
        display: none;
    }

    .cc-table tbody tr {
        display: block;
        margin-bottom: 12px;
        border: 1px solid #e2e6ea;
        border-radius: 8px;
        padding: 10px 14px;
        background: var(--sm-white, #fff);
    }

    .cc-table tbody tr:nth-child(even) {
        background: var(--sm-white, #fff);
    }

    .cc-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        padding: 6px 0;
        border-bottom: 1px solid #f0f2f5;
        font-size: 0.8rem;
    }

    .cc-table tbody td::before {
        content: attr(data-label);
        font-weight: 700;
        font-family: var(--sm-heading-font, 'Raleway', sans-serif);
        color: var(--sm-heading, #2d465e);
        flex: 0 0 40%;
        padding-right: 10px;
        font-size: 0.78rem;
    }

    .cc-table tbody td:last-child {
        border-bottom: none;
    }
}

@media (max-width: 480px) {
    .cc-main {
        padding: 16px 14px 12px;
    }

    .cc-btn {
        font-size: 0.72rem;
        padding: 9px 16px;
    }

    .cc-category {
        padding: 0 14px;
    }
}

/* ===== Scrollbar ===== */
.cc-banner-inner::-webkit-scrollbar {
    width: 6px;
}

.cc-banner-inner::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.cc-banner-inner::-webkit-scrollbar-thumb {
    background: #c1c9d2;
    border-radius: 3px;
}

.cc-banner-inner::-webkit-scrollbar-thumb:hover {
    background: #a0aab5;
}
