/* ==========================================================================
   Entriso Cookies Shield — Light Frosted Glassmorphism Styles (1:1 cookies-bar)
   ========================================================================== */

:root {
    /* Entriso Brand Violet Palette */
    --ecc-primary: #695ced;
    --ecc-primary-hover: #5a4de3;
    --ecc-primary-active: #4e42cc;
    
    /* Frosted Translucent Glass Surface */
    --ecc-bg: rgba(255, 255, 255, 0.68);
    --ecc-surface: rgba(20, 19, 31, 0.04);
    --ecc-surface-hover: rgba(20, 19, 31, 0.08);
    --ecc-border: rgba(216, 212, 232, 0.7);
    --ecc-border-subtle: rgba(231, 228, 242, 0.75);
    
    /* Typography & Neutrals */
    --ecc-title: #14131f;
    --ecc-text: #3a3850;
    --ecc-text-muted: #676482;
    --ecc-link: #695ced;
    --ecc-link-hover: #4f43cf;
    
    /* Geometry & Shadow */
    --ecc-radius: 14px;
    --ecc-radius-sm: 8px;
    --ecc-blur: 16px;
    --ecc-font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --ecc-font-heading: 'Syne', var(--ecc-font-family);
    --ecc-transition: all 0.18s ease;
    --ecc-shadow: 0 12px 36px -4px rgba(35, 28, 82, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

/* --------------------------------------------------------------------------
   Floating Trigger Icon (Bottom Left / Bottom Right)
   -------------------------------------------------------------------------- */
.ecc-trigger-icon {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 99999990;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--ecc-trigger-bg, var(--ecc-bg));
    backdrop-filter: blur(var(--ecc-blur)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--ecc-blur)) saturate(180%);
    border: 1px solid var(--ecc-border);
    color: var(--ecc-trigger-icon-color, var(--ecc-primary));
    display: none;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer;
    box-shadow: 0 6px 20px -2px rgba(35, 28, 82, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: var(--ecc-transition);
    box-sizing: border-box !important;
    padding: 0;
    margin: 0 !important;
}

.ecc-trigger-icon[style*="display: block"],
.ecc-trigger-icon[style*="display: inline"],
.ecc-trigger-icon[style*="display: inline-block"],
.ecc-trigger-icon[style*="display: flex"] {
    display: flex !important;
}

.ecc-trigger-icon:hover {
    border-color: var(--ecc-primary);
    color: var(--ecc-primary-hover);
    background: var(--ecc-trigger-hover-bg, rgba(255, 255, 255, 0.95));
    transform: scale(1.05);
    box-shadow: 0 8px 24px -2px rgba(35, 28, 82, 0.18);
}

.ecc-trigger-icon:active {
    transform: scale(0.96);
}

.ecc-cookie-svg {
    width: 18px;
    height: 18px;
    margin: auto !important;
    display: block !important;
    flex-shrink: 0 !important;
}

/* --------------------------------------------------------------------------
   Banner Wrapper & Floating Light Glass Container (Desktop Default)
   -------------------------------------------------------------------------- */
.ecc-banner-wrap {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999999;
    padding: 16px 20px;
    font-family: var(--ecc-font-family);
    color: var(--ecc-text);
    pointer-events: none;
    box-sizing: border-box;
}

.ecc-banner-inner {
    pointer-events: auto;
    max-width: 1120px;
    margin: 0 auto;
    background: var(--ecc-bg);
    backdrop-filter: blur(var(--ecc-blur)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--ecc-blur)) saturate(180%);
    border: 1px solid var(--ecc-border);
    border-radius: var(--ecc-radius);
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    box-shadow: var(--ecc-shadow);
    box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   Banner Typography & Content
   -------------------------------------------------------------------------- */
.ecc-banner-content {
    flex: 1 1 auto;
    min-width: 0;
}

.ecc-banner-content h3 {
    margin: 0 0 3px 0;
    font-family: var(--ecc-font-heading);
    font-size: 14.5px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ecc-title);
    line-height: 1.3;
}

.ecc-banner-content p {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
    color: var(--ecc-text-muted);
    font-weight: 400;
}

.ecc-banner-content a {
    color: var(--ecc-link);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(105, 92, 237, 0.4);
    font-weight: 500;
    transition: var(--ecc-transition);
}

.ecc-banner-content a:hover {
    color: var(--ecc-link-hover);
    text-decoration-color: var(--ecc-link-hover);
}

/* --------------------------------------------------------------------------
   Subtle Actions & Buttons (Desktop Default)
   -------------------------------------------------------------------------- */
.ecc-banner-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    align-items: center;
}

.ecc-btn {
    font-family: var(--ecc-font-family);
    padding: 8px 16px;
    border-radius: var(--ecc-radius-sm);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: -0.005em;
    cursor: pointer;
    transition: var(--ecc-transition);
    border: 1px solid transparent;
    text-transform: none;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    user-select: none;
    line-height: 1.4;
    box-sizing: border-box;
    box-shadow: none !important;
}

/* Primary Button (Akceptuję wszystko) */
.ecc-btn-primary {
    background: var(--ecc-primary);
    color: #ffffff;
    border: 1px solid transparent;
    font-weight: 600;
}

.ecc-btn-primary:hover {
    background: var(--ecc-primary-hover);
    color: #ffffff;
}

.ecc-btn-primary:active {
    background: var(--ecc-primary-active);
}

/* Secondary Button (Odrzuć wszystko) */
.ecc-btn-secondary {
    background: var(--ecc-surface);
    color: var(--ecc-text);
    border: 1px solid var(--ecc-border);
}

.ecc-btn-secondary:hover {
    background: var(--ecc-surface-hover);
    color: var(--ecc-title);
    border-color: rgba(105, 92, 237, 0.35);
}

.ecc-btn-secondary:active {
    background: rgba(20, 19, 31, 0.1);
}

/* Outline Button (Ustawienia) */
.ecc-btn-outline {
    background: transparent;
    color: var(--ecc-text-muted);
    border: 1px solid var(--ecc-border);
}

.ecc-btn-outline:hover {
    background: var(--ecc-surface);
    color: var(--ecc-title);
    border-color: rgba(105, 92, 237, 0.35);
}

.ecc-btn-outline:active {
    background: var(--ecc-surface-hover);
}

/* Desktop: Settings has NO icon, text only */
.ecc-settings-icon {
    display: none !important;
}

.ecc-btn-text {
    display: inline !important;
}

/* --------------------------------------------------------------------------
   Floating Layout Variants (Left / Right / Center Cards)
   -------------------------------------------------------------------------- */
.ecc-layout-float-left .ecc-banner-inner {
    max-width: 420px;
    margin-left: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 16px;
}

.ecc-layout-float-right .ecc-banner-inner {
    max-width: 420px;
    margin-right: 0;
    margin-left: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 16px;
}

.ecc-layout-center .ecc-banner-inner {
    max-width: 460px;
    margin: 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 16px;
}

.ecc-layout-float-left .ecc-banner-actions,
.ecc-layout-float-right .ecc-banner-actions,
.ecc-layout-center .ecc-banner-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 8px;
}

.ecc-layout-float-left .ecc-banner-actions .ecc-btn,
.ecc-layout-float-right .ecc-banner-actions .ecc-btn,
.ecc-layout-center .ecc-banner-actions .ecc-btn {
    width: 100%;
    margin: 0;
    text-align: center;
    justify-content: center;
    display: flex;
    align-items: center;
    box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   Preferences Modal (Front-End) - Frosted Light Glass
   -------------------------------------------------------------------------- */
.ecc-modal-wrap {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 999999999 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 16px !important;
    box-sizing: border-box !important;
    font-family: var(--ecc-font-family) !important;
}

.ecc-modal-wrap.ecc-visible {
    display: flex !important;
}

.ecc-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(20, 19, 31, 0.4) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    z-index: 1 !important;
}

.ecc-modal-container {
    position: relative !important;
    z-index: 2 !important;
    width: 100% !important;
    max-width: 480px !important;
    background: rgba(255, 255, 255, 0.90) !important;
    backdrop-filter: blur(24px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
    border: 1px solid var(--ecc-border) !important;
    border-radius: var(--ecc-radius) !important;
    padding: 22px 24px !important;
    box-shadow: 0 20px 50px -10px rgba(35, 28, 82, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
    color: var(--ecc-text) !important;
    box-sizing: border-box !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
}

.ecc-modal-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 16px !important;
    padding-bottom: 12px !important;
    border-bottom: 1px solid var(--ecc-border-subtle) !important;
}

.ecc-modal-header h2 {
    margin: 0 !important;
    font-family: var(--ecc-font-heading) !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    letter-spacing: -0.01em !important;
    color: var(--ecc-title) !important;
}

.ecc-close-btn {
    background: var(--ecc-surface) !important;
    border: 1px solid var(--ecc-border) !important;
    border-radius: 6px !important;
    color: var(--ecc-text-muted) !important;
    font-size: 18px !important;
    line-height: 1 !important;
    width: 28px !important;
    height: 28px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: var(--ecc-transition) !important;
    padding: 0 !important;
}

.ecc-close-btn:hover {
    background: var(--ecc-surface-hover) !important;
    color: var(--ecc-title) !important;
    border-color: rgba(105, 92, 237, 0.35) !important;
}

.ecc-modal-body {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    margin-bottom: 18px !important;
}

.ecc-preference-item {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 12px 14px !important;
    background: rgba(247, 246, 252, 0.8) !important;
    border-radius: 10px !important;
    border: 1px solid var(--ecc-border-subtle) !important;
    gap: 12px !important;
    transition: var(--ecc-transition) !important;
}

.ecc-preference-item:hover {
    background: #f1effd !important;
    border-color: #d3ccfa !important;
}

.ecc-pref-info {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
}

.ecc-pref-info strong {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: var(--ecc-title) !important;
}

.ecc-pref-info span {
    font-size: 12px !important;
    line-height: 1.4 !important;
    color: var(--ecc-text-muted) !important;
}

.ecc-modal-footer button {
    width: 100% !important;
    padding: 10px 18px !important;
    font-size: 13.5px !important;
}

/* --------------------------------------------------------------------------
   Custom Switch / Toggle
   -------------------------------------------------------------------------- */
.ecc-switch {
    position: relative !important;
    display: inline-block !important;
    width: 40px !important;
    height: 22px !important;
    flex-shrink: 0 !important;
    cursor: pointer !important;
}

.ecc-switch input {
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    position: absolute !important;
}

.ecc-slider {
    position: absolute !important;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #d8d4e8 !important;
    border: 1px solid rgba(20, 19, 31, 0.08) !important;
    border-radius: 22px !important;
    transition: var(--ecc-transition) !important;
}

.ecc-slider:before {
    position: absolute !important;
    content: "" !important;
    height: 16px !important;
    width: 16px !important;
    left: 2px !important;
    bottom: 2px !important;
    background: #ffffff !important;
    border-radius: 50% !important;
    transition: var(--ecc-transition) !important;
    box-shadow: 0 1px 3px rgba(35, 28, 82, 0.2) !important;
}

.ecc-switch input:checked + .ecc-slider {
    background: var(--ecc-primary) !important;
    border-color: transparent !important;
}

.ecc-switch input:checked + .ecc-slider:before {
    transform: translateX(18px) !important;
}

.ecc-switch.disabled {
    opacity: 0.55 !important;
    cursor: not-allowed !important;
}

/* ==========================================================================
   Ultra-Compact Mobile Architecture (< 768px)
   Line 1: "Akceptuję wszystko" 100% width
   Line 2: "Odrzuć wszystko" + Centered Settings Icon Button
   ========================================================================== */
@media (max-width: 768px) {
    .ecc-banner-wrap {
        padding: 8px 10px !important;
        bottom: 0 !important;
    }

    .ecc-banner-inner,
    .ecc-layout-bar .ecc-banner-inner,
    .ecc-layout-float-left .ecc-banner-inner,
    .ecc-layout-float-right .ecc-banner-inner,
    .ecc-layout-center .ecc-banner-inner {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
        padding: 10px 12px !important;
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 12px !important;
        box-shadow: 0 8px 24px -4px rgba(35, 28, 82, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
    }

    .ecc-banner-content h3 {
        font-size: 13px !important;
        margin-bottom: 2px !important;
        font-weight: 700 !important;
        line-height: 1.2 !important;
    }

    .ecc-banner-content p {
        font-size: 11px !important;
        line-height: 1.35 !important;
        color: var(--ecc-text-muted) !important;
    }

    .ecc-banner-content a {
        font-size: 11px !important;
    }

    /* 2-Line Mobile Action Grid */
    .ecc-banner-actions,
    .ecc-layout-bar .ecc-banner-actions,
    .ecc-layout-float-left .ecc-banner-actions,
    .ecc-layout-float-right .ecc-banner-actions,
    .ecc-layout-center .ecc-banner-actions {
        display: grid !important;
        grid-template-columns: 1fr 34px !important;
        gap: 6px !important;
        width: 100% !important;
    }

    /* Line 1: Accept Button 100% Width */
    .ecc-banner-actions #ecc-btn-accept {
        grid-column: 1 / -1 !important;
        order: 1 !important;
        width: 100% !important;
        height: 33px !important;
        padding: 0 12px !important;
        font-size: 12px !important;
        font-weight: 600 !important;
        justify-content: center !important;
        align-items: center !important;
    }

    /* Line 2 Left: Reject Button */
    .ecc-banner-actions #ecc-btn-reject {
        grid-column: 1 / 2 !important;
        order: 2 !important;
        width: 100% !important;
        height: 33px !important;
        padding: 0 10px !important;
        font-size: 11.5px !important;
        min-width: 0 !important;
        justify-content: center !important;
        align-items: center !important;
    }

    /* Line 2 Right: Settings Icon Button (Perfect Centering) */
    .ecc-banner-actions #ecc-btn-settings {
        grid-column: 2 / 3 !important;
        order: 3 !important;
        width: 34px !important;
        height: 33px !important;
        min-width: 34px !important;
        max-width: 34px !important;
        padding: 0 !important;
        margin: 0 !important;
        border-radius: 8px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        line-height: 1 !important;
        box-sizing: border-box !important;
        color: var(--ecc-text-muted) !important;
    }

    /* Mobile: Hide text, show & center icon */
    .ecc-banner-actions #ecc-btn-settings .ecc-btn-text {
        display: none !important;
    }

    .ecc-banner-actions #ecc-btn-settings .ecc-settings-icon {
        display: block !important;
        width: 16px !important;
        height: 16px !important;
        margin: auto !important;
        flex-shrink: 0 !important;
    }

    /* CSS Gear Icon Fallback if HTML has no SVG */
    .ecc-banner-actions #ecc-btn-settings:not(:has(svg))::before {
        content: '' !important;
        width: 16px !important;
        height: 16px !important;
        display: block !important;
        margin: auto !important;
        background-color: currentColor !important;
        -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'%3E%3C/circle%3E%3Cpath d='M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z'%3E%3C/path%3E%3C/svg%3E") center / contain no-repeat !important;
        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'%3E%3C/circle%3E%3Cpath d='M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z'%3E%3C/path%3E%3C/svg%3E") center / contain no-repeat !important;
    }

    .ecc-modal-container {
        padding: 16px 14px !important;
        border-radius: 12px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .ecc-preference-item {
        padding: 8px 10px !important;
        gap: 8px !important;
    }

    .ecc-trigger-icon {
        box-shadow: 0 2px 10px rgba(35, 28, 82, 0.12) !important;
        max-width: calc(100vw - 24px) !important;
    }
}
