/*
 * Print.az — global header & navigation v2 (shared, namespaced .pz-*).
 * Self-contained (hex values) so it works on every page regardless of local
 * token definitions. Injected/controlled by assets/js/header.js.
 */

/* Prevent the sticky header from covering in-page anchor targets. */
[id] { scroll-margin-top: 96px; }
body.pz-no-scroll { overflow: hidden; }

.pz-visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.pz-header {
  /* Fixed (not sticky): the shared header is moved to be a direct child of
   * <body> by header.js and offset via body padding-top, so it stays pinned
   * regardless of page wrappers (e.g. .page { overflow: hidden }). */
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid #e6e8ec;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: box-shadow 0.2s ease;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.pz-header.is-scrolled { box-shadow: 0 10px 30px rgba(17, 24, 39, 0.08); }

.pz-header-inner {
  width: min(1280px, calc(100% - 32px)); margin: 0 auto;
  display: flex; align-items: center; gap: 16px;
  min-height: 72px; transition: min-height 0.2s ease;
}
.pz-header.is-scrolled .pz-header-inner { min-height: 58px; }

.pz-logo { display: inline-flex; align-items: center; flex: 0 0 auto; }
.pz-logo img { display: block; width: auto; height: 42px; transition: height 0.2s ease; }
.pz-header.is-scrolled .pz-logo img { height: 34px; }

.pz-nav { display: none; }
.pz-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

/* Text links / buttons */
.pz-nav-list { list-style: none; display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; }
.pz-nav-item > a,
.pz-nav-item > button {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 12px; border: 0; background: transparent;
  color: #17191d; font: inherit; font-weight: 700; font-size: 0.98rem;
  border-radius: 10px; cursor: pointer;
}
.pz-nav-item > a:hover,
.pz-nav-item > button:hover,
.pz-nav-item > button[aria-expanded="true"] { background: #f6f7f9; color: #d71920; }
.pz-caret { width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform 0.15s ease; }
.pz-nav-item > button[aria-expanded="true"] .pz-caret { transform: rotate(225deg) translateY(-1px); }

.pz-menu { position: relative; }

/* Dropdown panels (Reklam İşləri, Haqqımızda) */
.pz-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 1001;
  min-width: 280px; padding: 10px; background: #fff;
  border: 1px solid #e6e8ec; border-radius: 16px;
  box-shadow: 0 24px 70px rgba(17, 24, 39, 0.12);
}
.pz-dropdown[hidden] { display: none; }
.pz-dropdown a {
  display: block; padding: 10px 12px; border-radius: 10px;
  color: #17191d; font-weight: 600; font-size: 0.95rem;
}
.pz-dropdown a:hover, .pz-dropdown a:focus-visible { background: #f6f7f9; color: #d71920; }
.pz-dropdown .pz-dropdown-cta {
  margin-top: 6px; border-top: 1px solid #e6e8ec; padding-top: 8px;
  font-weight: 800; color: #d71920;
}

/* Mega menu (category-first) */
.pz-mega {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 1001;
  background: #fff; border-bottom: 1px solid #e6e8ec;
  box-shadow: 0 24px 70px rgba(17, 24, 39, 0.12);
}
.pz-mega[hidden] { display: none; }
.pz-mega-grid {
  width: min(1280px, calc(100% - 32px)); margin: 0 auto;
  display: grid; grid-template-columns: 300px 1fr; gap: 24px; padding: 20px 0 24px;
}
.pz-mega-cats { list-style: none; margin: 0; padding: 0; border-right: 1px solid #e6e8ec; }
.pz-mega-cats button {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  padding: 12px 14px; border: 0; background: transparent; border-radius: 12px;
  color: #17191d; font: inherit; font-weight: 700; text-align: left; cursor: pointer;
}
.pz-mega-cats button::after { content: "›"; color: #9aa3af; font-size: 1.1rem; }
.pz-mega-cats button:hover,
.pz-mega-cats button[aria-selected="true"] { background: #f6f7f9; color: #d71920; }
.pz-mega-panel { padding: 6px 8px; }
.pz-mega-panel h3 { margin: 0 0 4px; font-size: 1.15rem; color: #17191d; }
.pz-mega-panel .pz-mega-desc { margin: 0 0 14px; color: #4f5865; font-size: 0.92rem; }
.pz-mega-links { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.pz-mega-links a { display: block; padding: 8px 10px; border-radius: 10px; color: #17191d; font-weight: 600; font-size: 0.94rem; }
.pz-mega-links a:hover, .pz-mega-links a:focus-visible { background: #f6f7f9; color: #d71920; }
.pz-mega-cta { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; color: #d71920; padding: 8px 10px; }
.pz-mega-cta::after { content: "→"; }

/* Search button + language + CTAs */
.pz-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border: 1px solid #e6e8ec; border-radius: 999px;
  background: #fff; color: #17191d; cursor: pointer;
}
.pz-icon-btn:hover { border-color: #d71920; color: #d71920; }
.pz-icon-btn svg { width: 20px; height: 20px; }

.pz-lang { display: none; align-items: center; gap: 2px; padding: 0 4px; }
.pz-lang button {
  border: 0; background: transparent; font: inherit; font-weight: 800; font-size: 0.85rem;
  color: #9aa3af; padding: 6px 6px; border-radius: 8px; cursor: pointer;
}
.pz-lang button.is-active { color: #17191d; }
.pz-lang button[disabled] { color: #c2c7cf; cursor: not-allowed; }
.pz-lang .pz-lang-sep { color: #d7dbe0; font-weight: 400; }

.pz-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 16px; border-radius: 999px;
  font: inherit; font-weight: 800; font-size: 0.92rem; cursor: pointer; white-space: nowrap;
  border: 1px solid transparent; transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.pz-btn:hover { transform: translateY(-1px); }
.pz-btn-secondary { color: #17191d; background: #fff; border-color: #d0d5dd; }
.pz-btn-secondary:hover { border-color: #17191d; }
.pz-btn-primary { color: #fff; background: #d71920; box-shadow: 0 14px 30px rgba(215, 25, 32, 0.24); }

.pz-burger {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 1px solid #e6e8ec; border-radius: 12px;
  background: #fff; color: #17191d; font-size: 1.3rem; cursor: pointer;
}

/* Desktop layout */
@media (min-width: 1024px) {
  .pz-nav { display: block; }
  .pz-lang { display: flex; }
  .pz-burger { display: none; }
  .pz-actions .pz-btn-mobile-only { display: none; }
}
@media (min-width: 1024px) and (max-width: 1220px) {
  .pz-header-inner { gap: 10px; }
  .pz-nav-item > a, .pz-nav-item > button { padding: 8px 8px; font-size: 0.9rem; }
  .pz-btn { padding: 0 12px; font-size: 0.84rem; }
  .pz-actions { gap: 8px; }
}
@media (max-width: 1023.98px) {
  .pz-actions .pz-btn-desktop-only { display: none; }
  .pz-lang { display: none; }
}
@media (max-width: 560px) {
  .pz-header-inner { gap: 8px; }
  .pz-btn { min-height: 40px; padding: 0 12px; font-size: 0.82rem; }
  .pz-icon-btn { width: 40px; height: 40px; }
  .pz-burger { width: 40px; height: 40px; }
  .pz-logo img { height: 32px; }
  .pz-header.is-scrolled .pz-logo img { height: 30px; }
}
@media (max-width: 400px) {
  .pz-header-inner { gap: 6px; }
  .pz-btn { padding: 0 10px; font-size: 0.78rem; }
  .pz-icon-btn { width: 36px; height: 36px; }
  .pz-burger { width: 36px; height: 36px; }
  .pz-logo img { height: 28px; }
}

/* --- Search overlay --- */
.pz-search { position: fixed; inset: 0; z-index: 2000; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; background: rgba(10, 12, 16, 0.5); }
.pz-search[hidden] { display: none; }
.pz-search-panel { width: min(680px, 100%); background: #fff; border-radius: 18px; box-shadow: 0 30px 80px rgba(17, 24, 39, 0.28); overflow: hidden; }
.pz-search-top { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid #e6e8ec; }
.pz-search-top svg { width: 20px; height: 20px; color: #9aa3af; flex: 0 0 auto; }
.pz-search-input { flex: 1; min-height: 40px; border: 0; outline: none; font: inherit; font-size: 1.05rem; font-weight: 600; color: #17191d; background: transparent; }
.pz-search-close { border: 0; background: #f6f7f9; border-radius: 999px; width: 34px; height: 34px; font-size: 1.1rem; cursor: pointer; color: #4f5865; }
.pz-search-results { max-height: min(60vh, 520px); overflow: auto; padding: 8px; }
.pz-search-group-title { padding: 10px 12px 4px; font-size: 0.76rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: #9aa3af; }
.pz-search-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 10px; color: #17191d; font-weight: 600; cursor: pointer; }
.pz-search-item small { color: #9aa3af; font-weight: 600; }
.pz-search-item:hover, .pz-search-item.is-active { background: #f6f7f9; color: #d71920; }
.pz-search-empty { padding: 24px 16px; text-align: center; color: #4f5865; font-weight: 600; }
.pz-search-hint { padding: 12px 16px; border-top: 1px solid #e6e8ec; color: #9aa3af; font-size: 0.82rem; }

/* --- Mobile drawer --- */
.pz-drawer { position: fixed; inset: 0; z-index: 1500; background: rgba(10, 12, 16, 0.5); display: flex; justify-content: flex-end; }
.pz-drawer[hidden] { display: none; }
.pz-drawer-panel { width: min(400px, 100%); height: 100%; background: #fff; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.pz-drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.pz-drawer-head img { height: 34px; }
.pz-drawer-close { border: 1px solid #e6e8ec; background: #fff; border-radius: 12px; width: 42px; height: 42px; font-size: 1.3rem; cursor: pointer; }
.pz-acc { border-bottom: 1px solid #eef0f3; }
.pz-acc > summary { list-style: none; cursor: pointer; padding: 14px 6px; font-weight: 800; font-size: 1.02rem; display: flex; justify-content: space-between; align-items: center; }
.pz-acc > summary::-webkit-details-marker { display: none; }
.pz-acc > summary::after { content: "+"; color: #d71920; font-weight: 800; }
.pz-acc[open] > summary::after { content: "−"; }
.pz-acc .pz-acc-body { padding: 0 6px 12px; display: flex; flex-direction: column; gap: 2px; }
.pz-acc .pz-acc-body a { padding: 9px 8px; border-radius: 8px; color: #17191d; font-weight: 600; }
.pz-acc .pz-acc-body a:hover { background: #f6f7f9; color: #d71920; }
.pz-subacc > summary { list-style: none; cursor: pointer; padding: 10px 8px; font-weight: 700; color: #4f5865; display: flex; justify-content: space-between; }
.pz-subacc > summary::-webkit-details-marker { display: none; }
.pz-subacc > summary::after { content: "+"; color: #9aa3af; }
.pz-subacc[open] > summary::after { content: "−"; }
.pz-subacc .pz-acc-body { padding-left: 12px; }
.pz-drawer-link { padding: 14px 6px; font-weight: 800; font-size: 1.02rem; border-bottom: 1px solid #eef0f3; display: block; color: #17191d; }
.pz-drawer-lang { display: flex; align-items: center; gap: 6px; padding: 14px 6px; }
.pz-drawer-lang button { border: 1px solid #e6e8ec; background: #fff; border-radius: 999px; padding: 8px 14px; font: inherit; font-weight: 800; cursor: pointer; color: #4f5865; }
.pz-drawer-lang button.is-active { border-color: #d71920; color: #d71920; }
.pz-drawer-lang button[disabled] { color: #c2c7cf; cursor: not-allowed; }
.pz-drawer-ctas { display: grid; gap: 10px; margin-top: 12px; }
.pz-drawer-ctas .pz-btn { width: 100%; }

@media (prefers-reduced-motion: reduce) {
  .pz-header, .pz-header-inner, .pz-logo img, .pz-caret, .pz-btn { transition: none !important; }
  html { scroll-behavior: auto !important; }
}
