/* =========================================================
   Mystical Pass — Sub Navigation Bar
   - อยู่ใต้ navbar หลักของ GNJOY
   - Theme: ดำ-น้ำเงิน + เส้นใต้ cyan (เข้ากับ theme หลัก)
   - Responsive: scroll แนวนอนได้บนมือถือ
   ========================================================= */

.subnav {
  position: fixed;
  top: 56px;             /* ใต้ navbar หลัก */
  left: 0;
  right: 0;
  width: 100%;
  z-index: 28;           /* น้อยกว่า navbar หลัก (z:30) */

  background:
    linear-gradient(180deg, rgba(2, 12, 28, 0.95) 0%, rgba(1, 8, 20, 0.92) 100%);
  border-bottom: 1px solid rgba(0, 220, 255, 0.22);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.subnav-inner {
  max-width: 1280px;
  margin: 0 auto;
  height: 42px;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 2.2vw, 36px);

  padding: 0 16px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* IE/Edge */
}
.subnav-inner::-webkit-scrollbar { display: none; }

.subnav-link {
  position: relative;
  flex-shrink: 0;
  padding: 8px 6px;

  color: #cfeeff;
  font-family: "Google Sans", "Kanit", sans-serif;
  font-size: clamp(12.5px, 0.95vw, 14px);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;

  transition: color 0.18s ease;
}

.subnav-link::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 4px;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, #00e5ff 50%, transparent 100%);
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.65);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.25s ease;
}

.subnav-link:hover {
  color: #00f4ff;
}
.subnav-link:hover::after {
  transform: scaleX(1);
}

.subnav-link.active {
  color: #00f4ff;
  text-shadow: 0 0 8px rgba(0, 230, 255, 0.55);
}
.subnav-link.active::after {
  transform: scaleX(1);
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.4) 0%, #00e5ff 50%, rgba(0, 229, 255, 0.4) 100%);
}

/* ทำให้ content หลักไม่โดน subnav บัง */
body.has-subnav .mainLayout,
body.has-subnav .landing {
  padding-top: clamp(108px, 12vh, 130px) !important;
}
body.has-subnav .btn_backLayout {
  top: 102px !important;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

/* ───── ≤992px: ลดความสูงและ gap ───── */
@media (max-width: 992px) {
  .subnav { top: 56px; }
  .subnav-inner { height: 40px; gap: clamp(12px, 2vw, 24px); padding: 0 14px; }
  body.has-subnav .mainLayout,
  body.has-subnav .landing { padding-top: 110px !important; }
  body.has-subnav .btn_backLayout { top: 102px !important; }
}

/* ───── ≤768px: scroll แนวนอนได้, จัดชิดซ้าย ───── */
@media (max-width: 768px) {
  .subnav-inner {
    height: 38px;
    justify-content: flex-start;
    gap: 18px;
    padding: 0 14px;
  }
  .subnav-link { font-size: 12.5px; padding: 7px 4px; }
  body.has-subnav .mainLayout,
  body.has-subnav .landing { padding-top: 108px !important; }
  body.has-subnav .btn_backLayout { top: 100px !important; }
}

/* ───── ≤576px: nav รองชิดซ้าย, ขนาดเล็กลง ───── */
@media (max-width: 576px) {
  .subnav-inner { height: 36px; gap: 14px; padding: 0 12px; }
  .subnav-link { font-size: 12px; padding: 6px 3px; }
  .subnav-link::after { bottom: 3px; left: 3px; right: 3px; }
  body.has-subnav .mainLayout,
  body.has-subnav .landing { padding-top: 100px !important; }
  body.has-subnav .btn_backLayout { top: 96px !important; }
}

/* ───── ≤380px: minimal ───── */
@media (max-width: 380px) {
  .subnav-inner { gap: 12px; padding: 0 10px; }
  .subnav-link { font-size: 11.5px; }
}

/* ───── Hover เฉพาะ device ที่ใช้เมาส์ ───── */
@media (hover: none) {
  .subnav-link:hover { color: #cfeeff; }
  .subnav-link:hover::after { transform: scaleX(0); }
  .subnav-link.active { color: #00f4ff; }
  .subnav-link.active::after { transform: scaleX(1); }
}

/* ───── Reduced motion ───── */
@media (prefers-reduced-motion: reduce) {
  .subnav-link,
  .subnav-link::after { transition: none; }
}
