
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  /* Mặc định giống trạng thái scrolled: */
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(15px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
  z-index: 1000;
  transition: all 0.3s ease;
}

.header .container {
  max-width: 90vw;
  margin: 0 auto;
  padding: 0 60px; /* Tăng padding 2 bên */
}

.header .nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 0; /* Tăng padding trên dưới */
  gap: 3rem; /* Tăng khoảng cách giữa logo và menu */
}

/* Cart icon styling */
.cart-icon-container {
    position: relative;
    display: inline-block;
    color: #2c3e50; /* đổi màu phù hợp với nền trắng */
}

.cart-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: red;
    color: white;
    border-radius: 50%;
    padding: 5px 8px;
    font-size: 12px;
    line-height: 1;
}

/* Brand/Logo - Thiết kế mới */
.brand {
  flex-shrink: 0;
  padding: 0.5rem 0; /* Thêm padding trên dưới cho logo */
}

.brand a {
  display: block;
  line-height: 0;
  transition: all 0.3s ease;
}

.brand a:hover {
  transform: scale(1.05); /* Hiệu ứng hover cho logo */
}

.brand img {
  height: 55px; /* Kích thước như khi scrolled (mặc định) */
  width: auto;
  transition: all 0.3s ease;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
}

/* Menu Navigation - Thiết kế mới */
.menu {
  display: flex;
  align-items: center;
  gap: 0.1rem; /* Khoảng cách đều giữa các item */
  flex-wrap: nowrap;
}
.header-cart-desktop {
  display: block;
}
.header-cart-mobile {
  display: none;
}

.menu a,
.menu button {
  position: relative;
  padding: 0.5rem 1rem; /* Padding thoải mái hơn */
  font-size: 0.85rem;
  font-weight: 600;
  color: #2c3e50; /* màu chữ mặc định (scrolled) */
  text-decoration: none;
  transition: all 0.3s ease;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* Hiệu ứng underline đẹp */
.menu a::after {
  content: '';
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: #2c3e50;
  transition: width 0.3s ease;
}

.menu a:hover::after {
  width: 70%;
}

.menu a:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

/* Khi hover — giữ cùng style scrolled */
.header .menu a:hover, .header .menu button:hover {
  color: var(--zz-blue-dark);
  background: var(--zz-blue-light);
}

/* Home icon styling */
.menu a[href="/"] {
  padding: 0.5rem 1rem; /* Padding nhỏ hơn cho icon */
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu a[href="/"] svg {
  transition: all 0.3s ease;
}

.menu a[href="/"]:hover svg {
  transform: scale(1.1);
}

/* Mobile: Hiển thị text "Trang chủ" thay vì icon */
@media (max-width: 900px) {
  .menu a[href="/"] {
    padding: 1.2rem 1.5rem;
    justify-content: flex-start;
  }
  
  .menu a[href="/"] svg {
    display: none;
  }
}
/* Active link - Thiết kế mới */
.menu a.active {
  background: rgba(255, 255, 255, 0.25);
  font-weight: 700;
}

.menu a.active::after {
  width: 70%;
}

.header .menu a.active {
  color: var(--zz-blue-dark);
  background: transparent;
}

/* Logout button styling - Thiết kế mới */
.menu form {
  display: inline-block;
  margin: 0;
  flex-shrink: 0;
}

.menu .btn {
  padding: 0.8rem 1.8rem; /* Padding lớn hơn cho button */
  font-size: 0.9rem;
  font-weight: 700;
  border: 2px solid #00bcd4;
  background: rgba(0, 188, 212, 0.05);
  color: #00bcd4;
  border-radius: 30px; /* Bo tròn nhiều hơn */
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.menu .btn:hover {
  background: #00bcd4;
  color: #ffffff;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 188, 212, 0.3);
}

/* Mobile Menu Toggle - Thiết kế mới */
.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  cursor: pointer;
  padding: 8px;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.mobile-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
}

.mobile-toggle span {
  display: block;
  width: 26px;
  height: 3px;
  background: #2c3e50; /* màu dark khi header trắng */
  border-radius: 3px;
  transition: all 0.3s ease;
}

/* Khi sử dụng class force-background (nếu có) vẫn tuân theo header mặc định */
.header.force-background .mobile-toggle {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(0, 188, 212, 0.3);
}

.header.force-background .mobile-toggle span {
  background: #2c3e50;
}

/* Spacer */
.header-spacer {
  height: 0;
  display: none;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1400px) {
  .header .container {
    padding: 0 40px;
  }
}

@media (max-width: 1200px) {
  .header .nav-container {
    gap: 2rem;
  }
  
  .menu {
    gap: 0.5rem;
  }
  
  .menu a,
  .menu button {
    padding: 0.7rem 1.2rem;
    font-size: 0.88rem;
  }
  
  .menu .btn {
    padding: 0.7rem 1.5rem;
  }
}

@media (max-width: 1024px) {
  .header .nav-container {
    gap: 1.5rem;
  }
  
  .menu {
    gap: 0.3rem;
  }
  
  .menu a,
  .menu button {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
  }
  
  .brand img {
    height: 60px;
  }
  
  /* giữ consistency: brand nhỏ hơn trên mobile */
  .header .brand img {
    height: 48px;
  }
}

@media (max-width: 1250px) {
  .header .container {
    padding: 0 25px;
  }

  .header .nav-container {
    padding: 1rem 0;
    gap: 1rem;
  }

  .brand img {
    height: 55px;
  }

  .header .brand img {
    height: 45px;
  }
 
  .header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
  }

  .mobile-toggle {
    display: flex;
    z-index: 1001;
  }

  .header-cart-desktop {
    display: none;
  }
  .header-cart-mobile {
    display: block;
  }
  .header .cart-icon-container {
    color: #0c8ce9;
  }

  .menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 320px;
    height: 100vh;
    background: rgba(44, 62, 80, 0.98); /* Đổi màu nền menu mobile mặc định đậm hơn */
    flex-direction: column;
    align-items: stretch;
    padding: 100px 30px 30px;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.15);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    gap: 0;
  }

  .menu.active {
    right: 0;
  }

  .menu a,
  .menu button {
    width: 100%;
    padding: 1rem 1.2rem;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    color: #fff !important; /* Mặc định chữ trắng trên nền đậm */
    border: none;
    text-align: left;
  }

  .menu a::after {
    display: none; /* Tắt underline effect trên mobile */
  }

  .menu a:hover {
    background: rgba(0, 188, 212, 0.08);
  }

  .menu form {
    width: 100%;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid #f0f0f0;
  }


  /* Mobile overlay */
  .menu::before {
    content: '';
    position: fixed;
    top: 0;
    left: -320px;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    backdrop-filter: blur(4px);
  }

  .menu.active::before {
    opacity: 1;
    pointer-events: auto;
    z-index: -1;
  }

  /* Hamburger animation */
  .mobile-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
  }

  .mobile-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
  }

  .mobile-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
  }
}

@media (max-width: 480px) {
  .header .container {
    padding: 0 20px;
  }
  
  .brand img {
    height: 40px;
  }

  .header .brand img {
    height: 40px;
  }
  .menu {
    width: 280px;
  }
}
