/* ==========================================================================
   MISTER FAST — Standard Enterprise Header Stylesheet V1.0
   Brand: Deep Royal Blue (#003DA5), Active Yellow (#FFCC00), Red Badges (#DC2626)
   Matches official reference image 100%. Accessible, high performance, responsive.
   ========================================================================== */

:root {
  --mf-hdr-bg: #003DA5;
  --mf-hdr-bg-hover: rgba(255, 255, 255, 0.12);
  --mf-hdr-active-bg: #FFCC00;
  --mf-hdr-active-text: #0B192C;
  --mf-hdr-badge-bg: #DC2626;
  --mf-hdr-border: rgba(255, 255, 255, 0.18);
  --mf-hdr-height: 68px;
}

/* ── 1. Main Header Container ─────────────────────────────────────────── */
.mf-std-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: var(--mf-hdr-bg);
  background: linear-gradient(180deg, #0045B5 0%, #003594 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 20px rgba(0, 20, 60, 0.25);
  z-index: 9999;
  font-family: 'Prompt', 'Noto Sans Thai', system-ui, -apple-system, sans-serif;
  box-sizing: border-box;
}

.mf-std-header-container {
  width: 100%;
  max-width: 1560px;
  min-height: var(--mf-hdr-height);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-sizing: border-box;
}

/* ── 2. Brand Logo (Left) ─────────────────────────────────────────────── */
.mf-std-brand-col {
  flex-shrink: 0;
}

.mf-std-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #FFFFFF;
  transition: opacity 0.2s ease;
}

.mf-std-brand-link:hover {
  opacity: 0.92;
}

.mf-std-brand-symbol {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  flex-shrink: 0;
}

.mf-std-brand-symbol img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: block;
  object-fit: contain;
}

.mf-std-brand-text {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #FFFFFF;
  white-space: nowrap;
}

.mf-std-brand-text b {
  font-weight: 900;
  color: #FFFFFF;
}

/* ── 3. Desktop Navigation (Center) ───────────────────────────────────── */
.mf-std-nav {
  display: flex;
  align-items: center;
  flex: 1;
  justify-content: center;
  min-width: 0;
}

.mf-std-nav-list {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: nowrap;
}

.mf-std-nav-li {
  position: relative;
  flex-shrink: 0;
}

.mf-std-nav-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  color: #FFFFFF;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.18s ease;
  cursor: pointer;
  border: none;
  background: transparent;
  font-family: inherit;
}

.mf-std-nav-item:hover {
  background: var(--mf-hdr-bg-hover);
  color: #FFFFFF;
}

/* Active State (Pill Yellow) */
.mf-std-nav-item.is-active {
  background: var(--mf-hdr-active-bg);
  color: var(--mf-hdr-active-text) !important;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.mf-std-nav-item.is-active .mf-std-nav-label {
  color: var(--mf-hdr-active-text) !important;
}

/* Icon Box for Active State */
.mf-std-nav-icon-box {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mf-std-nav-icon-box img,
.mf-std-nav-icon-box svg {
  width: 16px;
  height: 16px;
  display: block;
}

/* Icon Circle for Normal State */
.mf-std-nav-icon-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.2px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.mf-std-nav-item:hover .mf-std-nav-icon-circle {
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.16);
}

.mf-std-nav-icon-circle img,
.mf-std-nav-icon-circle svg {
  width: 15px;
  height: 15px;
  display: block;
}

.mf-std-emoji {
  font-size: 14px;
  line-height: 1;
}

/* Red Pill Badge */
.mf-std-nav-badge {
  display: inline-block;
  background: var(--mf-hdr-badge-bg);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  line-height: 1.2;
  box-shadow: 0 1px 4px rgba(220, 38, 38, 0.4);
  letter-spacing: 0.02em;
}

/* ── 4. "เพิ่มเติม" (More Dropdown) ───────────────────────────────────── */
.mf-std-dropdown {
  position: relative;
}

.mf-std-dropdown-trigger {
  gap: 6px;
}

.mf-std-chevron {
  transition: transform 0.2s ease;
}

.mf-std-dropdown.is-open .mf-std-chevron {
  transform: rotate(180deg);
}

.mf-std-dropdown-panel {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  background: #002B7A;
  border: 1px solid var(--mf-hdr-border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 15, 45, 0.45);
  padding: 8px 0;
  z-index: 10001;
  animation: mfDropFade 0.2s ease;
}

.mf-std-dropdown.is-open .mf-std-dropdown-panel {
  display: block;
}

@keyframes mfDropFade {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mf-std-dropdown-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mf-std-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  color: #FFFFFF;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: background-color 0.15s ease;
}

.mf-std-dropdown-item:hover,
.mf-std-dropdown-item.is-active {
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
}

.mf-std-dropdown-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mf-std-dropdown-label {
  flex: 1;
}

/* ── 5. Right Actions (Search, Auth, Hamburger) ───────────────────────── */
.mf-std-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.mf-std-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--mf-hdr-border);
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mf-std-icon-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  transform: scale(1.04);
}

.mf-std-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.mf-std-btn-login {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--mf-hdr-border);
  color: #FFFFFF;
}

.mf-std-btn-login:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #FFFFFF;
  transform: translateY(-1px);
}

.mf-std-btn-register {
  background: #FFCC00;
  border: 1px solid #FFCC00;
  color: #0B192C;
  font-weight: 800;
  box-shadow: 0 2px 10px rgba(255, 204, 0, 0.35);
}

.mf-std-btn-register:hover {
  background: #FFD633;
  border-color: #FFD633;
  color: #0B192C;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(255, 204, 0, 0.45);
}

.mf-std-btn-user {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--mf-hdr-border);
  color: #FFFFFF;
  gap: 8px;
}

.mf-std-btn-user:hover {
  background: rgba(255, 255, 255, 0.22);
}

.mf-std-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #FFCC00;
  color: #0B192C;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hamburger Toggle Button */
.mf-std-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--mf-hdr-border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mf-std-hamburger:hover {
  background: rgba(255, 255, 255, 0.2);
}

.mf-std-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: #FFFFFF;
  border-radius: 2px;
  transition: all 0.25s ease;
}

/* ── 6. Mobile Side Drawer ────────────────────────────────────────────── */
.mf-std-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 15, 40, 0.65);
  backdrop-filter: blur(4px);
  z-index: 100000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mf-std-drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.mf-std-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  height: 100%;
  height: 100dvh;
  width: 330px;
  max-width: 88vw;
  background: #002B7A;
  color: #FFFFFF;
  z-index: 100001;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: -8px 0 32px rgba(0, 10, 35, 0.4);
  overflow: hidden;
  box-sizing: border-box;
}

.mf-std-drawer.is-open {
  transform: translateX(0);
}

.mf-std-drawer-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--mf-hdr-border);
}

.mf-std-drawer-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--mf-hdr-border);
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mf-std-drawer-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 20px 36px;
  padding-bottom: calc(36px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
}

.mf-std-drawer-auth {
  margin-bottom: 20px;
}

.mf-std-drawer-auth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mf-std-drawer-auth-grid .mf-std-btn {
  width: 100%;
}

.mf-std-drawer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mf-std-drawer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 8px;
  color: #FFFFFF;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  transition: background-color 0.15s ease;
}

.mf-std-drawer-item:hover,
.mf-std-drawer-item.is-active {
  background: rgba(255, 255, 255, 0.14);
}

.mf-std-drawer-item.is-active {
  border-left: 4px solid #FFCC00;
  background: rgba(255, 204, 0, 0.16);
}

.mf-std-drawer-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mf-std-drawer-label {
  flex: 1;
}

.mf-std-drawer-extra {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--mf-hdr-border);
}

.mf-std-drawer-driver-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 8px;
  background: linear-gradient(135deg, #FFCC00 0%, #FFA800 100%);
  color: #0B192C;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(255, 168, 0, 0.3);
}

.mf-std-drawer-contact {
  margin-top: 24px;
  padding: 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
}

.mf-std-drawer-contact p {
  margin: 0;
}

.mf-std-drawer-contact strong {
  color: #FFCC00;
}

/* ── 7. Quick Search Modal ────────────────────────────────────────────── */
.mf-std-search-modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 15, 40, 0.7);
  backdrop-filter: blur(5px);
  z-index: 100005;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 20px 20px;
}

.mf-std-search-modal.is-open {
  display: flex;
}

.mf-std-search-dialog {
  width: 100%;
  max-width: 600px;
  background: #002B7A;
  border: 1px solid var(--mf-hdr-border);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 10, 35, 0.5);
  overflow: hidden;
  animation: mfDropFade 0.25s ease;
}

.mf-std-search-box {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--mf-hdr-border);
  gap: 12px;
}

.mf-std-search-input-icon {
  font-size: 18px;
}

.mf-std-search-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #FFFFFF;
  font-size: 16px;
  font-family: inherit;
}

.mf-std-search-box input::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

.mf-std-search-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #FFFFFF;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mf-std-search-results {
  padding: 18px;
}

.mf-std-search-hint {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mf-std-search-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mf-std-search-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.mf-std-search-tag:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: #FFCC00;
  color: #FFCC00;
}

/* ── 8. Responsive Adaptations ────────────────────────────────────────── */
/* Tablet Large (1280px to 1440px) */
@media (max-width: 1400px) {
  .mf-std-nav-item {
    padding: 7px 9px;
    font-size: 13.5px;
    gap: 6px;
  }
}

/* Tablet Medium (1080px to 1279px): Collapse items 6 & 7 into More */
@media (max-width: 1200px) {
  .mf-std-nav-li-partner,
  .mf-std-nav-li-news {
    display: none;
  }
}

/* Mobile & Small Tablet (< 1024px) */
@media (max-width: 1023px) {
  .mf-std-nav {
    display: none;
  }
  .mf-std-btn-login,
  .mf-std-btn-register,
  .mf-std-btn-user {
    display: none;
  }
  .mf-std-hamburger {
    display: flex;
  }
}

@media (max-width: 480px) {
  .mf-std-header-container {
    padding: 0 14px;
  }
  .mf-std-brand-text {
    font-size: 18px;
  }
  .mf-std-brand-symbol {
    width: 36px;
    height: 36px;
  }
  .mf-std-brand-symbol img {
    width: 36px;
    height: 36px;
  }
  .mf-std-drawer {
    width: 300px;
    max-width: 88vw;
  }
  .mf-std-drawer-auth-grid .mf-std-btn {
    padding: 8px 8px;
    font-size: 13px;
  }
}

@media (max-width: 360px) {
  .mf-std-header-container {
    padding: 0 10px;
    gap: 8px;
  }
  .mf-std-brand-text {
    font-size: 16px;
  }
  .mf-std-brand-symbol {
    width: 32px;
    height: 32px;
  }
  .mf-std-brand-symbol img {
    width: 32px;
    height: 32px;
  }
  .mf-std-icon-btn,
  .mf-std-hamburger {
    width: 36px;
    height: 36px;
  }
  .mf-std-drawer {
    width: 280px;
    max-width: 90vw;
  }
  .mf-std-drawer-header {
    padding: 12px 14px;
  }
  .mf-std-drawer-body {
    padding: 12px 14px 32px;
  }
  .mf-std-drawer-auth-grid {
    gap: 6px;
  }
  .mf-std-drawer-auth-grid .mf-std-btn {
    padding: 8px 4px;
    font-size: 12px;
  }
  .mf-std-drawer-item {
    padding: 9px 10px;
    font-size: 14px;
    gap: 8px;
  }
}
