#cookiepolicy {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 99999;
    padding: 15px 0;
    font-size: 14px;
    line-height: 1.5;
    transition: opacity 0.4s ease;
}

#cookiepolicy.cookiepolicy-fixed-bottom {
    bottom: 0;
}

#cookiepolicy.cookiepolicy-fixed-top {
    top: 0;
}

.cookiepolicy-msg {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
}

.cookiepolicy-text {
    flex: 1;
    min-width: 200px;
}

.cookiepolicy-buttons {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

#cookiepolicy-btn,
.cookiepolicy-btn-reject,
.cookiepolicy-btn-settings {
    display: inline-block;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    border: none;
    transition: all 0.3s ease;
}

.cookiepolicy-btn-settings {
    background: transparent;
    border: 1px solid currentColor !important;
}

#cookiepolicy-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: opacity 0.4s ease;
}

#cookiepolicy-modal {
    background: #fff;
    border-radius: 8px;
    max-width: 520px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.cookiepolicy-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid #e5e5e5;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.cookiepolicy-modal-header button {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    line-height: 1;
}

.cookiepolicy-modal-header button:hover {
    color: #333;
}

.cookiepolicy-modal-body {
    padding: 16px 24px;
    overflow-y: auto;
    flex: 1;
}

.cookiepolicy-modal-footer {
    display: flex;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid #e5e5e5;
    justify-content: flex-end;
}

.cookiepolicy-modal-footer button {
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
    border: none;
    transition: all 0.3s ease;
}

#cookiepolicy-save-btn {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

#cookiepolicy-save-btn:hover {
    background: #e8e8e8;
}

#cookiepolicy-acceptall-btn {
    background: #262626;
    color: #fff;
}

#cookiepolicy-acceptall-btn:hover {
    background: #444;
}

/* === Категорія === */
.cookiepolicy-category {
    padding: 14px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.cookiepolicy-category-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cookiepolicy-category-label {
    font-weight: 600;
    font-size: 15px;
    color: #333;
}

.cookiepolicy-category-desc {
    margin: 6px 0 0 52px;
    font-size: 13px;
    color: #777;
    line-height: 1.4;
}

/* === Toggle switch === */
.cookiepolicy-toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}

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

.cookiepolicy-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    border-radius: 22px;
    transition: 0.3s;
}

.cookiepolicy-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
}

.cookiepolicy-toggle input:checked + .cookiepolicy-slider {
    background-color: #4caf50;
}

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

.cookiepolicy-toggle input:disabled + .cookiepolicy-slider {
    background-color: #4caf50;
    opacity: 0.6;
    cursor: not-allowed;
}

#cookiepolicy-manage-btn {
    position: fixed;
    z-index: 99998;
    padding: 8px 16px;
    font-size: 13px;
    background: #262626;
    color: #fff;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

#cookiepolicy-manage-btn:hover {
    background: #444;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

#cookiepolicy-manage-btn.cookiepolicy-manage-icon-only {
    padding: 10px;
    font-size: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    justify-content: center;
}

.cookiepolicy-manage-bottom-left {
    bottom: 20px;
    left: 20px;
}

.cookiepolicy-manage-bottom-right {
    bottom: 20px;
    right: 20px;
}

@media (max-width: 768px) {
    .cookiepolicy-msg {
        flex-direction: column;
        text-align: center;
    }

    .cookiepolicy-buttons {
        justify-content: center;
        width: 100%;
        flex-direction: column;
    }

    #cookiepolicy-btn,
    .cookiepolicy-btn-reject,
    .cookiepolicy-btn-settings {
        width: 100%;
        text-align: center;
    }

    #cookiepolicy-modal {
        max-height: 90vh;
    }

    .cookiepolicy-category-desc {
        margin-left: 0;
        margin-top: 8px;
    }

    .cookiepolicy-modal-footer {
        flex-direction: column;
    }

    .cookiepolicy-modal-footer button {
        width: 100%;
    }

    #cookiepolicy-manage-btn {
        font-size: 0;
        padding: 10px;
        border-radius: 50%;
        width: 44px;
        height: 44px;
        justify-content: center;
    }

    #cookiepolicy-manage-btn i {
        font-size: 18px;
    }
}

.cookiepolicy-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    padding: 20px;
    transition: opacity 0.4s ease;
}

.cookiepolicy-popup {
    max-width: 480px;
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: cookiepolicy-popup-in 0.35s ease;
    overflow: hidden;
}

@keyframes cookiepolicy-popup-in {
    from { opacity: 0; transform: scale(0.92) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.cookiepolicy-popup-body {
    padding: 24px;
}

.cookiepolicy-popup .cookiepolicy-text {
    margin-bottom: 20px;
    line-height: 1.6;
}

.cookiepolicy-popup .cookiepolicy-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.cookiepolicy-popup-top-left     { align-items: flex-start; justify-content: flex-start; }
.cookiepolicy-popup-top-center   { align-items: flex-start; justify-content: center; }
.cookiepolicy-popup-top-right    { align-items: flex-start; justify-content: flex-end; }
.cookiepolicy-popup-center-left  { align-items: center; justify-content: flex-start; }
.cookiepolicy-popup-center-center { align-items: center; justify-content: center; }
.cookiepolicy-popup-center-right { align-items: center; justify-content: flex-end; }
.cookiepolicy-popup-bottom-left   { align-items: flex-end; justify-content: flex-start; }
.cookiepolicy-popup-bottom-center { align-items: flex-end; justify-content: center; }
.cookiepolicy-popup-bottom-right  { align-items: flex-end; justify-content: flex-end; }

@media (max-width: 576px) {
    .cookiepolicy-popup-overlay {
        padding: 0;
        align-items: flex-end !important;
        justify-content: stretch !important;
    }

    .cookiepolicy-popup {
        max-width: 100%;
        border-radius: 12px 12px 0 0;
    }
}
