/* ===== The 3D Switch — TH / EN Toggle ===== */
.switch {
  font-size: 13.5px;
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 4.8em;
  height: 2.2em;
  user-select: none;
  vertical-align: middle;
}

/* Hide default HTML checkbox */
.switch .cb {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

/* The slider */
.toggle {
  position: absolute;
  cursor: pointer;
  inset: 0;
  width: 100%;
  height: 100%;
  background-color: #1E293B;
  border-radius: 0.25em;
  transition: 0.4s;
  text-transform: uppercase;
  font-weight: 700;
  overflow: hidden;
  box-shadow: -0.2em 0 0 0 #0F172A, -0.2em 0.2em 0 0 #0F172A,
    0.2em 0 0 0 #0F172A, 0.2em 0.2em 0 0 #0F172A, 0 0.2em 0 0 #0F172A;
}

.toggle > .left {
  position: absolute;
  display: flex;
  width: 50%;
  height: 88%;
  background-color: #f3f3f3;
  color: #1E3A8A;
  left: 0;
  bottom: 0;
  align-items: center;
  justify-content: center;
  transform-origin: right;
  transform: rotateX(10deg);
  transform-style: preserve-3d;
  transition: all 150ms;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.left::before {
  position: absolute;
  content: "";
  width: 100%;
  height: 100%;
  background-color: rgb(206, 206, 206);
  transform-origin: center left;
  transform: rotateY(90deg);
}

.left::after {
  position: absolute;
  content: "";
  width: 100%;
  height: 100%;
  background-color: rgb(112, 112, 112);
  transform-origin: center bottom;
  transform: rotateX(90deg);
}

.toggle > .right {
  position: absolute;
  display: flex;
  width: 50%;
  height: 88%;
  background-color: #f3f3f3;
  color: rgb(160, 160, 160);
  right: 1px;
  bottom: 0;
  align-items: center;
  justify-content: center;
  transform-origin: left;
  transform: rotateX(10deg) rotateY(-45deg);
  transform-style: preserve-3d;
  transition: all 150ms;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.right::before {
  position: absolute;
  content: "";
  width: 100%;
  height: 100%;
  background-color: rgb(206, 206, 206);
  transform-origin: center right;
  transform: rotateY(-90deg);
}

.right::after {
  position: absolute;
  content: "";
  width: 100%;
  height: 100%;
  background-color: rgb(112, 112, 112);
  transform-origin: center bottom;
  transform: rotateX(90deg);
}

.switch input:checked + .toggle > .left {
  transform: rotateX(10deg) rotateY(45deg);
  color: rgb(160, 160, 160);
}

.switch input:checked + .toggle > .right {
  transform: rotateX(10deg) rotateY(0deg);
  color: #2563eb;
}

/* ปุ่มสลับภาษาสำหรับแผงแอดมินหรือพื้นหลังสีขาว (Light Background) */
.panel-lang-switch .lang-switch {
  background: #F1F5F9;
  border: 1.5px solid #CBD5E1;
}

.panel-lang-switch .lang-switch:hover {
  background: #E2E8F0;
  border-color: #94A3B8;
}

.panel-lang-switch .lang-btn {
  color: #475569;
}

.panel-lang-switch .lang-btn:hover {
  background: #E2E8F0;
  color: #0F172A;
}

.panel-lang-switch .lang-btn.active {
  background: #1E3A8A !important;
  color: #FFFFFF !important;
  box-shadow: 0 2px 6px rgba(30, 58, 138, 0.25);
}

.panel-lang-switch .lang-divider {
  color: #CBD5E1;
}

/* มือถือ: สวิตช์ภาษาแบบย่อ (TH | EN ไม่มีธง) เพื่อให้ navbar ไม่ล้นจอ */
@media (max-width: 480px) {
  .lang-switch-wrap { margin: 0; }
  .lang-switch { padding: 1px 2px; gap: 0; }
  .lang-btn span { display: none; }
  .lang-btn { padding: 3px 5px; font-size: 11px; gap: 0; }
  .lang-divider { padding: 0; }
}
