/* ============================================================
   PERDYSY HEADER STYLES
   Colors: Navy #1A3A5C | Blue #2D6A9F | White #FFFFFF
   ============================================================ */

/* ── Hide Elessi's native header (confirmed selectors from live page) ── */
header#header-content,
.site-header,
#header-content,
#header-content .header-wrapper,
.nasa-topbar-wrap,
#top-bar,
div.header-wrapper {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  overflow: hidden !important;
}

/* ── Ensure our header is always visible ── */
header#pd-header,
#pd-header,
.pd-announcement-bar {
  display: block !important;
  visibility: visible !important;
}
#pd-header { display: block !important; }

/* ── Base Header ─────────────────────────────────────────── */
#pd-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99999;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 2px 24px rgba(0,0,0,0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background 0.4s ease, box-shadow 0.4s ease;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

#pd-header.scrolled {
  background: rgba(255, 255, 255, 0.99);
  box-shadow: 0 2px 32px rgba(0,0,0,0.12);
}

/* ── Announcement Bar ────────────────────────────────────── */
.pd-announcement-bar {
  background: #1A3A5C;
  color: #fff;
  text-align: center;
  padding: 10px 48px 10px 24px;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  position: relative;
  z-index: 10000;
}

.pd-announcement-bar a {
  color: #fff;
  text-decoration: underline;
  margin-left: 8px;
}

.pd-ann-close {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  opacity: 0.7;
  font-size: 1rem;
  line-height: 1;
  transition: opacity 0.2s;
}
.pd-ann-close:hover { opacity: 1; }

/* ── Inner Container ─────────────────────────────────────── */
.pd-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px;
  transition: height 0.4s ease;
}

#pd-header.scrolled .pd-header-inner {
  height: 62px;
}

/* ── Logo ────────────────────────────────────────────────── */
.pd-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  text-decoration: none;
}

.pd-logo img {
  height: 42px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  transition: height 0.4s ease;
  filter: none;
}

#pd-header.scrolled .pd-logo img {
  height: 36px;
}

.pd-logo:hover img { opacity: 0.85; }

/* Text fallback */
.pd-logo-text {
  font-size: 1.6rem;
  font-weight: 800;
  color: #1A3A5C;
  letter-spacing: -0.03em;
}

/* ── Navigation ──────────────────────────────────────────── */
.pd-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 2px;
}

.pd-nav ul li { position: relative; }

.pd-nav ul li a {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #1A3A5C;
  text-decoration: none;
  border-radius: 6px;
  transition: color 0.3s ease, background 0.3s ease;
  white-space: nowrap;
}

.pd-nav ul li a:hover,
.pd-nav ul li.current-menu-item > a {
  color: #2D6A9F !important;
  background: rgba(45, 106, 159, 0.08);
}

/* Dropdown */
.pd-nav .sub-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 200px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.12);
  border: 1px solid #e8eef4;
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
  z-index: 1000;
  list-style: none;
}

.pd-nav li:hover > .sub-menu,
.pd-nav li:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.pd-nav .sub-menu li a {
  color: #1A3A5C !important;
  background: transparent !important;
  display: block !important;
  padding: 10px 12px !important;
  border-radius: 6px !important;
}

.pd-nav .sub-menu li a:hover {
  background: rgba(45, 106, 159, 0.08) !important;
  color: #2D6A9F !important;
}

/* ── Header Actions ──────────────────────────────────────── */
.pd-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.pd-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #1A3A5C;
  position: relative;
  transition: background 0.3s ease, color 0.3s ease, transform 0.2s ease;
  text-decoration: none;
}

.pd-action-btn:hover {
  background: rgba(45, 106, 159, 0.1);
  color: #2D6A9F;
  transform: scale(1.05);
}

.pd-action-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Cart badge */
.pd-cart-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #2D6A9F;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}

/* ── Search Panel ────────────────────────────────────────── */
.pd-search-wrap {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  padding: 20px 32px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  display: none;
  border-top: 2px solid #2D6A9F;
}

.pd-search-wrap.open {
  display: block;
  animation: pdSlideDown 0.25s ease;
}

@keyframes pdSlideDown {
  from { opacity:0; transform:translateY(-10px); }
  to   { opacity:1; transform:translateY(0); }
}

.pd-search-wrap form {
  display: flex;
  max-width: 600px;
  margin: 0 auto;
  gap: 10px;
}

.pd-search-wrap input[type="search"] {
  flex: 1;
  padding: 12px 18px !important;
  border-radius: 999px !important;
  border: 1.5px solid #dde4eb !important;
  background: #f4f7fa !important;
  font-size: 0.95rem !important;
  color: #1A3A5C !important;
  font-family: 'Inter', sans-serif !important;
}

.pd-search-wrap button {
  background: #2D6A9F !important;
  color: #fff !important;
  border: none !important;
  border-radius: 999px !important;
  padding: 12px 24px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  font-family: 'Inter', sans-serif !important;
}

.pd-search-wrap button:hover { background: #1A3A5C !important; }

/* ── Hamburger ───────────────────────────────────────────── */
.pd-hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

.pd-hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: #1A3A5C;
  border-radius: 999px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-origin: center;
}

.pd-hamburger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.pd-hamburger.open span:nth-child(2) { opacity:0; transform:scaleX(0); }
.pd-hamburger.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ── Mobile Drawer ───────────────────────────────────────── */
.pd-mobile-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: min(320px, 85vw);
  height: 100vh;
  background: #fff;
  z-index: 9998;
  overflow-y: auto;
  transition: right 0.4s cubic-bezier(0.4,0,0.2,1);
  box-shadow: -8px 0 40px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
}

.pd-mobile-drawer.open { right: 0; }

.pd-drawer-header {
  padding: 20px 16px 14px;
  border-bottom: 1px solid #eef2f7;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pd-drawer-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: #f4f7fa;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  color: #1A3A5C;
  transition: background 0.3s ease;
}
.pd-drawer-close:hover { background: rgba(45, 106, 159, 0.15); color: #2D6A9F; }

.pd-drawer-nav { padding: 12px; flex: 1; }

.pd-drawer-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pd-drawer-nav ul li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 14px;
  font-size: 0.93rem;
  font-weight: 500;
  color: #1A3A5C;
  text-decoration: none;
  border-radius: 8px;
  border-bottom: 1px solid #eef2f7;
  transition: background 0.3s ease, color 0.3s ease;
}
.pd-drawer-nav ul li a:hover { background: rgba(45,106,159,0.07); color: #2D6A9F; border-color: transparent; }
.pd-drawer-nav ul li:last-child a { border-bottom: none; }

.pd-drawer-actions {
  padding: 16px;
  border-top: 1px solid #eef2f7;
  display: flex;
  gap: 10px;
}

.pd-drawer-actions a {
  flex: 1;
  text-align: center;
  padding: 12px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  font-family: 'Inter', sans-serif;
}

.pd-drawer-actions .pd-btn-primary { background: #2D6A9F; color: #fff; }
.pd-drawer-actions .pd-btn-primary:hover { background: #1A3A5C; }
.pd-drawer-actions .pd-btn-ghost { background: #f4f7fa; color: #1A3A5C; }
.pd-drawer-actions .pd-btn-ghost:hover { background: #dde4eb; }

/* Overlay */
.pd-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 9997;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  backdrop-filter: blur(4px);
}
.pd-overlay.open { opacity: 1; visibility: visible; }

/* ── Page top padding ────────────────────────────────────── */
body { padding-top: calc(72px + 40px) !important; }
body.pd-no-announcement { padding-top: 72px !important; }

/* Admin bar offset */
.admin-bar #pd-header { top: 32px !important; }
@media screen and (max-width: 782px) {
  .admin-bar #pd-header { top: 46px !important; }
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1100px) {
  .pd-nav { display: none; }
  .pd-hamburger { display: flex; }
  .pd-header-inner { padding: 0 20px; }
}

@media (max-width: 768px) {
  .pd-logo img { height: 34px; }
  body { padding-top: calc(64px + 38px) !important; }
}
