/* ============================================================
   page-header.css — Prestige Solutions Option B Header Upgrade
   Loaded by header.htm so upgrades apply site-wide immediately
   without touching page templates or breaking homepage dark bar.
   ============================================================ */

/* ---------- Desktop (≥992px) ---------- */
@media (min-width: 992px) {
  .header_cta_mob,
  .nav_sub_toggle { display: none !important; }

  /* Subtle chevron on top-level items that own a dropdown */
  .nav_has_mega:has(.mega_menu_panel) > a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
  }
  .nav_has_mega:has(.mega_menu_panel) > a .nav_chev {
    font-size: 11px;
    line-height: 1;
    opacity: 0.65;
    transition: transform 0.22s ease, color 0.22s ease, opacity 0.22s ease;
  }
  .nav_has_mega:hover > a .nav_chev,
  .nav_has_mega:focus-within > a .nav_chev,
  .nav_has_mega.active > a .nav_chev {
    color: var(--gold);
    opacity: 1;
  }
  .nav_has_mega:hover > a .nav_chev,
  .nav_has_mega:focus-within > a .nav_chev {
    transform: rotate(180deg);
  }

  /* Open dropdown on keyboard focus-within as well as hover */
  .nav_has_mega:focus-within > .mega_menu_panel {
    display: block !important;
    animation: navDrop 0.18s ease-out;
  }

  /* Refined standard dropdown panel */
  .mega_menu_panel.adaptive_panel {
    border: 1px solid rgba(20, 16, 11, 0.08);
    border-top: 2px solid var(--gold);
    border-radius: 0 0 10px 10px;
    box-shadow: 0 22px 52px -14px rgba(20, 16, 11, 0.22);
    padding: 8px;
    min-width: 230px;
  }
  .mega_menu_panel.adaptive_panel:not(.mega_rich) .mega_title {
    border-radius: 6px;
    padding: 9px 14px;
  }
  .mega_sub_list {
    border: 1px solid rgba(20, 16, 11, 0.08);
    border-top: 2px solid var(--gold);
    border-radius: 0 0 10px 10px;
    box-shadow: 0 22px 52px -14px rgba(20, 16, 11, 0.22);
    padding: 8px;
    margin-left: 6px;
  }
  /* Invisible bridge between level-2 and level-3 flyout so diagonal cursor movement stays open */
  .mega_sub_list::before {
    content: '';
    position: absolute;
    top: -10px;
    bottom: -10px;
    left: -14px;
    width: 14px;
  }
  .mega_col:focus-within > .mega_sub_list { display: block; }
  .mega_sub_list li a { border-radius: 6px; padding: 8px 14px; }

  /* ---------- Option B: Flagship 2-Column Solutions & Products Mega Menu ---------- */
  .mega_menu_panel.mega_rich {
    width: 620px;
    min-width: 620px;
    max-width: calc(100vw - 40px);
    left: -72px;
    padding: 0;
    overflow: hidden;
  }
  .mega_rich_grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
  }
  .mega_rich_col {
    padding: 18px 18px 14px;
  }
  .mega_rich_col + .mega_rich_col {
    border-left: 1px solid rgba(20, 16, 11, 0.07);
    background: #fcfbf8;
  }
  .mega_rich_head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px 10px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(200, 169, 106, 0.26);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #86672c;
  }
  .mega_rich_head span {
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: none;
    color: #8a8175;
    font-size: 11px;
  }
  .mega_rich_list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .mega_rich_link {
    display: block;
    padding: 8px 10px;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.16s ease, transform 0.16s ease;
  }
  .mega_rich_link b {
    display: block;
    font-size: 13.5px;
    font-weight: 650;
    color: #14100b;
    line-height: 1.3;
    transition: color 0.16s ease;
  }
  .mega_rich_link small {
    display: block;
    margin-top: 2px;
    font-size: 11.5px;
    line-height: 1.4;
    color: #6b7280;
    font-weight: 400;
  }
  .mega_rich_link:hover,
  .mega_rich_link.is_cur {
    background: rgba(200, 169, 106, 0.15);
  }
  .mega_rich_link:hover b,
  .mega_rich_link.is_cur b {
    color: #14100b;
  }
  .mega_rich_link.is_cur {
    box-shadow: inset 2px 0 0 var(--gold);
  }

  /* Quick sub-links (e.g. Stage Lighting / RCU / Luggage / Cetis / Bittel) */
  .mega_sub_pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 2px 10px 7px;
  }
  .mega_sub_pills a {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    background: #f5f1e8;
    border: 1px solid rgba(200, 169, 106, 0.32);
    font-size: 11px;
    font-weight: 600;
    color: #5c4820;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
  }
  .mega_sub_pills a:hover,
  .mega_sub_pills a.is_cur {
    background: #14100b;
    border-color: #14100b;
    color: #e5cfa0;
  }

  .mega_rich_foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 22px;
    background: #f7f4ec;
    border-top: 1px solid rgba(200, 169, 106, 0.22);
    font-size: 12px;
  }
  .mega_rich_foot a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.18s;
  }
  .mega_foot_all { color: #374151; }
  .mega_foot_all:hover { color: #14100b; }
  .mega_foot_cta { color: #86672c; }
  .mega_foot_cta:hover { color: #14100b; }

  /* Subtle gold rim on Get a Quote pill for refined luxury cohesion */
  .header_cta_btn {
    padding: 10px 20px;
    font-size: 13.5px;
    border-color: rgba(200, 169, 106, 0.45);
  }
}

/* Narrow desktop / landscape tablet spacing protection (992px–1180px) */
@media (min-width: 992px) and (max-width: 1180px) {
  .nav_main_item { margin: 0 9px; }
  .nav_main_item > a { font-size: 12px; letter-spacing: 0.9px; white-space: nowrap; }
  .header_cta_btn { padding: 9px 15px; font-size: 12.5px; }
  .mega_menu_panel.mega_rich { width: 556px; min-width: 556px; left: -96px; }
}

/* ---------- Clean Non-Overlapping Drop-Down Search Bar (Desktop) ---------- */
.header_search_drawer {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 9998;
  background: rgba(255, 255, 255, 0.98);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(200, 169, 106, 0.25);
  border-bottom: 1px solid rgba(20, 16, 11, 0.10);
  box-shadow: 0 18px 40px -14px rgba(20, 16, 11, 0.18);
  padding: 14px 0;
}
.header_search_drawer.is_open {
  display: block;
  animation: navDrop 0.18s ease-out;
}
.header_search_drawer_in {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.header_search_form {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 560px;
  background: #f6f4ef;
  border: 1.5px solid rgba(200, 169, 106, 0.42);
  border-radius: 999px;
  padding: 3px 4px 3px 16px;
  transition: border-color 0.2s, background 0.2s;
}
.header_search_form:focus-within {
  background: #fff;
  border-color: #14100b;
}
.header_search_form i {
  color: #86672c;
  font-size: 14px;
  margin-right: 10px;
  flex-shrink: 0;
}
.header_search_form .modern_search_input {
  width: auto;
  flex: 1;
  min-width: 0;
  height: 36px;
  border: 0;
  background: transparent;
  padding: 0 8px 0 0;
  font-size: 14px;
  color: #14100b;
}
.header_search_form .modern_search_btn {
  width: auto;
  height: 34px;
  padding: 0 18px;
  border-radius: 999px;
  background: #14100b;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.2s, color 0.2s;
}
.header_search_form .modern_search_btn:hover {
  background: var(--gold);
  color: #14100b;
}
.header_search_close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(20, 16, 11, 0.12);
  background: #fff;
  color: #4b5563;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: background 0.18s, color 0.18s;
}
.header_search_close:hover {
  background: #14100b;
  color: #fff;
}

/* ---------- Mobile (≤991px) ---------- */
@media (max-width: 991px) {
  .header_search_drawer { display: none !important; }
  .nav_chev { display: none !important; }

  /* Compact Quote pill in mobile top bar, cleanly clearing the hamburger button */
  .header_right_tool { padding-right: 40px; }
  .header_cta_mob {
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    border-radius: 999px;
    background: #14100b;
    border: 1px solid rgba(200, 169, 106, 0.6);
    color: #e5cfa0 !important;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
  }
  .header_cta_mob:hover {
    background: var(--gold);
    color: #14100b !important;
  }

  /* Split mobile parent row: link navigates directly, button toggles submenu */
  .nav_has_sub {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
  }
  .nav_has_sub > a {
    flex: 1;
    min-width: 0;
    display: block;
  }
  /* Remove old pseudo-chevron on <a> since .nav_sub_toggle owns the chevron now */
  .nav_has_sub > a::after { display: none !important; }
  .nav_sub_toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    margin-right: 6px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #6b7280;
    font-size: 19px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
  }
  .nav_sub_toggle i { transition: transform 0.24s ease; }
  .nav_has_sub.is_open > .nav_sub_toggle {
    background: rgba(200, 169, 106, 0.14);
    color: #86672c;
  }
  .nav_has_sub.is_open > .nav_sub_toggle i { transform: rotate(180deg); }
  .nav_has_sub > .mega_menu_panel { width: 100%; flex-basis: 100%; }

  /* Mobile Mega Menu (Option B) clean stacked layout */
  .mega_menu_panel.mega_rich {
    background: #faf8f4;
    padding: 8px 16px 14px;
    border-top: 1px solid rgba(200, 169, 106, 0.2);
  }
  .mega_rich_grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
  .mega_rich_col { padding: 0; }
  .mega_rich_head {
    padding: 4px 0 6px;
    margin-bottom: 6px;
    border-bottom: 1px solid rgba(200, 169, 106, 0.22);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #86672c;
  }
  .mega_rich_head span { display: none; }
  .mega_rich_list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .mega_rich_link {
    display: block;
    padding: 7px 6px;
    border-radius: 6px;
    text-decoration: none;
  }
  .mega_rich_link b {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: #14100b;
  }
  .mega_rich_link small { display: none; }
  .mega_rich_link.is_cur { background: rgba(200, 169, 106, 0.18); }

  .mega_sub_pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 2px 4px 8px;
  }
  .mega_sub_pills a {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid rgba(200, 169, 106, 0.36);
    font-size: 11.5px;
    font-weight: 600;
    color: #5c4820;
    text-decoration: none;
  }
  .mega_rich_foot {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(200, 169, 106, 0.22);
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    font-size: 12.5px;
  }
  .mega_rich_foot a {
    font-weight: 700;
    color: #86672c;
    text-decoration: none;
  }

  /* Fix missing display:flex on standard 3rd-level mobile submenu */
  .mega_sub_list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 7px;
    list-style: none;
    padding: 0;
    margin: 8px 0 2px;
  }
  .mega_sub_list li a {
    display: inline-flex;
    padding: 5px 10px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid rgba(200, 169, 106, 0.32);
    font-size: 12px;
    color: #374151;
    text-decoration: none;
  }
}

@media (max-width: 380px) {
  .header_cta_mob { padding: 6px 11px; font-size: 11.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .nav_has_mega:has(.mega_menu_panel) > a .nav_chev,
  .nav_sub_toggle i,
  .mega_rich_link { transition: none; }
}
