/* NAVBAR */
 .site-header{
  position:fixed;
  top:0;
  left:0;
  width:100%;
  z-index:9999;

  background: rgba(5,10,15,.78);
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}

.nav {
  height: 60px;
  display: grid;
  grid-template-columns: minmax(230px, 1fr) auto minmax(260px, 1fr);
  align-items: center;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 600;
  letter-spacing: .13em;
  justify-self: start;
}

.brand-word {
  font-size: 14px;
  line-height: 1.25
}

.brand-word .highlight {
  color: var(--primary)
}

.brand-logo-mini{
  width:42px;
  height:42px;

  display:flex;
  align-items:center;
  justify-content:center;

  border:none;
  background:transparent;
  box-shadow:none;
  border-radius:0;
}

.brand-logo-mini img{
  width:100%;
  height:100%;
  object-fit:contain;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px
}

.nav-lang{
  height:35px;
  min-width:76px;
  margin-top:0;
  padding:0 9px;

  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:2px;

  border-radius:999px;
  border:1px solid rgba(255,176,0,.24);
  background:rgba(255,255,255,.025);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.035),
    0 8px 20px rgba(0,0,0,.16);
}

.nav-lang .lang-link{
  padding:0 4px;
  font-size:11px;
  letter-spacing:.08em;
}

.nav-lang .lang-link.active{
  padding:3px 7px;
}

.nav-lang span{
  color:rgba(255,176,0,.38);
  font-size:11px;
}

/* NAVBAR ICON / ACTION BUTTONS */
.icon-btn,
.home-btn,
.menu-btn{
  height:44px;
  min-width:44px;

  display:inline-flex;
  align-items:center;
  justify-content:center;

  border-radius:999px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.04);

  color:var(--text);
  
  transition:
    transform .45s cubic-bezier(.22,1,.36,1),
    background .45s cubic-bezier(.22,1,.36,1),
    border-color .45s cubic-bezier(.22,1,.36,1),
    color .45s cubic-bezier(.22,1,.36,1),
    box-shadow .45s cubic-bezier(.22,1,.36,1);

  cursor:pointer;
}

/* ปุ่มหน้าแรก สีเหลือง */
.home-btn{
  width:auto;
  min-width:92px;
  padding:0 20px;
  height:35px;

  background-color:#f59e0b;
  

  border:1px solid rgba(255,176,0,.30);
  color:#111820;

  font-size:12px;
  font-weight:600;
  letter-spacing:.02em;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.35),
    0 8px 18px rgba(255,176,0,.22);
}

/* ปุ่มค้นหา */
.icon-btn{
  width: 44px;;
  min-width:60px;
  height:35px;

  background:rgba(255,255,255,.035);
  color:var(--text);
  font-size: 30px;

  border:1px solid rgba(255,255,255,.18);

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04);
}

/* ปุ่มเมนู */
.menu-btn{
  width:44px;
  min-width:60px;
  height:35px;

  background:rgba(255,255,255,.035);
  color:var(--text);
  font-size: 20px;

  border:1px solid rgba(255,255,255,.18);

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04);
}

/* Hover */
.home-btn:hover{
  transform:translateY(-2px);

  background-color:rgba(255,176,0,.08);
  background-image:linear-gradient(180deg, rgba(255,176,0,.10), rgba(255,176,0,.04));

  border-color:rgba(255,176,0,.85);
  color:var(--primary);

  box-shadow:
    0 0 0 2px rgba(255,176,0,.10),
    0 12px 28px rgba(255,176,0,.12);
}

.icon-btn:hover,
.menu-btn:hover{
  transform:translateY(-2px);

  /* เหลืองโปร่ง */
  background:rgba(255,176,0,.06);

  /* ขอบเหลือง */
  border-color:rgba(255,176,0,.70);

  /* ตัวหนังสือ/ไอคอน */
  color:var(--primary);

  box-shadow:
    0 0 0 2px rgba(255,176,0,.08),
    0 10px 24px rgba(255,176,0,.10);
}

.search-pop{
  position:absolute;
  top:68px;
  right:calc(
    (100vw - min(
      var(--container),
      calc(100vw - (var(--page-padding) * 2))
    )) / 2
  );
  width:min(420px, calc(100vw - (var(--page-padding) * 2)));
  display:none;
  opacity:0;
  transform:translateY(-8px);

  transition:
    transform .4s cubic-bezier(.22,1,.36,1),
    opacity .4s cubic-bezier(.22,1,.36,1);
}

.search-pop.open{
   display:block;
   opacity:1;
   transform:translateY(0);
}

.search-pop input{
  width:100%;
  height:40px;
  padding:0 70px 0 28px;
  border-radius:999px;
  border:1px solid rgba(255,176,0,.10);
  background:
    linear-gradient(
      180deg,
      rgba(18,24,30,.96),
      rgba(8,11,16,.96)
    );
  backdrop-filter:blur(20px);
  color:var(--text);
  font-size:17px;
  font-weight:600;
  outline:none;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.12),
    0 12px 35px rgba(0,0,0,.40);
  transition:
    all .45s cubic-bezier(.22,1,.36,1);
}

.search-pop input:focus{
  border-color:rgba(255,176,0,.55);
  background:
    linear-gradient(
      180deg,
      rgba(20,26,32,.96),
      rgba(10,14,20,.96)
    );
  box-shadow:
    0 0 0 4px rgba(255,176,0,.05),
    0 14px 38px rgba(255,176,0,.08);
}

.search-pop input::placeholder{
   color:rgba(255,255,255,.45);
}

.search-results {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  max-height: 320px;
  overflow: auto
}

.search-results a {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 9px;
  border-radius: 12px;
  background: #111820;
}

.search-results img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 10px;
  background: #222
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .50);
  z-index: 10000;
  display: none
}

.drawer-backdrop.open {
  display: block
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: max-content;
  min-width: min(280px, calc(100vw - 28px));
  max-width: calc(100vw - 28px);
  background: linear-gradient(180deg, #121820, #070b0f);
  border-left: 1px solid var(--glass);
  box-shadow: var(--shadow);
  z-index: 10001;
  transform: translateX(105%);
  transition: .25s ease;
  padding: 22px;
  overflow-y:auto;
  overscroll-behavior:contain;
}

.drawer::-webkit-scrollbar{
  width:6px;
}

.drawer::-webkit-scrollbar-thumb{
  background:rgba(255,176,0,.35);
  border-radius:999px;
}

.drawer::-webkit-scrollbar-track{
  background:rgba(255,255,255,.04);
}

.drawer.open {
  transform: translateX(0)
}

.drawer-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:18px;
}

.drawer-close{
  width:42px;
  height:42px;

  display:flex;
  align-items:center;
  justify-content:center;

  border-radius:999px;

  background:rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.14);

  color:#fff;
  font-size:26px;
  font-weight:300;

  cursor:pointer;

  transition:.35s;
}

.drawer-close:hover{
  transform:rotate(90deg);

  background:rgba(255,176,0,.08);

  border-color:rgba(255,176,0,.7);

  color:var(--primary);
}

.drawer-nav {
  display: grid;
  gap: 10px
}

.drawer-nav a,
.drawer-toggle {
  padding: 12px 15px;
  border: 1px solid var(--glass);
  border-radius: 14px;
  background: linear-gradient(180deg, #20242a, #151a1f);
  color: var(--text);
}

.drawer-toggle {
  width: 100%;
  text-align: left;
  cursor: pointer
}

.drawer-nav a,
.drawer-toggle{
  transition:
    transform .35s ease,
    background .35s ease,
    border-color .35s ease,
    color .35s ease,
    box-shadow .35s ease;
}

.drawer-nav a:hover,
.drawer-toggle:hover{

  transform:translateX(6px);

  background:rgba(255,176,0,.06);

  border-color:rgba(255,176,0,.45);

  color:var(--primary);

  box-shadow:
    0 0 18px rgba(255,176,0,.08);
}

.sub-menu {
  display: none;
  padding-left: 12px;
  gap: 8px;
  margin: 8px 0 0;
}

.sub-menu.open {
  display: grid;
}

/* เพิ่มต่อจากตรงนี้ */

.sub-menu a{
  min-height:32px;
  padding:8px 16px;
  border-radius:10px;
  font-size:14px;
  font-weight:600;
  background:rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.08);
  color:var(--muted);
  transition:.35s;
}

.sub-menu a:hover{
  transform:translateX(6px);
  background:rgba(255,176,0,.05);
  border-color:rgba(255,176,0,.30);
  color:var(--primary);
}

.lang-inline{
  margin-top:0px;
  padding-top:0;
  text-align:center;
  color:rgba(255,255,255,.30);
}

.lang-link{
  background:none;
  border:none;
  padding:0 6px;
  font-size:13px;
  font-weight:700;
  color:rgba(255,255,255,.55);
  transition:.35s;
  cursor:pointer;
}

.lang-link:hover{
  color:var(--text);
}

.lang-link.active{

  color:var(--primary);

  background:
    radial-gradient(
      circle,
      rgba(255,255,255,.08) 0%,
      rgba(255,255,255,.03) 45%,
      transparent 75%
    );

  border-radius:999px;

  text-shadow:
    0 0 10px rgba(255,176,0,.28),
    0 0 18px rgba(255,176,0,.14);

  box-shadow:
    0 0 18px rgba(255,255,255,.05);

  padding:4px 10px;
}



.sub-menu a {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  line-height: 1.25;
}

.sub-en {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}

.sub-th {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}



  .nav {
    display: flex;
    justify-content: space-between;
  }

@media (max-width: 520px){
  .nav-actions{
    gap:6px;
  }

  .nav-lang{
    min-width:62px;
    padding:0 6px;
  }

  .nav-lang .lang-link{
    padding:0 3px;
    font-size:10px;
  }

  .nav-lang .lang-link.active{
    padding:3px 6px;
  }
}

/* Phone devices and the explicit phone preview only; keep desktop/tablet layout. */
  html.phone-layout .site-header .nav {
    position: relative;
    display: grid;
    grid-template-columns: 70px 44px minmax(52px, 1fr) 44px 70px;
    width: min(var(--container), calc(100% - 20px));
    height: 68px;
    gap: 5px;
  }

  html.phone-layout .site-header .brand {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    grid-column: auto;
    grid-row: auto;
    justify-self: center;
    flex: 0 0 auto;
    gap: 0;
    min-width: 0;
  }

  html.phone-layout .site-header .brand-word {
    display: none;
  }

  html.phone-layout .site-header .brand-logo-mini {
    width: 52px;
    height: 56px;
  }

  html.phone-layout .site-header .nav-actions {
    display: contents;
  }

  html.phone-layout .site-header .nav-actions .home-btn {
    grid-column: 4;
    grid-row: 1;
    justify-self: end;
    display: inline-flex;
    width: 44px;
    min-width: 44px;
    height: 36px;
    padding: 0 6px;
    border-radius: 12px;
    font-size: 10px;
    letter-spacing: 0;
  }

  html.phone-layout .site-header .nav-actions .nav-lang {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    display: inline-flex;
    width: 70px;
    min-width: 70px;
    height: 36px;
    padding: 0 4px;
    gap: 1px;
    border-radius: 12px;
  }

  html.phone-layout .site-header .nav-lang .lang-link {
    padding: 5px 3px;
    font-size: 11px;
    letter-spacing: 0;
  }

  html.phone-layout .site-header .nav-lang .lang-link.active {
    padding: 5px 3px;
  }

  html.phone-layout .site-header .nav-actions .icon-btn,
  html.phone-layout .site-header .nav-actions .menu-btn {
    width: 44px;
    height: 36px;
    min-width: 44px;
    padding: 0;
    border-radius: 12px;
  }

  html.phone-layout .site-header .nav-actions .icon-btn {
    grid-column: 2;
    grid-row: 1;
    flex: 0 0 44px;
    max-width: 44px;
    font-size: 28px;
    background: rgba(255, 255, 255, .09);
    border-color: rgba(255, 176, 0, .35);
  }

  html.phone-layout .site-header .nav-actions .menu-btn {
    grid-column: 5;
    grid-row: 1;
    width: 70px;
    min-width: 70px;
    font-size: 22px;
  }

/* Expand phone tap areas vertically while preserving the visible button sizes. */
html.phone-layout .site-header .home-btn,
html.phone-layout .site-header .icon-btn,
html.phone-layout .site-header .menu-btn,
html.phone-layout .site-header .nav-lang .lang-link {
  position: relative;
}

html.phone-layout .site-header .home-btn::after,
html.phone-layout .site-header .icon-btn::after,
html.phone-layout .site-header .menu-btn::after,
html.phone-layout .site-header .nav-lang .lang-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 44px;
  transform: translateY(-50%);
}

