
/* CPN MENU — Ultra Premium Minimal (self-contained) */
.cpn-menu, .cpn-menu * { box-sizing: border-box; }
.cpn-menu{ 
  --cpn-adminbar: 0px;
  width: 100%;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--cpn-text, #0b0b0b);
}
.cpn-menu a{ text-decoration: none !important; }

/* Hidden controller used to keep popup triggers working when the menu is intentionally not shown */
.cpn-menu--engine{ display: none !important; }

.cpn-menu[data-cpn-mode="inline"]{ position: relative; width: 100%; }
.cpn-menu[data-cpn-mode="inline"] .cpn-menu__bar{ margin: 0 auto; max-width: var(--cpn-maxw, 1100px); }

.cpn-menu[data-cpn-mode="floating_top"],
.cpn-menu[data-cpn-mode="floating_bottom"]{
  position: fixed;
  z-index: 999999;
  width: min(var(--cpn-maxw, 1100px), calc(100vw - 24px));
}
.cpn-menu[data-cpn-align="center"]{ left: 50%; transform: translateX(-50%); }
.cpn-menu[data-cpn-align="left"]{ left: 12px; transform: none; }
.cpn-menu[data-cpn-align="right"]{ right: 12px; left: auto; transform: none; }

.cpn-menu[data-cpn-mode="floating_top"]{ top: calc(var(--cpn-top, 10px) + var(--cpn-adminbar)); }
.cpn-menu[data-cpn-mode="floating_bottom"]{ bottom: var(--cpn-bottom, 18px); }

.cpn-menu__bar{
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 999px;
  background: var(--cpn-bar-bg, rgba(255,255,255,0.22));
  border: 1px solid var(--cpn-bar-border, rgba(255,255,255,0.25));
  box-shadow: 0 22px 50px var(--cpn-bar-shadow, rgba(0,0,0,0.22));
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  backdrop-filter: blur(18px) saturate(1.15);
}

.cpn-menu__brand{
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  justify-content: flex-start;
}

/* Brand is clickable (logo/text always goes Home) */
.cpn-menu__brandLink{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.cpn-menu__brandLink:hover{ opacity: .92; }
.cpn-menu__brandLink:focus-visible{
  outline: 2px solid rgba(0,0,0,.35);
  outline-offset: 4px;
  border-radius: 14px;
}
.cpn-menu__brandText{
  font-weight: 800;
  letter-spacing: .2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cpn-menu__logo{
  height: var(--cpn-logo-h, 26px);
  width: auto;
  display: block;
}

.cpn-menu__links{
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
  overflow: hidden;
}
.cpn-menu__link{
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--cpn-pill-bg, rgba(255,255,255,0.62));
  color: var(--cpn-pill-text, #0b0b0b) !important;
  border: 1px solid var(--cpn-pill-border, rgba(255,255,255,0.35));
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
  transition: transform .16s ease, background .16s ease;
}
.cpn-menu__link:hover{
  background: var(--cpn-pill-hover-bg, rgba(255,255,255,0.82));
  transform: translateY(-1px);
}

.cpn-menu__toggle{all:unset;box-sizing:border-box;display:none !important;align-items:center;justify-content:center;cursor:pointer;-webkit-tap-highlight-color:transparent;touch-action:manipulation;width:44px;height:44px;border-radius:18px;background:rgba(255,255,255,.16) !important;border:1px solid rgba(255,255,255,.22) !important;box-shadow:0 14px 34px rgba(0,0,0,.18);color:var(--cpn-text-color, #0b0b0b) !important;outline:none !important;}
.cpn-menu__toggle:hover{ background: rgba(255,255,255,.22) !important; transform: translateY(-1px); }

.cpn-menu__toggle:focus-visible{box-shadow:0 18px 44px rgba(0,0,0,.22), 0 0 0 3px rgba(255,255,255,.20);}
.cpn-menu__toggleIcon{
  width:18px;height:12px;display:block;position:relative;color:inherit;
  background:
    linear-gradient(currentColor,currentColor) 0 0/100% 2px no-repeat,
    linear-gradient(currentColor,currentColor) 0 50%/100% 2px no-repeat,
    linear-gradient(currentColor,currentColor) 0 100%/100% 2px no-repeat;
  border-radius:999px;
}
.cpn-menu__toggleIcon{ 
  color: var(--cpn-pill-text, #0b0b0b);
}
.cpn-menu__toggleIcon{
  /* middle line */
}
.cpn-menu__toggleIcon::marker{ content: ""; }

.cpn-menu__spacer{
  display: none;
  width: 44px;
  height: 44px;
}

/* Mobile layout */
@media (max-width: 1024px){
  /* Mobile / Tablet layout (<=1024px) */
  .cpn-menu__bar{grid-template-columns:44px 1fr 44px !important;}
  .cpn-menu__toggle{display:grid !important;}
  .cpn-menu__links{display:none !important;}
  .cpn-menu__brand{justify-content:center !important;justify-self:center !important;}
  .cpn-menu__spacer{display:block !important;}

  .cpn-menu__bar{ grid-template-columns: auto 1fr auto; }
  .cpn-menu__toggle{ display: grid; }
  .cpn-menu__links{ display: none; }
  .cpn-menu__brand{ justify-content: center; }
  .cpn-menu__spacer{ display: block; }
}

/* Elementor editor preview: keep desktop layout */
body.elementor-editor-active .cpn-menu__toggle,
body.elementor-editor-preview .cpn-menu__toggle{ display: none !important; }
body.elementor-editor-active .cpn-menu__links,
body.elementor-editor-preview .cpn-menu__links{ display: flex !important; }
body.elementor-editor-active .cpn-menu__spacer,
body.elementor-editor-preview .cpn-menu__spacer{ display: none !important; }

/* Drawer */
.cpn-drawer{
  position: fixed;
  inset: 0;
  z-index: 1000010;
  display: block;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  /* Drawer sizing: flush left, right gap is configurable from settings */
  --cpn-drawer-gap-right: var(--cpn-mobile-gap-right, 18px);
}
.cpn-drawer.is-open{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.cpn-drawer__overlay{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.25);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  opacity: 0;
  transition: opacity .22s ease;
}
.cpn-drawer.is-open .cpn-drawer__overlay{ opacity: 1; }
.cpn-drawer__panel{
  /*
    Mobile drawer UX:
    - Flush left (no gap)
    - Right-side gap so it looks like a mobile app drawer
  */
  position: fixed !important;
  top: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  right: auto !important;
  margin: 0 !important;
  width: min(360px, calc(100vw - var(--cpn-drawer-gap-right) - env(safe-area-inset-right)));
  max-width: calc(100vw - var(--cpn-drawer-gap-right) - env(safe-area-inset-right));
  background: var(--cpn-drawer-bg, #6366f1);
  color: var(--cpn-drawer-text, #ffffff);
  border-radius: 0 26px 26px 0;
  box-shadow: 0 30px 70px rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.16);
  transform: translateX(-22px) scale(.985);
  opacity: 0;
  transition: transform .34s cubic-bezier(.2,.95,.2,1), opacity .28s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.cpn-drawer.is-open .cpn-drawer__panel{
  transform: translateX(0) scale(1);
  opacity: 1;
}
.cpn-drawer__top{
  padding: 18px 18px 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.cpn-drawer__brandLink{
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.cpn-drawer__brandLink:hover{ opacity: .96; }
.cpn-drawer__brandLink:focus-visible{
  outline: 2px solid rgba(255,255,255,.55);
  outline-offset: 6px;
  border-radius: 18px;
}
.cpn-drawer__avatar{
  width: 44px; height: 44px;
  border-radius: 16px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.18);
}
.cpn-drawer__logo{ height: 24px; width: auto; display: block; filter: drop-shadow(0 10px 18px rgba(0,0,0,.18)); }
.cpn-drawer__logoBig{
  height: var(--cpn-mobile-logo-h, 74px);
  width: auto;
  max-width: 100%;
  display: block;
  filter: drop-shadow(0 12px 20px rgba(0,0,0,.20));
}
.cpn-drawer__brandText{ font-weight: 900; letter-spacing: .2px; }
.cpn-drawer__items{
  padding: 6px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cpn-drawer__item{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  color: var(--cpn-drawer-text, #fff) !important;
  background: var(--cpn-drawer-item-bg, rgba(255,255,255,0.08));
  border: 1px solid var(--cpn-drawer-item-border, rgba(255,255,255,0.10));
  font-weight: 800;
  transition: transform .16s ease, background .16s ease;
}
.cpn-drawer__item:hover{
  background: var(--cpn-drawer-active, rgba(255,255,255,0.16));
  transform: translateY(-1px);
}
.cpn-drawer__icon{
  width: 18px; height: 18px;
  display: grid;
  place-items: center;
  opacity: .95;
}
.cpn-drawer__icon svg{ width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.cpn-drawer__bottom{
  margin-top: auto;
  padding: 14px 16px 18px;
}
.cpn-drawer__close{
  all:unset;cursor:pointer;flex:0 0 auto;
  width:34px !important;
  height:34px !important;
  min-width:34px !important;
  min-height:34px !important;
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  padding: 0 !important;
  background:rgba(255,255,255,.18) !important;
  border:1px solid rgba(255,255,255,.22) !important;
  box-shadow:0 12px 28px rgba(0,0,0,.20);
  display:flex;
  align-items:center;
  justify-content:center;
  color: var(--cpn-drawer-text, #ffffff) !important;
  outline: none !important;
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
}

/* Minimal close "X" (real glyph = perfect centering across iOS) */
.cpn-drawer__closeX{
  font-size: 18px;
  line-height: 1;
  font-weight: 900;
  display:block;
  transform: translateY(-0.5px);
}

/* Modal */
.cpn-modal{
  position: fixed;
  inset: 0;
  z-index: 1000010;
  display: none;
  align-items: center;
  justify-content: center;
  padding: calc(12px + var(--cpn-adminbar)) 12px 12px;
  pointer-events: none;
}
.cpn-modal.is-open{ display: flex; pointer-events: auto; }
.cpn-modal__overlay{
  position: absolute;
  inset: 0;
  background: var(--cpn-overlay-bg, rgba(0,0,0,0.38));
  -webkit-backdrop-filter: blur(var(--cpn-overlay-blur, 18px)) saturate(1.25);
  backdrop-filter: blur(var(--cpn-overlay-blur, 18px)) saturate(1.25);
  opacity: 0;
  transition: opacity .24s cubic-bezier(.16,1,.3,1);
}
.cpn-modal.is-open .cpn-modal__overlay{ opacity: 1; }
.cpn-modal__panel{
  position: relative;
  width: min(var(--cpn-modal-maxw, 1200px), calc(100vw - 24px));
  height: min(var(--cpn-modal-maxh, 86vh), calc(100vh - 24px));
  border-radius: 22px;
  overflow: hidden;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 30px 70px rgba(0,0,0,.35);
  transform: translateY(14px) scale(.97);
  opacity: 0;
  transition: transform .32s cubic-bezier(.16,1,.3,1), opacity .32s cubic-bezier(.16,1,.3,1);
  display: flex;
  flex-direction: column;
}
.cpn-modal.is-open .cpn-modal__panel{ transform: translateY(0) scale(1); opacity: 1; }
.cpn-modal__top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 12px 14px;
  background: rgba(15,23,42,.74);
  border-bottom: 1px solid rgba(255,255,255,.10);
}
.cpn-modal__title{
  color: rgba(255,255,255,.92);
  font-weight: 800;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 12px;
}
.cpn-modal__btn--close{
  all: unset !important;
  width: 44px !important;
  height: 44px !important;
  display: grid !important;
  place-items: center !important;
  cursor: pointer !important;
  border-radius: 999px !important;
  background: rgba(255,255,255,.14) !important;
  border: 1px solid rgba(255,255,255,.22) !important;
  box-shadow: 0 14px 28px rgba(0,0,0,.18) !important;
  user-select: none !important;
}
.cpn-modal__btn--close .cpn-modal__x{
  font-size: 22px !important;
  line-height: 1 !important;
  font-weight: 900 !important;
  color: rgba(255,255,255,.94) !important;
}
.cpn-modal__btn--close:hover{
  transform: translateY(-1px) !important;
  background: rgba(255,255,255,.20) !important;
}
.cpn-modal__body{
  flex: 1;
  background: rgba(255,255,255,0.92);
}
.cpn-modal__content{
  width: 100%;
  height: 100%;
}
.cpn-modal__frame{
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #fff;
}

/* Embed & video support */
.cpn-modal__embed{
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
}
.cpn-modal__video{
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
  object-fit: contain;
}

/* Full-screen popup on mobile */
@media (max-width: 768px){
  .cpn-modal[data-cpn-fs-mobile="1"]{
    padding: var(--cpn-adminbar, 0px) 0 0;
  }
  .cpn-modal[data-cpn-fs-mobile="1"] .cpn-modal__panel{
    width: 100vw;
    height: calc(100dvh - var(--cpn-adminbar, 0px));
    max-height: calc(100dvh - var(--cpn-adminbar, 0px));
    border-radius: 0;
  }
}

/* Scroll lock */
html.cpn-scroll-lock, body.cpn-scroll-lock{ overflow: hidden !important; }

/* -------------------------------------------------
   Mobile drawer (v1.8.0) — fit-to-content + centered
   Fixes:
   - No forced empty space (panel no longer 100vh)
   - Vertically centered drawer on mobile
   - Flush-left (no left gap) while keeping a right breathing space
   - Smaller close button
-------------------------------------------------- */

@media (max-width: 1024px){
  /*
    Robust mobile centering (fix for devices where 100vh != visible viewport):
    - Use flexbox centering on the drawer container
    - Use dynamic viewport units (dvh) when supported
    - Keep panel fully visible (never clipped above the screen)
  */
  .cpn-drawer{
    --cpn-drawer-gap-right: var(--cpn-mobile-gap-right, 20px);
  }
  .cpn-drawer.is-open{
    display: flex;
    align-items: center;
    justify-content: flex-start;
    /* Safe-area aware padding (iPhone notch / dynamic browser bars) */
    padding-top: calc(var(--cpn-adminbar, 0px) + 12px + env(safe-area-inset-top));
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }

  .cpn-drawer__panel{
    position: relative !important;
    top: auto !important;
    bottom: auto !important;
    left: 0 !important;
    right: auto !important;
    height: auto !important;
    /* fallback first, then modern dynamic viewport */
    max-height: calc(100vh - var(--cpn-adminbar, 0px) - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
    max-height: calc(100dvh - var(--cpn-adminbar, 0px) - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
    width: min(360px, calc(100vw - var(--cpn-drawer-gap-right) - env(safe-area-inset-right))) !important;
    max-width: calc(100vw - var(--cpn-drawer-gap-right) - env(safe-area-inset-right)) !important;
    transform: translateX(-14px) scale(.985);
    border-radius: 26px !important;
    display: flex !important;
    flex-direction: column !important;
  }
  .cpn-drawer.is-open .cpn-drawer__panel{
    transform: translateX(0) scale(1) !important;
    opacity: 1 !important;
  }

  .cpn-drawer__items{
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .cpn-drawer__footer{
    padding: 14px 16px 18px;
    border-top: 1px solid rgba(255,255,255,.14);
    background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  }

  .cpn-drawer__desc{
    font-size: 13px;
    line-height: 1.45;
    opacity: .92;
    margin-bottom: 12px;
  }

  .cpn-social{
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
  }
  .cpn-social__btn{
    width: 44px;
    height: 44px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: var(--cpn-social-bg, rgba(255,255,255,.12));
    border: 1px solid var(--cpn-social-border, rgba(255,255,255,.16));
    box-shadow: 0 12px 28px rgba(0,0,0,.18);
    transition: transform .16s ease, background .16s ease;
  }
  .cpn-social__btn:hover{
    transform: translateY(-1px);
    background: rgba(255,255,255,.18);
  }
  .cpn-social__btn svg{
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  /* Close button already forced minimal above */
}

@media (prefers-reduced-motion: reduce){
  .cpn-drawer__overlay,
  .cpn-drawer__panel,
  .cpn-modal__overlay,
  .cpn-modal__panel{ transition: none !important; }
}

/* Desktop rules (>=1025px) */
@media (min-width: 1025px){
  .cpn-menu__toggle{display:none !important;}
  .cpn-menu__links{display:flex !important;}
  .cpn-menu__spacer{display:none !important;}
}


/* Fallback blur when backdrop-filter is not supported */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  body.cpn-drawer-open > *:not(.cpn-drawer) {
    filter: blur(var(--cpn-blur, 14px));
  }
}


/* Drawer item custom icon */
.cpn-drawer__icon{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;flex:0 0 26px}
.cpn-drawer__iconImg{width:20px;height:20px;object-fit:contain;display:block}
