/* Cookie consent banner — xem public/js/cookie-consent.js */
.cc { --cc-primary: #0d6efd; --cc-text: #212529; --cc-muted: #555; --cc-border: #dee2e6; font-size: 14px; line-height: 1.5; color: var(--cc-text); }
.cc [hidden] { display: none !important; }
.cc p { margin: 0 0 8px; color: var(--cc-muted); }
.cc a { color: var(--cc-primary); text-decoration: underline; }
.cc-title { font-weight: 700; font-size: 16px; color: var(--cc-text) !important; margin-bottom: 6px !important; }

.cc-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 99990;
    display: flex; align-items: center; gap: 24px;
    padding: 16px 24px; background: #fff;
    border-top: 1px solid var(--cc-border); box-shadow: 0 -4px 16px rgba(0, 0, 0, .12);
}
.cc-bar__text { flex: 1 1 auto; min-width: 0; }
.cc-bar__text p:last-child { margin-bottom: 0; }

.cc-actions { display: flex; flex-wrap: wrap; gap: 8px; flex: 0 0 auto; }
.cc-btn {
    padding: 9px 18px; border: 1px solid var(--cc-primary); border-radius: 6px;
    background: #fff; color: var(--cc-primary); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
}
.cc-btn:hover { background: #f0f6ff; }
.cc-btn--primary { background: var(--cc-primary); color: #fff; }
.cc-btn--primary:hover { background: #0b5ed7; }
.cc-btn--link { border-color: transparent; text-decoration: underline; }

.cc-overlay {
    position: fixed; inset: 0; z-index: 99991;
    display: flex; align-items: center; justify-content: center;
    padding: 16px; background: rgba(0, 0, 0, .5);
}
.cc-modal {
    position: relative; width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow-y: auto;
    padding: 24px; background: #fff; border-radius: 10px; box-shadow: 0 10px 40px rgba(0, 0, 0, .25);
}
.cc-close {
    position: absolute; top: 8px; right: 12px; border: 0; background: none;
    font-size: 28px; line-height: 1; color: #888; cursor: pointer;
}
.cc-category { padding: 12px 0; border-bottom: 1px solid var(--cc-border); }
.cc-category p { margin: 4px 0 0; font-size: 13px; }
.cc-category__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cc-category__name { font-weight: 600; }
.cc-modal .cc-actions { justify-content: flex-end; margin-top: 16px; }

.cc-switch { position: relative; display: inline-block; flex: 0 0 auto; width: 44px; height: 24px; margin: 0; }
.cc-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.cc-switch input:disabled { cursor: not-allowed; }
.cc-switch span { position: absolute; inset: 0; border-radius: 24px; background: #ccc; transition: background .2s; }
.cc-switch span::before {
    content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
    border-radius: 50%; background: #fff; transition: transform .2s;
}
.cc-switch input:checked + span { background: var(--cc-primary); }
.cc-switch input:checked + span::before { transform: translateX(20px); }
.cc-switch input:disabled + span { opacity: .6; }
.cc-switch input:focus-visible + span { outline: 2px solid var(--cc-primary); outline-offset: 2px; }

@media (max-width: 767px) {
    .cc-bar { flex-direction: column; align-items: stretch; gap: 12px; padding: 14px 16px; }
    .cc-bar .cc-actions, .cc-modal .cc-actions { flex-direction: column; }
    .cc-btn { width: 100%; white-space: normal; }
    .cc-modal { padding: 20px 16px; }
}

/* Ô thay thế iframe/video/bình luận khi chưa đồng ý */
.consent-embed { position: relative; }
/* Iframe trong thân bài: nằm trong <p>, kế thừa căn lề của đoạn */
.consent-embed--inline { display: inline-block; max-width: 100%; vertical-align: top; }
.consent-embed--fluid { display: block; width: 100%; }
.consent-embed--active > .consent-placeholder { display: none; }
.consent-embed:not(.consent-embed--active) > iframe,
.consent-embed:not(.consent-embed--active) > video { visibility: hidden; }
.video-container > .consent-embed,
.tiktok-native-wrapper > .consent-embed { position: absolute; inset: 0; }
.tiktok-native-wrapper > .consent-embed > video { width: 100%; height: 100%; }

.consent-placeholder {
    display: flex; align-items: center; justify-content: center;
    padding: 16px; background: #1f1f1f; color: #fff; text-align: center; overflow: hidden;
}
.consent-placeholder--video,
.consent-placeholder--embed { position: absolute; inset: 0; min-height: 160px; }
.consent-placeholder--comments { background: #f5f6f8; color: #333; border: 1px dashed #ccc; border-radius: 8px; min-height: 120px; }
.consent-placeholder__thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .35; }
.consent-placeholder__body { display: block; position: relative; max-width: 420px; }
.consent-placeholder__text {
    display: block; margin: 0 0 12px; font-size: 14px; line-height: 1.5; color: inherit; }
.consent-accept-embed {
    padding: 8px 16px; border: 0; border-radius: 6px; background: #0d6efd; color: #fff;
    font-weight: 600; font-size: 14px; cursor: pointer;
}
.consent-accept-embed:hover { background: #0b5ed7; }
