/* ================================================================
   RE-VEAL Cookie Consent
   แถบขอความยินยอมคุกกี้ + หน้าต่างตั้งค่าคุกกี้
   ================================================================= */

.rv-cookie-banner,
.rv-cookie-modal {
    font-family: var(--font--body, Heebo, sans-serif);
    box-sizing: border-box;
}

.rv-cookie-banner *,
.rv-cookie-modal * {
    box-sizing: border-box;
}

.rv-cookie-banner[hidden],
.rv-cookie-modal[hidden] {
    display: none !important;
}

/* ----------------------------------------------------------------
   แถบด้านล่าง
----------------------------------------------------------------- */

.rv-cookie-banner {
    position: fixed;
    z-index: 9998;
    inset: auto 0 0 0;
    background: #035925;
    color: #fff;
    padding: 20px;
    box-shadow: 0 -6px 24px #0000002e;
    animation: rv-cookie-slide-up .35s ease both;
}

@keyframes rv-cookie-slide-up {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.rv-cookie-banner__inner {
    max-width: 1336px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 24px;
}

.rv-cookie-banner__text {
    flex: 1 1 420px;
    min-width: 260px;
}

.rv-cookie-banner__title {
    font-size: 18px;
    line-height: 140%;
    font-weight: 600;
    margin: 0 0 6px;
    color: #fff;
}

.rv-cookie-banner__description {
    font-size: 15px;
    line-height: 160%;
    margin: 0;
    color: #ffffffe6;
}

.rv-cookie-banner__description a,
.rv-cookie-modal__description a {
    color: #e5f937;
    text-decoration: underline;
}

.rv-cookie-banner__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    flex: 0 1 auto;
}

/* ----------------------------------------------------------------
   ปุ่ม
----------------------------------------------------------------- */

.rv-cookie-button {
    font-family: inherit;
    font-size: 15px;
    line-height: 1;
    font-weight: 500;
    padding: 13px 22px;
    border-radius: 100px;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color .2s, color .2s, border-color .2s, opacity .2s;
}

.rv-cookie-button--primary {
    background: #e5f937;
    color: #0b2a17;
    border-color: #e5f937;
}

.rv-cookie-button--primary:hover {
    background: #d3e824;
    border-color: #d3e824;
}

.rv-cookie-button--outline {
    background: #0000;
    color: #fff;
    border-color: #ffffff66;
}

.rv-cookie-button--outline:hover {
    background: #ffffff1f;
    border-color: #fff;
}

.rv-cookie-button--ghost {
    background: #0000;
    color: #035925;
    border-color: #035925;
}

.rv-cookie-button--ghost:hover {
    background: #f2f8f3;
}

.rv-cookie-button:focus-visible,
.rv-cookie-switch input:focus-visible + .rv-cookie-switch__track {
    outline: 2px solid #4bbb37;
    outline-offset: 2px;
}

/* ----------------------------------------------------------------
   หน้าต่างตั้งค่า
----------------------------------------------------------------- */

.rv-cookie-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.rv-cookie-modal__overlay {
    position: absolute;
    inset: 0;
    background: #0b1a10cc;
}

.rv-cookie-modal__dialog {
    position: relative;
    background: #fff;
    color: #3b3b33;
    border-radius: 20px;
    width: min(680px, 100%);
    max-height: min(86vh, 780px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 60px #00000040;
    animation: rv-cookie-fade-in .25s ease both;
}

@keyframes rv-cookie-fade-in {
    from { transform: translateY(12px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.rv-cookie-modal__header {
    padding: 26px 26px 14px;
    border-bottom: 1px solid #e2e7e4;
}

.rv-cookie-modal__title {
    font-family: var(--font--title, Heebo, sans-serif);
    font-size: 24px;
    line-height: 130%;
    color: #000;
    margin: 0 0 8px;
}

.rv-cookie-modal__description {
    font-size: 15px;
    line-height: 160%;
    margin: 0;
    color: #3b3b33;
}

.rv-cookie-modal__body {
    padding: 8px 26px 20px;
    overflow-y: auto;
}

.rv-cookie-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid #e2e7e4;
    background: #fff;
    color: #3b3b33;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.rv-cookie-modal__close:hover {
    background: #f2f8f3;
}

/* ----------------------------------------------------------------
   รายการประเภทคุกกี้
----------------------------------------------------------------- */

.rv-cookie-group {
    border-bottom: 1px solid #e2e7e4;
    padding: 18px 0;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    justify-content: space-between;
}

.rv-cookie-group:last-child {
    border-bottom: none;
}

.rv-cookie-group__name {
    font-size: 17px;
    font-weight: 600;
    color: #000;
    margin: 0 0 4px;
}

.rv-cookie-group__text {
    font-size: 14px;
    line-height: 160%;
    margin: 0;
    color: #3b3b33;
}

.rv-cookie-group__badge {
    display: inline-block;
    font-size: 12px;
    line-height: 1;
    padding: 6px 10px;
    border-radius: 100px;
    background: #f2f8f3;
    color: #035925;
    border: 1px solid #e2e7e4;
    white-space: nowrap;
}

/* สวิตช์เปิด/ปิด */

.rv-cookie-switch {
    flex: none;
    position: relative;
    display: inline-flex;
    align-items: center;
}

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

.rv-cookie-switch__track {
    width: 52px;
    height: 30px;
    border-radius: 100px;
    background: #d6ddd8;
    position: relative;
    transition: background-color .2s;
    pointer-events: none;
}

.rv-cookie-switch__track:after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    transition: transform .2s;
    box-shadow: 0 1px 3px #0000002e;
}

.rv-cookie-switch input:checked + .rv-cookie-switch__track {
    background: #035925;
}

.rv-cookie-switch input:checked + .rv-cookie-switch__track:after {
    transform: translateX(22px);
}

.rv-cookie-switch input:disabled {
    cursor: not-allowed;
}

.rv-cookie-switch input:disabled + .rv-cookie-switch__track {
    background: #4bbb37;
    opacity: .55;
}

.rv-cookie-modal__footer {
    padding: 18px 26px 24px;
    border-top: 1px solid #e2e7e4;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    background: #f2f8f3;
}

/* ----------------------------------------------------------------
   ปุ่มเปิดตั้งค่าในหน้าเนื้อหา
----------------------------------------------------------------- */

.rv-cookie-settings-trigger {
    display: inline-block;
    margin: 8px 0 0;
}

body.rv-cookie-modal-open {
    overflow: hidden;
}

/* ----------------------------------------------------------------
   จอเล็ก
----------------------------------------------------------------- */

@media screen and (max-width: 767px) {

    .rv-cookie-banner {
        padding: 18px 16px;
    }

    .rv-cookie-banner__inner {
        gap: 14px;
    }

    .rv-cookie-banner__actions {
        width: 100%;
    }

    .rv-cookie-button {
        flex: 1 1 auto;
        text-align: center;
        padding: 13px 16px;
    }

    .rv-cookie-modal {
        padding: 0;
        align-items: flex-end;
    }

    .rv-cookie-modal__dialog {
        border-radius: 20px 20px 0 0;
        max-height: 92vh;
    }

    .rv-cookie-modal__footer {
        justify-content: stretch;
    }

    .rv-cookie-modal__footer .rv-cookie-button {
        flex: 1 1 140px;
    }
}

/* ----------------------------------------------------------------
   ลดการเคลื่อนไหวตามการตั้งค่าของผู้ใช้
----------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {

    .rv-cookie-banner,
    .rv-cookie-modal__dialog {
        animation: none;
    }
}
