/* ================================================================
   Mod Consent — Styles
   ----------------------------------------------------------------
   Primary colour: uses --ctaux-consent-color.
   To inherit your site's brand colour, map it before loading this
   file, e.g.:  --ctaux-consent-color: var(--your-primary, #2563eb);
================================================================ */

:root {
    --ctaux-consent-color: black;
    
}

#mod-consent-wrapper h1,
#mod-consent-wrapper h2,
#mod-consent-wrapper button {
    font-family: inherit;
}

/* ----------------------------------------------------------------
   Overlay — toggled via .overlay class on #mod-consent-wrapper
---------------------------------------------------------------- */
#mod-consent-wrapper::after {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
#mod-consent-wrapper::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.32);
    z-index: 9990;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

#mod-consent-wrapper.overlay::after {
    pointer-events: auto;
    opacity: 1;
}

/* ----------------------------------------------------------------
   Banner — floating centered window on desktop, full-width on mobile
---------------------------------------------------------------- */
#mod-consent-banner {
    position: fixed;
    bottom: 24px;
    left: 50%;
    z-index: 9999;
    background: #fff;
    border-radius: 10px;
    width: 600px;
    padding: 20px 24px;
    margin-left: -300px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    animation: mod-consent-slide-up 0.25s ease;
}

@media (max-width: 600px) {
    #mod-consent-banner {
        bottom: 0;
        left: 0;
        right: 0;
        transform: none;
        width: 100%;
        border-radius: 10px 10px 0 0;
    }
}

.mod-consent-banner__description {
    font-size: 0.875rem;
    line-height: 1.55;
    color: #374151;
    margin: 0;
}

.mod-consent-banner__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    flex-shrink: 0;
}

/* ----------------------------------------------------------------
   Modal
---------------------------------------------------------------- */
#mod-consent-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    background: #fff;
    border-radius: 10px;
    width: min(520px, calc(100vw - 40px));
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    animation: mod-consent-modal-in 0.2s ease;
}

.mod-consent-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
    gap: 12px;
}

.mod-consent-modal__header h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: #111827;
}

.mod-consent-modal__close {
    background: none;
    border: none;
    cursor: pointer;
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}

.mod-consent-modal__close:hover {
    background: #f3f4f6;
    color: #111827;
}

.mod-consent-modal__description {
    padding: 10px 24px 16px;
    font-size: 0.8125rem;
    line-height: 1.55;
    color: #6b7280;
    border-bottom: 1px solid #f3f4f6;
}

/* ----------------------------------------------------------------
   Consent type rows
---------------------------------------------------------------- */
.mod-consent-modal__types {
    padding: 14px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mod-consent-type {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px 16px;
    margin: 0;
}

.mod-consent-type__name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    padding: 0 2px;
    float: none;
}

.mod-consent-type__content {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 6px;
}

.mod-consent-type__description {
    flex: 1;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #6b7280;
}

/* Toggle switch */
.mod-consent-type__toggle {
    flex-shrink: 0;
    display: inline-block;
    position: relative;
    width: 40px;
    height: 22px;
    cursor: pointer;
}

.mod-consent-type__toggle input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

/* track */
.mod-consent-type__toggle::before {
    content: '';
    position: absolute;
    inset: 0;
    background: #d1d5db;
    border-radius: 11px;
    transition: background 0.2s;
}

/* thumb */
.mod-consent-type__toggle::after {
    content: '';
    position: absolute;
    left: 2px;
    top: 2px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s;
}

.mod-consent-type__toggle:has(input:checked)::before {
    background: var(--ctaux-consent-color);
}

.mod-consent-type__toggle:has(input:checked)::after {
    transform: translateX(18px);
}

.mod-consent-type__toggle:has(input:disabled) {
    cursor: not-allowed;
    opacity: 0.55;
}

/* ----------------------------------------------------------------
   Modal footer
---------------------------------------------------------------- */
.mod-consent-modal__footer {
    display: flex;
    gap: 8px;
    padding: 14px 24px 20px;
    flex-wrap: wrap;
    align-items: center;
    border-top: 1px solid #f3f4f6;
}

.mod-consent-modal__btn--save {
    margin-left: auto;
}

/* ----------------------------------------------------------------
   Buttons — shared base
---------------------------------------------------------------- */
.mod-consent-banner__btn,
.mod-consent-modal__btn {
    padding: 9px 18px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    line-height: 1.2;
    white-space: nowrap;
    transition: filter 0.15s, background 0.15s;
}

/* Primary — accept / save */
.mod-consent-banner__btn--accept,
.mod-consent-modal__btn--accept-all,
.mod-consent-modal__btn--save {
    background: var(--ctaux-consent-color);
    color: #fff;
    border-color: var(--ctaux-consent-color);
}

.mod-consent-banner__btn--accept:hover,
.mod-consent-modal__btn--accept-all:hover,
.mod-consent-modal__btn--save:hover {
    filter: brightness(0.88);
}

/* Secondary — reject */
.mod-consent-banner__btn--preferences,
.mod-consent-banner__btn--reject,
.mod-consent-modal__btn--reject-all {
    background: #fff;
    color: #374151;
    border-color: #d1d5db;
}
.mod-consent-banner__btn--preferences:hover,
.mod-consent-banner__btn--reject:hover,
.mod-consent-modal__btn--reject-all:hover {
    background: #f3f4f6;
}

/* Tertiary — preferences link (banner only) */
.mod-consent-banner__btn--other {
    background: transparent;
    border-color: transparent;
    color: var(--ctaux-consent-color);
    text-decoration: underline;
    text-underline-offset: 2px;
    padding-left: 4px;
    padding-right: 4px;
}

.mod-consent-banner__btn--other:hover {
    opacity: 0.75;
}

/* ----------------------------------------------------------------
   Open button — fixed bottom-right
---------------------------------------------------------------- */
#mod-consent-open-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9997;
    background: var(--ctaux-consent-color);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 18px;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: filter 0.15s;
}

#mod-consent-open-btn:hover {
    filter: brightness(0.88);
}

/* ----------------------------------------------------------------
   Animations
---------------------------------------------------------------- */
@keyframes mod-consent-slide-up {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

@keyframes mod-consent-modal-in {
    from { opacity: 0; transform: translate(-50%, -47%); }
    to   { opacity: 1; transform: translate(-50%, -50%); }
}

@keyframes mod-consent-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}
