/* Mobile Navigation Bar */
.mobile-nav-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #024170 0%, #035a9e 100%);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  padding: 5px 0 8px;
}

/* Show mobile nav only on mobile devices */
@media (max-width: 768px) {
  .mobile-nav-bar {
    display: flex;
    justify-content: space-around;
    align-items: center;
  }

  /* Hide desktop navigation on mobile */
  .navigation {
    display: none !important;
  }

  /* Add padding to body to prevent content being hidden behind nav */
  body {
    padding-bottom: 70px;
  }

  /* Hide back-to-top button on mobile */
  .backtop {
    display: none !important;
  }

  /* Hide services section on mobile */
  .testimonial-2 {
    display: none !important;
  }
}

.mobile-nav-item {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.mobile-nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-decoration: none;
  padding: 8px 15px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  position: relative;
}

.mobile-nav-link:hover,
.mobile-nav-link:focus {
  color: #fff;
  text-decoration: none;
  transform: translateY(-3px);
}

.mobile-nav-link i {
  margin-bottom: 4px;
  transition: all 0.3s ease;
}

.mobile-nav-link span {
  font-size: 11px;
  font-weight: 500;
  font-family: 'Sarabun', sans-serif;
}

.service-icon-wrapper {
  display: contents;
}

/* Mobile Popup Styles */
.mobile-popup {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  z-index: 2000;
  animation: fadeIn 0.3s ease;
}

.mobile-popup.active {
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

.popup-content {
  background: #fff;
  width: 100%;
  max-height: 80vh;
  border-radius: 20px 20px 0 0;
  overflow: hidden;
  animation: slideUp 0.3s ease;
  display: flex;
  flex-direction: column;
}

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: linear-gradient(135deg, #024170 0%, #035a9e 100%);
  color: #fff;
  border-bottom: 3px solid #ff6b35;
}

.popup-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #fff;
}

.popup-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  font-size: 24px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.popup-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.popup-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

/* Services Grid */
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.service-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.service-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  border-color: #ff6b35;
  background: #fff;
}

.service-img {
  width: 100%;
  height: 80px;
  object-fit: contain;
  margin-bottom: 10px;
  border-radius: 8px;
}

.service-title {
  font-size: 13px;
  color: #024170;
  text-align: center;
  font-weight: 500;
  line-height: 1.3;
}

/* Menu List */
.menu-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.menu-item {
  border-bottom: 1px solid #eee;
}

.menu-item:last-child {
  border-bottom: none;
}

.menu-link {
  display: flex;
  align-items: center;
  padding: 15px 10px;
  color: #333;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
}

.menu-link:hover {
  background: #f8f9fa;
  color: #024170;
  text-decoration: none;
}

.menu-link i {
  margin-right: 12px;
  font-size: 18px;
  color: #ff6b35;
  min-width: 24px;
}

.menu-link span {
  font-size: 15px;
  font-weight: 500;
}

/* Submenu Styles */
.has-submenu .submenu {
  display: none;
  list-style: none;
  padding: 0;
  margin: 0;
  background: #f8f9fa;
}

.has-submenu.active .submenu {
  display: block;
}

.has-submenu.active .submenu-toggle i {
  transform: rotate(180deg);
}

.submenu-toggle {
  position: relative;
}

.submenu-toggle i {
  transition: transform 0.3s ease;
}

.submenu-item {
  border-top: 1px solid #e0e0e0;
}

.submenu-link {
  display: block;
  padding: 12px 15px 12px 50px;
  color: #555;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.3s ease;
}

.submenu-link:hover {
  background: #fff;
  color: #024170;
  text-decoration: none;
  padding-left: 55px;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .service-item {
    padding: 12px;
  }

  .service-img {
    height: 70px;
  }

  .service-title {
    font-size: 12px;
  }

  .popup-header h3 {
    font-size: 18px;
  }
}

/* Smooth scrolling for popup body */
.popup-body::-webkit-scrollbar {
  width: 6px;
}

.popup-body::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.popup-body::-webkit-scrollbar-thumb {
  background: #024170;
  border-radius: 10px;
}

.popup-body::-webkit-scrollbar-thumb:hover {
  background: #035a9e;
}

/* Mobile Language Switcher */
.mobile-lang-switcher {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid #eee;
}

.lang-label {
  display: flex;
  align-items: center;
  color: #666;
  font-size: 14px;
  margin-bottom: 12px;
}

.lang-label i {
  margin-right: 10px;
  font-size: 18px;
  color: #011b3d;
}

.lang-options {
  display: flex;
  gap: 10px;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  color: #333;
  background: #f5f5f5;
  font-weight: 500;
  transition: all 0.3s ease;
  flex: 1;
  justify-content: center;
}

.lang-btn img {
  width: 24px;
  height: auto;
  border-radius: 2px;
}

.lang-btn:hover {
  background: #e0e0e0;
  color: #011b3d;
  text-decoration: none;
}

.lang-btn.active {
  background: #011b3d;
  color: #fff;
}

.lang-btn.active:hover {
  background: #023a6b;
  color: #fff;
}

/* Language Popup Small */
.popup-small {
  max-height: 50vh;
}

.lang-options-popup {
  display: flex;
  gap: 15px;
}

.lang-btn-large {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 30px;
  border-radius: 12px;
  text-decoration: none;
  color: #333;
  background: #f5f5f5;
  font-weight: 500;
  transition: all 0.3s ease;
  flex: 1;
  justify-content: center;
}

.lang-btn-large img {
  width: 48px;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.lang-btn-large span {
  font-size: 16px;
}

.lang-btn-large:hover {
  background: #e0e0e0;
  color: #011b3d;
  text-decoration: none;
  transform: translateY(-3px);
}

.lang-btn-large.active {
  background: #011b3d;
  color: #fff;
  box-shadow: 0 4px 15px rgba(1, 27, 61, 0.3);
}

.lang-btn-large.active:hover {
  background: #023a6b;
  color: #fff;
}

/* Mobile Search Fixes */
@media (max-width: 767px) {
  .search-header .search-form {
    width: 100%;
  }

  .search-input-group {
    display: flex !important;
    flex-wrap: nowrap !important;
    width: 100%;
    align-items: stretch;
  }

  .search-input {
    flex: 1 1 auto;
    width: auto !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    margin-bottom: 0 !important;
    height: 45px;
    /* Ensure check height matches */
  }

  .btn-search {
    flex: 0 0 auto;
    width: auto !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    height: 45px;
    /* Fixed height */
    display: flex;
    align-items: center;
    padding: 0 15px;
  }
}