/* =====================================================================
   AGX Side Drawer — frontend styles
   Every selector is scoped under #agx-sd-root (or the .agx-sd- prefix)
   so nothing collides with the theme or Elementor. Colour/size values
   the admin screen can change are exposed as custom properties and
   overridden inline by the plugin.
===================================================================== */

#agx-sd-root,
#agx-sd-root *,
#agx-sd-root *::before,
#agx-sd-root *::after { box-sizing: border-box; }

#agx-sd-root {
  --agx-sd-navy-deep: #0E2D7B;
  --agx-sd-navy: #0E2D7B;
  --agx-sd-blue: #235AE7;
  --agx-sd-blue-deep: #1642B8;
  --agx-sd-ink: #0E2D7B;
  --agx-sd-body: #4F4F4F;
  --agx-sd-border: #E3E7F5;
  --agx-sd-subtle: #B9C4EE;
  --agx-sd-width: 480px;
  --agx-sd-tab-top: 172px;
  --agx-sd-head-font: "Nunito Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --agx-sd-body-font: "Nunito Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ---------- Overlay ---------- */
#agx-sd-root .agx-sd-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 17, 45, 0.55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  z-index: 9998;
}
#agx-sd-root .agx-sd-overlay.is-open { opacity: 1; pointer-events: auto; }

/* ---------- Drawer panel ---------- */
#agx-sd-root .agx-sd-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(var(--agx-sd-width), 92vw);
  background: #fff;
  z-index: 9999;
  box-shadow: -24px 0 60px rgba(10, 33, 92, 0.25);
  transform: translateX(100%);
  display: flex;
  flex-direction: column;
  font-family: var(--agx-sd-body-font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--agx-sd-body);
  -webkit-font-smoothing: antialiased;

  /* Closed panel is taken out of the tab order. visibility flips only
     after the slide-out finishes so it doesn't vanish mid-animation. */
  visibility: hidden;
  transition: transform .32s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .32s;
}
#agx-sd-root .agx-sd-drawer.is-open {
  transform: translateX(0);
  visibility: visible;
  transition: transform .32s cubic-bezier(.2, .8, .2, 1), visibility 0s linear 0s;
}

/* Left-hand-side variant */
#agx-sd-root.agx-sd-side-left .agx-sd-drawer {
  right: auto;
  left: 0;
  transform: translateX(-100%);
  box-shadow: 24px 0 60px rgba(10, 33, 92, 0.25);
}
#agx-sd-root.agx-sd-side-left .agx-sd-drawer.is-open { transform: translateX(0); }

/* ---------- Header ---------- */
#agx-sd-root .agx-sd-head {
  padding: 24px 26px;
  background: var(--agx-sd-navy-deep);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex: 0 0 auto;
}
#agx-sd-root .agx-sd-head h4 {
  font-family: var(--agx-sd-head-font);
  font-weight: 800;
  line-height: 1.2;
  color: #fff;
  font-size: 1.08rem;
  margin: 0;
  padding: 0;
}
#agx-sd-root .agx-sd-head p {
  color: var(--agx-sd-subtle);
  font-size: .82rem;
  margin: 4px 0 0;
  padding: 0;
  line-height: 1.45;
}
#agx-sd-root .agx-sd-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background .18s ease;
}
#agx-sd-root .agx-sd-close:hover { background: rgba(255, 255, 255, 0.22); }
#agx-sd-root .agx-sd-close svg { width: 16px; height: 16px; display: block; }

/* ---------- Scrollable body ---------- */
#agx-sd-root .agx-sd-body {
  padding: 10px 0 26px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  flex: 1 1 auto;
}
#agx-sd-root .agx-sd-group { padding: 18px 26px 6px; }
#agx-sd-root .agx-sd-group-title {
  font-family: var(--agx-sd-head-font);
  font-weight: 800;
  font-size: 13.5px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--agx-sd-blue);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
  line-height: 1.35;
}
#agx-sd-root .agx-sd-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: var(--agx-sd-blue);
}
#agx-sd-root .agx-sd-feature {
  padding: 13px 0;
  border-bottom: 1px solid var(--agx-sd-border);
}
#agx-sd-root .agx-sd-feature b {
  display: block;
  font-family: var(--agx-sd-head-font);
  font-weight: 700;
  font-size: .92rem;
  color: var(--agx-sd-ink);
  line-height: 1.35;
}
#agx-sd-root .agx-sd-feature span {
  display: block;
  font-size: .83rem;
  color: var(--agx-sd-body);
  margin-top: 3px;
  line-height: 1.55;
}

/* Plain bullet — an item with no heading, marked with an em dash. */
#agx-sd-root .agx-sd-item {
  position: relative;
  padding: 0 0 0 18px;
  margin: 9px 0 0;
  font-size: .86rem;
  line-height: 1.55;
  color: var(--agx-sd-body);
}
#agx-sd-root .agx-sd-item:first-child { margin-top: 4px; }
#agx-sd-root .agx-sd-item::before {
  content: "\2014";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--agx-sd-blue);
}
#agx-sd-root .agx-sd-item strong,
#agx-sd-root .agx-sd-item b {
  font-family: var(--agx-sd-head-font);
  font-weight: 700;
  color: var(--agx-sd-ink);
}

/* ---------- Footer ---------- */
#agx-sd-root .agx-sd-footer {
  padding: 18px 26px;
  border-top: 1px solid var(--agx-sd-border);
  flex: 0 0 auto;
}

/* ---------- Floating tab handle ---------- */
#agx-sd-root .agx-sd-tab {
  position: fixed;
  right: 0;
  top: var(--agx-sd-tab-top);
  z-index: 9990;
  background: var(--agx-sd-blue);
  color: #fff;
  border: none;
  padding: 16px 8px;
  border-radius: 10px 0 0 10px;
  font-family: var(--agx-sd-head-font);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .4px;
  box-shadow: -6px 6px 18px rgba(35, 90, 231, 0.32);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease, right .3s ease, left .3s ease;
}
#agx-sd-root .agx-sd-tab.is-visible { opacity: 1; pointer-events: auto; }
#agx-sd-root .agx-sd-tab svg {
  writing-mode: horizontal-tb;
  width: 16px;
  height: 16px;
  display: block;
}
#agx-sd-root.agx-sd-side-left .agx-sd-tab {
  right: auto;
  left: 0;
  border-radius: 0 10px 10px 0;
  box-shadow: 6px 6px 18px rgba(35, 90, 231, 0.32);
}
#agx-sd-root.agx-sd-side-left .agx-sd-tab svg,
#agx-sd-root.agx-sd-side-left .agx-sd-close svg {
  transform: rotate(180deg);
}

/* The tab sits beneath the overlay, so while the panel is open it would
   otherwise show through the dimming layer as a muted navy. Fade it out
   instead — it has nothing left to do until the panel closes. */
#agx-sd-root.is-drawer-open .agx-sd-tab,
#agx-sd-root.is-drawer-open.agx-sd-tab-always .agx-sd-tab {
  opacity: 0;
  pointer-events: none;
}

/* "always visible" mode skips the scroll trigger entirely */
#agx-sd-root.agx-sd-tab-always .agx-sd-tab { opacity: 1; pointer-events: auto; }

@media (max-width: 640px) {
  #agx-sd-root.agx-sd-hide-tab-mobile .agx-sd-tab { display: none; }
}

/* ---------- Buttons (drawer footer + [agx_drawer_button] shortcode) ---------- */
.agx-sd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: "Nunito Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 700;
  font-size: 15px;
  padding: 15px 28px;
  border-radius: 10px;
  border: 2px solid transparent;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.2;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease,
              color .18s ease, border-color .18s ease;
}
.agx-sd-btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.agx-sd-btn-sm { padding: 11px 20px; font-size: 13.5px; }
.agx-sd-btn-block { width: 100%; }
.agx-sd-btn-primary {
  background: #0E2D7B;
  color: #fff;
  box-shadow: 0 10px 26px rgba(14, 45, 123, 0.32);
}
.agx-sd-btn-primary:hover,
.agx-sd-btn-primary:focus {
  background: #0A215C;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(14, 45, 123, 0.42);
}
.agx-sd-btn-ghost {
  background: transparent;
  border-color: rgba(14, 45, 123, 0.25);
  color: #0E2D7B;
}
.agx-sd-btn-ghost:hover,
.agx-sd-btn-ghost:focus {
  background: rgba(14, 45, 123, 0.06);
  border-color: #0E2D7B;
  color: #0E2D7B;
}

/* ---------- Scroll lock ---------- */
body.agx-sd-lock { overflow: hidden; }

/* ---------- Accessibility ---------- */
#agx-sd-root .agx-sd-tab:focus-visible,
#agx-sd-root .agx-sd-close:focus-visible,
.agx-sd-btn:focus-visible {
  outline: 3px solid #00DEFF;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  #agx-sd-root .agx-sd-drawer,
  #agx-sd-root .agx-sd-overlay,
  #agx-sd-root .agx-sd-tab,
  .agx-sd-btn {
    transition-duration: .01ms !important;
  }
  .agx-sd-btn-primary:hover { transform: none; }
}

/* ---------- Print ---------- */
@media print {
  #agx-sd-root { display: none !important; }
}
