/* ========================
   GLOBAL & HEADER (Desktop)
   ======================== */
.fixed-top {
  position: fixed;
}

.header {
  width: 100%;
  height: 50px;
  background: #ca1d1d;
  border-bottom: 1px solid hsla(0, 0%, 100%, 0.2);
  z-index: 1;
  transition: 1s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header .header_container {
  max-width: 1280px;
  padding: 0 20px;
  display: flex;
  align-items: center;
}

.header_container-logo {
  padding-right: 20px;
}

/* ========================
     MENU (Desktop)
     ======================== */
.header .menu {
  position: relative;
  right: 0;
}

.header .menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.header .menu > ul > li {
  display: inline-block;
}

/* Link chung */
.header .menu a {
  display: block;
  padding: 0.75rem 1rem;
  text-decoration: none;
  text-transform: capitalize;
  font-size: 16px;
  color: #fff;
  line-height: 1.5;
  position: relative;
}

/* Dropdown icon cho menu ngang */
.header .menu > ul > .dropdown > a {
  padding-right: 30px;
}

.header .menu i {
  font-size: 10px;
  pointer-events: none;
  user-select: none;
  position: absolute;
  color: #fff;
  top: calc(50% - 5px);
  right: 5px;
}

.header .menu > ul > li > i {
  right: 0;
}

/* ========================
     SUB-MENU (Desktop Dropdown)
     ======================== */
.header .menu .dropdown {
  position: relative;
}

.header .menu .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 220px;
  padding: 15px 0;
  background-color: #ca1d1d;
  box-shadow: 0 0 5px hsla(0, 0%, 0%, 0.5);
  z-index: 1;
  transform-origin: top;
  transform: scaleY(0);
  visibility: hidden;
  opacity: 0;
  transition: all 0.5s ease;
}

.header .menu li:hover > .sub-menu {
  transform: none;
  visibility: visible;
  opacity: 1;
}

.sub-menu-second {
  width: 260px !important;
}

.header .menu .sub-menu-right {
  left: 100%;
  top: 0;
}

.header .menu .sub-menu a {
  padding: 6px 24px;
}

.header .menu .sub-menu .dropdown > a {
  padding-right: 34px;
}

/* Hiệu ứng underline hover cho sub-menu */
.header .menu .sub-menu span {
  background-image: linear-gradient(#fff, #fff);
  background-size: 0 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 0.2s ease;
}

.header .menu .sub-menu li:hover > a > span {
  background-size: 100% 1px;
}

.header .menu .sub-menu i {
  transform: rotate(-90deg);
  right: 24px;
}

/* ========================
     HEADER LEFT/RIGHT & Open Menu Button
     ======================== */
.header-left {
  display: flex;
}

.header-right {
  position: absolute;
  right: 0;
}

.header-left .open-menu-btn,
.header .menu .head,
.header .menu .menu_head {
  display: none;
}

/* ========================
     SIDE MENU (Mobile)
     ======================== */
.side {
  position: fixed;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  max-height: 100%;
  overflow-y: auto;
  padding: 1rem 1.75rem;
  z-index: 100;
  background: #ca1d1d;
  transition: transform 0.5s ease;
}

.side ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.link-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.side ul a {
  display: flex;
  padding: 0.75rem 1rem;
  transition: background 0.2s ease;
  outline: 0;
}

.side ul a:hover {
  background: #a20d0d;
  cursor: pointer;
}

/* ========================
     SIDE MENU Dropdown (Mobile)
     ======================== */
.dropdown-content,
.dropdown-content-sub-menu {
  overflow: hidden;
  max-height: 0;
}

/* Hiệu ứng mở chậm 1.5s */
.dropdown-content.opening,
.dropdown-content-sub-menu.opening {
  transition: max-height 1.4s ease-out;
  max-height: 700px;
}

/* Hiệu ứng đóng nhanh 0.3s */
.dropdown-content.closing,
.dropdown-content-sub-menu.closing {
  transition: max-height 0.6s ease-in-out;
  max-height: 0;
}

.dropdown-content li a {
  padding-left: 35px;
}

.dropdown-content-sub-menu li a {
  padding-left: 60px;
}

/* Cho các submenu lồng nhau (cấp 3 trở lên) */
.dropdown-content-sub-menu ul.dropdown-content-sub-menu li a {
  padding-left: 85px;
}

.dropdown-content,
.dropdown-content-sub-menu {
  overflow: hidden;
  max-height: 0;
  transition: max-height 1.5s;
}

.dropdown-content.active,
.dropdown-content-sub-menu.active {
  max-height: 700px;
}

.dropdown-btn i,
.dropdown-btn-sub-menu i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: rotate(-90deg);
  transition: all 0.3s ease;
}

.side i.active {
  transform: rotate(0deg);
}

/* ========================
     SIDE HEAD (Mobile Header Area)
     ======================== */

.side_head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 40px;
  margin: 0.5rem 0;
  box-sizing: border-box;
}

.side_head_logo img {
  height: auto;
  max-height: 60px;
  transition: 0.2s ease;
}

/* =================================================== */
/* =================================================== */

.side .close-menu-btn {
  height: 100%;
  min-width: 40px;

  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;

  background: transparent;
  border: none;
  border-radius: 8px;

  cursor: pointer;
  margin: 0;
  z-index: 110;
}

.side .close-menu-btn:hover {
  background-color: #842029;
}

.side .close-menu-btn::before,
.side .close-menu-btn::after {
  content: "";
  position: absolute;
  width: 50%;
  height: 2px;
  background-color: #fff;
  top: 50%;
  left: 50%;
  transform-origin: center;
}

.side .close-menu-btn::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.side .close-menu-btn::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* =================================================== */
/* =================================================== */

/* ========================
     RESPONSIVE Styles
     ======================== */
@media screen and (min-width: 768px) {
  .dropdown-btn,
  .dropdown-btn-sub-menu {
    position: relative;
  }
}

@media screen and (max-width: 1024px) {
  .header .header_container {
    padding: 0 10px;
  }
}

@media screen and (max-width: 768px) {
  .side {
    padding: 0.5rem 1rem;
  }

  .side ul a {
    font-size: 15px;
  }

  .dropdown-content li a {
    padding-left: 2.25rem;
  }

  .dropdown-content-sub-menu li a {
    padding-left: 3.75rem;
  }

  .dropdown-content-sub-menu ul.dropdown-content-sub-menu li a {
    padding-left: 4.75rem;
  }

  .side_head_logo img {
    height: 50px;
  }
}

@media (max-width: 648px) {
  .side_head_logo img {
    height: 45px;
  }

  .side ul a {
    font-size: 14px;
    padding-left: 0.75rem;
  }

  .dropdown-content li a {
    padding-left: 2rem;
  }

  .dropdown-content-sub-menu li a {
    padding-left: 3.25rem;
  }

  .dropdown-content-sub-menu ul.dropdown-content-sub-menu li a {
    padding-left: 4.25rem;
  }
}

@media (max-width: 448px) {
  .side {
    padding: 0.5rem 1rem;
  }

  .side_head_logo img {
    height: 40px;
  }

  .side ul a {
    font-size: 13px;
    padding-left: 0.5rem;
  }

  .dropdown-content li a {
    padding-left: 1.5rem;
  }

  .dropdown-content-sub-menu li a {
    padding-left: 2.75rem;
  }

  .dropdown-content-sub-menu ul.dropdown-content-sub-menu li a {
    padding-left: 3.5rem;
  }
}

@media (max-width: 878px) {
  .stretch {
    display: none;
  }

  .side.open {
    transform: translateX(200%);
  }

  .header_container .header_container-logo {
    display: none;
  }

  .header-left {
    height: 40px;
    width: 44px;
  }

  /* Menu cover & Open Menu Button (Mobile) */
  .header_container .menu-cover {
    position: fixed;
    right: -100%;
    top: 0;
    width: 50%;
    height: 100%;
    background-color: #3b3b3b;
    opacity: 0.4;
    padding: 15px 30px 30px;
    overflow-y: auto;
    z-index: 1000;
  }

  .header_container .menu-cover.open {
    transform: translateX(-200%);
  }

  .header-left .open-menu-btn {
    left: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    width: 44px;
    cursor: pointer;
    position: relative;
    background-color: transparent;
    border: none;
  }

  .header-left .open-menu-btn .line {
    height: 2px;
    width: 22px;
    background-color: #fff;
    position: absolute;
  }

  .header-left .open-menu-btn .line-1 {
    transform: translateY(-6px);
  }

  .header-left .open-menu-btn .line-3 {
    transform: translateY(6px);
  }
}

@media (max-width: 768px) {
  .header {
    height: 40px;
  }
}
