:root {
    --banner-height: 80px;
}

/* --- FONTS & RESET --- */
.cookie-banner,
.cookie-sidebar,
.cookie-modal-overlay {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

.cookie-banner *,
.cookie-sidebar * {
    box-sizing: border-box;
}

/* --- OVERLAY --- */
.cookie-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.35);
    z-index: 99998;
}

/* --- BOTTOM BANNER --- */
.cookie-banner {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.12);
    border: 1px solid #e5e7eb;
    padding: 16px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 99999;
    gap: 24px;
}

.cookie-banner-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    max-width: 58%;
}

.cookie-banner-icon {
    color: #111111;
    flex-shrink: 0;
    margin-top: 2px;
}

.cookie-banner-text h4 {
    margin: 0 0 4px 0;
    font-size: 15px;
    font-weight: 700;
    color: #111111;
}

.cookie-banner-text p {
    margin: 0;
    font-size: 12px;
    color: #555555;
    line-height: 1.4;
}

.cookie-banner-text .cookie-policy-line {
    margin-top: 4px;
}

.cookie-policy-link,
.footer-link-wrap a {
    color: #ff522b;
    text-decoration: underline;
    font-size: 12px;
    font-weight: 500;
}

.cookie-policy-link:hover,
.footer-link-wrap a:hover {
    color: #e03d19;
}

.cookie-banner-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* --- SIDEBAR / MODAL --- */
.cookie-sidebar {
    position: fixed;
    right: 20px;
    bottom: calc(20px + var(--banner-height) + 8px);
    width: 370px;
    max-width: calc(100vw - 40px);
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border: 1px solid #e5e7eb;
    z-index: 100000;
    padding: 20px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - var(--banner-height) - 60px);
    overflow-y: auto;
}

.cookie-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.cookie-sidebar-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #111111;
}

.btn-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #888888;
    padding: 0;
    line-height: 1;
}

.btn-close:hover {
    color: #111111;
}

.cookie-sidebar-desc {
    font-size: 11.5px;
    color: #666666;
    margin: 0 0 14px 0;
    line-height: 1.35;
}

.cookie-categories {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cookie-category-item {
    border: 1px solid #ededed;
    border-radius: 8px;
    padding: 10px 12px;
    background-color: #ffffff;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #111111;
}

.icon-lock {
    color: #666666;
}

.cookie-category-item p {
    font-size: 11px;
    color: #777777;
    margin: 4px 0 0 0;
    line-height: 1.3;
}

/* --- TOGGLE SWITCHES --- */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #dcdce1;
    transition: 0.2s ease;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: #ffffff;
    transition: 0.2s ease;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.cookie-consent-banner input:checked + .slider,
.cookie-sidebar input:checked + .slider {
    background-color: #ff522b;
}

input:checked + .slider:before {
    transform: translateX(16px);
}

.toggle-switch.disabled .slider {
    background-color: #dcdce1;
    cursor: not-allowed;
}

/* FOOTER */
.cookie-sidebar-footer {
    margin-top: 16px;
}

.footer-link-wrap {
    text-align: center;
    margin-top: 10px;
    font-size: 11.5px;
    color: #666666;
}

/* --- BUTTONS --- */
.btn-cookie {
    height: 38px;
    padding: 0 20px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.cookie-banner .btn-primary {
    background-color: #ff522b;
    color: #ffffff;
}

.cookie-banner .btn-primary:hover {
    background-color: #e03d19;
    border: 1px solid #d13126;
}

.cookie-banner .btn-secondary {
    background-color: #ffffff;
    color: #111111;
    border-color: #d1d5db;
}

.cookie-banner .btn-secondary:hover {
    background-color: #f9fafb;
    border: 1px solid #d13126;
}

.cookie-banner .btn-text {
    background: transparent;
    color: #ff522b;
    padding: 0 8px;
}

.cookie-banner .btn-text:hover {
    text-decoration: underline;
}

.btn-block {
    width: 100%;
}

/* --- MOBILE ADAPTIVE --- */
@media (max-width: 768px) {
    .cookie-banner {
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: 12px 12px 0 0;
        padding: 16px;
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    }

    .cookie-banner-content {
        max-width: 100%;
    }

    .cookie-banner-actions {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }

    .cookie-banner-actions button {
        width: 100%;
    }

    .cookie-sidebar {
        right: 0;
        left: 0;
        bottom: 0;
        top: auto;
        width: 100%;
        max-width: 100%;
        height: auto;
        max-height: 85vh;
        border-radius: 16px 16px 0 0;
        border: none;
        box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.25);
        padding: 20px 16px;
    }
}