/* =====================================================================
   MENU TỔNG – Phong Thủy Đông Dương  (desktop "sớ" + mobile accordion)
   Dán vào: Flatsome → Advanced → Custom CSS → All screens
   → XÓA hết các khối CSS menu cũ (sớ v1/v2, menu mobile, bổ sung v3) rồi dán khối này.
   Cần kèm script trong file menu-tong.js (Footer Scripts).
   Customizer: Header → Mobile Menu → Menu Overlay = Left, Overlay Color = Light
   ===================================================================== */


/* ---------------------------------------------------------------------
   1. DESKTOP – DROPDOWN KIỂU SỚ
   --------------------------------------------------------------------- */

/* khung sớ */
#header .header-nav .nav-dropdown.nav-dropdown-default {
  min-width: 260px;
  padding: 30px 30px 32px;
  border: 0;
  border-radius: 3px;
  background:
    linear-gradient(90deg, rgba(120,80,20,.08), rgba(120,80,20,0) 10%, rgba(120,80,20,0) 90%, rgba(120,80,20,.08)),
    repeating-linear-gradient(0deg, rgba(150,110,40,.035) 0 1px, rgba(0,0,0,0) 1px 5px),
    #fbf3df;
  box-shadow:
    inset 0 0 0 8px #fbf3df,
    inset 0 0 0 9px rgba(154,74,44,.45),
    0 28px 48px -20px rgba(18,49,42,.55);
  overflow: visible;
}

/* 2 trục gỗ đầu – cuối sớ */
#header .header-nav .nav-dropdown.nav-dropdown-default::before,
#header .header-nav .nav-dropdown.nav-dropdown-default::after {
  content: "";
  position: absolute;
  left: -12px;
  right: -12px;
  width: auto;
  height: 12px;
  margin: 0;
  border: 0;
  border-radius: 6px;
  transform: none;
  background:
    radial-gradient(circle at 6px 50%, #f2c66a 0 3.5px, rgba(0,0,0,0) 4px),
    radial-gradient(circle at calc(100% - 6px) 50%, #f2c66a 0 3.5px, rgba(0,0,0,0) 4px),
    linear-gradient(180deg, #8a5a22 0%, #5e3a14 45%, #3e260c 100%);
  box-shadow: 0 3px 6px -2px rgba(40,24,6,.5);
}
#header .header-nav .nav-dropdown.nav-dropdown-default::before { top: -6px; }
#header .header-nav .nav-dropdown.nav-dropdown-default::after  { bottom: -6px; }

/* mega menu nhiều cột: căn giữa dưới mục cha */
#header .header-nav .has-dropdown:hover > .nav-dropdown.nav-dropdown-default:has(> .nav-dropdown-col),
#header .header-nav .has-dropdown.current-dropdown > .nav-dropdown.nav-dropdown-default:has(> .nav-dropdown-col) {
  left: 50%;
  margin-left: -440px; /* = nửa chiều rộng */
}
#header .header-nav .nav-dropdown.nav-dropdown-default:has(> .nav-dropdown-col) {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr;
  width: 880px;
  max-width: calc(100vw - 40px);
  padding: 34px 16px;
}
#header .header-nav .nav-dropdown-default:has(> .nav-dropdown-col) > li {
  display: block;
  width: auto;
  min-width: 0;
  padding: 0 22px;
  border-left: 1px solid rgba(154,112,40,.28);
}
#header .header-nav .nav-dropdown-default:has(> .nav-dropdown-col) > li:first-child { border-left: 0; }

/* tiêu đề cột */
#header .header-nav .nav-dropdown-default:has(> .nav-dropdown-col) > li > a {
  position: relative;
  display: block;
  margin: 0 0 8px;
  padding: 0 0 12px;
  border-bottom: 0;
  background: none;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #9a4a2c;
}
#header .header-nav .nav-dropdown-default:has(> .nav-dropdown-col) > li > a::before {
  content: "";
  position: absolute;
  top: auto;
  bottom: 0;
  left: 0;
  width: 42px;
  height: 2px;
  margin: 0;
  border: 0;
  transform: none;
  background: #f2a21b;
  transition: width .3s ease;
}
#header .header-nav .nav-dropdown-default:has(> .nav-dropdown-col) > li > a:hover { padding-left: 0; background: none; color: #7c3720; }
#header .header-nav .nav-dropdown-default:has(> .nav-dropdown-col) > li > a:hover::before { width: 80px; }

/* danh sách con trong cột */
#header .header-nav .nav-dropdown-col > .nav-column {
  position: static;
  display: block;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}
#header .header-nav .nav-dropdown-col > .nav-column::before,
#header .header-nav .nav-dropdown-col > .nav-column::after { display: none; }

/* dòng mục (dropdown thường + mục con trong cột) */
#header .header-nav .nav-dropdown.nav-dropdown-default:not(:has(> .nav-dropdown-col)) > li > a,
#header .header-nav .nav-dropdown-col > .nav-column > li > a {
  position: relative;
  display: block;
  margin: 0;
  padding: 9px 4px 9px 20px;
  border-bottom: 1px dashed rgba(154,112,40,.3);
  font-family: "Playfair Display", Georgia, serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0;
  text-transform: none;
  color: #1d4a3a;
  transition: color .2s ease, padding-left .25s ease, background-color .2s ease;
}
#header .header-nav .nav-dropdown.nav-dropdown-default:not(:has(> .nav-dropdown-col)) > li:last-child > a,
#header .header-nav .nav-dropdown-col > .nav-column > li:last-child > a { border-bottom: 0; }

#header .header-nav .nav-dropdown.nav-dropdown-default:not(:has(> .nav-dropdown-col)) > li > a::before,
#header .header-nav .nav-dropdown-col > .nav-column > li > a::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border: 1px solid #c9780a;
  transform: rotate(45deg);
  opacity: 1;
  transition: background-color .2s ease;
}
#header .header-nav .nav-dropdown.nav-dropdown-default:not(:has(> .nav-dropdown-col)) > li > a:hover,
#header .header-nav .nav-dropdown-col > .nav-column > li > a:hover {
  padding-left: 26px;
  background: rgba(242,162,27,.08);
  color: #9a4a2c;
}
#header .header-nav .nav-dropdown.nav-dropdown-default:not(:has(> .nav-dropdown-col)) > li > a:hover::before,
#header .header-nav .nav-dropdown-col > .nav-column > li > a:hover::before { background: #f2a21b; border-color: #f2a21b; }

/* bỏ màu "active" mặc định của Flatsome */
#header .header-nav .nav-dropdown-default li.active > a { color: #1d4a3a; }
#header .header-nav .nav-dropdown-default:has(> .nav-dropdown-col) > li.active > a { color: #9a4a2c; }

/* hiệu ứng sớ trải xuống */
#header .header-nav .has-dropdown:hover > .nav-dropdown.nav-dropdown-default,
#header .header-nav .has-dropdown.current-dropdown > .nav-dropdown.nav-dropdown-default {
  animation: ldd-so-mo .35s ease-out;
}
@keyframes ldd-so-mo {
  from { opacity: 0; clip-path: inset(0 0 100% 0); }
  to   { opacity: 1; clip-path: inset(-20px -20px -20px -20px); }
}


/* ---------------------------------------------------------------------
   2. MOBILE – KHUNG MENU TRƯỢT TRÁI
   --------------------------------------------------------------------- */

/* nền mờ phía sau */
.off-canvas.mfp-bg.mfp-ready,
.mfp-bg.off-canvas {
  background: rgba(18,46,36,.55);
  opacity: 1;
  backdrop-filter: blur(2px);
}

/* khung menu */
.off-canvas-left .mfp-content {
  width: min(86vw, 360px);
  background:
    radial-gradient(ellipse 80% 40% at 100% 0%, rgba(242,162,27,.16), rgba(242,162,27,0) 70%),
    #f6eddb;
  box-shadow: 20px 0 50px -20px rgba(18,46,36,.5);
}
.off-canvas .mobile-sidebar { padding: 0; }
.off-canvas .mobile-sidebar .sidebar-menu {
  position: relative;
  padding: 96px 0 28px !important;
  text-align: left;
  transform: none !important;   /* tắt kiểu trượt trang con của Flatsome */
}

/* logo + đường kẻ đầu menu */
.off-canvas .mobile-sidebar .sidebar-menu::before {
  content: "";
  position: absolute;
  top: 24px;
  left: 24px;
  width: 190px;
  height: 46px;
  background: url("/wp-content/uploads/2026/10/PHONG-THUY-DONG-DUONG-2.webp") left center / contain no-repeat;
}
.off-canvas .mobile-sidebar .sidebar-menu::after {
  content: "";
  position: absolute;
  top: 86px;
  left: 24px;
  right: 24px;
  height: 1px;
  background: linear-gradient(90deg, rgba(176,132,52,.55), rgba(176,132,52,0));
}

/* nút đóng X – nền kem sáng, nổi trên lớp phủ */
.off-canvas .mfp-close {
  top: 18px !important;
  right: 14px !important;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(201,120,10,.55);
  background: #fbf3df !important;
  color: #1d4a3a !important;
  box-shadow: 0 8px 20px -6px rgba(0,0,0,.45);
  opacity: 1 !important;
  mix-blend-mode: normal;
}
.off-canvas .mfp-close:hover { background: #f2a21b !important; }

/* ẩn phần tử mẫu của Flatsome */
.off-canvas .nav-sidebar > li:has(> .element-error),
.off-canvas .nav-sidebar > li.header-newsletter-item,
.off-canvas .nav-sidebar > li.header-social-icons,
.off-canvas .nav-sidebar > li.header-divider,
.off-canvas .nav-slide .nav-slide-header { display: none !important; }


/* ---------------------------------------------------------------------
   3. MOBILE – MỤC CẤP 1
   --------------------------------------------------------------------- */
.off-canvas .nav-sidebar.nav-vertical > li { position: relative; border: 0 !important; }
.off-canvas .nav-sidebar.nav-vertical > li.menu-item > a {
  position: relative;
  display: flex;
  align-items: center;
  padding: 15px 24px 15px 46px !important;
  border-bottom: 1px solid rgba(176,132,52,.18);
  font-family: "Playfair Display", Georgia, serif;
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: #1d4a3a;
  transition: background-color .2s, color .2s;
}
/* hạt thoi đầu dòng */
.off-canvas .nav-sidebar.nav-vertical > li.menu-item > a::before {
  content: "";
  position: absolute;
  left: 24px;
  top: 50%;
  width: 7px;
  height: 7px;
  border: 1px solid #c9780a;
  transform: translateY(-50%) rotate(45deg);
  opacity: 1;
}
/* mũi tên phải (mục không có menu con) */
.off-canvas .nav-sidebar.nav-vertical > li.menu-item:not(.has-child) > a::after {
  content: "›";
  margin-left: auto;
  font-family: system-ui, sans-serif;
  font-size: 22px;
  color: rgba(29,74,58,.35);
}
.off-canvas .nav-sidebar.nav-vertical > li.menu-item > a:hover,
.off-canvas .nav-sidebar.nav-vertical > li.menu-item > a:active { background: rgba(242,162,27,.1); }
.off-canvas .nav-sidebar.nav-vertical > li.current-menu-item:not(.has-child) > a { color: #c9780a; }
.off-canvas .nav-sidebar.nav-vertical > li.current-menu-item:not(.has-child) > a::before { background: #f2a21b; border-color: #f2a21b; }

/* mục cha có menu con: bấm cả dòng để mở/đóng */
.off-canvas .nav-sidebar > li.has-child > .toggle {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: auto !important;
  height: 60px;
  margin: 0 !important;
  padding: 0 22px 0 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  border: 0;
  background: none;
  box-shadow: none;
  opacity: 1;
  color: rgba(29,74,58,.45);
}
.off-canvas .nav-sidebar > li.has-child > .toggle i { font-size: 20px; transition: transform .25s ease; }
.off-canvas .nav-sidebar > li.has-child.ldm-open > .toggle i { transform: rotate(90deg); color: #c9780a; }
.off-canvas .nav-sidebar > li.has-child.ldm-open > a { color: #c9780a; background: rgba(242,162,27,.1); }
.off-canvas .nav-sidebar > li.has-child.ldm-open > a::before { background: #f2a21b; border-color: #f2a21b; }

/* hiệu ứng mục hiện lần lượt khi mở menu */
.off-canvas.mfp-ready .nav-sidebar > li.menu-item { animation: ldm-in .35s ease-out backwards; }
.off-canvas.mfp-ready .nav-sidebar > li.menu-item:nth-child(2) { animation-delay: .04s; }
.off-canvas.mfp-ready .nav-sidebar > li.menu-item:nth-child(3) { animation-delay: .08s; }
.off-canvas.mfp-ready .nav-sidebar > li.menu-item:nth-child(4) { animation-delay: .12s; }
.off-canvas.mfp-ready .nav-sidebar > li.menu-item:nth-child(5) { animation-delay: .16s; }
.off-canvas.mfp-ready .nav-sidebar > li.menu-item:nth-child(6) { animation-delay: .2s; }
@keyframes ldm-in { from { opacity: 0; transform: translateX(-14px); } }


/* ---------------------------------------------------------------------
   4. MOBILE – MENU CON XỔ XUỐNG (accordion)
   --------------------------------------------------------------------- */
.off-canvas .nav-slide > li > .sub-menu,
.off-canvas .nav-slide > li > ul.children {
  position: static !important;
  display: none !important;
  width: auto !important;
  top: auto !important;
  bottom: auto !important;
  left: auto !important;
  padding: 6px 0 14px 46px !important;
  overflow: visible !important;
  background: rgba(255,251,242,.6);
  border-bottom: 1px solid rgba(176,132,52,.18);
}
.off-canvas .nav-slide > li.ldm-open > .sub-menu,
.off-canvas .nav-slide > li.ldm-open > ul.children {
  display: block !important;
  animation: ldm-xo .3s ease-out;
}
@keyframes ldm-xo { from { opacity: 0; transform: translateY(-6px); } }

/* tiêu đề nhóm (Tư vấn phong thủy, Hóa giải…) */
.off-canvas .nav-slide > li > .sub-menu > li:not(.nav-slide-header) { display: block !important; margin: 0 !important; border: 0 !important; }
.off-canvas .nav-slide > li > .sub-menu > li > a {
  position: relative;
  display: block;
  padding: 14px 18px 8px 0 !important;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 13px !important;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase !important;
  color: #9a4a2c !important;
}
.off-canvas .nav-slide > li > .sub-menu > li > a::after {
  content: "";
  display: block;
  width: 36px;
  height: 2px;
  margin-top: 7px;
  background: #f2a21b;
}

/* các dòng mục con */
.off-canvas .nav-slide > li > .sub-menu > li > .sub-menu {
  position: static !important;
  display: block !important;
  left: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0;
  background: none;
  transform: none !important;
  opacity: 1 !important;
}
.off-canvas .nav-slide > li > .sub-menu > li > .sub-menu > li { display: block; margin: 0 !important; border: 0 !important; }
.off-canvas .nav-slide > li > .sub-menu > li > .sub-menu > li > a {
  position: relative;
  display: block;
  padding: 9px 18px !important;
  border-bottom: 1px dashed rgba(154,112,40,.3);
  font-family: "Playfair Display", Georgia, serif;
  font-size: 15px !important;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0;
  text-transform: none !important;
  color: #1d4a3a !important;
}
.off-canvas .nav-slide > li > .sub-menu > li > .sub-menu > li:last-child > a { border-bottom: 0; }
.off-canvas .nav-slide > li > .sub-menu > li > .sub-menu > li > a::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border: 1px solid #c9780a;
  transform: rotate(45deg);
  opacity: 1;
}
.off-canvas .nav-slide > li > .sub-menu > li > .sub-menu > li > a:active { color: #9a4a2c !important; background: rgba(242,162,27,.1); }
.off-canvas .nav-slide > li > .sub-menu > li > .sub-menu > li > a:active::before { background: #f2a21b; border-color: #f2a21b; }


/* ---------------------------------------------------------------------
   5. MOBILE – KHỐI HTML CUỐI MENU (nút lập lá số + liên hệ)
   --------------------------------------------------------------------- */
.off-canvas .nav-sidebar > li.html { padding: 0 !important; border: 0 !important; }
.ldm { padding: 22px 24px 8px; font-family: "Be Vietnam Pro", system-ui, sans-serif; text-align: left; }
.ldm a { text-decoration: none; }
.ldm__cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px 14px 20px;
  border-radius: 999px;
  background: #1d4a3a;
  color: #faf6ea !important;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 14px 28px -14px rgba(29,74,58,.8);
}
.ldm__cta span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #f2a21b;
  color: #1d4a3a;
  font-size: 16px;
}
.ldm__card {
  margin-top: 18px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(176,132,52,.28);
  background: rgba(255,251,242,.85);
}
.ldm__k { font-size: 11px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: #c9780a; }
.ldm__phone { display: block; margin-top: 4px; font-family: "Playfair Display", Georgia, serif; font-size: 24px; color: #1d4a3a !important; }
.ldm__btns { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ldm__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border-radius: 12px;
  border: 1px solid rgba(29,74,58,.25);
  color: #1d4a3a !important;
  font-size: 14px;
  font-weight: 600;
}
.ldm__btn--zalo { background: #0068ff; border-color: #0068ff; color: #fff !important; }
.ldm__btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ldm__addr { margin-top: 12px; font-size: 12.5px; line-height: 1.55; color: rgba(29,74,58,.72); }


/* ---------------------------------------------------------------------
   6. GIẢM CHUYỂN ĐỘNG
   --------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  #header .header-nav .nav-dropdown.nav-dropdown-default,
  .off-canvas .nav-sidebar > li.menu-item,
  .off-canvas .nav-slide > li > .sub-menu { animation: none !important; }
}
