/* ==========================================================================
   Cookie Consent — Styles
   Design tokens from brandflow theme: Saans font, #1B1A7A primary, etc.
   ========================================================================== */

/* Body scroll lock when panel is open */
body.lore-consent-no-scroll {
    overflow: hidden;
}

/* Banner (first level — fixed bottom bar) */
.lore-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: #fff;
    box-shadow: 0 -4px 24px rgba(27, 26, 122, .12);
    transform: translateY(100%);
    animation: loreConsentSlideUp .3s ease forwards;
    font-family: 'Saans', system-ui, -apple-system, sans-serif;
}

.lore-consent-banner[hidden] {
    display: none;
}

.lore-consent-banner__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 32px;
    display: flex;
    align-items: center;
    gap: 32px;
}

.lore-consent-banner__content {
    flex: 1;
    min-width: 0;
}

.lore-consent-banner__title {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 600;
    color: #232B50;
    line-height: 1.3;
}

.lore-consent-banner__text {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #232B50;
}

.lore-consent-banner__link {
    color: #3531E9;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.lore-consent-banner__link:hover {
    color: #1B1A7A;
}

.lore-consent-banner__actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

/* Shared button styles */
.lore-consent-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    padding: 12px 24px;
    border-radius: 12px;
    font-family: 'Saans', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    border: none;
    transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
    white-space: nowrap;
}

.lore-consent-btn:focus-visible {
    outline: 2px solid #3531E9;
    outline-offset: 2px;
}

.lore-consent-btn--accept {
    background: #3531E9;
    color: #fff;
}

.lore-consent-btn--accept:hover {
    background: #1B1A7A;
}

.lore-consent-btn--refuse {
    background: #E0E0FF;
    color: #1B1A7A;
}

.lore-consent-btn--refuse:hover {
    background: #c8c8f5;
}

.lore-consent-btn--customize {
    background: transparent;
    color: #1B1A7A;
    border: 1px solid #1B1A7A;
}

.lore-consent-btn--customize:hover {
    background: #f5f5ff;
}

/* ==========================================================================
   Panel (second level — overlay with categories)
   ========================================================================== */

.lore-consent-panel {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Saans', system-ui, -apple-system, sans-serif;
}

.lore-consent-panel[hidden] {
    display: none;
}

.lore-consent-panel__overlay {
    position: absolute;
    inset: 0;
    background: rgba(27, 26, 122, .4);
    animation: loreConsentFadeIn .2s ease;
}

.lore-consent-panel__inner {
    position: relative;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(27, 26, 122, .18);
    display: flex;
    flex-direction: column;
    animation: loreConsentScaleIn .25s ease;
}

.lore-consent-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px 16px;
    border-bottom: 1px solid #f0f0f8;
}

.lore-consent-panel__title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #232B50;
}

.lore-consent-panel__close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: 24px;
    color: #232B50;
    cursor: pointer;
    border-radius: 8px;
    transition: background .15s;
}

.lore-consent-panel__close:hover {
    background: #f0f0f8;
}

.lore-consent-panel__close:focus-visible {
    outline: 2px solid #3531E9;
    outline-offset: 2px;
}

.lore-consent-panel__body {
    flex: 1 1 0%;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 20px 28px;
}

.lore-consent-panel__footer {
    padding: 16px 28px 24px;
    border-top: 1px solid #f0f0f8;
    display: flex;
    justify-content: flex-end;
}

/* Category block */
.lore-consent-category {
    padding: 16px 0;
    border-bottom: 1px solid #f0f0f8;
}

.lore-consent-category:last-child {
    border-bottom: none;
}

.lore-consent-category__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.lore-consent-category__info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.lore-consent-category__name {
    font-size: 15px;
    font-weight: 600;
    color: #232B50;
}

.lore-consent-category__badge {
    font-size: 11px;
    font-weight: 500;
    color: #3531E9;
    background: #E0E0FF;
    padding: 2px 8px;
    border-radius: 6px;
}

.lore-consent-category__provider {
    font-size: 12px;
    color: #8888aa;
    font-weight: 400;
}

.lore-consent-category__desc {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.55;
    color: #666;
}

.lore-consent-category__tags {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.lore-consent-category__cookies {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.lore-consent-cookie {
    font-size: 11px;
    font-family: 'SFMono-Regular', Consolas, monospace;
    background: #f5f5fa;
    color: #555;
    padding: 2px 8px;
    border-radius: 4px;
}

.lore-consent-cookie em {
    font-style: normal;
    color: #999;
    margin-left: 4px;
}

/* ==========================================================================
   Toggle switch
   ========================================================================== */

.lore-consent-toggle {
    flex-shrink: 0;
}

.lore-consent-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.lore-consent-toggle label {
    display: block;
    width: 44px;
    height: 24px;
    background: #ccc;
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background .2s;
}

.lore-consent-toggle label::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
}

.lore-consent-toggle input:checked + label {
    background: #3531E9;
}

.lore-consent-toggle input:checked + label::after {
    transform: translateX(20px);
}

.lore-consent-toggle input:focus-visible + label {
    outline: 2px solid #3531E9;
    outline-offset: 2px;
}

/* Disabled state (strictly necessary) */
.lore-consent-toggle--disabled label {
    background: #3531E9;
    opacity: .6;
    cursor: not-allowed;
}

.lore-consent-toggle--disabled input:checked + label::after {
    transform: translateX(20px);
}

/* ==========================================================================
   Floating button
   ========================================================================== */

.lore-consent-float {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 99998;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #1B1A7A;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(27, 26, 122, .3);
    transition: background .15s, transform .15s;
}

.lore-consent-float[hidden] {
    display: none;
}

.lore-consent-float:hover {
    background: #3531E9;
    transform: scale(1.08);
}

.lore-consent-float:focus-visible {
    outline: 2px solid #3531E9;
    outline-offset: 3px;
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes loreConsentSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes loreConsentFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes loreConsentScaleIn {
    from { opacity: 0; transform: scale(.95); }
    to { opacity: 1; transform: scale(1); }
}

/* ==========================================================================
   Responsive (< 768px)
   ========================================================================== */

@media (max-width: 767px) {
    .lore-consent-banner__inner {
        flex-direction: column;
        padding: 20px;
        gap: 16px;
    }

    .lore-consent-banner__actions {
        flex-direction: column;
        width: 100%;
    }

    .lore-consent-btn {
        width: 100%;
    }

    .lore-consent-panel__inner {
        width: 95%;
        max-height: 90vh;
        border-radius: 12px;
    }

    .lore-consent-panel__header {
        padding: 20px 20px 14px;
    }

    .lore-consent-panel__body {
        padding: 16px 20px;
    }

    .lore-consent-panel__footer {
        padding: 14px 20px 20px;
    }

    .lore-consent-panel__footer .lore-consent-btn {
        width: 100%;
    }
}
