/* ===================================================
   Cookie Banner PF — Frontend Styles
   Author: Paweł Falkowski
   =================================================== */

/* ---- Variables applied dynamically via JS ---- */
.cbp-banner,
.cbp-modal-box {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---- Overlay ---- */
.cbp-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 99998;
    opacity: 0;
    transition: opacity .3s ease;
}
.cbp-overlay.cbp-visible { opacity: 1; }

/* ---- Banner ---- */
.cbp-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    padding: 0;
    box-shadow: 0 -4px 24px rgba(0,0,0,.12);
    transform: translateY(100%);
    transition: transform .35s cubic-bezier(.25,.46,.45,.94);
}
.cbp-banner.cbp-visible { transform: translateY(0); }

.cbp-banner-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 20px 28px;
    flex-wrap: wrap;
    max-width: 1400px;
    margin: 0 auto;
}

.cbp-banner-content { flex: 1; min-width: 260px; }
.cbp-banner-title {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
}
.cbp-banner-desc {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    opacity: .85;
}

.cbp-banner-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* ---- Buttons ---- */
.cbp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    transition: opacity .2s, transform .15s;
    white-space: nowrap;
    text-decoration: none;
}
.cbp-btn:hover  { opacity: .88; transform: translateY(-1px); }
.cbp-btn:active { transform: translateY(0); }
.cbp-btn:focus  { outline: 3px solid rgba(14,69,119,.4); outline-offset: 2px; }

/* Color variants — applied dynamically, fallback colors here */
.cbp-btn-accept  { background: #0e4577; color: #fff; }
.cbp-btn-reject  { background: #fff; color: #0e4577; border-color: #0e4577; }
.cbp-btn-settings{ background: #f2f2f2; color: #1a1a1a; }
.cbp-btn-save    { background: #db3224; color: #fff; }

/* ---- Modal ---- */
.cbp-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity .3s ease;
}
.cbp-modal.cbp-visible { opacity: 1; }

.cbp-modal-box {
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0,0,0,.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(.95) translateY(10px);
    transition: transform .3s cubic-bezier(.25,.46,.45,.94);
}
.cbp-modal.cbp-visible .cbp-modal-box { transform: scale(1) translateY(0); }

.cbp-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid rgba(0,0,0,.1);
    flex-shrink: 0;
}
.cbp-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}
.cbp-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: .6;
    transition: opacity .2s, background .2s;
    color: inherit;
}
.cbp-modal-close:hover { opacity: 1; background: rgba(0,0,0,.08); }

.cbp-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

.cbp-modal-desc {
    font-size: 14px;
    opacity: .75;
    margin: 0 0 16px;
    line-height: 1.55;
}

/* ---- Category ---- */
.cbp-category {
    padding: 14px 0;
    border-bottom: 1px solid rgba(0,0,0,.07);
}
.cbp-category:last-child { border-bottom: none; }

.cbp-category-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}
.cbp-category-info { flex: 1; }
.cbp-category-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 3px;
}
.cbp-category-desc {
    display: block;
    font-size: 13px;
    opacity: .7;
    line-height: 1.45;
}

/* ---- Toggle ---- */
.cbp-toggle { flex-shrink: 0; padding-top: 2px; }
.cbp-toggle-input { display: none; }

.cbp-toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    width: 46px;
    height: 26px;
    background: #aaa;
    border-radius: 13px;
    position: relative;
    transition: background .25s;
}
.cbp-toggle-input:checked + .cbp-toggle-label { background: #0e4577; }
.cbp-toggle-knob {
    position: absolute;
    left: 3px;
    top: 3px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform .25s;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.cbp-toggle-input:checked + .cbp-toggle-label .cbp-toggle-knob {
    transform: translateX(20px);
}

/* Required toggle */
.cbp-toggle-required .cbp-toggle-label {
    cursor: not-allowed;
    opacity: .6;
}
.cbp-always-on {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    opacity: .7;
    white-space: nowrap;
}
.cbp-toggle-required .cbp-required-label {
    background: none !important;
    width: auto;
    height: auto;
    border-radius: 0;
}

/* Tags */
.cbp-category-vars {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}
.cbp-tag {
    font-size: 11px;
    font-family: monospace;
    background: rgba(0,0,0,.06);
    padding: 2px 7px;
    border-radius: 4px;
    color: inherit;
    opacity: .7;
}

/* ---- Modal Footer ---- */
.cbp-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(0,0,0,.1);
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
}

/* ---- Floating Button ---- */
.cbp-fab {
    position: fixed;
    bottom: 24px;
    z-index: 99997;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 18px rgba(0,0,0,.28);
    transition: transform .2s, box-shadow .2s, opacity .2s;
    opacity: 1;
    background: #0e4577;
    color: #fff;
    padding: 0;
    animation: cbp-pulse 3s ease-in-out infinite;
}
@keyframes cbp-pulse {
    0%   { box-shadow: 0 4px 18px rgba(0,0,0,.28), 0 0 0 0 rgba(14,69,119,.35); }
    60%  { box-shadow: 0 4px 18px rgba(0,0,0,.28), 0 0 0 10px rgba(14,69,119,0); }
    100% { box-shadow: 0 4px 18px rgba(0,0,0,.28), 0 0 0 0 rgba(14,69,119,0); }
}
.cbp-fab:hover {
    transform: scale(1.12) rotate(-15deg);
    box-shadow: 0 6px 24px rgba(0,0,0,.32);
    animation: none;
}
.cbp-fab:focus {
    outline: 3px solid rgba(14,69,119,.4);
    outline-offset: 3px;
}
.cbp-fab-left  { left: 24px; }
.cbp-fab-right { right: 24px; }

/* hide fab when banner is visible (redundant) */
.cbp-fab.cbp-fab-hidden { opacity: 0; pointer-events: none; }

/* ---- Responsive ---- */
@media (max-width: 600px) {
    .cbp-banner-inner {
        flex-direction: column;
        align-items: stretch;
        padding: 16px 18px;
        gap: 14px;
    }
    .cbp-banner-actions {
        flex-direction: column;
    }
    .cbp-btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
    .cbp-modal-box {
        max-height: 95vh;
    }
    .cbp-modal-header,
    .cbp-modal-body,
    .cbp-modal-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
}
