/* =========================================================
   Header / Menu (clean version, based on provided HTML)
   ========================================================= */

/* 外層固定 */
.bg_headmenu {
  width: 100%;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 999;
}

/* header 容器 */
.headmenu {
  width: 100%;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 999;
  display: flex;
  background: transparent;
}

/* =========================================================
   Logo + Toggle area (menu_flex01)
   ========================================================= */
.menu_flex01 {
  position: relative;
  z-index: 999;
}
@media (min-width:1290px){
  .menu_flex01 {
    position: absolute;
    top:0;
  }

  .menu_flex02 {
    margin-top: 3rem;
  }
}

/* logo */
.btn_logo {
  width: 100%;
  max-width: 250px;
  height: auto;
  padding: 5%;
  background-repeat: no-repeat;
  background-position: center top;
  background-size: 100% auto;
  image-rendering: -webkit-optimize-contrast;
  /* position: absolute; */
  left: 0;
  top: 0.4rem;
}

.btn_logo a {
  width: 100%;
  aspect-ratio: 640 / 370;
  height: auto;
  display: block;
  transition: all 0.3s;
}

.btn_logo a:hover {
  cursor: default;
}

.btn_logo a img{
  background-position: left top;
  background-size: 100% auto;
}

.cn .btn_logo a img{
  background-image: url(../images/logo_szm_cn.png);
}

.en .btn_logo a img{
  background-image: url(../images/logo_szm_en.png);
}

.th .btn_logo a img{
  background-image: url(../images/logo_szm_th.png);
}

.vi .btn_logo a img{
  background-image: url(../images/logo_szm_vi.png);
}


/* 立即預約（手機才顯示） */
.btn_toggle_sure {
  position: relative;
  max-width: 12rem;
  margin: 0.6rem 0.8rem 0.6rem 0;
  display: none;
  /* default: PC 隱藏 */
  animation: btntogglesure 1s infinite alternate;
}

@keyframes btntogglesure {
  from {
    filter: brightness(100%);
    transform: scale(1);
  }

  to {
    filter: brightness(130%);
    transform: scale(1.03);
  }
}

/* 漢堡按鈕（手機才顯示） */
.btn_toggle {
  margin: 0;
  position: relative;
  display: none;
  /* default: PC 隱藏 */
  z-index: 100;
}

.btn_toggle a {
  background-repeat: no-repeat;
  background-image: url(../images/btn_toggle.webp);
  background-size: 100% auto;
  background-position: right center;
  white-space: nowrap;
  overflow: hidden;
  display: block;
  transition: all 0.2s;
}

.btn_toggle a:hover {
  filter: brightness(120%);
}

/* 漢堡「關閉」狀態（通常 JS 會把 .btn_toggle 換成 .close） */
.close a {
  white-space: nowrap;
  overflow: hidden;
  display: block;
  float: right;
  /* margin: 0.6rem 0.8rem 0.6rem 0; */
  background-repeat: no-repeat;
  background-image: url(../images/btn_toggle_ov.webp);
  background-size: 100% auto;
  background-position: right center;
}

.close a:hover {
  filter: brightness(120%);
}

/* =========================================================
   Top menu wrapper (menu_flex02)
   ========================================================= */
.menu_flex02 {
  width: 100%;
  height: fit-content;
  /* margin-top: 2%; */
  display: flex;
  justify-content: flex-end;
  position: relative;
  z-index: 1;
}

/* =========================================================
   New Capsule Menu (ul.menu)
   ========================================================= */
:root {
  --menu-bg: rgba(70, 45, 28, 0.78);
  --menu-border: rgba(212, 170, 90, 0.35);

  --menu-text: rgba(243, 226, 179, 0.78);
  --menu-text-strong: #f3e2b3;

  --menu-hover-bg: rgba(68, 54, 29, 0.5);
  --menu-hover-border: rgba(255, 220, 140, 0.0);

  --menu-active-bg: linear-gradient(to bottom, rgba(255, 226, 160, 0.95) 0%, rgba(212, 170, 90, 0.92) 50%, rgba(170, 118, 44, 0.95) 100%);
  --menu-active-border: rgba(255, 232, 170, 0.7);
  --menu-active-text: #4a2d10;

  --menu-glow: rgba(255, 170, 80, 0.18);
  --menu-active-glow: rgba(255, 200, 90, 0.45);
}

.menu {
  position: relative;
  width: fit-content;
  margin: 0 auto;
  padding: 8px 10px;
  background: var(--menu-bg);
  border-radius: 999px;
  border: 1px solid var(--menu-border);
  box-shadow:
    0 0 26px var(--menu-glow),
    inset 0 0 10px rgba(255, 210, 130, 0.08);
  display: flex;
  align-items: center;
  gap: clamp(2px, 3vw, 10px);
}



@supports not ((backdrop-filter: blur(8px)) or (-webkit-backdrop-filter: blur(8px))) {
  .menu {
    background: rgba(55, 36, 22, 0.9);
  }
}

/* 金色流光邊 */
.menu::before {
  content: '';
  padding: 1px;
  background: linear-gradient(120deg, rgba(255, 230, 170, 0.55), rgba(255, 210, 130, 0.12), rgba(255, 230, 170, 0.45));
  border-radius: 999px;
  pointer-events: none;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.85;
  position: absolute;
  inset: 0;
}

/* li / a */
.menu li {
  margin: 0;
  max-width: none;
  list-style: none;
}

.menu li a {
  padding: 0 clamp(1px, 1vw, 10px);
  text-decoration: none;
  text-align: center;
  border: 1px solid transparent;
  border-radius: 999px;
  transition:
    background-color .2s,
    border-color .2s,
    box-shadow .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* 文字 */
.menu_txt {
  color: var(--menu-text);
  font-size: clamp(17px, 5vw, 20px);
  font-weight: 500;
  font-family: 'Noto Serif', serif;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  transition: all 0.2s;
}

.cn .menu_txt {
  font-family: 'Noto Serif SC', serif;
  font-weight: 700;
  letter-spacing: 0.5px;
}

@media (min-width:768px){
  .menu li a {
    padding: 0 clamp(5px, 1vw, 22px);
  }

  .menu_txt {
    white-space: nowrap;
  }

  .vi .menu{
    gap: 0px;
  }
  .en .menu_txt {
    font-size: clamp(10px, 2.5vw, 20px);
  }

  .vi .menu_txt {
    font-size: clamp(10px, 1.8vw, 20px);
  }
}

/* hover */
.menu>li>a:hover {
  background-color: var(--menu-hover-bg);
  border-color: var(--menu-hover-border);
  box-shadow: 0 0 14px rgba(255, 190, 90, 0.18);
}

.menu li a:hover .menu_txt {
  color: var(--menu-text-strong);
}

/* active */
.menu li a.active {
  background: var(--menu-active-bg);
  border-color: var(--menu-active-border);
  box-shadow:
    0 0 18px var(--menu-active-glow),
    inset 0 0 10px rgba(255, 255, 255, 0.28);
}

.menu li a.active .menu_txt {
  color: var(--menu-active-text);
  text-shadow: none;
}

/* focus */
.menu li a:focus-visible {
  outline: none;
  border-color: rgba(255, 235, 180, 0.9);
  box-shadow:
    0 0 0 3px rgba(255, 200, 110, 0.25),
    0 0 18px rgba(255, 200, 90, 0.35);
}

/* =========================================================
   Language Dropdown (li.menu_lang)
   ========================================================= */
.menu_lang {
  position: relative;
}

.menu_lang .lang_toggle {
  gap: 10px;
}

/* 小箭頭 */
.lang_arrow {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-right: 2px solid rgba(243, 226, 179, 0.9);
  border-bottom: 2px solid rgba(243, 226, 179, 0.9);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  margin-left: 2px;
  margin-top: -3px;
}

/* 展開時箭頭翻轉（JS 需加上 .is-open） */
.menu_lang.is-open .lang_arrow {
  margin-top: 4px;
  transform: rotate(-135deg);
}

/* 下拉面板 */
.lang_list {
  min-width: 180px;
  margin: .25rem 0 0 0;
  padding: 8px;
  background: rgba(55, 36, 22, 0.88);
  border-radius: 16px;
  border: 1px solid rgba(212, 170, 90, 0.35);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.35),
    0 0 26px rgba(255, 170, 80, 0.1);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 2000;
}

.menu_lang.is-open .lang_list {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.lang_list li {
  margin: .3rem 0 !important;
}

.lang_list a {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
  color: rgba(243, 226, 179, 0.85);
  font-family: 'Noto Sans', serif;
  font-size: clamp(14px, 3vw, 18px);
  font-weight: 600;
  letter-spacing: 0.3px;
  border: 1px solid transparent;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}


.lang_list a:hover {
  background-color: rgba(212, 170, 90, 0.25);
  border-color: rgba(255, 220, 140, 0.35);
  color: #f3e2b3;
}

.lang_list a.is-active {
  background: var(--menu-active-bg);
  border-color: var(--menu-active-border);
  color: var(--menu-active-text);
  text-shadow: none;
}

/* 點擊遮罩（你目前有放在 a 裡面，但又不想吃點擊） */
.btn_click {
  pointer-events: none !important;
}

.menu_lang .btn_click {
  pointer-events: none !important;
}

/* =========================================================
   Social (PC: menu_flex04 / MB: social_mb)
   ========================================================= */
.menu_flex04 {
  width: 22%;
  height: fit-content;
  display: flex;
  justify-content: flex-end;
  position: relative;
  z-index: 1;
  margin-top: 18px;
  margin-right: 2%;
}

/* =========================================================
   Mobile menu show/hide (body class controlled by jQuery/JS)
   ========================================================= */
.menu_show .menu_flex02 {
  display: block;
  /* animation: .5s fat; */
  transition: all .5s;
  transform: translateX(0%);
  opacity: 1;
  pointer-events: auto;
}

.menu_close .menu_flex02 {
  display: block;
  animation: .5s close;
}

@keyframes fat {
  0% {
    opacity: 0;
    transform: translateX(20%);
  }

  100% {
    opacity: 1;
    transform: translateX(0%);
  }
}

@keyframes close {
  0% {
    opacity: 1;
    transform: translateX(0%);
  }

  100% {
    opacity: 0;
    transform: translateX(-50%);
  }
}

/* =========================================================
   RWD
   ========================================================= */
@media screen and (min-width: 768px) {
  .menu_flex02 {
    padding-right: 1%;
  }
}

@media screen and (max-width: 1920px) {
  .headmenu {
    justify-content: space-between;
    align-items: center;
  }

  /* .menu_flex02 {
    margin-top: 0;
  } */
}

@media screen and (max-width: 767px) {

  .btn_toggle_sure,
  .btn_toggle {
    display: block;
  }

  .headmenu {
    width: 100%;
    display: block;
    height: 60px;
    background: rgba(114, 53, 27, 0.89);
    /* background-color: #000000c9; */
    background-color: transparent;
    align-items: center;
  }

  /* PC 社群隱藏（你 HTML 上本身就 d-none，這裡保險） */
  .menu_flex04 .social {
    display: none;
  }

  /* logo 區 */
  .menu_flex01 {
    width: 100%;
    padding-right: clamp(.5rem, 5vw, 2rem);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
  }

  .btn_logo {
    max-width: 10rem;
    padding: 5px;
  }

  /* menu panel */
  .menu_flex02 {
    width: fit-content;
    height: auto;
    position: absolute;
    right: 5%;
    top: 0;
    padding-top: 3.5rem;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    opacity: 0;
    margin-top: 5%;
    transform: translateX(20%);
    pointer-events: none;
  }

  .menu_flex02.trans {
    transition: all 0.5s ease;
  }

  .headmenu::after {
    content: '';
    width: 100vw;
    height: 100vh;
    mask-image: linear-gradient(to bottom, rgb(0, 0, 0, 1) 60%, rgba(0, 0, 0, 0) 100%);
    background: linear-gradient(to bottom, rgb(0, 0, 0, .5) 60%, rgba(0, 0, 0, 0) 100%);
    position: fixed;
    left: 0;
    top: 0;
    display: block;
    z-index: -1;
    backdrop-filter: blur(3px);
    transition: blur .3s, opacity .3s;
    opacity: 0;
    pointer-events: none;
  }

  .menu_show .headmenu::after {
    opacity: 1;
  }



  /* MB 社群顯示 */
  .social_mb {
    padding: 0 1rem !important;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-around;
  }

  .social_mb li {
    margin: 10px 0;
    width: 40%;
  }

  /* 漢堡尺寸 */
  .btn_toggle {
    width: 45px;
  }

  :root {
    --menu-hover-bg: rgba(212, 170, 90, 0.25);
    --menu-hover-border: rgba(255, 220, 140, 0.15);
  }

  .menu>li {
    width: 100%;
    padding: 0 clamp(5px, 3vw, 12px);
    margin: 0.35rem;
  }
}



@media screen and (max-width: 400px) {
  .btn_logo {
    top: 0.3rem;
  }

  .btn_toggle_sure {
    max-width: 10.5rem;
  }
}

@media screen and (max-width: 370px) {

  .btn_toggle_sure {
    max-width: 9.5rem;
  }
}

/* =========================================================
   🔥 Mobile Capsule Panel Enhancement
   只強化手機版 (<=767px)
   ========================================================= */
/* ✅ Mobile: 語系下拉（只留這套，不要重複寫） */
@media screen and (max-width: 767px) {
  .menu {
    width: 100%;
    /* min-width: 190px; */
    margin: auto;
    border-radius: clamp(5px, 3vw, 12px);
    border: none;
    background: rgb(50 31 17 / 91%);
    padding: clamp(5px, 3vw, 12px) 0;
    padding-left: 0 !important;
    flex-direction: column;
    backdrop-filter: none !important;
  }

  .menu::before {
    border-radius: clamp(5px, 3vw, 12px);
  }


  /* 預設收起 */
  #menuLang #langList {
    position: static !important;
    width: 100% !important;
    min-width: 0 !important;
    margin-top: 10px !important;

    /* 關鍵：覆寫桌機的隱藏方式 */
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;

    display: none !important;

    background: rgba(45, 28, 15, 0.95) !important;
    border: 1px solid rgba(212, 170, 90, 0.28) !important;
    border-radius: 16px;
    box-shadow: inset 0 0 10px rgba(255, 210, 130, 0.06) !important;

    z-index: 3000 !important;
  }

  /* 展開 */
  #menuLang.is-open #langList {
    display: block !important;
  }

  #menuLang #langList a {
    display: block;
    text-align: center !important;
    padding: clamp(2px, 2vw, 5px) clamp(5px, 3vw, 10px);
  }

}


@media screen and (max-width: 320px) {
  .menu_flex02 {
    margin-top: 2.5rem;
  }
}

@media screen and (max-width: 200px) {
  .menu_flex02 {
    width: 96%;
    right: 2%;
  }
}