/* =====================================================
   COOKIE CONSENT BANNER + SETTINGS MODAL
   ===================================================== */

.cookie-consent {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 9990;
    background: #fff;
    color: #1f2937;
    border-radius: 12px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
    animation: cookie-slide-up 0.35s ease-out;
}

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

@keyframes cookie-slide-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.cookie-consent__content { flex: 1 1 360px; min-width: 0; }

.cookie-consent__title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 6px;
    color: #111827;
}

.cookie-consent__text {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #4b5563;
    margin: 0;
}

.cookie-consent__text a {
    color: #111827;
    text-decoration: underline;
    font-weight: 500;
}

.cookie-consent__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    flex-shrink: 0;
}

.cookie-consent__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
    line-height: 1.2;
    font-family: inherit;
}

.cookie-consent__btn--primary {
    background: #111827;
    color: #fff;
    border-color: #111827;
}
.cookie-consent__btn--primary:hover { background: #000; border-color: #000; }

.cookie-consent__btn--secondary {
    background: #fff;
    color: #1f2937;
    border-color: #d1d5db;
}
.cookie-consent__btn--secondary:hover { background: #f3f4f6; border-color: #9ca3af; }

/* Settings modal */
.cookie-settings {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.cookie-settings[hidden] { display: none; }

.cookie-settings__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
}

.cookie-settings__modal {
    position: relative;
    max-width: 640px;
    width: 100%;
    max-height: 90vh;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    animation: cookie-modal-pop 0.25s ease-out;
}

@keyframes cookie-modal-pop {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.cookie-settings__header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cookie-settings__title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: #111827;
}

.cookie-settings__close {
    background: transparent;
    border: 0;
    color: #6b7280;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.cookie-settings__close:hover { background: #f3f4f6; color: #111827; }

.cookie-settings__body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.cookie-settings__intro {
    font-size: 0.875rem;
    color: #4b5563;
    margin: 0 0 16px;
    line-height: 1.5;
}

.cookie-category {
    padding: 14px 0;
    border-bottom: 1px solid #e5e7eb;
}
.cookie-category:last-child { border-bottom: 0; }

.cookie-category__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.cookie-category__title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.cookie-category__title {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.cookie-category__badge {
    display: inline-block;
    padding: 2px 8px;
    background: #ecfdf5;
    color: #047857;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.cookie-category__desc {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

/* Toggle switch */
.cookie-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

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

.cookie-toggle__slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: #d1d5db;
    border-radius: 999px;
    transition: background 0.2s ease;
    flex-shrink: 0;
}
.cookie-toggle__slider::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.cookie-toggle input:checked + .cookie-toggle__slider {
    background: #10b981;
}
.cookie-toggle input:checked + .cookie-toggle__slider::before {
    transform: translateX(20px);
}
.cookie-toggle input:focus-visible + .cookie-toggle__slider {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3);
}
.cookie-toggle__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.cookie-settings__footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Footer button styling — match footer__legal-link */
.footer__legal-link--button {
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    text-decoration: none;
}
.footer__legal-link--button:hover { text-decoration: underline; }

@media (max-width: 640px) {
    .cookie-consent { left: 8px; right: 8px; bottom: 8px; }
    .cookie-consent__inner { padding: 16px; gap: 12px; }
    .cookie-consent__actions { width: 100%; }
    .cookie-consent__btn { flex: 1 1 auto; padding: 12px 14px; font-size: 0.825rem; }
    .cookie-settings__modal { max-height: 95vh; }
    .cookie-settings__footer { flex-direction: column-reverse; }
    .cookie-settings__footer .cookie-consent__btn { width: 100%; }
}
