/* ================================================================
   4RAU — Site Header (3-Layer Desktop Structure)
   Layer 1 : .site-topbar      — thin info bar (dark green)
   Layer 2 : .site-header-main — logo + search + actions (gradient)
   Layer 3 : .site-navbar      — navigation (white)
   Mobile  : .header-mobile    — giữ nguyên (style.css)
================================================================ */

/* ── 1. TOP INFO BAR ──────────────────────────────────────── */

.site-topbar {
  background: var(--cp-primary);
  /* no border-bottom — Layer 1 & 2 flow into each other seamlessly */
  position: relative;
  z-index: 1002;
}

.site-topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 36px;
}

.site-topbar__left {
  display: flex;
  align-items: center;
  gap: 0;
}

.site-topbar__center {
  flex: 1;
  text-align: center;
  font-size: 11.5px;
  font-weight: 600;
  color: rgba(255,255,255,.9);
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-topbar__right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* Info links (left) */
.topbar-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 12px;
  height: 36px;
  font-size: 11.5px;
  font-weight: 500;
  color: rgba(255,255,255,.82);
  text-decoration: none;
  border-right: 1px solid rgba(255,255,255,.12);
  transition: color .15s ease;
}

.topbar-link:first-child {
  padding-left: 0;
}

.topbar-link:last-child {
  border-right: none;
}

.topbar-link:hover {
  color: #fff;
  text-decoration: none;
}

.topbar-link i {
  font-size: 11px;
  opacity: .8;
}

/* Language button (right) */
.topbar-lang {
  position: relative;
}

.topbar-lang__btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  height: 28px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 4px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease;
}

.topbar-lang__btn:hover,
.topbar-lang__btn.show {
  background: rgba(255,255,255,.18);
  color: #fff;
  text-decoration: none;
}

.topbar-lang__btn::after { display: none; } /* remove BS caret */

.topbar-lang__btn img.emoji {
  width: 16px; height: 12px;
  border-radius: 2px;
  object-fit: cover;
  display: block;
}

.topbar-lang__btn i {
  font-size: 10px;
  opacity: .7;
}

.topbar-lang .dropdown-menu {
  min-width: 140px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  padding: 4px 0;
  margin-top: 6px !important;
  z-index: 1050 !important;
}

.topbar-lang .dropdown-menu .dropdown-item {
  font-size: 13px;
  padding: 8px 14px;
  font-weight: 500;
}

.topbar-lang .dropdown-menu .dropdown-item:hover {
  background: var(--cp-green-pale);
  color: var(--cp-primary);
}


/* ── 2. MAIN HEADER (Logo + Search + Actions) ─────────────── */

.site-header-main {
  background: var(--cp-gradient);
  position: sticky;
  top: 0;
  z-index: 1000;
  /* no shadow — layers connect seamlessly; navbar border-bottom handles separation from page */
}

.site-header-main__inner {
  display: grid;
  grid-template-columns: 190px 1fr auto;
  align-items: center;
  gap: 20px;
  height: 68px; /* exact height — Layer 3 sticks at top:68px must match */
}

/* Logo */
.site-header-main__logo a {
  display: inline-block;
}

.site-header-main__logo img {
  height: 40px;
  width: auto;
  display: block;
  object-fit: contain;
  filter: brightness(0) invert(1); /* white on dark bg */
  transition: opacity .15s ease;
}

.site-header-main__logo a:hover img {
  opacity: .85;
}

/* Search bar */
.site-header-main__search {
  position: relative;
}

.site-header-main__search form {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 9999px;
  overflow: hidden;
  /* no outer shadow — sits cleanly on gradient bg */
}

/* Icon inside left of search */
.site-header-main__search .search-icon-left {
  display: flex;
  align-items: center;
  padding: 0 4px 0 20px;
  color: #9ca3af;
  font-size: 14px;
  pointer-events: none;
  flex-shrink: 0;
}

.site-header-main__search input[type="search"] {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  padding: 13px 8px 13px 10px;
  font-family: var(--cp-font-body) !important;
  font-size: 13.5px;
  font-weight: 400;
  color: var(--cp-text-primary);
  -webkit-appearance: none;
}

.site-header-main__search input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.site-header-main__search input::placeholder {
  color: #b0b8c1;
  font-weight: 400;
}

.site-header-main__search .search-submit {
  background: var(--cp-primary);
  border: none;
  border-radius: 0 9999px 9999px 0;
  width: 48px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  transition: background .15s ease;
  flex-shrink: 0;
}

.site-header-main__search .search-submit:hover {
  background: var(--cp-primary-mid);
}

/* Autocomplete results */
.site-header-main__search ul.search-product {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  z-index: 600;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  list-style: none;
  padding: 0; margin: 0;
  overflow: hidden;
}

/* Actions row */
.site-header-main__actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hdr-action-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 9999px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
  -webkit-tap-highlight-color: transparent;
}

.hdr-action-btn:hover {
  background: rgba(255,255,255,.22);
  border-color: rgba(255,255,255,.35);
  color: #fff;
  text-decoration: none;
}

.hdr-action-btn .item-count {
  position: absolute;
  top: -5px; right: -5px;
  min-width: 18px; height: 18px;
  padding: 0 4px;
  border-radius: 9999px;
  background: #e53e00;
  border: 2px solid transparent;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}

/* User avatar */
.hdr-action-btn img.avatar {
  width: 28px; height: 28px;
  border-radius: 9999px;
  object-fit: cover;
  display: block;
}

/* Lang button in actions */
.hdr-action-lang {
  width: auto;
  min-width: 38px;
  padding: 0 10px;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
}

.hdr-action-lang::after { display: none; }

.hdr-action-lang img.emoji {
  width: 18px; height: 13px;
  border-radius: 2px;
  object-fit: cover;
  display: block;
}

/* Dropdown menus */
.site-header-main__actions .dropdown-menu {
  border-radius: 12px;
  border: 1px solid #eaeaea;
  box-shadow: 0 14px 34px rgba(0,0,0,.12);
  overflow: hidden;
  padding: 6px 0;
  margin-top: 10px !important;
}

.site-header-main__actions .dropdown-menu a,
.site-header-main__actions .dropdown-menu li > a {
  font-size: 13px;
  padding: 8px 16px;
  font-weight: 500;
  color: var(--cp-text-primary);
}

.site-header-main__actions .dropdown-menu a:hover {
  background: var(--cp-green-pale);
  color: var(--cp-primary);
}

/* Mini cart dropdown */
.mini-cart-dropdown {
  width: 320px !important;
  min-width: 320px;
  padding: 0 !important;
}

.mini-cart-dropdown .single-cart-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
}

.mini-cart-dropdown .cart-img {
  position: relative;
  width: 64px; height: 64px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #f3f4f6;
}

.mini-cart-dropdown .cart-img img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.mini-cart-dropdown .pro-quantity {
  position: absolute;
  top: -4px; right: -4px;
  width: 18px; height: 18px;
  border-radius: 9999px;
  background: var(--cp-primary);
  color: #fff;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}

.mini-cart-dropdown .cart-content {
  flex: 1; min-width: 0;
}

.mini-cart-dropdown .cart-content .title {
  font-size: 13px;
  font-weight: 600;
  color: var(--cp-text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mini-cart-dropdown .cart-content .title a {
  color: inherit; text-decoration: none;
}

.mini-cart-dropdown .cart-content .title a:hover {
  color: var(--cp-primary);
}

.mini-cart-dropdown .cart-price {
  gap: 6px;
  margin-top: 4px;
}

.mini-cart-dropdown .sale-price {
  font-size: 13px; font-weight: 700;
  color: var(--cp-sale);
}

.mini-cart-dropdown .regular-price {
  font-size: 12px;
  color: var(--cp-text-muted);
  text-decoration: line-through;
}

.mini-cart-dropdown .del-icon {
  color: #9ca3af; font-size: 13px;
  flex-shrink: 0;
  transition: color .15s;
}

.mini-cart-dropdown .del-icon:hover { color: #e53e00; }

.mini-cart-dropdown .product-total {
  padding: 10px 16px;
  border-top: 1px solid #f3f4f6;
}

.mini-cart-dropdown .cart-total {
  list-style: none; padding: 0; margin: 0;
  font-size: 13px; font-weight: 600;
  color: var(--cp-text-primary);
  display: flex; justify-content: space-between;
}

.mini-cart-dropdown .cart-total span {
  color: var(--cp-primary);
  font-weight: 700;
}

.mini-cart-dropdown .product-btn {
  padding: 10px 16px;
}

.mini-cart-dropdown .product-btn a {
  display: block; width: 100%;
  padding: 9px;
  text-align: center;
  background: var(--cp-primary) !important;
  border-color: var(--cp-primary) !important;
  border-radius: 8px;
  font-size: 13px; font-weight: 700;
  color: #fff !important;
  text-decoration: none;
  transition: background .15s;
}

.mini-cart-dropdown .product-btn a:hover {
  background: var(--cp-primary-mid) !important;
}

/* Empty cart */
.mini-cart-empty {
  padding: 28px 16px;
  text-align: center;
}

.mini-cart-empty img {
  width: 80px; height: auto;
  margin: 0 auto 10px;
  display: block;
  opacity: .65;
}

.mini-cart-empty span {
  font-size: 13px; color: var(--cp-text-muted);
}


/* ── 3. NAVIGATION BAR ────────────────────────────────────── */

.site-navbar {
  background: #fff;
  border-bottom: 1.5px solid #e5e7eb;
  position: sticky;
  top: 68px; /* height of site-header-main */
  z-index: 999;
}

.site-navbar__inner {
  display: flex;
  align-items: center;
  min-height: 50px;
  gap: 0;
}

/* All Categories Button — green bordered box (matches old website) */
.btn-all-cat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  height: auto;
  border: 1.5px solid var(--cp-primary);
  border-radius: 4px;
  background: transparent;
  color: var(--cp-primary);
  font-family: var(--cp-font-menu) !important;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
  flex-shrink: 0;
  margin-right: 8px;
}

.btn-all-cat:hover {
  background: var(--cp-green-pale);
  color: var(--cp-primary);
  text-decoration: none;
}

.btn-all-cat i {
  font-size: 14px;
}

/* Categories dropdown panel */
.all-cat-panel {
  position: absolute;
  top: 100%;
  left: 0;
  width: 260px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-top: 3px solid var(--cp-primary);
  border-radius: 0 0 10px 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,.10);
  z-index: 950;
  padding: 6px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}

.btn-all-cat-wrap:hover .all-cat-panel,
.btn-all-cat-wrap:focus-within .all-cat-panel,
.all-cat-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.all-cat-panel a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--cp-text-primary);
  text-decoration: none;
  transition: background .12s, color .12s, padding-left .12s;
}

.all-cat-panel a i {
  font-size: 10px;
  color: var(--cp-primary-light);
  flex-shrink: 0;
}

.all-cat-panel a:hover {
  background: var(--cp-green-pale);
  color: var(--cp-primary);
  padding-left: 26px;
  text-decoration: none;
}

/* Main Nav Links */
.site-navbar__nav {
  display: flex;
  align-items: stretch;
  flex: 1;
  height: 50px;
  overflow: hidden;
}

.site-navbar__nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0 clamp(10px, 1.1vw, 18px);
  font-family: var(--cp-font-menu) !important;
  font-size: clamp(11px, 0.76vw, 13px);
  font-weight: 500;
  color: #374151;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: .01em;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}

.site-navbar__nav-link:hover,
.site-navbar__nav-link.active {
  color: var(--cp-primary);
  border-bottom-color: var(--cp-primary);
  text-decoration: none;
}

/* Separator between links */
.site-navbar__nav-link + .site-navbar__nav-link::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  width: 1px; height: 14px;
  transform: translateY(-50%);
  background: #e5e7eb;
}

/* Special "HỎI BARBER" link */
.site-navbar__special {
  display: flex;
  align-items: center;
  padding: 0 0 0 12px;
  margin-left: auto;
  flex-shrink: 0;
  border-left: 1.5px solid #e5e7eb;
}

.btn-advisor-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: transparent;
  color: #e85d04;
  font-family: var(--cp-font-menu) !important;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1.5px solid #e85d04;
  border-radius: 4px;
  transition: all .18s ease;
  white-space: nowrap;
}

.btn-advisor-nav:hover {
  background: #e85d04;
  color: #fff;
  text-decoration: none;
}

.btn-advisor-nav i {
  font-size: 13px;
}


/* ── 4. MOBILE HEADER (override gradient) ─────────────────── */

/* Mobile header background uses green gradient */
.header-mobile {
  background: var(--cp-gradient) !important;
}

/* Mobile menu drawer background */
.header-mobile-menu {
  /* keep existing styles from style.css, just ensure z-index */
}

/* ── 5. STICKY BEHAVIOR ───────────────────────────────────── */

/* Khi scroll, top-bar không sticky, chỉ main-header + navbar sticky */
@media (min-width: 992px) {
  .site-header-main {
    position: sticky;
    top: 0;
    z-index: 1000;
  }

  .site-navbar {
    position: sticky;
    top: 68px;
    z-index: 999;
  }

  .site-topbar {
    position: relative; /* không sticky */
  }
}

/* ── 6. RESPONSIVE ────────────────────────────────────────── */

@media (max-width: 1199.98px) {
  .site-header-main__inner {
    grid-template-columns: 160px 1fr auto;
    gap: 14px;
    height: 68px; /* keep consistent */
  }

  .site-header-main__logo img {
    height: 36px;
  }
}

@media (max-width: 991.98px) {
  .site-topbar,
  .site-header-main,
  .site-navbar {
    display: none !important;
  }
}
