/* ============================================================
   Architerra Mega Menu — mega-menu.css
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --amm-navy:      #063655;
  --amm-navy-dk:   #042840;
  --amm-gold:      #be9936;
  --amm-gold-dk:   #a8862e;
  --amm-border:    #e8ecef;
  --amm-bg:        #f7f8fa;
  --amm-text:      #063655;
  --amm-muted:     #9ca3af;
  --amm-icon:      #015b97;
  --amm-white:     #ffffff;
  --amm-sidebar-w: 240px;
}

/* ── REALHOMES STACKING CONTEXT FIX ─────────────────────── */
/*
 * RealHomes wraps all page content in .rh_wrap with position:relative; z-index:0
 * This creates a stacking context that traps our position:fixed panels behind
 * Elementor page content. Removing z-index collapses the context so our panels
 * paint correctly above all page content.
 *
 * Also suppresses modern variation header elements that may still render.
 * The child theme partial override prevents the native header from loading,
 * but these rules act as a safety net for any edge cases.
 */
.rh_wrap { z-index: auto !important; }

/* Modern variation — safety net selectors */
.rh_long_screen_header_temp,
.rh_responsive_header_temp,
.rh_mod_sticky_header,
.rhea_long_screen_header_temp,
.rhea-sticky-header,
.rhea-mobile-sticky-header,
.rh_header_var_1,
.rh_header_var_2,
.rh_header_var_3,
.rh_header_var_4 { display: none !important; }

/* Ultra variation — safety net selectors */
.rh_header, #rh-main-header, .main-header-wrap,
.inspiry-header, .rh-ultra-header, .rh-modern-header,
.rh-sticky-active, #rh-sticky-header,
.sticky-header-wrap, .ultra-main-header { display: none !important; }

/* ── ADMIN BAR OFFSET ────────────────────────────────────── */
/* Keeps our sticky header below the WP admin bar when logged in */
.admin-bar #amm-header { top: 32px; }
@media screen and (max-width: 782px) {
  .admin-bar #amm-header { top: 46px; }
}

/* Top bar removed — see header-output.php */

/* ── TOP BAR — currently hidden, uncomment to restore ────── */
/*
.amm-topbar { background: var(--amm-navy); height: 36px; display: flex; align-items: center; }
.amm-topbar-inner { width: 100%; padding: 0 40px; display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 13px; font-family: 'Montserrat', sans-serif; color: var(--amm-white); }
.amm-topbar-phone { display: flex; align-items: center; gap: 6px; color: var(--amm-white); text-decoration: none; font-weight: 500; }
.amm-topbar-phone strong { font-weight: 700; }
.amm-topbar-sep { color: rgba(255,255,255,0.35); }
.amm-topbar-cta { color: var(--amm-white); text-decoration: none; font-weight: 500; transition: opacity 0.15s; }
.amm-topbar-cta:hover { opacity: 0.8; text-decoration: underline; }
*/

/* ── MAIN HEADER ─────────────────────────────────────────── */
#amm-header {
  background: var(--amm-white);
  height: 81px;
  border-bottom: 1px solid var(--amm-border);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: box-shadow 0.2s ease;
  font-family: 'Montserrat', sans-serif;
}
#amm-header.scrolled {
  box-shadow: 0 2px 8px rgba(6,54,85,0.08);
}
.amm-header-inner {
  padding: 0 40px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.amm-logo img {
  max-width: 300px;
  width: 100%;
  height: auto;
  display: block;
}
.amm-logo a { display: block; line-height: 0; }

/* ── NAV ─────────────────────────────────────────────────── */
.amm-nav {
  display: flex;
  align-items: center;
  height: 100%;
}
.amm-nav-item {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 28px 24px;
  height: 81px;
  font-size: 14px;
  font-weight: 500;
  color: var(--amm-navy);
  letter-spacing: 0.2px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s, color 0.15s;
  user-select: none;
  white-space: nowrap;
}
.amm-nav-item.is-active { border-bottom-color: var(--amm-navy); }
.amm-chevron { display: flex; align-items: center; transition: transform 0.2s ease; }
.amm-nav-item.is-active .amm-chevron { transform: rotate(180deg); }

/* ── HEADER ACTIONS ──────────────────────────────────────── */
.amm-actions { display: flex; align-items: center; gap: 16px; }
.amm-cta {
  display: inline-flex;
  align-items: center;
  background: var(--amm-gold);
  color: var(--amm-white);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 12px 24px;
  border-radius: 6px;
  transition: background 0.15s;
  white-space: nowrap;
  font-family: 'Montserrat', sans-serif;
}
.amm-cta:hover { background: var(--amm-gold-dk); color: var(--amm-white); }

/* Hamburger — hidden on desktop */
.amm-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none !important;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: background 0.15s;
  color: var(--amm-navy) !important;
}
.amm-hamburger:hover { background: var(--amm-bg); }
.amm-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--amm-navy);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
  transform-origin: center;
}

/* ── MEGA PANELS ─────────────────────────────────────────── */
#amm-panels-wrap { position: static; }

.amm-panel {
  display: none;
  position: fixed;
  left: 0;
  width: 100vw;
  background: var(--amm-white);
  box-shadow: 0 12px 40px rgba(6,54,85,0.12), 0 4px 12px rgba(6,54,85,0.06);
  border-top: 1px solid var(--amm-border);
  z-index: 9999;
  font-family: 'Montserrat', sans-serif;
}
.amm-panel.is-open { display: block; }

/* Panel inner containers */
.amm-panel-inner,
.amm-cards-inner {
  display: block;
  width: 100%;
}
.amm-panel-row {
  display: flex;
  width: 100%;
}
.amm-content-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 28px 40px;
  min-width: 0;
}
.amm-content-row {
  display: flex;
  flex: 1;
  gap: 40px;
  align-items: flex-start;
  min-height: 240px;
}
.amm-panel-content { flex: 1; min-width: 0; }

/* ── SIDEBAR ─────────────────────────────────────────────── */
.amm-sidebar {
  width: var(--amm-sidebar-w);
  min-width: var(--amm-sidebar-w);
  background: var(--amm-navy);
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.amm-sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.amm-sidebar-item:hover {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.9);
}
.amm-sidebar-item.is-active {
  background: rgba(255,255,255,0.12);
  color: var(--amm-white);
  font-weight: 600;
  border-left-color: var(--amm-gold);
}
.amm-si-label { flex: 1; }
.amm-si-arrow { opacity: 0; transition: opacity 0.12s; }
.amm-sidebar-item.is-active .amm-si-arrow { opacity: 1; }
.amm-sidebar-link {
  display: block;
  color: var(--amm-gold);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 16px 24px;
  margin-top: auto;
}
.amm-sidebar-link:hover { text-decoration: underline; }

/* ── CONTENT TABS ────────────────────────────────────────── */
.amm-tab { display: none; }
.amm-tab.is-active { display: block; }

.amm-tab-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amm-muted);
  margin-bottom: 20px;
}

/* Location cards */
.amm-location-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--amm-text);
  transition: background 0.15s;
  margin-bottom: 8px;
}
.amm-location-card:hover { background: var(--amm-bg); color: var(--amm-text); }
.amm-lc-icon { color: var(--amm-icon); flex-shrink: 0; }
.amm-location-card strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--amm-navy);
  margin-bottom: 2px;
}
.amm-location-card span { font-size: 13px; color: var(--amm-muted); }

/* Communities grid */
.amm-communities-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  height: 100%;
}
.amm-community-col { padding-right: 28px; }
.amm-community-col + .amm-community-col {
  padding-left: 28px;
  border-left: 1px solid var(--amm-border);
}
.amm-community-col-header {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
  color: var(--amm-icon);
}
.amm-col-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amm-muted);
}
.amm-community-link {
  display: block;
  font-size: 14px;
  color: var(--amm-navy);
  text-decoration: none;
  padding: 7px 0;
}
.amm-community-link:hover { color: var(--amm-gold); }

/* Collection cards */
.amm-collection-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--amm-navy);
  transition: background 0.15s;
  margin-bottom: 6px;
}
.amm-collection-card:hover { background: var(--amm-bg); }
.amm-cc-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--amm-bg);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--amm-icon);
}
.amm-cc-title { font-size: 15px; font-weight: 600; color: var(--amm-navy); display: block; margin-bottom: 2px; }
.amm-cc-price { font-size: 13px; font-weight: 500; color: rgb(107,114,128); }

/* Floor plans tab */
.amm-fp-title { font-size: 22px; font-weight: 700; color: var(--amm-navy); margin-bottom: 12px; }
.amm-fp-desc { font-size: 14px; color: rgb(107,114,128); line-height: 1.6; max-width: 520px; margin-bottom: 24px; }

/* ── PHOTO PANEL ─────────────────────────────────────────── */
.amm-photo { width: 308px; min-width: 308px; flex-shrink: 0; }
.amm-photo img { width: 100%; height: 200px; object-fit: cover; border-radius: 8px; display: block; }

/* ── ICON CARDS (panels B & C) ───────────────────────────── */
.amm-cards-content {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  align-content: start;
}
.amm-icon-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--amm-text);
  transition: background 0.15s;
}
.amm-icon-card:hover { background: var(--amm-bg); }
.amm-ic-icon { color: var(--amm-icon); flex-shrink: 0; margin-top: 1px; }
.amm-icon-card strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--amm-navy);
  margin-bottom: 5px;
}
.amm-icon-card p { font-size: 13px; color: var(--amm-muted); line-height: 1.5; margin: 0; }

/* ── PANEL FOOTER ────────────────────────────────────────── */
.amm-panel-footer {
  border-top: 1px solid var(--amm-border);
  padding: 20px 0 0;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

/* ── BUTTONS ─────────────────────────────────────────────── */
.amm-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 6px;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.amm-btn-navy { background: var(--amm-navy); color: var(--amm-white); }
.amm-btn-navy:hover { background: var(--amm-navy-dk); color: var(--amm-white); }
.amm-btn-gold { background: var(--amm-gold); color: var(--amm-white); }
.amm-btn-gold:hover { background: var(--amm-gold-dk); color: var(--amm-white); }

/* ── MOBILE MENU ─────────────────────────────────────────── */
#amm-mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 320px;
  max-width: 100vw;
  height: 100%;
  background: var(--amm-white);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(6,54,85,0.15);
  transition: right 0.3s ease;
  font-family: 'Montserrat', sans-serif;
  overflow-y: auto;
}
#amm-mobile-menu.is-open { right: 0; }

#amm-mob-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(6,54,85,0.45);
  z-index: 9999;
}
#amm-mob-overlay.is-visible { display: block; }

/* Mobile header bar */
.amm-mob-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--amm-border);
  flex-shrink: 0;
}
.amm-mob-header .amm-logo img { max-height: 40px; }
.amm-mob-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--amm-navy) !important;
  border-radius: 6px;
  transition: background 0.15s;
  display: flex;
  align-items: center;
}
.amm-mob-close:hover { background: var(--amm-bg); }

/* Mobile nav groups */
.amm-mob-nav { flex: 1; overflow-y: auto; }
.amm-mob-group { border-bottom: 1px solid var(--amm-border); }

.amm-mob-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: none;
  border: none;
  font-size: 15px;
  font-weight: 600;
  color: var(--amm-navy) !important;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
  text-align: left;
}
.amm-mob-toggle:hover { background: var(--amm-bg); }

.amm-mob-arrow {
  display: flex;
  align-items: center;
  transition: transform 0.2s ease;
  flex-shrink: 0;
  color: var(--amm-muted);
}
.amm-mob-toggle[aria-expanded="true"] .amm-mob-arrow {
  transform: rotate(90deg);
}

/* Accordion submenu */
.amm-mob-submenu {
  display: none;
  padding: 0 20px 12px;
}
.amm-mob-submenu.is-open { display: block; }

.amm-mob-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amm-muted);
  padding: 12px 0 6px;
}
.amm-mob-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  font-size: 14px;
  color: var(--amm-navy);
  text-decoration: none;
  border-bottom: 1px solid var(--amm-border);
}
.amm-mob-link:last-child { border-bottom: none; }
.amm-mob-link:hover { color: var(--amm-gold); }
.amm-mob-link svg { color: var(--amm-icon); flex-shrink: 0; }

/* Simple links (no accordion) */
.amm-mob-plain-link {
  display: block;
  padding: 18px 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--amm-navy);
  text-decoration: none;
  border-bottom: 1px solid var(--amm-border);
}
.amm-mob-plain-link:hover { background: var(--amm-bg); }

/* Mobile footer */
.amm-mob-footer {
  padding: 20px;
  border-top: 1px solid var(--amm-border);
  flex-shrink: 0;
}
.amm-mob-footer .amm-cta {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-bottom: 16px;
}
.amm-mob-phone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  color: var(--amm-muted);
  text-decoration: none;
}
.amm-mob-phone:hover { color: var(--amm-navy); }
.amm-mob-phone strong { color: var(--amm-navy); font-weight: 600; }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .amm-nav,
  .amm-cta { display: none !important; }

  .amm-hamburger { display: flex; }

  .amm-header-inner { padding: 0 20px; }

}

/* ── REALHOMES / ELEMENTOR BUTTON OVERRIDE ───────────────── */
/*
 * RealHomes main.css and Elementor kit CSS both set color:white on all
 * <button> elements globally. These rules restore correct colors for
 * our mobile menu buttons which use <button> tags.
 */
#amm-hamburger,
#amm-hamburger span,
#amm-mob-close,
.amm-mob-toggle,
.amm-mob-toggle .amm-mob-arrow {
  color: var(--amm-navy) !important;
}
#amm-hamburger span {
  background: var(--amm-navy) !important;
}
#amm-hamburger,
#amm-mob-close,
.amm-mob-toggle {
  background: transparent !important;
}
#amm-hamburger:hover,
#amm-mob-close:hover,
.amm-mob-toggle:hover {
  background: var(--amm-bg) !important;
}
