/* =========================================================
   Web Kit × Flatsome
   1. Trung hoà CSS nền của Flatsome bên trong các section .kit
   2. Header Flatsome theo phong cách kit (trong suốt trên hero, đặc lại khi cuộn)
   3. Footer / trang chung
   ========================================================= */

/* ---------- 1. Reset trong .kit (đứng trước các rule thành phần nhờ :where) ---------- */
.kit :where(p, ul, ol, li, dl, dt, dd, blockquote, figure, h1, h2, h3, h4, h5, h6, label, form) { margin: 0; }
.kit :where(ul, ol) { padding: 0; }
.kit :where(h1, h2, h3, h4, h5, h6) { width: auto; color: inherit; text-transform: none; }
.kit :where(h3) { font-size: inherit; font-weight: 600; }
.kit :where(h3, h4, h5, h6, p, li, button, input, select, textarea, label, blockquote, dt, dd) { font-family: inherit; }
.kit :where(blockquote) { border: 0; padding: 0; font-size: inherit; font-style: normal; color: inherit; }
.kit :where(dt, dd) { display: block; font-weight: inherit; text-transform: none; letter-spacing: normal; }
.kit :where(dl) { text-transform: none; letter-spacing: normal; font-size: inherit; line-height: inherit; }
.kit .field :is(input, select, textarea):not(:focus) { box-shadow: none; }
.kit :where(label) { font-size: inherit; display: inline; color: inherit; }
.kit :where(button) {
  margin: 0; padding: 1px 6px; min-height: 0; line-height: inherit; letter-spacing: normal; text-transform: none;
  font-weight: inherit; text-shadow: none; background: none; border: 0; border-radius: 0; color: inherit; max-width: none;
}
.kit :where(input, select, textarea) {
  height: auto; max-width: none; box-shadow: none; margin: 0; vertical-align: baseline; letter-spacing: normal;
  background-image: none; color: inherit;
}
.kit :where(a) { color: inherit; }
.kit :where(a:hover) { color: inherit; }
.kit :where(img) { vertical-align: baseline; }
.kit .btn { text-decoration: none; }
.kit .btn-brass, .kit .btn-brass:hover, .kit .btn-primary, .kit .btn-primary:hover { color: #fff; }
.kit em { font-style: italic; }
.kit .sc-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.kit dialog { color: var(--ink); }

/* Section xếp chồng trực tiếp, không có khoảng hở */
#content > .kit, .page-wrapper > .kit, .entry-content > .kit { margin: 0; }
.kit-hero.has-quick-book { background: var(--paper); }

/* ---------- 2. Header Flatsome ---------- */
body { font-family: var(--body); background: var(--paper); color: var(--ink); }
#wrapper, #main { background: var(--paper); }
.header-wrapper, #masthead { font-family: var(--body); }
#masthead .header-main { transition: background-color .3s, color .3s, box-shadow .3s; }
#logo img { max-height: 48px; width: auto; }
/* Khung header rộng như .sc-container của các section */
#masthead .header-inner { width: min(1200px, 100% - 40px); max-width: none; padding-inline: 0; }
@media (max-width: 760px) { #masthead .header-inner { width: calc(100% - 32px); } #logo img { max-height: 40px; } }

/* Menu chính */
.header-nav-main.nav > li > a {
  font-family: var(--body); font-size: .88rem; font-weight: 500; letter-spacing: 0; text-transform: none;
  padding-block: 6px; border-bottom: 1px solid transparent; transition: border-color .2s, color .2s;
}
.header-nav-main.nav > li { margin: 0 clamp(7px, 1.1vw, 15px); }
/* Menu toàn link neo (#…) nên WordPress đánh dấu "current" cho mọi mục → chỉ gạch chân khi rê chuột */
.header-nav-main.nav > li > a:hover { border-color: var(--accent); }
.header-nav-main.nav > li.active > a, .header-nav-main.nav > li.current-menu-item > a { color: inherit; }
body:not(.home) .header-nav-main.nav > li.current-menu-item > a { border-color: var(--accent); }

/* Header trên nền sáng (đã cuộn / trang con) */
.header-main { background-color: rgba(250, 246, 238, .94); color: var(--ink); }
.header-main .nav > li > a { color: var(--ink); }
.stuck .header-main, .header-main.stuck { backdrop-filter: blur(12px); box-shadow: 0 1px 0 var(--line); }

/* Header trong suốt trên hero (trang chủ) */
.transparent .header-main { background: transparent; }
.transparent:not(.stuck) .header-main,
.transparent:not(.stuck) .header-main .nav > li > a,
.transparent:not(.stuck) .kit-header-call { color: #fff; }
.transparent .header-wrapper:not(.stuck) .header-main .nav > li > a,
.header.transparent .header-wrapper:not(.stuck) .kit-header-call,
.header.transparent .header-wrapper:not(.stuck) .nav-icon a { color: #fff; }
.transparent .header-wrapper.stuck .header-main { background: rgba(250, 246, 238, .94); }

/* Hotline + nút Đặt phòng trong header */
.kit-header-call,
.header-nav-main.nav > li > a.kit-header-call { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9rem; text-decoration: none; white-space: nowrap; color: inherit; border: 0; padding: 0; }
.kit-header-call svg { width: 1em; height: 1em; }
/* Di động / máy tính bảng: chỉ còn icon, cùng cỡ với icon menu (24px) và vùng bấm 44px */
@media (max-width: 1020px) {
  .kit-header-call span { display: none; }
  .header-nav .kit-header-call, .mobile-nav .kit-header-call { justify-content: center; width: 44px; height: 44px; font-size: 16px; }
  .header-nav .kit-header-call svg, .mobile-nav .kit-header-call svg { width: 22px; height: 22px; }
  .mobile-nav > li.html_topbar_left { margin-right: 2px; }
}
/* Màn hình 850–1150px: header desktop của Flatsome còn hiện, thu gọn menu để không xuống dòng */
@media (min-width: 850px) and (max-width: 1150px) {
  .header-nav-main.nav > li { margin: 0 5px; }
  .header-nav-main.nav > li > a { font-size: .8rem; }
  #masthead .header-inner { width: calc(100% - 24px); }
  #logo img { max-height: 40px; }
  .header-button-1 .button { padding: 0 .9em; }
}
@media (min-width: 850px) and (max-width: 960px) {
  .header-nav-main.nav > li.html_topbar_left { display: none; }
}
.kit-header-call:hover { color: var(--accent); }
.header-button-1 .button, #masthead .header-button .button {
  border-radius: 999px; background: var(--accent); border-color: var(--accent); color: #fff;
  text-transform: none; letter-spacing: 0; font-weight: 600; font-size: .85rem; padding: 0 1.2em; min-height: 40px; height: 40px; line-height: 38px; margin: 0;
  box-shadow: 0 8px 22px rgba(185, 138, 68, .35);
}
.header-button-1 .button:hover, #masthead .header-button .button:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

/* Biểu tượng menu di động */
.nav-icon a, .mobile-nav .icon-menu { color: inherit; }

/* Menu trượt trên di động */
.off-canvas .mobile-sidebar, .mfp-content .mobile-sidebar { background: var(--paper); }
.off-canvas .nav-sidebar > li > a { font-family: var(--display); font-size: 1.2rem; text-transform: none; color: var(--ink); }

/* ---------- 3. Footer + chung ---------- */
.absolute-footer { display: none; }
.back-to-top { display: none !important; }
.footer-wrapper > .kit-footer { margin: 0; }
.kit .site-footer h3 { font-family: var(--body); }
.kit .site-footer a { color: inherit; }
.kit .site-footer a:hover { color: #fff; }

/* ---------- 4. Trang con ----------
   Bản HTML có header cố định nên dải tiêu đề / đầu trang chừa thêm --header-h.
   Ở Flatsome header nằm trong luồng trang, nên bỏ phần chừa đó. */
.kit .sc-banner { padding-top: 44px; }
.kit .sc-banner.has-cards { padding-bottom: 96px; }
.kit .page-room .page-head { padding-top: 28px; }
.kit .sc-banner .crumbs a { color: inherit; }
@media (max-width: 760px) {
  .kit .sc-banner { padding-top: 28px; }
}
/* Thẻ liên hệ chồng lên dải tiêu đề phía trên: nền trong suốt để thấy dải xanh */
.kit-contact { background: transparent; }
.kit-banner + .kit-contact, .kit-banner + * .kit-contact { position: relative; }
/* Thanh di động trên trang phòng: giá + nút */
@media (max-width: 760px) {
  .kit .mobile-bar.is-room { grid-template-columns: 1fr auto; align-items: center; }
}
.kit .page-post .post-banner h1 { max-width: 24ch; }

/* Trang Hình ảnh: lưới ảnh cùng phong cách bộ ảnh trang phòng */
.kit .photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: clamp(160px, 20vw, 260px); gap: 10px; }
.kit .photo-grid button { position: relative; padding: 0; border: 0; border-radius: 16px; overflow: hidden; background: var(--cream); cursor: zoom-in; }
.kit .photo-grid button:nth-child(6n + 1) { grid-column: span 2; grid-row: span 2; }
.kit .photo-grid img { width: 100%; height: 100%; object-fit: cover; transition: scale .5s; }
.kit .photo-grid button:hover img { scale: 1.04; }
.kit .photo-grid span { position: absolute; left: 12px; bottom: 12px; padding: .35em 1em; border-radius: 999px; background: rgba(14, 42, 34, .78); color: #fff; font-size: .74rem; }
@media (max-width: 760px) {
  .kit .photo-grid { grid-template-columns: 1fr 1fr; grid-auto-rows: 38vw; }
  .kit .photo-grid button:nth-child(6n + 1) { grid-column: 1 / -1; grid-row: span 1; height: auto; }
}
.kit [hidden] { display: none !important; }


/* ---------- 5. Ô chọn (select) trong form đặt phòng ----------
   Nội dung đang chọn nằm trong <button><selectedcontent>, nên nút này mới là phần tử co giãn:
   phải cho nó min-width: 0 thì chữ dài mới bị cắt bằng "…" thay vì tràn ra ngoài. */
.kit .select > button { flex: 1 1 auto; min-width: 0; overflow: hidden; display: block; padding: 0; text-align: start; font: inherit; color: inherit; background: none; border: 0; }
.kit .select selectedcontent { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kit .select selectedcontent .opt-meta { white-space: nowrap; }
.kit .qb-field, .kit .field { min-width: 0; }
.kit .quick-book .select { width: 100%; min-width: 0; }
/* Thanh đặt nhanh: không cần giá trong ô đã chọn (đã có trong danh sách) */
.kit .quick-book selectedcontent .opt-meta { display: none; }

/* Điện thoại nhỏ: mỗi ô một dòng để chữ không bị cắt */
@media (max-width: 480px) {
  .kit .quick-book { grid-template-columns: 1fr; }
  .kit .quick-book .qb-field { padding: 8px 14px; }
}

/* ---------- 6. Bảng chọn loại phòng (popover, cùng kiểu lịch / số khách) ---------- */
.kit .pop.room-pick .cal-hint { margin: 2px 2px 10px; }
.kit .room-opts { display: grid; gap: 6px; }
.kit .room-opt {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 20px; align-items: center; gap: 12px;
  width: 100%; min-height: 56px; padding: 10px 14px; text-align: start;
  border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink);
  transition: background-color .15s, border-color .15s;
}
.kit .room-opt:hover { background: var(--cream); }
.kit .room-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.kit .room-opt[aria-checked="true"] { background: var(--brand-100); border-color: var(--brand-700); }
.kit .ro-text { min-width: 0; }
.kit .ro-text b { display: block; font-weight: 600; font-size: .95rem; line-height: 1.3; }
.kit .ro-text small, .kit .ro-price small { display: block; font-size: .76rem; color: var(--muted); line-height: 1.3; }
.kit .ro-price { text-align: end; white-space: nowrap; }
.kit .ro-price b { font-family: var(--display); font-weight: 500; font-size: 1.05rem; color: var(--accent-dark); }
.kit .ro-check { width: 20px; height: 20px; color: var(--brand-700); visibility: hidden; }
.kit .room-opt[aria-checked="true"] .ro-check { visibility: visible; }
@media (min-width: 761px) { .kit .pop.room-pick { min-width: 360px; } }
/* Mũi tên xoay khi bảng đang mở (nút + 1 ô ẩn + bảng) */
.kit .ctl:has(+ input + :popover-open) .chev { rotate: 180deg; }

/* ---------- 7. Hero trên điện thoại: không rớt dòng ----------
   Cỡ chữ tính theo chiều rộng màn hình cho nội dung mặc định;
   app.js (fitHero) thu nhỏ thêm nếu nội dung sửa trong UX Builder dài hơn. */
.kit .hero h1 .h1-line { display: block; }
@media (max-width: 760px) {
  .kit .hero .hero-inner > .eyebrow {
    display: flex; width: max-content; max-width: none; white-space: nowrap;
    gap: .55em; letter-spacing: .12em; font-size: clamp(.6rem, 2.9vw, .72rem);
  }
  .kit .hero .hero-inner > .eyebrow::before { width: 18px; }
  .kit .hero .hero-inner > .eyebrow .sc-stars svg { width: .9em; height: .9em; }

  /* (100vw - 32px lề) ÷ độ dài dòng dài nhất (≈ 9,7 em với font Fraunces) → 0,102 */
  .kit .hero h1 { max-width: none; font-size: min(calc((100vw - 32px) * .102), 3.25rem); }
  .kit .hero h1 .h1-line { width: max-content; white-space: nowrap; }

  .kit .hero-cta { flex-wrap: nowrap; gap: 8px; }
  .kit .hero-cta .btn {
    flex: 1 1 0; min-width: 0; padding-inline: .8em; gap: .4em;
    font-size: clamp(.75rem, 3.65vw, .92rem); white-space: nowrap;
  }
}
@media (max-width: 359px) {
  .kit .hero-cta .btn svg { display: none; }
}

/* ---------- 8. Menu trượt trên điện thoại (off-canvas Flatsome) ---------- */
.off-canvas-right .mfp-content:not(.off-canvas-cart), .off-canvas-left .mfp-content:not(.off-canvas-cart) { --drawer-width: min(340px, 88vw); } /* Flatsome dùng biến này cho độ rộng + hiệu ứng trượt */
.off-canvas .mfp-content { background: var(--paper); }
.off-canvas #main-menu,
.off-canvas #main-menu .sidebar-menu { background: var(--paper); color: var(--ink); width: 100%; max-width: none; }
.off-canvas #main-menu .sidebar-menu { display: flex; flex-direction: column; min-height: 100%; padding: 0 0 24px; }
.off-canvas .mfp-close { display: none !important; } /* dùng nút đóng riêng trong đầu menu */
.off-canvas.mfp-bg, .mfp-bg.off-canvas { background: rgba(14, 42, 34, .55); opacity: 1; backdrop-filter: blur(3px); }

/* Đầu menu: logo + nút đóng */
.kit-menu-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 14px 20px; border-bottom: 1px solid var(--line); }
.kit-menu-head .smh-logo img { height: 44px; width: auto; display: block; }
.kit .smh-close {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 50%;
  border: 1px solid var(--line); background: var(--white); color: var(--brand-800); transition: background-color .2s, color .2s;
}
.kit .smh-close svg { width: 20px; height: 20px; }
.kit .smh-close:hover { background: var(--brand-800); color: #fff; }

/* Danh sách menu */
.off-canvas #main-menu .nav-sidebar { padding: 6px 20px 0; margin: 0; }
.off-canvas #main-menu .nav-sidebar > li { border-bottom: 1px solid var(--line); margin: 0; }
.off-canvas #main-menu .nav-sidebar > li > a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 2px; font-family: var(--display); font-size: 1.2rem; font-weight: 500;
  letter-spacing: -.005em; text-transform: none; color: var(--ink); transition: color .2s, padding .2s;
}
.off-canvas #main-menu .nav-sidebar > li > a::after {
  content: ""; flex: none; width: 18px; height: 18px; background: var(--accent); opacity: .55;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: opacity .2s, translate .2s;
}
.off-canvas #main-menu .nav-sidebar > li > a:hover { color: var(--accent-dark); }
.off-canvas #main-menu .nav-sidebar > li > a:hover::after { opacity: 1; translate: 3px 0; }
/* Mục của trang đang xem (bỏ qua các link neo "#…" của trang chủ vì WordPress đánh dấu tất cả) */
body:not(.home) .off-canvas #main-menu .nav-sidebar > li.current-menu-item > a { color: var(--accent-dark); }
body:not(.home) .off-canvas #main-menu .nav-sidebar > li.current-menu-item > a::after { opacity: 1; }
.off-canvas #main-menu .nav-sidebar .toggle { display: none; }

/* Cuối menu: nút + thông tin liên hệ */
.kit-menu-foot { margin-top: auto; padding: 22px 20px 0; }
.kit-menu-foot .smf-actions { display: grid; gap: 10px; }
.kit-menu-foot .btn { min-height: 50px; }
.kit-menu-foot .btn-ghost { color: var(--brand-800); background: var(--white); }
.kit-menu-foot .smf-info { list-style: none; margin: 20px 0 0; padding: 16px 0 0; border-top: 1px solid var(--line); display: grid; gap: 10px; font-size: .86rem; color: var(--muted); }
.kit-menu-foot .smf-info li { display: flex; gap: 10px; align-items: flex-start; margin: 0; }
.kit-menu-foot .smf-info svg { width: 18px; height: 18px; color: var(--accent-dark); flex: none; margin-top: 1px; }
.kit-menu-foot .smf-info a { color: var(--brand-700); text-decoration: none; font-weight: 500; }
.kit-menu-foot .smf-tagline { margin-top: 16px; font-family: var(--display); font-style: italic; font-size: 1rem; color: var(--accent-dark); }

/* Web chưa có logo: hiện tên bằng chữ */
.kit .logo-text { font-family: var(--display); font-size: 1.6rem; font-weight: 600; line-height: 1.1; margin: 0 0 18px; color: #fff; }
.kit-menu-head .logo-text { font-family: var(--display); font-size: 1.3rem; font-weight: 600; color: var(--ink); }
/* Header Flatsome khi chưa có logo (hiện tên web bằng chữ) */
#logo > a:not(:has(img)) { font-family: var(--display); font-size: 1.35rem; font-weight: 600; line-height: 1.1; text-transform: none; letter-spacing: 0; color: var(--ink); white-space: nowrap; }
.transparent #logo > a:not(:has(img)) { color: #fff; }
/* Header trong suốt trên hero: dùng logo cho nền tối (Flatsome › Logo › "Logo dark", kit seed lấy img/logo-dark.png) */
.header.transparent .header-wrapper:not(.stuck) #logo:has(.header-logo-dark) .header-logo { display: none !important; }
.header.transparent .header-wrapper:not(.stuck) #logo .header-logo-dark { display: block !important; }
