/* ═══════════════════════════════════════════════════════════
   Cookie Consent — Modern Floating Card Style
   ═══════════════════════════════════════════════════════════ */

/* ── Banner ── */
#cookie-banner {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(120px);
    z-index: 99999;
    width: calc(100% - 48px);
    max-width: 780px;
    background: #ffffff;
    color: #374151;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    border-radius: 18px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.14), 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f0;
    font-family: 'Poppins', sans-serif;
    font-size: 0.83rem;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.45s ease;
    opacity: 0;
    padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
}

#cookie-banner.is-visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ── Logo + text row ── */
.cookie-banner-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 220px;
}

.cookie-banner-logo {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgb(229,84,0), rgb(255,120,0));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(229,84,0,0.25);
}

.cookie-banner-logo img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

#cookie-banner p {
    margin: 0;
    line-height: 1.55;
    color: #6b7280;
    font-size: 0.82rem;
}

#cookie-banner p strong {
    color: #111827;
    font-weight: 700;
}

#cookie-banner a {
    color: rgb(229,84,0);
    text-decoration: none;
    font-weight: 600;
}

#cookie-banner a:hover { color: #c94a00; text-decoration: underline; }

/* ── Action buttons ── */
.cookie-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.cookie-btn {
    padding: 9px 18px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-height: 38px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    letter-spacing: 0.2px;
}

.cookie-btn-accept {
    background: linear-gradient(135deg, rgb(229,84,0), rgb(255,107,0));
    color: #fff;
    box-shadow: 0 4px 14px rgba(229,84,0,0.3);
}

.cookie-btn-accept:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(229,84,0,0.4);
}

.cookie-btn-necessary {
    background: #f3f4f6;
    color: #6b7280;
    border: 1.5px solid #e5e7eb;
}

.cookie-btn-necessary:hover {
    background: #e9eaec;
    color: #374151;
}

.cookie-btn-settings {
    background: transparent;
    color: #9ca3af;
    border: 1.5px solid #e5e7eb;
}

.cookie-btn-settings:hover {
    background: #f9fafb;
    color: #374151;
    border-color: #d1d5db;
}

/* ── Settings modal ── */
#cookie-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 16px;
}

#cookie-modal.is-open { display: flex; }

.cookie-modal-box {
    background: #fff;
    border-radius: 22px;
    padding: 28px 26px 24px;
    max-width: 440px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 24px 80px rgba(0,0,0,0.2);
    animation: cookieModalIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes cookieModalIn {
    from { opacity: 0; transform: scale(0.92) translateY(16px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.cookie-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.cookie-modal-logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgb(229,84,0), rgb(255,107,0));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(229,84,0,0.25);
}

.cookie-modal-logo img {
    width: 26px;
    height: 26px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.cookie-modal-box h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.cookie-modal-box > p {
    font-size: 0.8rem;
    color: #9ca3af;
    margin-bottom: 20px;
    line-height: 1.6;
}

.cookie-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 0;
    border-bottom: 1px solid #f3f4f6;
    gap: 14px;
}

.cookie-toggle-row:last-of-type { border-bottom: none; }

.cookie-toggle-info { flex: 1; }

.cookie-toggle-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1f2937;
    display: block;
}

.cookie-toggle-desc {
    font-size: 0.73rem;
    color: #9ca3af;
    margin-top: 2px;
    display: block;
    line-height: 1.4;
}

/* Toggle switch */
.cookie-switch {
    position: relative;
    width: 46px;
    height: 26px;
    flex-shrink: 0;
}

.cookie-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.cookie-switch-slider {
    position: absolute;
    inset: 0;
    background: #e5e7eb;
    border-radius: 26px;
    cursor: pointer;
    transition: background 0.25s;
}

.cookie-switch-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
    box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}

.cookie-switch input:checked + .cookie-switch-slider {
    background: linear-gradient(135deg, rgb(229,84,0), rgb(255,107,0));
}

.cookie-switch input:checked + .cookie-switch-slider::before {
    transform: translateX(20px);
}

.cookie-switch input:disabled + .cookie-switch-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.cookie-switch input:focus-visible + .cookie-switch-slider {
    outline: 3px solid rgba(229,84,0,0.4);
    outline-offset: 2px;
}

.cookie-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 22px;
}

.cookie-modal-actions .cookie-btn {
    flex: 1;
    text-align: center;
    padding: 11px 16px;
    min-height: 44px;
    border-radius: 12px;
}

/* ── Mobile ── */
@media (max-width: 600px) {
    #cookie-banner {
        bottom: 12px;
        width: calc(100% - 24px);
        border-radius: 16px;
        padding: 14px 16px;
        padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
        flex-direction: column;
        align-items: flex-start;
    }

    .cookie-banner-inner { min-width: unset; width: 100%; }
    .cookie-actions { width: 100%; }
    .cookie-btn { flex: 1; text-align: center; }

    .cookie-modal-box {
        padding: 22px 18px 20px;
        border-radius: 18px;
    }
}
