/* VnGuide cookie consent banner — PDPL Law 91/2025 compliance */

.vnguide-cookie-banner {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 9999;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.12);
    padding: 16px 20px;
}
.vnguide-cookie-banner[hidden] { display: none; }

.vnguide-cookie-banner__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}
.vnguide-cookie-banner__content { flex: 1 1 480px; min-width: 280px; }
.vnguide-cookie-banner__title { font-size: 16px; font-weight: 700; margin: 0 0 6px; color: #0f2d5e; }
.vnguide-cookie-banner__desc { font-size: 14px; line-height: 1.5; color: #4b5563; margin: 0; }
.vnguide-cookie-banner__link { color: #0f2d5e; text-decoration: underline; font-weight: 600; }
.vnguide-cookie-banner__link:hover { color: #2e6bff; }

.vnguide-cookie-banner__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.vnguide-cookie-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1;
    min-height: 40px;
}
.vnguide-cookie-btn--primary { background: #f9c20b; color: #0f2d5e; }
.vnguide-cookie-btn--primary:hover { background: #e6ad00; }
.vnguide-cookie-btn--secondary { background: #fff; color: #4b5563; border-color: #d1d5db; }
.vnguide-cookie-btn--secondary:hover { background: #f3f4f6; }

/* Preferences modal */
.vnguide-cookie-prefs {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.vnguide-cookie-prefs[hidden] { display: none; }
.vnguide-cookie-prefs__backdrop { position: absolute; inset: 0; background: rgba(15, 24, 38, 0.6); }
.vnguide-cookie-prefs__panel {
    position: relative;
    background: #fff;
    border-radius: 12px;
    max-width: 540px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}
.vnguide-cookie-prefs__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}
.vnguide-cookie-prefs__header h2 { margin: 0; font-size: 18px; font-weight: 700; color: #0f2d5e; }
.vnguide-cookie-prefs__close {
    background: transparent; border: 0; cursor: pointer;
    width: 32px; height: 32px; border-radius: 6px;
    font-size: 22px; color: #6b7280;
}
.vnguide-cookie-prefs__close:hover { background: #f3f4f6; color: #111; }
.vnguide-cookie-prefs__body { padding: 16px 20px; }
.vnguide-cookie-pref-item { padding: 12px 0; border-bottom: 1px solid #f3f4f6; }
.vnguide-cookie-pref-item:last-child { border-bottom: 0; }
.vnguide-cookie-pref-item__head {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px;
}
.vnguide-cookie-pref-item__head strong { color: #111; font-size: 15px; }
.vnguide-cookie-pref-item__badge {
    background: #f3f4f6; color: #6b7280; font-size: 12px; padding: 4px 10px; border-radius: 9999px;
}
.vnguide-cookie-pref-item p { margin: 0; font-size: 13px; color: #6b7280; line-height: 1.5; }

.vnguide-cookie-toggle { position: relative; display: inline-block; width: 44px; height: 24px; }
.vnguide-cookie-toggle input { opacity: 0; width: 0; height: 0; }
.vnguide-cookie-toggle span {
    position: absolute; cursor: pointer; inset: 0;
    background: #d1d5db; border-radius: 9999px; transition: 0.2s;
}
.vnguide-cookie-toggle span::before {
    position: absolute; content: ''; height: 18px; width: 18px;
    left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: 0.2s;
}
.vnguide-cookie-toggle input:checked + span { background: #16a34a; }
.vnguide-cookie-toggle input:checked + span::before { transform: translateX(20px); }

.vnguide-cookie-prefs__footer {
    padding: 16px 20px; border-top: 1px solid #e5e7eb; text-align: right;
}

/* Mobile compact: 1-line title + desc, horizontal 2-button row, max-height 140px */
@media (max-width: 768px) {
    .vnguide-cookie-banner { padding: 10px 14px; }
    .vnguide-cookie-banner__inner { gap: 10px; }
    .vnguide-cookie-banner__title { font-size: 14px; margin-bottom: 2px; }
    .vnguide-cookie-banner__desc { font-size: 12px; line-height: 1.35; }
    .vnguide-cookie-banner__desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .vnguide-cookie-banner__actions { gap: 6px; }
    .vnguide-cookie-btn { padding: 8px 12px; font-size: 13px; min-height: 36px; }
}
@media (max-width: 480px) {
    /* A.1.2: ultra-compact mobile — 1-line desc, single row 3 buttons, total ~110px height. */
    .vnguide-cookie-banner__inner { flex-direction: column; align-items: stretch; padding: 10px 12px; gap: 8px; }
    .vnguide-cookie-banner__content { flex: 0 1 auto; min-width: 0; }
    .vnguide-cookie-banner__title { font-size: 13px; margin: 0; }
    .vnguide-cookie-banner__desc { display: -webkit-box; -webkit-line-clamp: 1 !important; -webkit-box-orient: vertical; overflow: hidden; font-size: 11px; line-height: 1.3; margin: 0; }
    .vnguide-cookie-banner__actions { flex-direction: row; flex-wrap: nowrap; gap: 4px; }
    .vnguide-cookie-btn { flex: 1 1 33%; min-width: 0; padding: 7px 4px; font-size: 11px; min-height: 32px; }
    .vnguide-cookie-btn--primary { order: 99; flex-basis: 33%; }
}

/* Body padding compensation — applied via JS when banner visible */
body.vnguide-cookie-banner-visible {
    padding-bottom: var(--vnguide-cookie-banner-h, 0px);
}
