/* Reset และ Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  padding-top: 70px;
}

/* Navbar Styles */
.navbar {
  background-color: #4caf50;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  padding: 0 20px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.navbar-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 30px;
  align-items: center;
  margin-right: auto;
  padding: 0;
}

.nav-links li a {
  color: white;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 5px;
  transition: background-color 0.3s ease;
}

.nav-links li a:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

#nav-login, #nav-logout {
  position: absolute;
  top: 20px;
  right: 250px; /* ปรับให้ห่างจากตะกร้า */
  color: white;
  text-decoration: none;
  font-weight: 500;
  font-size: 16px;
}

#nav-login:hover, #nav-logout:hover {
  opacity: 0.8;
}


#nav-cart {
  position: absolute;
  top: 20px;
  right: 100px;
  color: white;
  text-decoration: none;
  font-weight: 500;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 5px;
}

#nav-cart i {
  font-size: 18px;
}

#nav-cart:hover {
  opacity: 0.8;
}


/* Hamburger Menu Toggle (Mobile) */
.menu-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 10px;
  width: 30px;
  height: 30px;
  justify-content: space-between;
}

.menu-toggle span {
  width: 100%;
  height: 3px;
  background-color: white;
  transition: all 0.3s ease;
  transform-origin: left;
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg);
}

/* Responsive Design */
@media screen and (max-width: 768px) {
  .navbar-container {
    flex-direction: column;
    height: auto;
    padding: 15px 0;
  }
  
  .menu-toggle {
    display: block;
    position: absolute;
    top: 20px;
    right: 20px;
  }
  
  .nav-links {
    flex-direction: column;
    width: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    gap: 0;
    margin-top: 50px;
  }
  
  .nav-links.show {
    max-height: 400px;
  }
  
  .nav-links li {
    width: 100%;
    text-align: center;
  }
  
  .nav-links li a {
    display: block;
    padding: 15px 20px;
    border-radius: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .nav-links li:last-child a {
    border-bottom: none;
  }
}

.cart-badge {
  background-color: red;
  color: white;
  padding: 2px 6px;
  border-radius: 50%;
  font-size: 12px;
  margin-left: 5px;
}
