/*
 * MWKConnect — Cookie Consent Banner
 * ถูกต้องตาม พ.ร.บ. คุ้มครองข้อมูลส่วนบุคคล พ.ศ. 2562 (PDPA)
 * Pattern: floating card — ใช้ style เดียวกับ .mwk-pwa-install
 */

/* ─── Banner card ───────────────────────────────────────────────────────────── */
.mwk-cookie-banner {
    position: fixed;
    z-index: 10950;
    right: 18px;
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    width: min(420px, calc(100% - 36px));
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .09);
    border-top: 3px solid #3c8dbc;
    border-radius: 6px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .14);
    padding: 16px 18px 14px;
    display: none;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .24s ease, transform .24s ease;
    font-size: .875rem;
    line-height: 1.5;
    color: #343a40;
}
.mwk-cookie-banner.is-visible {
    display: block;
}
.mwk-cookie-banner.is-open {
    opacity: 1;
    transform: translateY(0);
}

/* ─── Header row ────────────────────────────────────────────────────────────── */
.mwk-cookie-banner__header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.mwk-cookie-banner__header-icon {
    color: #3c8dbc;
    font-size: 1rem;
    flex-shrink: 0;
    line-height: 1;
}
.mwk-cookie-banner__title {
    font-size: .92rem;
    font-weight: 700;
    color: #343a40;
    margin: 0;
    line-height: 1.3;
}

/* ─── Body text ─────────────────────────────────────────────────────────────── */
.mwk-cookie-banner__text {
    font-size: .82rem;
    color: #6c757d;
    margin: 0 0 12px;
    line-height: 1.6;
}
.mwk-cookie-banner__text a {
    color: #3c8dbc;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 500;
}
.mwk-cookie-banner__text a:hover {
    color: #2f7199;
}

/* ─── Divider ───────────────────────────────────────────────────────────────── */
.mwk-cookie-banner__divider {
    border: none;
    border-top: 1px solid #e9ecef;
    margin: 0 0 12px;
}

/* ─── Actions ───────────────────────────────────────────────────────────────── */
.mwk-cookie-banner__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mwk-cookie-btn-accept {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 6px 16px;
    background-color: #3c8dbc;
    border: 1px solid #3c8dbc;
    border-radius: 4px;
    color: #fff;
    font-size: .84rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.3;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.mwk-cookie-btn-accept:hover,
.mwk-cookie-btn-accept:focus {
    background-color: #367fa9;
    border-color: #367fa9;
    color: #fff;
    text-decoration: none;
    outline: none;
    box-shadow: 0 2px 8px rgba(60, 141, 188, .3);
}
.mwk-cookie-btn-accept:active {
    background-color: #2e6e8e;
    border-color: #2e6e8e;
    box-shadow: none;
}

.mwk-cookie-btn-link {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 6px 10px;
    font-size: .82rem;
    color: #6c757d;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.3;
    transition: background-color .15s ease, color .15s ease;
}
.mwk-cookie-btn-link:hover,
.mwk-cookie-btn-link:focus {
    background: #e9ecef;
    color: #343a40;
    text-decoration: none;
    outline: none;
}

/* ─── PDPA badge ────────────────────────────────────────────────────────────── */
.mwk-cookie-banner__badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .72rem;
    font-weight: 600;
    color: #6c757d;
    margin-top: 10px;
    line-height: 1.3;
}
.mwk-cookie-banner__badge i {
    font-size: .7rem;
    color: #28a745;
}

/* ─── Responsive: mobile ────────────────────────────────────────────────────── */
@media (max-width: 575.98px) {
    .mwk-cookie-banner {
        right: 10px;
        bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        width: calc(100% - 20px);
        padding: 14px 14px 12px;
    }
    .mwk-cookie-banner__actions {
        flex-direction: column;
        gap: 7px;
    }
    .mwk-cookie-btn-accept,
    .mwk-cookie-btn-link {
        width: 100%;
        justify-content: center;
    }
}

/* ─── Print / Reduced motion ────────────────────────────────────────────────── */
@media print {
    .mwk-cookie-banner { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
    .mwk-cookie-banner { transition: none; }
}
