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

/* 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: 80px;
  }

  /* Hide desktop 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 2px;
  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;
  white-space: nowrap;
}


/* Service button styles removed to match other items */


/* 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, #3a1458 0%, #5c2080 100%);
  color: #fff;
  border-bottom: 3px solid #c8a2e0;
}

.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: #9b5cc0;
  background: #fff;
}

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

.service-title {
  font-size: 13px;
  color: #3a1458;
  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: #3a1458;
  text-decoration: none;
}

.menu-link i {
  margin-right: 12px;
  font-size: 18px;
  color: #9b5cc0;
  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: #3a1458;
  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: #3a1458;
  border-radius: 10px;
}

.popup-body::-webkit-scrollbar-thumb:hover {
  background: #5c2080;
}

/* Accessibility Popup Styles */
.access-section {
  margin-bottom: 12px;
}

.access-section h4 {
  font-size: 14px;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 8px;
  border-left: 3px solid #9b5cc0;
  padding-left: 8px;
}

.access-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

/* Special grid for mode with 4 items - try to fit 4 in row or 2x2 tightly */
.access-grid:first-of-type {
  grid-template-columns: repeat(2, 1fr);
  /* Keep 2x2 for better touch targets, but tighter */
}

.access-item {
  display: flex;
  flex-direction: row;
  /* Horizontal layout for compactness */
  align-items: center;
  justify-content: flex-start;
  padding: 10px;
  background: #f8f9fa;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #2c3e50;
  gap: 10px;
}

.access-item i {
  font-size: 20px;
  margin-bottom: 0;
  color: #3a1458;
}

.access-item span {
  font-size: 13px;
  font-weight: 500;
}

.access-item:hover,
.access-item.active {
  background: #fff;
  border-color: #9b5cc0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.access-item.active i {
  color: #9b5cc0;
}

.font-controls-wrapper {
  display: flex;
  gap: 8px;
}

.font-control-btn {
  flex: 1;
  padding: 8px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.font-control-btn:hover,
.font-control-btn.active {
  background: #3a1458;
  color: #fff;
  border-color: #3a1458;
}

.mobile-search-form {
  display: flex;
  gap: 6px;
}

.mobile-search-form input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  outline: none;
  font-size: 13px;
}

.mobile-search-form input:focus {
  border-color: #3a1458;
}

.mobile-search-form button {
  width: 40px;
  background: #9b5cc0;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
}