/* =========================================================================
 * Xpede Cookie Consent
 * Sticky bottom banner + preferences modal.
 * Scoped under .xpede-cc* class names to avoid clashing with site styles.
 * ====================================================================== */

:root {
    --xpede-cc-bg: #ffffff;
    --xpede-cc-text: #2b2f38;
    --xpede-cc-muted: #5b6470;
    --xpede-cc-border: #e6e8ee;
    --xpede-cc-primary: #ff5a1f;
    --xpede-cc-primary-hover: #e64a12;
    --xpede-cc-dark: #1f2430;
    --xpede-cc-radius: 14px;
    --xpede-cc-shadow: 0 -6px 30px rgba(20, 24, 33, 0.14);
}

/* ----------------------------------------------------------------------
 * Banner (sticky bottom)
 * -------------------------------------------------------------------- */
.xpede-cc-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
    background: var(--xpede-cc-bg);
    color: var(--xpede-cc-text);
    box-shadow: var(--xpede-cc-shadow);
    border-top: 1px solid var(--xpede-cc-border);
    transform: translateY(110%);
    opacity: 0;
    transition: transform .45s cubic-bezier(.16, 1, .3, 1), opacity .35s ease;
    font-family: 'Nunito', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.xpede-cc-banner.is-visible {
    transform: translateY(0);
    opacity: 1;
}

.xpede-cc-banner__inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 18px 22px;
    display: flex;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
}

.xpede-cc-banner__text {
    flex: 1 1 420px;
    min-width: 260px;
}

.xpede-cc-banner__title {
    margin: 0 0 4px;
    font-size: 17px;
    font-weight: 700;
    color: var(--xpede-cc-dark);
}

.xpede-cc-banner__message {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    color: #5b6470;
}

.xpede-cc-banner__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

/* ----------------------------------------------------------------------
 * Buttons
 * -------------------------------------------------------------------- */
.xpede-cc-btn {
    appearance: none;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 11px 20px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, border-color .2s ease, transform .05s ease;
    white-space: nowrap;
    font-family: inherit;
}

.xpede-cc-btn:active {
    transform: translateY(1px);
}

.xpede-cc-btn:focus-visible {
    outline: 3px solid rgba(255, 90, 31, 0.45);
    outline-offset: 2px;
}

.xpede-cc-btn--primary {
    background: var(--xpede-cc-primary);
    color: #fff;
}

.xpede-cc-btn--primary:hover {
    background: var(--xpede-cc-primary-hover);
}

.xpede-cc-btn--secondary {
    background: #f3f4f7;
    color: var(--xpede-cc-dark);
    border-color: #e6e8ee;
}

.xpede-cc-btn--secondary:hover {
    background: #e9ebf0;
}

.xpede-cc-btn--ghost {
    background: transparent;
    color: var(--xpede-cc-dark);
    border-color: #cfd3dc;
}

.xpede-cc-btn--ghost:hover {
    background: #f3f4f7;
}

/* ----------------------------------------------------------------------
 * Modal
 * -------------------------------------------------------------------- */
.xpede-cc-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: 'Nunito', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.xpede-cc-overlay {
    position: absolute;
    inset: 0;
    background: rgba(17, 21, 28, 0.55);
    opacity: 0;
    transition: opacity .3s ease;
}

.xpede-cc-dialog {
    position: relative;
    background: #fff;
    width: 100%;
    max-width: 620px;
    max-height: 88vh;
    overflow: hidden;
    border-radius: var(--xpede-cc-radius);
    box-shadow: 0 24px 70px rgba(15, 19, 27, 0.35);
    display: flex;
    flex-direction: column;
    transform: translateY(18px) scale(.98);
    opacity: 0;
    transition: transform .3s cubic-bezier(.16, 1, .3, 1), opacity .3s ease;
}

.xpede-cc-modal.is-open .xpede-cc-overlay {
    opacity: 1;
}

.xpede-cc-modal.is-open .xpede-cc-dialog {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.xpede-cc-dialog__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px 14px;
    border-bottom: 1px solid var(--xpede-cc-border);
}

.xpede-cc-dialog__title {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 800;
    color: var(--xpede-cc-dark);
}

.xpede-cc-dialog__subtitle {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.5;
    color: #6b7280;
}

.xpede-cc-close {
    appearance: none;
    border: none;
    background: #f3f4f7;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    color: #5b6470;
    cursor: pointer;
    flex: 0 0 auto;
    transition: background .2s ease;
}

.xpede-cc-close:hover {
    background: #e6e8ee;
}

.xpede-cc-close:focus-visible {
    outline: 3px solid rgba(255, 90, 31, 0.45);
    outline-offset: 2px;
}

.xpede-cc-dialog__body {
    padding: 8px 24px;
    overflow-y: auto;
}

/* category rows */
.xpede-cc-category {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 0;
    border-bottom: 1px solid #f0f1f5;
}

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

.xpede-cc-category__label {
    margin: 0 0 4px;
    font-size: 15.5px;
    font-weight: 700;
    color: var(--xpede-cc-dark);
}

.xpede-cc-category__desc {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: #6b7280;
}

.xpede-cc-category__badge {
    display: inline-block;
    margin-left: 8px;
    font-size: 11px;
    font-weight: 700;
    color: #1f9d55;
    background: #e7f7ee;
    border-radius: 20px;
    padding: 2px 9px;
    vertical-align: middle;
}

/* toggle switch */
.xpede-cc-switch {
    position: relative;
    flex: 0 0 auto;
    width: 46px;
    height: 26px;
    margin-top: 2px;
}

.xpede-cc-switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.xpede-cc-switch__track {
    position: absolute;
    inset: 0;
    background: #cfd3dc;
    border-radius: 999px;
    transition: background .25s ease;
    pointer-events: none;
}

.xpede-cc-switch__track::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
    transition: transform .25s ease;
}

.xpede-cc-switch input:checked + .xpede-cc-switch__track {
    background: var(--xpede-cc-primary);
}

.xpede-cc-switch input:checked + .xpede-cc-switch__track::before {
    transform: translateX(20px);
}

.xpede-cc-switch input:disabled + .xpede-cc-switch__track {
    background: #b7d8c2;
    cursor: not-allowed;
}

.xpede-cc-switch input:focus-visible + .xpede-cc-switch__track {
    outline: 3px solid rgba(255, 90, 31, 0.45);
    outline-offset: 2px;
}

.xpede-cc-dialog__footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    padding: 16px 24px 22px;
    border-top: 1px solid var(--xpede-cc-border);
}

/* prevent background scroll while modal is open */
body.xpede-cc-no-scroll {
    overflow: hidden;
}

/* ----------------------------------------------------------------------
 * Responsive
 * -------------------------------------------------------------------- */
@media (max-width: 768px) {
    .xpede-cc-banner__inner {
        padding: 16px;
        gap: 14px;
    }

    .xpede-cc-banner__actions {
        width: 100%;
    }

    .xpede-cc-banner__actions .xpede-cc-btn {
        flex: 1 1 auto;
        text-align: center;
    }

    .xpede-cc-dialog__footer {
        flex-direction: column-reverse;
    }

    .xpede-cc-dialog__footer .xpede-cc-btn {
        width: 100%;
        text-align: center;
    }
}

/* respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
    .xpede-cc-banner,
    .xpede-cc-overlay,
    .xpede-cc-dialog {
        transition: none;
    }
}
