/* ------------------------------------------------------------------
 * cookie-consent.css — แถบและหน้าต่างตั้งค่าคุกกี้ (PDPA)
 * ------------------------------------------------------------------ */

.mhs-consent,
.mhs-consent-modal {
    font-family: 'Prompt', 'Noto Sans Thai', Tahoma, sans-serif;
}

.mhs-consent[hidden],
.mhs-consent-modal[hidden] {
    display: none !important;
}

/* ---------- แถบด้านล่าง ---------- */
.mhs-consent {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99990;
    padding: 14px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 -6px 28px rgba(0, 0, 0, .18);
    border-top: 3px solid #a10000;
    animation: mhs-consent-up .28s ease-out;
}

@keyframes mhs-consent-up {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

.mhs-consent-box {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.mhs-consent-main { flex: 1 1 460px; }

.mhs-consent-title {
    font-size: 17px;
    font-weight: 700;
    color: #a10000;
    margin: 0 0 4px;
}

.mhs-consent-text {
    font-size: 14px;
    line-height: 1.65;
    color: #444;
    margin: 0;
}

.mhs-consent-text a {
    color: #a10000;
    text-decoration: underline;
}

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

/* ---------- ปุ่ม ---------- */
.mhs-btn {
    font-family: inherit;
    font-size: 14px;
    line-height: 1;
    padding: 12px 18px;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: filter .15s ease, background .15s ease;
}

.mhs-btn:hover { filter: brightness(.94); }

.mhs-btn-primary {
    background: #a10000;
    color: #fff;
    font-weight: 700;
}

.mhs-btn-outline {
    background: #fff;
    color: #a10000;
    border-color: #a10000;
}

.mhs-btn-ghost {
    background: #f1f1f1;
    color: #444;
    border-color: #ddd;
}

/* ---------- หน้าต่างตั้งค่า ---------- */
.mhs-consent-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.mhs-consent-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .55);
}

.mhs-consent-modal-box {
    position: relative;
    width: 100%;
    max-width: 640px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}

.mhs-consent-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.mhs-consent-modal-head h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #a10000;
}

.mhs-consent-close {
    background: none;
    border: 0;
    font-size: 26px;
    line-height: 1;
    color: #999;
    cursor: pointer;
}

.mhs-consent-modal-body {
    padding: 18px 20px;
    overflow-y: auto;
}

.mhs-consent-cat {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 12px 14px;
    margin-top: 12px;
}

.mhs-consent-cat-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.mhs-consent-cat strong {
    font-size: 15px;
    color: #222;
}

.mhs-consent-cat p {
    margin: 6px 0 0;
    font-size: 13px;
    line-height: 1.6;
    color: #666;
}

.mhs-consent-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 20px;
    background: #e8f5e9;
    color: #1a7f37;
    font-size: 11px;
    vertical-align: middle;
}

.mhs-consent-note {
    margin: 16px 0 0;
    font-size: 12px;
    color: #888;
    line-height: 1.6;
}

.mhs-consent-modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    padding: 14px 20px;
    border-top: 1px solid #eee;
    background: #fafafa;
}

/* ---------- สวิตช์เปิด/ปิด ---------- */
.mhs-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex: none;
}

.mhs-switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.mhs-switch-track {
    position: absolute;
    inset: 0;
    background: #ccc;
    border-radius: 26px;
    transition: background .2s ease;
    pointer-events: none;
}

.mhs-switch-track::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s ease;
}

.mhs-switch input:checked + .mhs-switch-track { background: #a10000; }
.mhs-switch input:checked + .mhs-switch-track::before { transform: translateX(22px); }
.mhs-switch.is-locked .mhs-switch-track { background: #9e9e9e; }
.mhs-switch.is-locked input { cursor: not-allowed; }

/* ---------- ลิงก์ตั้งค่าคุกกี้ที่ footer ---------- */
.mhs-consent-reopen {
    background: none;
    border: 0;
    padding: 0;
    color: inherit;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

/* ---------- จอเล็ก ---------- */
@media (max-width: 767px) {
    .mhs-consent { padding: 12px; }
    .mhs-consent-box { gap: 12px; }
    .mhs-consent-actions { width: 100%; }
    .mhs-consent-actions .mhs-btn { flex: 1 1 auto; }
    .mhs-consent-title { font-size: 16px; }
    .mhs-consent-text { font-size: 13px; }
    .mhs-consent-modal-foot .mhs-btn { flex: 1 1 auto; }
}

/* ---------- หน้าเอกสารนโยบาย (privacy / cookie / terms) ---------- */
.policy-doc {
    line-height: 1.85;
    color: #333;
    max-width: 900px;
    margin: 0 auto;
}

.policy-doc h2 {
    font-size: 21px;
    color: #a10000;
    margin: 32px 0 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0e2e2;
}

.policy-doc h3 {
    font-size: 17px;
    color: #333;
    margin: 20px 0 8px;
}

.policy-doc ul {
    padding-left: 22px;
    margin-bottom: 14px;
}

.policy-doc li {
    margin-bottom: 6px;
}

.policy-doc p {
    margin-bottom: 14px;
}

.policy-doc a {
    color: #a10000;
    text-decoration: underline;
}

.policy-doc table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0 18px;
    font-size: 15px;
}

.policy-doc table th {
    background: #a10000;
    color: #fff;
    text-align: left;
    padding: 10px 12px;
    font-weight: 600;
}

.policy-doc table td {
    border: 1px solid #e6e6e6;
    padding: 10px 12px;
    vertical-align: top;
}

.policy-doc table tbody tr:nth-child(even) {
    background: #fafafa;
}

.policy-doc .table-responsive {
    overflow-x: auto;
}

/* ---------- FAQ (ใช้ร่วมกับ AEO) ---------- */
.mhs-faq-item {
    border: 1px solid #e6e6e6;
    border-radius: 8px;
    padding: 0;
    margin-bottom: 10px;
    background: #fff;
    overflow: hidden;
}

.mhs-faq-q {
    cursor: pointer;
    padding: 14px 18px;
    font-weight: 700;
    color: #a10000;
    list-style: none;
    position: relative;
    padding-right: 44px;
}

.mhs-faq-q::-webkit-details-marker { display: none; }

.mhs-faq-q::after {
    content: '+';
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: #a10000;
}

.mhs-faq-item[open] .mhs-faq-q::after { content: '\2212'; }

.mhs-faq-a {
    padding: 0 18px 16px;
    color: #444;
    line-height: 1.75;
}
