/* GDPR Cookie Consent Banner */

#cc-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

body.cc-open #cc-backdrop {
    opacity: 1;
    pointer-events: all;
}

.cc__banner {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    width: 100%;
    max-width: 660px;
    z-index: 9999;
    background: #ffffff;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    visibility: hidden;
    opacity: 0;
}

body.cc-open .cc__banner {
    transform: translateX(-50%) translateY(0);
    visibility: visible;
    opacity: 1;
}

@media (max-width: 640px) {
    .cc__banner {
        left: 0;
        transform: translateY(100%);
        border-radius: 14px 14px 0 0;
    }

    body.cc-open .cc__banner {
        transform: translateY(0);
        visibility: visible;
        opacity: 1;
    }
}

@media (prefers-color-scheme: dark) {
    .cc__banner {
        background: #1e1e1e;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
    }
}

.cc__inner {
    padding: 1.25rem 1.5rem;
}

.cc__title {
    font-size: 15px;
    font-weight: 600;
    color: #111;
    margin: 0 0 6px;
}

.cc__description {
    font-size: 13px;
    color: #555;
    line-height: 1.6;
    margin: 0 0 1rem;
}

.cc__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.cc__btn {
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background 0.15s;
    outline: none;
}

.cc__btn--accept {
    background: #2a78d6;
    color: #fff;
}

.cc__btn--accept:hover {
    background: #1c5fab;
}

.cc__btn--reject {
    background: transparent;
    border: 1.5px solid #aaa;
    color: #333;
}

.cc__btn--reject:hover {
    border-color: #555;
}

.cc__btn--customize {
    background: transparent;
    border: none;
    color: #777;
    font-size: 13px;
    text-decoration: underline;
    padding: 8px 4px;
}

.cc__btn--customize:hover {
    color: #333;
}

.cc__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: transparent;
    border: none;
    font-size: 16px;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cc__close:hover {
    background: #f0f0f0;
    color: #333;
}

.cc__link {
    display: block;
    margin-top: 10px;
    font-size: 11px;
    color: #999;
    text-decoration: underline;
}

.cc__link:hover {
    color: #555;
}

.cc__back {
    background: none;
    border: none;
    font-size: 13px;
    color: #2a78d6;
    cursor: pointer;
    padding: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.cc__toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.cc__toggle-row:last-child {
    border-bottom: none;
}

.cc__toggle-label {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: #222;
}

.cc__toggle-label small {
    display: block;
    font-size: 11px;
    color: #888;
    margin-top: 2px;
}

.cc__toggle-wrap {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

.cc__toggle {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.cc__slider {
    display: inline-block;
    width: 42px;
    height: 24px;
    background: #ccc;
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
}

.cc__slider::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.cc__toggle:checked + .cc__slider {
    background: #2a78d6;
}

.cc__toggle:checked + .cc__slider::before {
    transform: translateX(18px);
}

.cc__toggle:disabled + .cc__slider {
    opacity: 0.4;
    cursor: not-allowed;
}

.cc__required-badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 20px;
    background: #e8f0fe;
    color: #2a78d6;
    font-weight: 500;
}

@media (prefers-color-scheme: dark) {
    .cc__title {
        color: #f0f0f0;
    }

    .cc__description,
    .cc__toggle-label small {
        color: #aaa;
    }

    .cc__btn--reject {
        border-color: #555;
        color: #ddd;
    }

    .cc__close:hover {
        background: #2a2a2a;
    }

    .cc__toggle-row {
        border-bottom-color: #2a2a2a;
    }

    .cc__toggle-label {
        color: #e0e0e0;
    }

    .cc__required-badge {
        background: #1c3a6b;
        color: #7ab3f5;
    }
}

/*
USAGE — add to your PHP layout template:

In <head>:
  <link rel="stylesheet" href="/assets/css/cookie-consent.css">

Before </body>:
  <?php
  require_once __DIR__ . '/includes/cookie-consent.php';
  render_consent_banner($cc_translations);
  ?>
  <script src="/assets/js/cookie-consent.js"></script>
*/
