/* =========================================================
   RSD Drilldown — FULL CSS (revizuit complet)
   - overlay transparent
   - card cu chenar (radius 16 + shadow)
   - X sus/stanga centrat
   - back mic + icon desenat corect
   - root panel impins in jos ca sa nu fie overlap
   - header offset 97 desktop / 91 mobile (+ admin bar)
   - al 2-lea rand (parintele) clickabil
========================================================= */

/* Header offset */
:root { --rsd-header-offset: 97px; }
@media (max-width: 767px){
  :root { --rsd-header-offset: 91px; }
}

/* 0) Overlay fundal = transparent */
#body_overlay{
  background: transparent !important;
  opacity: 0 !important;
}

/* 1) Wrapper sidebar transparent */
.mfn-header-tmpl-menu-sidebar{
  background: transparent !important;
}

.mfn-header-tmpl-menu-sidebar .mfn-header-tmpl-menu-sidebar-wrapper{
  background: transparent !important;
  padding-top: calc(var(--rsd-header-offset) + var(--wp-admin--admin-bar--height, 0px) +
12px) !important;
  padding-left: 12px !important;
  padding-right: 12px !important;
  padding-bottom: 12px !important;
}

/* 2) Card / chenar */
.mfn-header-tmpl-menu-sidebar .rsd-drill-mount{
  position: relative;
  width: 320px;
  max-width: calc(100vw - 24px);
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 16px;
  box-shadow: 0px 12px 34px -18px #000000;
  background: #fff;
  overflow: hidden;
  z-index: 10;
}

/* 3) Ascunde meniul nativ doar dupa build */
.mfn-header-tmpl-menu-sidebar.rsd-drill-built .rsd-native-menu{
  display: none !important;
}

/* 4) X in chenar */
.mfn-header-tmpl-menu-sidebar .rsd-close-btn{
  position: absolute;
  top: 8px !important;
  left: 8px !important;
  width: 32px !important;
  height: 32px !important;
  padding: 0 !important;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,.12);
  background: #fff;
  cursor: pointer;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 18px;
  line-height: 1 !important;
  z-index: 20;
}

/* ascunde X-ul nativ BeTheme */
.mfn-header-tmpl-menu-sidebar .mfn-close-icon,
.mfn-header-tmpl-menu-sidebar .mfn-close{
  display: none !important;
}

/* 5) Panouri */
.mfn-header-tmpl-menu-sidebar .rsd-drill-panels{
  position: relative;
  height: 520px;
  max-height: calc(100vh - var(--rsd-header-offset) - var(--wp-admin--admin-bar--height, 0px)
- 24px) !important;
}

/* doar panel-ul activ e vizibil */
.mfn-header-tmpl-menu-sidebar ul.rsd-panel{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    list-style: none;
    margin: 0;
    padding: 0;
    background: #fff;
    transform: translateX(100%);
    transition: transform .22s ease;
    visibility: hidden;
}

.mfn-header-tmpl-menu-sidebar ul.rsd-panel.is-active{
  transform: translateX(0);
  visibility: visible;
}

.mfn-header-tmpl-menu-sidebar ul.rsd-panel.is-prev{
  transform: translateX(-100%);
  visibility: hidden;
}

/* root panel impins in jos ca sa nu stea sub X */
.mfn-header-tmpl-menu-sidebar .rsd-drill-panels > ul.rsd-panel:first-of-type{
  padding-top: 52px !important;
}

/* randuri */
.mfn-header-tmpl-menu-sidebar ul.rsd-panel > li{
  border-bottom: 1px solid rgba(0,0,0,.08);
}

.mfn-header-tmpl-menu-sidebar ul.rsd-panel > li:last-child{
  border-bottom: 0;
}

.mfn-header-tmpl-menu-sidebar ul.rsd-panel a{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px;
  text-decoration: none;
  color: #111;
}

/* parinti -> sageata dreapta */
.mfn-header-tmpl-menu-sidebar .rsd-has-children > a:after{
  content: "›";
  font-size: 22px;
    line-height: 1;
    opacity: .7;
    flex: 0 0 auto;
}

/* 6) Header sticky (Back + titlu) */
.mfn-header-tmpl-menu-sidebar .rsd-back{
  position: sticky;
  top: 0;
  z-index: 15;
  background: #fff;
  border-bottom: 1px solid rgba(0,0,0,.10);
  padding: 10px 12px 10px 60px;
}

.mfn-header-tmpl-menu-sidebar .rsd-back-row{
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 26px;
}

/* back mic + icon curat */
.mfn-header-tmpl-menu-sidebar .rsd-back-btn{
  appearance: none;
  border: 1px solid rgba(0,0,0,.12);
  background: #fff;
  border-radius: 9px;
  width: 26px;
  height: 26px;
  min-width: 26px;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer;
  line-height: 1 !important;
  flex: 0 0 26px;
}

/* iconul din buton: sageata desenata din border + rotate */
.mfn-header-tmpl-menu-sidebar .rsd-back-icon{
  width: 8px;
  height: 8px;
  border-left: 1.8px solid #111;
  border-bottom: 1.8px solid #111;
  transform: rotate(45deg);
  margin-left: 2px;
    display: block;
}

.mfn-header-tmpl-menu-sidebar .rsd-back-title{
  font-weight: 800;
  font-size: 16px;
  color: #111;
  user-select: none;
  line-height: 1.25;
}

/* randul cu parintele - clickabil */
.mfn-header-tmpl-menu-sidebar .rsd-parent-row{
  background: rgba(0,0,0,.03);
}

.mfn-header-tmpl-menu-sidebar .rsd-parent-link,
.mfn-header-tmpl-menu-sidebar .rsd-parent-row span{
  display: block;
  width: 100%;
  padding: 12px 14px;
  font-weight: 800;
  color: #111;
  text-decoration: none;
  line-height: 1.3;
}

.mfn-header-tmpl-menu-sidebar .rsd-parent-link:hover{
  background: rgba(0,0,0,.02);
}

/* fine-tuning pe mobil */
@media (max-width: 767px){
  .mfn-header-tmpl-menu-sidebar .rsd-drill-mount{
    width: min(320px, calc(100vw - 24px));
  }

    .mfn-header-tmpl-menu-sidebar .rsd-drill-panels{
      height: 500px;
    }
}
