/* 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;
  }
}

.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: 13px;
  font-weight: 500;
  font-family: 'Sarabun', sans-serif;
}

/* Center service button - Circular elevated design like reference */
.mobile-nav-item:nth-child(2) {
  position: relative;
}

.mobile-nav-item:nth-child(2) .mobile-nav-link {
  background: linear-gradient(135deg, #ff6b35 0%, #ff8c42 100%);
  border-radius: 50%;
  width: 65px;
  height: 65px;
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 -4px 20px rgba(255, 107, 53, 0.4),
    0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 4px solid #fff;
  transition: all 0.3s ease;
}

.mobile-nav-item:nth-child(2) .mobile-nav-link:hover {
  transform: translateX(-50%) translateY(-3px);
  box-shadow: 0 -6px 24px rgba(255, 107, 53, 0.5),
    0 6px 16px rgba(0, 0, 0, 0.2);
}

.mobile-nav-item:nth-child(2) .mobile-nav-link i {
  font-size: 28px;
  color: #fff;
  margin-bottom: 0;
}

.mobile-nav-item:nth-child(2) .mobile-nav-link span {
  position: absolute;
  bottom: -45px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
  display: block;
}

.service-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 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;
}