/* ============================================
   ICAOLPT Cookie Consent Banner
   DSGVO/GDPR + TTDSG compliant
   ============================================ */

/* --- Banner (bottom bar) --- */
.icaolpt-cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999999;
    background: #ffffff;
    border-top: 3px solid #1e3a5f;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transform: translateY(100%);
    transition: transform 0.4s ease;
}

.icaolpt-cookie-banner.is-visible {
    transform: translateY(0);
}

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

.icaolpt-cookie-banner__text {
    flex: 1 1 400px;
    min-width: 280px;
}

.icaolpt-cookie-banner__text h3 {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 600;
    color: #1e3a5f;
    line-height: 1.3;
}

.icaolpt-cookie-banner__text p {
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
    color: #4a5568;
}

.icaolpt-cookie-banner__text a {
    color: #1e3a5f;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.icaolpt-cookie-banner__text a:hover {
    color: #2d5a8e;
}

.icaolpt-cookie-banner__actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.icaolpt-cookie-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
    white-space: nowrap;
    line-height: 1.4;
}

.icaolpt-cookie-btn:active {
    transform: scale(0.98);
}

.icaolpt-cookie-btn--accept {
    background: #1e3a5f;
    color: #ffffff;
}

.icaolpt-cookie-btn--accept:hover {
    background: #2d5a8e;
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.3);
}

.icaolpt-cookie-btn--reject {
    background: #e2e8f0;
    color: #1e3a5f;
}

.icaolpt-cookie-btn--reject:hover {
    background: #cbd5e0;
}

.icaolpt-cookie-btn--settings {
    background: transparent;
    color: #1e3a5f;
    border: 1px solid #cbd5e0;
}

.icaolpt-cookie-btn--settings:hover {
    background: #f7fafc;
    border-color: #1e3a5f;
}

/* --- Settings Panel (overlay) --- */
.icaolpt-cookie-settings {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000000;
    background: #ffffff;
    border-top: 3px solid #1e3a5f;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.18);
    max-height: 85vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.35s ease;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.icaolpt-cookie-settings.is-visible {
    transform: translateY(0);
}

.icaolpt-cookie-settings__inner {
    max-width: 720px;
    margin: 0 auto;
    padding: 28px 32px 24px;
}

.icaolpt-cookie-settings__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.icaolpt-cookie-settings__header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1e3a5f;
}

.icaolpt-cookie-settings__close {
    background: none;
    border: none;
    font-size: 24px;
    color: #718096;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1;
}

.icaolpt-cookie-settings__close:hover {
    background: #f7fafc;
    color: #1e3a5f;
}

.icaolpt-cookie-settings__intro {
    font-size: 13px;
    line-height: 1.6;
    color: #4a5568;
    margin: 0 0 20px;
}

.icaolpt-cookie-settings__intro a {
    color: #1e3a5f;
    text-decoration: underline;
}

/* --- Cookie Category --- */
.icaolpt-cookie-category {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
}

.icaolpt-cookie-category__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: #f7fafc;
    cursor: default;
}

.icaolpt-cookie-category__info {
    flex: 1;
}

.icaolpt-cookie-category__name {
    font-size: 14px;
    font-weight: 600;
    color: #1e3a5f;
    margin: 0 0 2px;
}

.icaolpt-cookie-category__desc {
    font-size: 12px;
    color: #718096;
    margin: 0;
    line-height: 1.4;
}

/* --- Toggle Switch --- */
.icaolpt-cookie-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    margin-left: 16px;
}

.icaolpt-cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.icaolpt-cookie-toggle__slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #cbd5e0;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.25s;
}

.icaolpt-cookie-toggle__slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform 0.25s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.icaolpt-cookie-toggle input:checked + .icaolpt-cookie-toggle__slider {
    background: #1e3a5f;
}

.icaolpt-cookie-toggle input:checked + .icaolpt-cookie-toggle__slider::before {
    transform: translateX(20px);
}

.icaolpt-cookie-toggle input:disabled + .icaolpt-cookie-toggle__slider {
    background: #1e3a5f;
    opacity: 0.6;
    cursor: not-allowed;
}

.icaolpt-cookie-toggle input:disabled:checked + .icaolpt-cookie-toggle__slider {
    opacity: 0.6;
}

.icaolpt-cookie-category__badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #718096;
    background: #e2e8f0;
    padding: 2px 8px;
    border-radius: 3px;
    margin-left: 8px;
    vertical-align: middle;
}

/* --- Cookie Details (expandable) --- */
.icaolpt-cookie-category__details {
    padding: 0 18px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.icaolpt-cookie-category.is-expanded .icaolpt-cookie-category__details {
    max-height: 300px;
    padding: 12px 18px;
}

.icaolpt-cookie-category__toggle-details {
    background: none;
    border: none;
    font-size: 12px;
    color: #718096;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
    margin-top: 4px;
}

.icaolpt-cookie-category__toggle-details:hover {
    color: #1e3a5f;
}

.icaolpt-cookie-detail-table {
    width: 100%;
    font-size: 12px;
    border-collapse: collapse;
    color: #4a5568;
}

.icaolpt-cookie-detail-table th {
    text-align: left;
    font-weight: 600;
    color: #1e3a5f;
    padding: 4px 8px 4px 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.icaolpt-cookie-detail-table td {
    padding: 4px 8px 4px 0;
    border-bottom: 1px solid #f0f4f8;
}

/* --- Settings Footer --- */
.icaolpt-cookie-settings__footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

/* --- Footer Link --- */
.icaolpt-cookie-footer-link {
    cursor: pointer;
    background: none;
    border: none;
    font-size: 13px;
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
    padding: 0;
    font-family: inherit;
    opacity: 0.8;
}

.icaolpt-cookie-footer-link:hover {
    opacity: 1;
    color: #ffffff;
}

/* --- Backdrop --- */
.icaolpt-cookie-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s, visibility 0.4s;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.icaolpt-cookie-backdrop.is-visible {
    opacity: 1;
    visibility: visible;
}

/* Lock body scroll while consent is pending */
body.icaolpt-consent-pending {
    overflow: hidden !important;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .icaolpt-cookie-banner__inner {
        flex-direction: column;
        padding: 20px;
        gap: 16px;
    }

    .icaolpt-cookie-banner__actions {
        width: 100%;
    }

    .icaolpt-cookie-btn {
        flex: 1;
        padding: 12px 16px;
        font-size: 13px;
    }

    .icaolpt-cookie-settings__inner {
        padding: 20px;
    }

    .icaolpt-cookie-settings__footer {
        flex-wrap: wrap;
    }

    .icaolpt-cookie-settings__footer .icaolpt-cookie-btn {
        flex: 1;
        min-width: 120px;
    }
}

@media (max-width: 420px) {
    .icaolpt-cookie-banner__actions {
        flex-direction: column;
    }

    .icaolpt-cookie-btn {
        width: 100%;
    }
}

/* ─── Accessibility ───────────────────────────────────────────────────── */

/* Focus-visible outlines */
.icaolpt-cookie-banner *:focus-visible,
.icaolpt-cookie-settings *:focus-visible {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
}

/* Minimum touch target sizes */
.icaolpt-cookie-btn { min-height: 44px; }
.icaolpt-cookie-settings__close { min-width: 44px; min-height: 44px; }
.icaolpt-cookie-toggle { min-width: 44px; min-height: 44px; display: flex; align-items: center; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .icaolpt-cookie-banner,
    .icaolpt-cookie-settings,
    .icaolpt-cookie-backdrop,
    .icaolpt-cookie-toggle__slider,
    .icaolpt-cookie-toggle__slider::before,
    .icaolpt-cookie-btn {
        transition-duration: 0.01ms !important;
    }
}
