/* ============================================================
   Cookie Consent Manager – Styles
   ============================================================ */

/* --- Reset inside the plugin scope ---- */
#ccm-banner *,
#ccm-modal * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ============================================================
   Banner
   ============================================================ */
.ccm-banner {
    position: fixed;
    z-index: 999999;
    left: 0;
    right: 0;
    background: #ffffff;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333333;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.ccm-banner--bottom { bottom: 0; }
.ccm-banner--top    { top: 0;    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12); }

/* Centred overlay variant */
.ccm-banner--center {
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%);
    max-width: 600px;
    width: calc(100% - 32px);
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
}

/* Hidden state */
.ccm-banner[hidden] { display: none !important; }

.ccm-banner__inner {
    display: flex;
    align-items: center;
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 24px;
}

@media (max-width: 768px) {
    .ccm-banner__inner {
        flex-direction: column;
        align-items: stretch;
    }
}

.ccm-banner__content { flex: 1; }

.ccm-banner__title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #111111;
}

.ccm-banner__description {
    font-size: 13px;
    color: #555555;
    line-height: 1.6;
}

.ccm-banner__description a {
    color: #0073aa;
    text-decoration: underline;
}

.ccm-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .ccm-banner__actions { flex-direction: column; }
    .ccm-banner__actions .ccm-btn { width: 100%; }
}

/* ============================================================
   Buttons
   ============================================================ */
.ccm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    line-height: 1;
    cursor: pointer;
    border: 2px solid transparent;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    white-space: nowrap;
    text-decoration: none;
}

.ccm-btn:focus-visible {
    outline: 3px solid #0073aa;
    outline-offset: 2px;
}

/* Primary: Accept */
.ccm-btn--primary {
    background: #0073aa;
    color: #ffffff;
    border-color: #0073aa;
}
.ccm-btn--primary:hover {
    background: #005177;
    border-color: #005177;
}

/* Secondary: Refuse */
.ccm-btn--secondary {
    background: #f0f0f0;
    color: #333333;
    border-color: #f0f0f0;
}
.ccm-btn--secondary:hover {
    background: #dcdcdc;
    border-color: #dcdcdc;
}

/* Outline: Personalise */
.ccm-btn--outline {
    background: transparent;
    color: #0073aa;
    border-color: #0073aa;
}
.ccm-btn--outline:hover {
    background: #e8f4fb;
}

/* ============================================================
   Modal
   ============================================================ */
.ccm-modal[hidden] { display: none !important; }

.ccm-modal {
    position: fixed;
    inset: 0;
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    color: #333333;
}

.ccm-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    cursor: pointer;
}

.ccm-modal__box {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25);
    max-width: 620px;
    width: calc(100% - 32px);
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px;
    z-index: 1;
}

.ccm-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #999999;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 0.2s;
}
.ccm-modal__close:hover { color: #333333; }
.ccm-modal__close:focus-visible {
    outline: 3px solid #0073aa;
    outline-offset: 2px;
}

.ccm-modal__title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #111111;
}

.ccm-modal__intro {
    font-size: 13px;
    color: #666666;
    margin-bottom: 24px;
    line-height: 1.6;
}

/* ============================================================
   Category list
   ============================================================ */
.ccm-categories {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 28px;
}

.ccm-category {
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 16px;
    background: #fafafa;
}

.ccm-category__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.ccm-category__label {
    font-weight: 600;
    font-size: 14px;
    color: #111111;
}

.ccm-category__description {
    font-size: 12px;
    color: #666666;
    line-height: 1.5;
}

/* ============================================================
   Toggle switch
   ============================================================ */
.ccm-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    cursor: pointer;
}

.ccm-toggle__input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.ccm-toggle__slider {
    position: absolute;
    inset: 0;
    background: #cccccc;
    border-radius: 24px;
    transition: background 0.2s ease;
}

.ccm-toggle__slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    top: 3px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.ccm-toggle__input:checked + .ccm-toggle__slider {
    background: #0073aa;
}

.ccm-toggle__input:checked + .ccm-toggle__slider::before {
    transform: translateX(20px);
}

.ccm-toggle__input:disabled + .ccm-toggle__slider {
    opacity: 0.6;
    cursor: not-allowed;
}

.ccm-toggle__input:focus-visible + .ccm-toggle__slider {
    outline: 3px solid #0073aa;
    outline-offset: 2px;
}

/* ============================================================
   Modal footer
   ============================================================ */
.ccm-modal__footer {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    border-top: 1px solid #e5e5e5;
    padding-top: 20px;
}

@media (max-width: 480px) {
    .ccm-modal__footer { flex-direction: column-reverse; }
    .ccm-modal__footer .ccm-btn { width: 100%; }
    .ccm-modal__box { padding: 20px 16px; }
}

/* ============================================================
   Re-open button (floating badge)
   ============================================================ */
#ccm-reopen-btn {
    position: fixed;
    bottom: 16px;
    left: 16px;
    z-index: 999998;
    background: #0073aa;
    color: #ffffff;
    border: none;
    border-radius: 50px;
    padding: 10px 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}
#ccm-reopen-btn:hover { background: #005177; }
#ccm-reopen-btn[hidden] { display: none !important; }
