:root {
    /* Headings responsive ตาม Bootstrap 5 ใช้ px + offset */
    --fs-h1: clamp(36px, 2.5vw + 24px, 80px);
    --fs-h2: clamp(30px, 2vw + 20px, 64px);
    --fs-h3: clamp(26px, 1.5vw + 20px, 52px);
    --fs-h4: clamp(23px, 1.2vw + 18px, 45px);
    --fs-h5: clamp(18px, 1vw + 16px, 30px);
    --fs-h6: clamp(16px, 0.8vw + 14px, 25px);
    --fs-p: clamp(14px, 0.5vw + 14px, 18px);
    --fs-small: clamp(12px, 0.25vw + 12px, 14px);
}

@font-face {
    font-family: "MeridiesAntiqua";
    src: url("../font/Meridies_Antiqua.otf") format("opentype");
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: "PSLPro";
    src: url("../font/PSL037PRO.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: "PSLPro";
    src: url("../font/PSL038PRO.ttf") format("truetype");
    font-weight: 800;
    font-style: normal;
}

/* ==== font ==== */
.font-meridies {
    font-family: "MeridiesAntiqua", serif;
}

.font-psl {
    font-family: "PSLPro", sans-serif;
}

body {
    font-family: "Kanit", sans-serif;
}

h1,
.h1 {
    font-size: var(--fs-h1);
}

h2,
.h2 {
    font-size: var(--fs-h2);
}

h3,
.h3 {
    font-size: var(--fs-h3);
}

h4,
.h4 {
    font-size: var(--fs-h4);
}

h5,
.h5 {
    font-size: var(--fs-h5);
}

h6,
.h6 {
    font-size: var(--fs-h6);
}

p,
.p {
    font-size: var(--fs-p);
}

small,
.small {
    font-size: var(--fs-small);
}

/* ==== button ==== */
.btn.primary {
    background: url("../images/btn/btn_bg_01.png");
    background-position: center;
    background-size: cover;
    filter: drop-shadow(1px 3px 1px #000000e1);
    color: #9c836c;
    border: 0px solid;

    transition: all .5s;
}

.btn.secondary {
    background: url("../images/btn/btn_bg_02.png");
    background-position: center;
    background-size: cover;
    filter: drop-shadow(1px 3px 1px #000000e1);
    color: #8a6026;
    border: 0px solid;

    transition: all .5s;
}

.btn {
    width: 360px;
    height: 76px;
    border-radius: 50px;
    padding: 5px 35px;
    border: 0px solid transparent;
}

.btn.md {
    width: 300px;
    height: 55px;
}

.btn.sm {
    background: url("../images/btn/btn_bg_sm.png");
    background-position: center;
    background-size: cover;
    filter: drop-shadow(1px 3px 1px #000000e1);
    color: #8a6026;
    border: 0px solid;
    transition: all .5s;

    width: 180px;
    height: 60px;
}

.btn.primary:hover {
    filter: drop-shadow(1px 2px 10px #ffc354);
}

.btn.secondary:hover,
.btn.sm:hover {
    filter: drop-shadow(1px 2px 10px #fff);
}

/* ==== Select ====  */
.select_lang {
    font-size: 14px !important;
    font-weight: 600;
    width: 105px;
    height: 35px;
    border-radius: 50px;
    padding: 0px 5px;

    background: url("../images/btn/btn_bg_01.png");
    background-position: center;
    background-size: cover;
    border: 1px solid transparent;
    color: #b78c64;

    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1099;
}

/* ==== Loading Overlay Styles ==== */

.topbar_mainLayout {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;

    display: flex;
    align-items: center;
    gap: 10px;
}


#loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.733);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transform: scale(1);
}

#loadingOverlay.fade-out {
    animation: fadeOut 0.3s ease-in-out forwards;
}

.loading-container {
    text-align: center;
    padding: 30px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 15px;
    border: 6px solid #00000081;
    border-top: 6px solid #1290ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    font-size: 24px;
    font-weight: 600;
    color: #1290ff;
    margin-top: 8px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading {
    width: 100%;
    height: 30px;
    background: linear-gradient(0deg, #1b1615ab 10%, #702500a6 90%);
    border: 1px solid #f4c463a3;
    border-radius: 5px;
}

body.loading-active {
    /* overflow: hidden !important; */
    /* ป้องกัน scroll bar ขึ้น */
}
