/*
 * BINTACURA — Cookie Consent Banner
 * Modern two-stage GDPR/APDP consent: compact bar + expandable category panel.
 * Dark fixed theme for visibility across all page backgrounds.
 */

/* ── Wrapper ──────────────────────────────────────────────────────────────── */
#cookieConsentBanner {
    display: none;
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    width: min(680px, calc(100vw - 32px));
    background: #0f172a;
    color: #f1f5f9;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255,255,255,0.07);
    font-family: inherit;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

/* ── Compact stage ────────────────────────────────────────────────────────── */
.cookie-compact {
    padding: 20px 24px;
}

.cookie-compact-top {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
}

.cookie-icon {
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}

.cookie-compact-text {
    flex: 1;
}

.cookie-consent-title {
    font-weight: 700;
    font-size: 1rem;
    margin: 0 0 5px;
    color: #f8fafc;
}

.cookie-consent-desc {
    font-size: 0.8125rem;
    line-height: 1.55;
    margin: 0;
    color: #94a3b8;
}

.cookie-consent-link {
    color: #60a5fa;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cookie-consent-link:hover {
    color: #93c5fd;
}

.cookie-compact-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.cookie-btn-accept {
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 9px 18px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.cookie-btn-accept:hover {
    background: #1d4ed8;
}

.cookie-btn-essential {
    background: transparent;
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 8px;
    padding: 9px 18px;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
    white-space: nowrap;
}

.cookie-btn-essential:hover {
    border-color: rgba(148, 163, 184, 0.7);
    color: #f1f5f9;
}

.cookie-btn-customize {
    background: transparent;
    color: #60a5fa;
    border: none;
    padding: 9px 4px;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    margin-left: auto;
    text-decoration: underline;
    text-underline-offset: 2px;
    white-space: nowrap;
}

.cookie-btn-customize:hover {
    color: #93c5fd;
}

.cookie-btn-save {
    background: #16a34a;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 9px 18px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.cookie-btn-save:hover {
    background: #15803d;
}

.cookie-btn-back {
    background: transparent;
    color: #64748b;
    border: none;
    padding: 9px 4px;
    font-size: 0.8125rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.cookie-btn-back:hover {
    color: #94a3b8;
}

/* ── Expanded / Customize panel ───────────────────────────────────────────── */
.cookie-expanded {
    display: none;
}

.cookie-expanded.cookie-panel-open {
    display: block;
}

.cookie-expanded-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 24px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.cookie-expanded-header h3 {
    font-size: 0.9375rem;
    font-weight: 700;
    margin: 0;
    color: #f8fafc;
}

.cookie-expanded-body {
    padding: 8px 24px 4px;
}

.cookie-category {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

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

.cookie-category-info {
    flex: 1;
}

.cookie-category-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #e2e8f0;
    margin: 0 0 3px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cookie-category-badge {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 20px;
    background: rgba(100, 116, 139, 0.3);
    color: #94a3b8;
    letter-spacing: 0.02em;
}

.cookie-category-badge-required {
    background: rgba(22, 163, 74, 0.2);
    color: #4ade80;
}

.cookie-category-desc {
    font-size: 0.75rem;
    line-height: 1.5;
    color: #64748b;
    margin: 0;
}

/* ── Toggle switch ────────────────────────────────────────────────────────── */
.cookie-toggle {
    position: relative;
    flex-shrink: 0;
    margin-top: 2px;
}

.cookie-toggle input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.cookie-toggle-slider {
    display: block;
    width: 40px;
    height: 22px;
    background: #334155;
    border-radius: 22px;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.cookie-toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #94a3b8;
    transition: transform 0.2s, background 0.2s;
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background: #2563eb;
}

.cookie-toggle input:checked + .cookie-toggle-slider::after {
    transform: translateX(18px);
    background: #fff;
}

.cookie-toggle input:disabled + .cookie-toggle-slider {
    cursor: not-allowed;
    opacity: 0.6;
}

/* ── Expanded footer ──────────────────────────────────────────────────────── */
.cookie-expanded-footer {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 14px 24px 20px;
    border-top: 1px solid rgba(255,255,255,0.07);
    flex-wrap: wrap;
}

/* ── Divider ──────────────────────────────────────────────────────────────── */
.cookie-divider {
    height: 1px;
    background: rgba(255,255,255,0.07);
    margin: 0;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 520px) {
    #cookieConsentBanner {
        bottom: 0;
        border-radius: 16px 16px 0 0;
        width: 100%;
    }

    .cookie-compact-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .cookie-btn-customize {
        margin-left: 0;
        text-align: center;
    }

    .cookie-btn-accept,
    .cookie-btn-essential,
    .cookie-btn-save {
        width: 100%;
        text-align: center;
    }
}
