/**
 * Simple CMP – Banner Styles
 *
 * Provides layout, positioning and default visual treatment for the standard
 * consent banner. All values use CSS custom properties so themes can override
 * them without specificity conflicts.
 *
 * @version 1.0.0
 */

/* ── Custom properties ──────────────────────────────────────────────────── */
:root {
    --scmp-bg          : #fff;
    --scmp-text        : #1a1a1a;
    --scmp-border      : rgba(0, 0, 0, .12);
    --scmp-radius      : 8px;
    --scmp-shadow      : 0 4px 24px rgba(0, 0, 0, .14);
    --scmp-z           : 99999;
    --scmp-gap         : 1rem;
    --scmp-padding     : 1rem;
    --scmp-padding-mobile: 0.75rem;
    --scmp-font-size   : 0.9rem;
    --scmp-link-color  : currentColor;
    --scmp-link-hover-color : #1a5fa0;
    --scmp-btn-gap     : 0.5rem;

    --scmp-btn-accept-bg    : #2271b1;
    --scmp-btn-accept-color : #fff;
    --scmp-btn-reject-bg    : #f0f0f1;
    --scmp-btn-reject-color : #1a1a1a;
    --scmp-btn-prefs-bg     : transparent;
    --scmp-btn-prefs-color  : #2271b1;
    --scmp-btn-radius       : 4px;
    --scmp-btn-padding      : 0.55rem 1.1rem;
    --scmp-btn-font-size    : inherit;
    --scmp-icon-size        : 48px;
    --scmp-icon-bg          : #e6f0f8;
    --scmp-icon-color       : #2271b1;
    --scmp-content-max-width: 680px;
}

/* ── Banner container ───────────────────────────────────────────────────── */
.simple-cmp-banner {
    position      : fixed !important;
    z-index       : var( --scmp-z ) !important;
    background    : var( --scmp-bg ) !important;
    color         : var( --scmp-text ) !important;
    border        : 1px solid var( --scmp-border ) !important;
    border-radius : var( --scmp-radius ) !important;
    box-shadow    : var( --scmp-shadow ) !important;
    max-width     : 680px;
    width         : calc( 100% - 2rem ) !important;
    font-size     : var( --scmp-font-size ) !important;
    line-height   : 1.55 !important;
    padding       : var( --scmp-padding ) !important;
    box-sizing    : border-box !important;
}

.simple-cmp-banner__container {
    width     : 100%;
    max-width : inherit;
    margin    : 0 auto;
}

/* Hidden state – toggled by JS */
.simple-cmp-banner[hidden] {
    display : none !important;
}

/* ── Positions ──────────────────────────────────────────────────────────── */
.simple-cmp-banner--bottom-center {
    bottom : 1rem;
    left   : 50%;
    transform : translateX( -50% );
}

.simple-cmp-banner--bottom-left {
    bottom : 1rem;
    left   : 1rem;
}

.simple-cmp-banner--bottom-right {
    bottom : 1rem;
    right  : 1rem;
}

.simple-cmp-banner--bottom-full-width {
    left          : 0 !important;
    right         : 0 !important;
    bottom        : 0 !important;
    width         : 100% !important;
    max-width     : none !important;
    transform     : none !important;
    border-radius : 0 !important;
    border-left   : 0 !important;
    border-right  : 0 !important;
}

.simple-cmp-banner--bottom-full-width .simple-cmp-banner__container {
    max-width : var( --scmp-content-max-width );
}

.simple-cmp-banner--top-center {
    top   : 1rem;
    left  : 50%;
    transform : translateX( -50% );
}

.simple-cmp-banner--center {
    top       : 50%;
    left      : 50%;
    transform : translate( -50%, -50% );
}

/* ── Inner layout ───────────────────────────────────────────────────────── */
.simple-cmp-banner__inner {
    display        : flex;
    flex-direction : column;
    gap            : var( --scmp-gap );
}

.simple-cmp-banner__content {
    display     : flex;
    align-items : flex-start;
    gap         : 0.75rem;
    min-width   : 0;
}

.simple-cmp-banner__icon {
    width           : var( --scmp-icon-size );
    height          : var( --scmp-icon-size );
    min-width       : var( --scmp-icon-size );
    border-radius   : 0;
    background      : var( --scmp-icon-bg );
    color           : var( --scmp-icon-color );
    display         : inline-flex;
    align-items     : center;
    justify-content : center;
    flex-shrink     : 0;
}

.simple-cmp-banner__icon svg {
    width  : 100%;
    height : 100%;
}

.simple-cmp-banner__text a {
    color           : var( --scmp-link-color ) !important;
    text-decoration : underline !important;
}
.simple-cmp-banner__text a:hover {
    color : var( --scmp-link-hover-color, var( --scmp-link-color ) ) !important;
}

.simple-cmp-banner__text p:first-child { margin-top  : 0; }
.simple-cmp-banner__text p:last-child  { margin-bottom: 0; }

.simple-cmp-banner__actions {
    display   : flex;
    flex-wrap : wrap;
    gap       : var( --scmp-btn-gap ) !important;
}

.simple-cmp-banner--bottom-full-width .simple-cmp-banner__inner {
    flex-direction  : row;
    align-items     : center;
    justify-content : space-between;
    flex-wrap       : wrap;
}

.simple-cmp-banner--bottom-full-width .simple-cmp-banner__content {
    flex: 1 1 320px;
}

.simple-cmp-banner--bottom-full-width .simple-cmp-banner__actions {
    flex         : 0 0 auto;
    display      : inline-flex;
    flex-wrap    : nowrap;
    margin-left  : auto;
    white-space  : nowrap;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
.simple-cmp-banner .simple-cmp-btn {
    display       : inline-block !important;
    padding       : var( --scmp-btn-padding ) !important;
    border        : none !important;
    border-radius : var( --scmp-btn-radius ) !important;
    cursor        : pointer !important;
    font-size     : var( --scmp-btn-font-size ) !important;
    font-weight   : var( --scmp-btn-weight, 500 ) !important;
    font-family   : inherit !important;
    text-align    : center !important;
    white-space   : nowrap !important;
    line-height   : 1.4 !important;
    text-decoration: none !important;
    box-shadow    : none !important;
    transition    : opacity 0.15s ease, filter 0.15s ease !important;
    margin        : 0 !important;
    outline       : none;
}

.simple-cmp-banner .simple-cmp-btn:hover  { opacity: 0.88 !important; }
.simple-cmp-banner .simple-cmp-btn:active { filter: brightness(0.92) !important; }

.simple-cmp-banner .simple-cmp-btn--accept {
    background   : var( --scmp-btn-accept-bg ) !important;
    color        : var( --scmp-btn-accept-color ) !important;
    border-color : var( --scmp-btn-accept-bg ) !important;
}

.simple-cmp-banner .simple-cmp-btn--reject {
    background   : var( --scmp-btn-reject-bg ) !important;
    color        : var( --scmp-btn-reject-color ) !important;
    border-color : var( --scmp-border ) !important;
}

.simple-cmp-banner .simple-cmp-btn--preferences,
.simple-cmp-banner .simple-cmp-btn--prefs {
    background      : transparent !important;
    color           : var( --scmp-btn-prefs-color ) !important;
    text-decoration : underline !important;
    border          : none !important;
    box-shadow      : none !important;
    padding-left    : 0 !important;
    padding-right   : 0 !important;
}

.simple-cmp-banner .simple-cmp-btn--save {
    background   : var( --scmp-btn-accept-bg ) !important;
    color        : var( --scmp-btn-accept-color ) !important;
    border-color : var( --scmp-btn-accept-bg ) !important;
}

/* ── Preferences panel ──────────────────────────────────────────────────── */
.simple-cmp-preferences {
    border-top : 1px solid var( --scmp-border );
    padding-top: var( --scmp-gap );
    margin-top : var( --scmp-gap );
}

.simple-cmp-preferences[hidden] {
    display : none !important;
}

.simple-cmp-preferences h3 {
    margin: 0 0 0.75rem;
    font-size: 1rem;
}

.simple-cmp-prefs__list {
    list-style : none;
    margin     : 0 0 var( --scmp-gap );
    padding    : 0;
    display    : flex;
    flex-direction: column;
    gap        : 0.5rem;
}

.simple-cmp-prefs__list label {
    display    : grid;
    grid-template-columns: auto 1fr;
    gap        : 0.4rem 0.6rem;
    cursor     : pointer;
    align-items: start;
}

.simple-cmp-prefs__list input[type="checkbox"] {
    margin-top: 0.15rem;
}

.simple-cmp-prefs__list strong {
    font-weight: 600;
}

.simple-cmp-prefs__list span {
    grid-column : 2;
    color       : #555;
    font-size   : 0.85em;
}

.simple-cmp-prefs__actions {
    display: flex;
    gap: 0.5rem;
}

/* ── Close button ───────────────────────────────────────────────────────── */
.simple-cmp-close {
    position   : absolute;
    top        : 0rem;
    background : none;
    border     : none;
    cursor     : pointer;
    color      : var( --scmp-text );
    padding    : 0.25rem 0.5rem;
    font-size  : 1.2rem;
    line-height: 1;
    opacity    : 0.55;
    transition : opacity 0.15s ease;
}
.simple-cmp-close:hover  { opacity: 1; }
.simple-cmp-close--x_top_right { right: 0rem; }
.simple-cmp-close--x_top_left  { left:  0rem; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media ( max-width: 768px ) {
    .simple-cmp-banner {
        left          : 10px !important;
        right         : 10px !important;
        width         : auto !important;
        max-width     : none !important;
        transform     : none !important;
        border-radius : var( --scmp-radius ) !important;
        padding       : var( --scmp-padding-mobile ) !important;
        font-size     : var( --scmp-font-size-mobile, var( --scmp-font-size ) ) !important;
    }

    .simple-cmp-banner .simple-cmp-banner__actions {
        gap : var( --scmp-btn-gap-mobile, var( --scmp-btn-gap ) ) !important;
    }

    .simple-cmp-banner--bottom-center,
    .simple-cmp-banner--bottom-left,
    .simple-cmp-banner--bottom-right {
        bottom : 10px !important;
        left   : 10px !important;
        right  : 10px !important;
    }

    .simple-cmp-banner--bottom-full-width {
        left          : 0 !important;
        right         : 0 !important;
        bottom        : 0 !important;
        width         : 100% !important;
        border-radius : 0 !important;
        padding       : var( --scmp-padding-mobile ) !important;
    }

    .simple-cmp-banner--bottom-full-width .simple-cmp-banner__container {
        max-width : var( --scmp-content-max-width ) !important;
        padding   : 0 !important;
    }

    .simple-cmp-banner--bottom-full-width .simple-cmp-banner__inner {
        flex-direction : column;
        align-items    : stretch;
    }

    .simple-cmp-banner--bottom-full-width .simple-cmp-banner__content {
        flex  : 1 1 auto;
        width : 100%;
    }

    .simple-cmp-banner--bottom-full-width .simple-cmp-banner__actions {
        margin-left    : 0;
        width          : 100%;
        display        : flex;
        flex-direction : column;
        white-space    : normal;
    }

    .simple-cmp-banner--top-center {
        top  : 10px !important;
        left : 10px !important;
        right: 10px !important;
    }

    .simple-cmp-banner--center {
        top  : 50% !important;
        left : 10px !important;
        right: 10px !important;
        transform: translateY( -50% ) !important;
    }

    .simple-cmp-banner__actions {
        flex-direction : column;
    }

    .simple-cmp-banner__content {
        align-items : flex-start;
    }

    .simple-cmp-banner .simple-cmp-btn {
        width: 100% !important;
        text-align: center !important;
    }
}
