/* ============================================================
   PlugNest v7 — Floating Pill Navbar (Framer-inspired)
   ============================================================ */

/* ── CSS property for animated border ────────────────────── */
@property --angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

/* ── Announcement ribbon ─────────────────────────────────── */
.pn-ribbon {
  background: linear-gradient(90deg, #7c3aed 0%, #a855f7 40%, #ec4899 70%, #7c3aed 100%);
  background-size: 200% 100%;
  animation: ribbon-slide 6s linear infinite;
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 0;
  text-align: center;
  position: relative;
  z-index: 200;
  letter-spacing: 0.2px;
}
.pn-ribbon a { color: rgba(255,255,255,0.9); text-decoration: underline; }
.pn-ribbon a:hover { color: #fff; }
@keyframes ribbon-slide {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* ── Nav outer wrapper ───────────────────────────────────── */
.pn-nav-outer {
  position: sticky;
  top: 0;
  z-index: 150;
  display: flex;
  justify-content: center;
  padding: 14px 20px;
  pointer-events: none;
}

/* ── Spinning border container ───────────────────────────── */
.pn-nav-border {
  position: relative;
  border-radius: 22px;
  max-width: 100%;          /* never exceed the viewport */
  width: auto;              /* hug the pill's content, not full width */
  pointer-events: all;
}

/* Animated conic-gradient border */
.pn-nav-border::before {
  content: '';
  position: absolute;
  inset: -1.5px;
  border-radius: inherit;
  background: conic-gradient(
    from var(--angle),
    transparent 0%,
    transparent 75%,
    rgba(124,58,237,0.8) 85%,
    rgba(236,72,153,0.6) 92%,
    transparent 100%
  );
  animation: border-spin 5s linear infinite;
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: -1;
}
.pn-nav-border:hover::before,
.pn-nav-border.glow::before {
  opacity: 1;
}
@keyframes border-spin {
  to { --angle: 360deg; }
}

/* ── Pill itself ─────────────────────────────────────────── */
.pn-pill {
  background: rgba(8, 8, 20, 0.82);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 22px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  animation: pill-drop 0.65s cubic-bezier(0.34,1.56,0.64,1) 0.2s both;
}
.pn-nav-border:hover .pn-pill {
  border-color: rgba(124,58,237,0.2);
  box-shadow: 0 8px 48px rgba(0,0,0,0.5), 0 0 0 1px rgba(124,58,237,0.1) inset;
}
@keyframes pill-drop {
  from { opacity: 0; transform: translateY(-18px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Logo ────────────────────────────────────────────────── */
.pn-pill-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
  text-decoration: none;
  margin-right: 4px;
}
.pn-pill-logo-mark {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, #7c3aed, #ec4899);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  box-shadow: 0 0 16px rgba(124,58,237,0.45);
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
  flex-shrink: 0;
}
.pn-pill-logo:hover .pn-pill-logo-mark {
  transform: rotate(-10deg) scale(1.12);
  box-shadow: 0 0 28px rgba(124,58,237,0.7);
}
.pn-pill-logo-text {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
}
.pn-pill-logo-text em { color: #a78bfa; font-style: normal; }

/* ── Divider ─────────────────────────────────────────────── */
.pn-nav-divider {
  width: 1px;
  height: 20px;
  background: rgba(255,255,255,0.08);
  flex-shrink: 0;
  margin: 0 6px;
}

/* ── Center nav links ────────────────────────────────────── */
.pn-pill-links {
  display: flex;
  align-items: center;
  gap: 1px;
  flex: 0 1 auto;   /* hug content — don't stretch the pill full-width */
}
.pn-pill-link {
  position: relative;
  padding: 6px 13px;
  font-size: 13.5px;
  font-weight: 500;
  color: rgba(255,255,255,0.62);
  border-radius: 11px;
  text-decoration: none;
  transition: color 0.2s;
  white-space: nowrap;
}
.pn-pill-link::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(255,255,255,0.07);
  opacity: 0;
  transform: scale(0.85);
  transition: all 0.22s cubic-bezier(0.34,1.56,0.64,1);
}
.pn-pill-link:hover { color: #fff; }
.pn-pill-link:hover::before { opacity: 1; transform: scale(1); }
.pn-pill-link.active { color: #a78bfa; }
.pn-pill-link.active::before { opacity: 1; transform: scale(1); background: rgba(124,58,237,0.12); }

/* Hot badge on a nav link */
.pn-nav-hot {
  display: inline-block;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #000;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 4px;
  vertical-align: middle;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ── Right actions ───────────────────────────────────────── */
.pn-pill-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Search icon button */
.pn-search-btn {
  width: 42px; height: 42px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.55);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.34,1.56,0.64,1);
  text-decoration: none;
}
.pn-search-btn:hover {
  background: rgba(124,58,237,0.15);
  border-color: rgba(124,58,237,0.3);
  color: #fff;
  transform: scale(1.08);
}

/* Cart button */
.pn-pill-cart {
  position: relative;
  width: 42px; height: 42px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.65);
  font-size: 17px;
  text-decoration: none;
  transition: all 0.22s cubic-bezier(0.34,1.56,0.64,1);
}
.pn-pill-cart:hover {
  background: rgba(124,58,237,0.15);
  border-color: rgba(124,58,237,0.35);
  color: #fff;
  transform: scale(1.08);
}
.pn-pill-cart-count {
  position: absolute;
  top: -7px; right: -7px;
  background: linear-gradient(135deg, #db2777, #ec4899);
  color: #fff;
  font-size: 10px; font-weight: 800;
  min-width: 19px; height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg, #06060f);
  box-shadow: 0 3px 10px rgba(236, 72, 153, 0.55), 0 0 0 1px rgba(236, 72, 153, 0.25);
  animation: badge-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  line-height: 1;
}
/* Replayed by JS every time the count changes */
.pn-pill-cart-count.pop {
  animation: badge-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
/* Soft pulse ring to draw the eye when items are in the cart */
.pn-pill-cart-count::after {
  content: '';
  position: absolute; inset: -2px;
  border-radius: inherit;
  border: 2px solid rgba(236, 72, 153, 0.5);
  animation: badge-ring 2.4s ease-out infinite;
  pointer-events: none;
}
@keyframes badge-ring {
  0%   { transform: scale(1);   opacity: 0.9; }
  60%  { transform: scale(1.7); opacity: 0; }
  100% { transform: scale(1.7); opacity: 0; }
}

/* CTA button */
.pn-pill-cta {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff;
  font-size: 13px; font-weight: 700;
  padding: 8px 18px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all 0.22s ease;
  position: relative; overflow: hidden;
  box-shadow: 0 3px 16px rgba(124,58,237,0.4);
  white-space: nowrap;
}
.pn-pill-cta::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
  transform: translateX(-100%);
  transition: transform 0.45s;
}
.pn-pill-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(124,58,237,0.6);
  color: #fff;
}
.pn-pill-cta:hover::after { transform: translateX(100%); }

/* ── Mobile hamburger ────────────────────────────────────── */
.pn-pill-ham {
  display: none;
  width: 34px; height: 34px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4.5px; cursor: pointer; flex-shrink: 0;
}
.pn-pill-ham span {
  display: block; width: 18px; height: 1.5px;
  background: rgba(255,255,255,0.75); border-radius: 2px;
  transition: all 0.25s ease;
}
.pn-pill-ham.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.pn-pill-ham.open span:nth-child(2) { opacity: 0; }
.pn-pill-ham.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ── Mobile drawer — full-screen popup, on top of everything ── */
.pn-pill-drawer {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(6,6,15,0.98);
  backdrop-filter: blur(26px);
  -webkit-backdrop-filter: blur(26px);
  z-index: 2400;              /* above ribbon (200), navbar (150), Aleena chatbot (2300) */
  flex-direction: column;
}
/* Keep the floating Aleena chatbot from covering the open drawer */
body.pn-drawer-open .al-launcher,
body.pn-drawer-open .al-win { display: none !important; }
.pn-pill-drawer.open {
  display: flex;
  animation: drawer-slide-in 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes drawer-slide-in {
  from { opacity: 0; transform: translateX(26px); }
  to   { opacity: 1; transform: translateX(0); }
}
/* Links fade up in a gentle stagger as the panel opens */
.pn-pill-drawer.open .pn-drawer-body > a,
.pn-pill-drawer.open .pn-drawer-cat-group {
  animation: drawer-item-in 0.4s ease both;
}
@keyframes drawer-item-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.pn-pill-drawer.open .pn-drawer-body > *:nth-child(1)  { animation-delay: 0.04s; }
.pn-pill-drawer.open .pn-drawer-body > *:nth-child(2)  { animation-delay: 0.07s; }
.pn-pill-drawer.open .pn-drawer-body > *:nth-child(3)  { animation-delay: 0.10s; }
.pn-pill-drawer.open .pn-drawer-body > *:nth-child(4)  { animation-delay: 0.13s; }
.pn-pill-drawer.open .pn-drawer-body > *:nth-child(5)  { animation-delay: 0.16s; }
.pn-pill-drawer.open .pn-drawer-body > *:nth-child(6)  { animation-delay: 0.19s; }
.pn-pill-drawer.open .pn-drawer-body > *:nth-child(7)  { animation-delay: 0.22s; }
.pn-pill-drawer.open .pn-drawer-body > *:nth-child(8)  { animation-delay: 0.25s; }
.pn-pill-drawer.open .pn-drawer-body > *:nth-child(9)  { animation-delay: 0.28s; }
/* Respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
  .pn-pill-drawer.open,
  .pn-pill-drawer.open .pn-drawer-body > a,
  .pn-pill-drawer.open .pn-drawer-cat-group { animation: none; }
}

/* Drawer top bar (brand + close) */
.pn-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.pn-drawer-brand { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.pn-drawer-brand-mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg,#7c3aed,#ec4899);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; box-shadow: 0 0 14px rgba(124,58,237,0.45);
}
.pn-drawer-brand-text {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 16px; font-weight: 800; color: #fff; letter-spacing: -0.3px;
}
.pn-drawer-brand-text em { color: #a78bfa; font-style: normal; }
.pn-drawer-close {
  width: 38px; height: 38px; border-radius: 10px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.8); font-size: 15px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.pn-drawer-close:hover { background: rgba(236,72,153,0.18); color: #fff; }

/* Drawer body (compact — fits without scrolling in its default state) */
.pn-drawer-body {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 12px 16px 14px;
  display: flex; flex-direction: column;
}
.pn-drawer-body > a {
  display: flex; align-items: center; gap: 11px;
  font-size: 14px; font-weight: 600; color: rgba(255,255,255,0.82);
  padding: 9px 12px; border-radius: 11px;
  text-decoration: none;
  transition: background 0.18s, color 0.18s;
}
.pn-drawer-body > a:hover,
.pn-drawer-body > a:active { background: rgba(124,58,237,0.14); color: #fff; }
.pn-drawer-body > a > i { font-size: 16px; width: 21px; text-align: center; flex-shrink: 0; }

.pn-drawer-tag {
  font-size: 10px; font-weight: 800; color: #10b981;
  background: rgba(16,185,129,0.16); border-radius: 5px;
  padding: 1px 6px; margin-left: 2px;
}

/* ── Categories: collapsible group at the end of the drawer ── */
.pn-drawer-cat-group {
  margin-top: 8px; padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.pn-drawer-cat-toggle {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  background: none; border: none; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 600; color: rgba(255,255,255,0.82);
  padding: 9px 12px; border-radius: 11px;
  transition: background 0.18s, color 0.18s;
}
.pn-drawer-cat-toggle > span { display: flex; align-items: center; gap: 11px; }
.pn-drawer-cat-toggle > span > i { font-size: 16px; width: 21px; text-align: center; }
.pn-drawer-cat-toggle:hover { background: rgba(124,58,237,0.14); color: #fff; }
.pn-drawer-cat-chev { font-size: 12px; transition: transform 0.28s ease; opacity: 0.7; }
.pn-drawer-cat-group.open .pn-drawer-cat-chev { transform: rotate(180deg); }

/* Panel: collapsed by default, expands on toggle (no scroll until opened) */
.pn-drawer-cat-panel {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 2px 8px;
  max-height: 0; overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.25s ease, margin-top 0.3s ease;
}
.pn-drawer-cat-group.open .pn-drawer-cat-panel {
  max-height: 60vh; opacity: 1; margin-top: 4px;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.pn-drawer-cat-panel a {
  display: block; font-size: 11.5px; font-weight: 500;
  color: rgba(255,255,255,0.72); padding: 6px 10px; border-radius: 8px;
  text-decoration: none; transition: background 0.18s, color 0.18s;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pn-drawer-cat-panel a:hover { background: rgba(124,58,237,0.14); color: #fff; }

/* ── Drawer footer: Sell + Support buttons on one row ── */
.pn-drawer-foot {
  display: flex; gap: 12px;
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.pn-drawer-fbtn {
  flex: 1;
  display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 9px;
  padding: 10px 10px;
  border-radius: 13px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.18s ease;
}
.pn-drawer-fbtn:active { transform: translateY(1px); }
.pn-drawer-fbtn-ico {
  width: 30px; height: 30px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #fff; flex-shrink: 0;
}
.pn-drawer-fbtn-label { font-size: 14px; font-weight: 700; color: #fff; }
.pn-drawer-fbtn.sell {
  background: rgba(236,72,153,0.10); border-color: rgba(236,72,153,0.30);
}
.pn-drawer-fbtn.sell .pn-drawer-fbtn-ico {
  background: linear-gradient(135deg,#db2777,#ec4899);
  box-shadow: 0 4px 14px rgba(236,72,153,0.4);
}
.pn-drawer-fbtn.support {
  background: rgba(124,58,237,0.10); border-color: rgba(124,58,237,0.30);
}
.pn-drawer-fbtn.support .pn-drawer-fbtn-ico {
  background: linear-gradient(135deg,#7c3aed,#a855f7);
  box-shadow: 0 4px 14px rgba(124,58,237,0.4);
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .pn-pill-links { display: none; }
  .pn-nav-divider:first-of-type { display: none; }
  /* Account / dashboard + admin stay on the bar, but icon-only (no text) */
  .pn-acct-name { display: none !important; }
  .pn-acct-btn {
    width: 42px !important; height: 42px !important;
    padding: 0 !important; gap: 0 !important;
    justify-content: center;
  }
}
@media (max-width: 640px) {
  .pn-pill-cta { display: none; }
  .pn-pill-ham { display: flex; }
  .pn-nav-outer { padding: 10px 14px; }
  /* Compact, evenly-spaced icon bar (logo · search · msg · cart · admin · dash · ham) */
  .pn-pill { padding: 8px 10px; gap: 6px; }
  .pn-pill-right { gap: 6px; }
  .pn-nav-divider { display: none; }
  /* Signed-out: fewer icons, so span the full width with roomier spacing */
  .pn-nav-border.guest { width: 100%; }
  .pn-nav-border.guest .pn-pill { width: 100%; }
  .pn-nav-border.guest .pn-pill-right { gap: 12px; margin-left: auto; }
  .pn-search-btn, .pn-pill-cart, .pn-acct-btn {
    width: 38px !important; height: 38px !important;
    font-size: 15px !important; border-radius: 10px !important;
  }
  .pn-acct-btn img,
  .pn-acct-btn > span:not(.pn-acct-name) { width: 26px !important; height: 26px !important; }
  .pn-pill-ham { width: 38px; height: 38px; }
  .pn-pill-logo-text { font-size: 16px; }
  .pn-pill-logo-mark { width: 30px; height: 30px; font-size: 16px; }
}
@media (max-width: 400px) {
  /* Squeeze a little more so 6 icons + logo never overflow */
  .pn-pill { gap: 5px; padding: 7px 8px; }
  .pn-pill-right { gap: 5px; }
  .pn-search-btn, .pn-pill-cart, .pn-acct-btn, .pn-pill-ham {
    width: 34px !important; height: 34px !important; font-size: 14px !important;
  }
  .pn-acct-btn img,
  .pn-acct-btn > span:not(.pn-acct-name) { width: 24px !important; height: 24px !important; }
  .pn-pill-logo-mark { width: 28px; height: 28px; font-size: 15px; }
  .pn-pill-logo-text { font-size: 15px; }
}
