/* =========================================
	CONTAINER & NAVBAR
========================================= */
.ic-menu {
  background: #ffffff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  position: relative;
  z-index: 9999;
}

.ic-menu .container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
  box-sizing: border-box;
  position: relative;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  position: relative;
  height: 70px;
}

/* =========================================
	LOGO
========================================= */
.logo {
  display: flex;
  align-items: center;
}

.logo img {
  height: auto;
  max-height: 48px;
  display: block;
  object-fit: contain;
}

/* =========================================
	MENU LEVEL 1 (DESKTOP)
========================================= */
.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 0 auto;
  padding: 0;
}

.nav-links > li {
  position: relative;
}

.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-links a {
  color: #2b2b2b;
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  transition: color 0.25s ease;
  position: relative;
}

/* Hiệu ứng gạch chân động thay cho font-weight bold tránh giật layout */
.nav-links > li > .menu-item > a::after,
.nav-links > li > a::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 14px;
  right: 14px;
  height: 2px;
  background-color: #db3832;
  transform: scaleX(0);
  transition: transform 0.25s ease;
}

.nav-links > li:hover > .menu-item > a,
.nav-links > li:hover > a {
  color: #db3832;
}

.nav-links > li:hover > .menu-item > a::after,
.nav-links > li:hover > a::after {
  transform: scaleX(1);
}

/* Arrow indicator */
.submenu-toggle {
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  color: #666;
  transition: color 0.2s ease;
}

.arrow {
  display: inline-block;
  font-size: 10px;
  transition: transform 0.25s ease;
}

/* =========================================
	DROPDOWN LEVEL 2 (DESKTOP)
========================================= */
.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 210px;
  list-style: none;
  margin: 0;
  padding: 8px 0;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border: 1px solid #f0f0f0;
  visibility: hidden;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  pointer-events: none;
  z-index: 1000;
}

/* Padding ảo chống hổng chuột gây mất hover */
.dropdown::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 0;
  width: 100%;
  height: 10px;
}

.dropdown > li {
  position: relative;
  padding: 0;
}

.dropdown li a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px;
  color: #444;
  font-size: 14px;
  font-weight: 400;
  transition: background 0.2s ease, color 0.2s ease;
}

.dropdown li:hover > .menu-item > a,
.dropdown li:hover > a {
  background: #fdf2f2;
  color: #db3832;
}

/* Show Dropdown L2 */
.nav-links > li:hover > .dropdown {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.nav-links > li:hover > .menu-item .arrow {
  transform: rotate(180deg);
  color: #db3832;
}

/* =========================================
	DROPDOWN LEVEL 3 (DESKTOP)
========================================= */
.dropdown-sub {
  position: absolute;
  top: -8px;
  left: 100%;
  min-width: 200px;
  margin: 0;
  padding: 8px 0;
  list-style: none;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border: 1px solid #f0f0f0;
  visibility: hidden;
  opacity: 0;
  transform: translateX(10px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  pointer-events: none;
  z-index: 1001;
}

.dropdown-sub::before {
  content: '';
  position: absolute;
  top: 0;
  left: -10px;
  width: 10px;
  height: 100%;
}

.dropdown > li:hover > .dropdown-sub {
  visibility: visible;
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.dropdown > li:hover > .menu-item .arrow {
  transform: rotate(-90deg);
  color: #db3832;
}

/* =========================================
	RIGHT BUTTONS & SEARCH TOGGLE
========================================= */
.btn-inmenu {
  display: flex;
  align-items: center;
  margin-left: 15px;
}

.search-button {
  background: #f5f5f5;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #333;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
}

.search-button:hover {
  background: #db3832;
  color: #fff;
}

.search-form {
  position: absolute;
  top: 100%;
  right: 15px;
  width: 320px;
  background: #fff;
  padding: 12px;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  border: 1px solid #eee;
  display: none;
  z-index: 10000;
}

.search-form.show {
  display: block;
  animation: fadeInDown 0.25s ease;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.search-line {
  display: flex;
  gap: 6px;
}

.search-line input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  outline: none;
  font-size: 14px;
}

.search-line input:focus {
  border-color: #db3832;
}

.search-line button {
  background: #db3832;
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
}

/* =========================================
	BURGER & FIXED MENU
========================================= */
.burger {
  display: none;
  font-size: 24px;
  color: #333;
  cursor: pointer;
  padding: 5px;
}

.ic-menu.fixed {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  animation: menuSlideDown 0.3s ease;
}

@keyframes menuSlideDown {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

/* =========================================
	MOBILE RESPONSIVE (<= 768px)
========================================= */
@media (max-width: 768px) {
  .burger {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    background: #ffffff;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px 0;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    display: none;
    max-height: 80vh;
    overflow-y: auto;
    border-top: 1px solid #eee;
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links > li {
    width: 100%;
    border-bottom: 1px solid #f5f5f5;
  }

  .nav-links a {
    width: 100%;
    padding: 12px 20px;
    box-sizing: border-box;
  }

  .nav-links > li > .menu-item > a::after {
    display: none;
  }

  .submenu-toggle {
    padding: 12px 20px;
  }

  /* Dropdown MobileAccordion */
  .dropdown,
  .dropdown-sub {
    position: static;
    visibility: visible;
    opacity: 1;
    transform: none;
    box-shadow: none;
    border: none;
    border-radius: 0;
    background: #f9f9f9;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
    pointer-events: auto;
  }

  .dropdown-sub {
    background: #f0f0f0;
  }

  .dropdown li a {
    padding-left: 35px;
  }

  .dropdown-sub li a {
    padding-left: 50px;
  }

  .nav-links li.open > .dropdown,
  .dropdown li.open > .dropdown-sub {
    max-height: 500px;
  }

  .nav-links li.open > .menu-item .arrow,
  .dropdown li.open > .menu-item .arrow {
    transform: rotate(180deg);
    color: #db3832;
  }

  .search-form {
    width: calc(100% - 30px);
    right: 15px;
  }
}


