:root {
  --color-main: #423625;
  --color-back01: #f0e9dc;
  --color-back02: #faf5ec;
  --main-text-click: #a2762f;
  --font-sans: "SVN-Gilroy", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --header-height: 65px;
}
html, body{
  margin: 0;
  padding: 0;
}
body{
  font-family: var(--font-sans);
  font-weight: 350;
  overflow: hidden;
}
.header-buffer {
  height: 65px;
}
#loader{
  position: fixed;
    top: 0px;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fcf1d9f4; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: top 2s ease-in-out;
}
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  padding: 0 130px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;

  background: var(--color-main);

  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  z-index: 999;

  /* iOS/Safari: giúp fixed ổn định khi scroll */
  transform: translateZ(0);
  will-change: transform;
}

.logo_header {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  min-width: 64px;
}

.logo_header img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  display: block;
}

.hamburger-btn{
  display: none;
  border: 0;
  background: transparent;
  padding: 10px;
  margin: 0;
  border-radius: 10px;
  cursor: pointer;
}

.hamburger-icon{
  position: relative;
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-back02);
  border-radius: 999px;
}

.hamburger-icon::before,
.hamburger-icon::after{
  content: "";
  position: absolute;
  left: 0;
  width: 22px;
  height: 2px;
  background: var(--color-back02);
  border-radius: 999px;
}
.hamburger-icon::before{ top: -7px; }
.hamburger-icon::after{ top: 7px; }

.mobile-overlay{
  display: none;
}

.mobile-drawer{
  display: contents; /* desktop: giữ bố cục cũ */
}

.drawer-header{
  display: none;
}

.drawer-close{
  border: 0;
  background: transparent;
  color: var(--color-back02);
  font-size: 34px;
  line-height: 1;
  padding: 0 6px;
  cursor: pointer;
}

.menu-nav {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;

  gap: 100px;
  margin: 0;
  padding: 0;
  letter-spacing: 1.2px;

  flex: 1;       
}

.menu-nav a {
  text-decoration: none;
  font-size: 16px;
  font-weight: 300;

  color: var(--color-back02);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.menu-nav a:hover {
  color: var(--main-text-click);
  transform: translateY(-1px);
}


.search {
  display: flex;
  align-items: center;

  gap: 10px;
  padding: 8px 12px;

  border-radius: 10px;
  background: rgba(137, 137, 137, 0.18);
  min-width: 220px;
}

.search i {
  color: rgba(236, 207, 153, 0.633);
  font-size: 12px;
}

.search input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: rgba(236, 207, 153, 0.95);
  font-size: 14px;
}

.search input::placeholder {
  color: rgba(236, 207, 153, 0.65);
  font-weight: 100 !important;
  font-family: var(--font-sans);
}

@media (max-width: 900px) {
  .menu-nav { gap: 18px; }
  .search { min-width: 180px; }
}

@media (max-width: 720px) {
  /* Mobile: chỉ hiện logo + nút 3 gạch */
  .header{
    padding: 0 12px;
    height: 65px;
    gap: 10px;
  }

  .logo_header{
    width: 52px;
    min-width: 52px;
  }

  .logo_header img{
    width: 40px;
    height: 40px;
  }

  .hamburger-btn{
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Ẩn menu/search trên thanh top, đưa vào drawer */
  .menu-nav,
  .search{
    display: none;
  }

  /* hidden attribute luôn thắng */
  [hidden]{
    display: none !important;
  }

  .mobile-overlay{
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 998;
  }

  .mobile-drawer{
    display: block;
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(86vw, 360px);
    background: var(--color-main);
    z-index: 999;
    padding: 16px 14px 20px;
    transform: translateX(102%);
    transition: transform .25s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
  }

  .drawer-header{
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
  }

  .mobile-drawer .search{
    display: flex;
    width: min(100%, 320px);
    min-width: 0;
    padding: 10px 12px;
    margin: 0 auto 14px;
    border-radius: 999px;
    box-sizing: border-box;
    overflow: hidden;
  }

  .mobile-drawer .search input{
    min-width: 0;
  }

  .mobile-drawer .menu-nav{
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    width: 100%;
  }

  .mobile-drawer .menu-nav li{
    padding: 14px 2px;
    border-top: 1px solid rgba(250,245,236,.35);
  }
  .mobile-drawer .menu-nav li:last-child{
    border-bottom: 1px solid rgba(250,245,236,.35);
  }

  .mobile-drawer .menu-nav a{
    font-size: 18px;
    font-weight: 350;
  }

  /* buffer theo chiều cao header */
  .header-buffer{
    height: 0;
  }

  /* trạng thái mở */
  .header.is-open .mobile-overlay{
    display: block;
  }

  .header.is-open .mobile-drawer{
    transform: translateX(0);
  }

  /* trong drawer: ô tìm kiếm lên đầu, rồi đến menu */
  .mobile-drawer{
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .mobile-drawer .drawer-header{
    order: 0;
  }

  .mobile-drawer .search{
    order: 1;
  }

  .mobile-drawer .menu-nav{
    order: 2;
  }
}

