/* ============================================================
   RENSI MOBILE MEGA MENU
   Drill-down panel menu, only active at ≤980px
   ============================================================ */

/* ---- Show / hide ------------------------------------------ */
@media (min-width: 981px) {
  #rensi-header-btns,
  #rensi-mnav { display: none !important; }
}

@media (max-width: 980px) {
  /* Hide Divi's own hamburger + search */
  .mobile_nav,
  .et_pb_menu__mobile-trigger,
  #et_mobile_nav_menu,
  #et_top_search { display: none !important; }

  #rensi-header-btns { display: flex !important; }
}

/* ---- Button group (search + hamburger) -------------------- */
#rensi-header-btns {
  position: fixed;
  top: 43px;          /* ≤480px default: 32px bar + (60px header / 2) − (38px btn / 2) */
  right: 12px;
  z-index: 1000010;
  display: none;      /* shown via media query above */
  align-items: center;
  gap: 6px;
}

/* Header is fixed at top:32px (≤480px) or top:60px (481-980px) on all pages.
   Centre the buttons within the 60px header below the contact bar. */
@media (max-width: 480px) {
  #rensi-header-btns {
    top: 43px;   /* 32px bar + (60px header / 2) − (38px btn / 2) */
  }
  #rensi-search-bar {
    top: 92px;   /* 32px bar + 60px header */
  }
}

@media (min-width: 481px) and (max-width: 980px) {
  #rensi-header-btns {
    top: 71px;   /* 60px bar + (60px header / 2) − (38px btn / 2) */
  }
  #rensi-search-bar {
    top: 120px;  /* 60px bar + 60px header */
  }
}

/* Shared button style */
#rensi-search-trigger,
#rensi-mnav-trigger {
  width: 38px;
  height: 38px;
  background: var(--rensi-purple, #5b2068);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.2s;
  flex-shrink: 0;
}

#rensi-search-trigger:hover,
#rensi-search-trigger:focus-visible,
#rensi-mnav-trigger:hover,
#rensi-mnav-trigger:focus-visible {
  background: #7a2d96;
  outline: none;
}

/* Search icon */
#rensi-search-trigger svg {
  width: 18px;
  height: 18px;
  stroke: #fff;
}

/* Hamburger lines */
#rensi-mnav-trigger {
  flex-direction: column;
  gap: 5px;
}

#rensi-mnav-trigger span {
  display: block;
  width: 18px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
  transform-origin: center;
}

/* Animate to × when open */
#rensi-mnav-trigger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
#rensi-mnav-trigger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
#rensi-mnav-trigger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---- Full-screen overlay ---------------------------------- */
#rensi-mnav {
  position: fixed;
  inset: 0;
  z-index: 1000009;
  visibility: hidden;
  pointer-events: none;
}

#rensi-mnav.is-open {
  visibility: visible;
  pointer-events: auto;
}

/* Backdrop */
.rensi-mnav__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 0.3s ease;
  cursor: pointer;
}

#rensi-mnav.is-open .rensi-mnav__backdrop {
  opacity: 1;
}

/* ---- Drawer ----------------------------------------------- */
.rensi-mnav__drawer {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(320px, 88vw);
  background: #160820;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

#rensi-mnav.is-open .rensi-mnav__drawer {
  transform: translateX(0);
}

/* ---- Drawer header bar ------------------------------------ */
.rensi-mnav__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 60px;
  background: var(--rensi-purple, #5b2068);
  flex-shrink: 0;
}

.rensi-mnav__logo {
  height: 32px;
  width: auto;
  display: block;
}

.rensi-mnav__logo-text {
  color: #fff;
  font-family: var(--font-primary, sans-serif);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.rensi-mnav__close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.8);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rensi-mnav__close:hover {
  color: #fff;
  background: rgba(255,255,255,0.12);
}

/* ---- Panels container ------------------------------------- */
.rensi-mnav__panels {
  position: relative;
  flex: 1;
  overflow: hidden;
}

/* ---- Individual panel ------------------------------------- */
.rensi-mnav__panel {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
}

/* Root panel visible by default */
.rensi-mnav__panel--root {
  transform: translateX(0);
}

/* Active = slide to center */
.rensi-mnav__panel.is-active {
  transform: translateX(0) !important;
}

/* Prev = slide off to left */
.rensi-mnav__panel.is-prev {
  transform: translateX(-100%) !important;
}

/* ---- Sub-panel heading (parent category name + link) ------ */
.rensi-mnav__panel-head {
  display: flex;
  align-items: center;
  gap: 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}

.rensi-mnav__back {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.06);
  border: none;
  border-right: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.65);
  font-family: var(--font-primary, sans-serif);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 13px 14px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.rensi-mnav__back:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.rensi-mnav__back svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.rensi-mnav__panel-title {
  flex: 1;
  display: block;
  padding: 13px 16px;
  color: #fff;
  font-family: var(--font-primary, sans-serif);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s;
}

.rensi-mnav__panel-title:hover {
  color: var(--rensi-orange, #f39200);
}

/* ---- Menu list -------------------------------------------- */
.rensi-mnav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
}

.rensi-mnav__item {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.rensi-mnav__link {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 15px 18px;
  color: rgba(255,255,255,0.85);
  font-family: var(--font-primary, sans-serif);
  font-size: 0.98rem;
  font-weight: 500;
  text-decoration: none !important;
  transition: color 0.15s, background 0.15s;
  line-height: 1.3;
}

.rensi-mnav__link:hover,
.rensi-mnav__link:focus {
  color: #fff;
  background: rgba(255,255,255,0.05);
  outline: none;
}

/* ---- Arrow button (drill down) ---------------------------- */
.rensi-mnav__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  flex-shrink: 0;
  background: none;
  border: none;
  border-left: 1px solid rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.35);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  padding: 0;
}

.rensi-mnav__arrow:hover {
  background: rgba(255,255,255,0.07);
  color: var(--rensi-orange, #f39200);
}

.rensi-mnav__arrow svg {
  width: 18px;
  height: 18px;
}

/* ---- Custom mobile search bar ----------------------------- */
#rensi-search-bar {
  position: fixed;
  top: 112px;        /* just below the 112px divi header bottom */
  left: 0;
  right: 0;
  z-index: 1000008;
  background: #fff;
  border-bottom: 2px solid var(--rensi-purple, #5b2068);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  padding: 10px 12px;
  display: none;
  pointer-events: none;
  transform: translateY(-8px);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

#rensi-search-bar.is-open {
  display: flex;
  pointer-events: auto;
  transform: translateY(0);
  opacity: 1;
}

#rensi-search-bar form {
  display: flex;
  width: 100%;
  gap: 8px;
  align-items: center;
  margin: 0;
}

#rensi-search-bar input[type="search"] {
  flex: 1;
  border: 1.5px solid rgba(91,32,104,0.25);
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 16px;     /* 16px prevents iOS zoom */
  font-family: var(--font-primary, sans-serif);
  outline: none;
  background: #f9f7fb;
  color: #1a0a22;
  -webkit-appearance: none;
}

#rensi-search-bar input[type="search"]:focus {
  border-color: var(--rensi-purple, #5b2068);
  background: #fff;
}

#rensi-search-bar button[type="submit"] {
  width: 40px;
  height: 40px;
  background: var(--rensi-purple, #5b2068);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}

#rensi-search-bar button[type="submit"]:hover {
  background: #7a2d96;
}

#rensi-search-bar button[type="submit"] svg {
  width: 18px;
  height: 18px;
  stroke: #fff;
}

@media (min-width: 981px) {
  #rensi-search-bar { display: none !important; }
}

/* ---- Body scroll lock ------------------------------------- */
/* Use html overflow (not position:fixed on body) to avoid scroll-jump CLS.
   Compensate the disappearing scrollbar with padding-right. */
html.rensi-mnav-open {
  overflow: hidden;
}

body.rensi-mnav-open {
  padding-right: var(--rensi-scrollbar-w, 0px);
}
