/* ============================================================
   NFS Custom Header
   ============================================================ */

/* ── Topbar ── */
.nfs-topbar {
  background: #f3f4f6;
  border-bottom: 1px solid #e5e7eb;
  font-size: 13px;
  color: #4b5563;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.nfs-topbar > .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 36px;
}
.nfs-topbar-left { display: flex; align-items: center; gap: 28px; }
.nfs-city { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: #111827; }
.nfs-top-links ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 24px; }
.nfs-top-links a { color: #4b5563; text-decoration: none; font-size: 13px; }
.nfs-top-links a:hover { color: #1d4ed8; }
.nfs-topbar-right { display: flex; align-items: center; gap: 14px; }
.nfs-phone {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 700; color: #111827; text-decoration: none;
}
.nfs-phone:hover { color: #1d4ed8; }
.nfs-hours { color: #6b7280; font-size: 12px; }
.nfs-topbar-custom-text { font-size: 13px; color: #4b5563; }

/* ── Header main ── */
.nfs-header {
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  position: relative;
  z-index: 100;
}
.nfs-header > .container {
  display: grid;
  grid-template-columns: 220px 180px 1fr auto;
  align-items: center;
  gap: 24px;
  height: 96px;
}

/* ── Logo ── */
.nfs-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.nfs-logo-img { height: 44px; width: auto; }
.nfs-logo-img-mobile { display: none; height: 40px; width: auto; max-width: 200px; }
.nfs-header-phone-mobile { display: none; }
.nfs-logo-mark {
  width: 44px; height: 44px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #2f6fe6 0%, #1d4ed8 55%, #14338f 100%);
  display: grid; place-items: center;
  box-shadow: inset 0 0 0 4px rgba(255,255,255,0.18), 0 4px 12px rgba(29,78,216,0.25);
  position: relative; flex-shrink: 0;
}
.nfs-logo-mark::after {
  content: "";
  position: absolute; inset: 10px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #1d4ed8 0 90deg, #4b7eff 90deg 180deg, #1d4ed8 180deg 270deg, #4b7eff 270deg 360deg);
  mask: radial-gradient(circle, transparent 6px, #000 7px, #000 9px, transparent 10px);
  -webkit-mask: radial-gradient(circle, transparent 6px, #000 7px, #000 9px, transparent 10px);
}
.nfs-logo-text { line-height: 1; }
.nfs-logo-text b {
  display: block; font-weight: 800; font-size: 17px;
  letter-spacing: 0.02em; color: #0a2540;
}
.nfs-logo-text span {
  display: block; font-size: 10.5px; color: #6b7280;
  margin-top: 4px; letter-spacing: 0.04em;
}

/* ── Catalog button + dropdown ── */
.nfs-catalog-wrap { position: relative; }
.nfs-btn-catalog {
  height: 48px;
  background: #1d4ed8; color: #fff;
  font-weight: 700; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 15px; text-decoration: none;
  font-family: inherit; border: none; cursor: pointer;
  transition: background .15s, border-radius .2s;
  padding: 0 22px;
}
.nfs-btn-catalog:hover { background: #1e40af; color: #fff; }
.nfs-btn-catalog.is-open { border-radius: 8px 8px 0 0; }

/* ── Mega Menu ── */
.nfs-megamenu {
  display: none;
  position: fixed; top: auto;
  left: 50%; transform: translateX(-50%);
  width: calc(100% - 40px); max-width: var(--nfs-container, 1320px);
  background: #fff;
  border-radius: 0 0 18px 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,.16), 0 0 0 1px rgba(0,0,0,.04);
  z-index: 200;
  overflow: hidden;
}
.nfs-megamenu.is-open { display: flex; }

/* Left panel */
.nfs-mm-left {
  width: 280px;
  padding: 10px 0;
  border-right: 1px solid #f1f5f9;
  overflow-y: auto;
  max-height: 70vh;
  flex-shrink: 0;
}
.nfs-mm-section { padding-bottom: 6px; }
.nfs-mm-section + .nfs-mm-section { border-top: 1px solid #f1f5f9; padding-top: 6px; }
.nfs-mm-section-title {
  padding: 8px 20px 4px;
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .06em; color: #9ca3af;
}
.nfs-mm-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 20px;
  font-size: 14px; font-weight: 500; color: #1f2937;
  text-decoration: none; transition: background .12s, color .12s;
  cursor: pointer;
}
.nfs-mm-item:hover, .nfs-mm-item.is-active {
  background: #f0f4ff; color: #1d4ed8;
}
.nfs-mm-item--simple { padding: 7px 20px; font-size: 13px; }
.nfs-mm-icon { width: 20px; height: 20px; flex-shrink: 0; color: #6b7280; }
.nfs-mm-item:hover .nfs-mm-icon, .nfs-mm-item.is-active .nfs-mm-icon { color: #1d4ed8; }
.nfs-mm-chevron { width: 14px; height: 14px; color: #c7ced8; margin-left: auto; flex-shrink: 0; }
.nfs-mm-item:hover .nfs-mm-chevron, .nfs-mm-item.is-active .nfs-mm-chevron { color: #1d4ed8; }
.nfs-mm-all-btn {
  display: block; margin: 6px 12px; padding: 10px 16px;
  background: #f0f4ff; border-radius: 10px;
  font-size: 13px; font-weight: 700; color: #1d4ed8;
  text-decoration: none; text-align: center; transition: background .12s;
}
.nfs-mm-all-btn:hover { background: #dbeafe; }

/* Submenu panel */
.nfs-mm-sub {
  display: none;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  max-height: 70vh;
  overflow-y: auto;
}
.nfs-mm-sub.is-visible { display: flex; }
.nfs-mm-sub-header {
  padding: 18px 24px 12px;
  border-bottom: 1px solid #f1f5f9;
}
.nfs-mm-sub-tag {
  display: block;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: #6b7280;
  margin-bottom: 4px;
}
.nfs-mm-sub-title {
  font-size: 20px; font-weight: 800; color: #111827;
  margin: 0 0 4px; line-height: 1.2;
}
.nfs-mm-sub-desc {
  display: block;
  font-size: 13px; color: #6b7280; line-height: 1.4;
}
.nfs-mm-sub-body {
  display: flex; flex: 1; padding: 16px 24px 20px; gap: 20px;
}
.nfs-mm-columns {
  display: flex; gap: 24px; flex: 3;
}
.nfs-mm-col { min-width: 110px; }
.nfs-mm-col-title {
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .05em; color: #9ca3af;
  padding-bottom: 8px; margin-bottom: 4px;
  border-bottom: 1px solid #f1f5f9;
}
.nfs-mm-col-link {
  display: block; padding: 5px 0;
  font-size: 13px; font-weight: 500; color: #374151;
  text-decoration: none; transition: color .1s;
}
.nfs-mm-col-link:hover { color: #1d4ed8; }

/* Promo panel */
.nfs-mm-promo {
  flex: 2; min-width: 200px;
  background: #0f172a; border-radius: 14px;
  padding: 20px; color: #fff;
  display: flex; flex-direction: column; justify-content: flex-end;
  background-size: cover; background-position: center;
  position: relative; overflow: hidden;
}
.nfs-mm-promo::before {
  content: ''; position: absolute; inset: 0;
  background: var(--mm-promo-overlay, linear-gradient(180deg, transparent 30%, rgba(15,23,42,.85)));
  border-radius: 14px;
}
.nfs-mm-promo-content { position: relative; z-index: 1; }
.nfs-mm-promo-tag {
  display: inline-block; padding: 3px 10px;
  background: rgba(255,255,255,.15); border-radius: 6px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; margin-bottom: 10px;
}
.nfs-mm-promo-title { display: block; font-size: 17px; font-weight: 800; margin-bottom: 6px; font-style: normal; }
.nfs-mm-promo-text { font-size: 12px; color: rgba(255,255,255,.7); line-height: 1.4; margin-bottom: 12px; }
.nfs-mm-promo-btn {
  display: inline-block; padding: 8px 14px;
  background: #fff; color: #0f172a;
  border-radius: 8px; font-size: 12px; font-weight: 700;
  text-decoration: none; transition: opacity .15s;
  font-style: normal;
}
.nfs-mm-promo:hover .nfs-mm-promo-btn { opacity: .85; }
.nfs-mm-promo { text-decoration: none; color: #fff; }

/* Overlay */
.nfs-catalog-overlay {
  display: none; position: fixed; inset: 0; z-index: 99;
  background: rgba(0,0,0,.2);
}
.nfs-catalog-overlay.is-open { display: block; }

/* ── Search ── */
.nfs-search { position: relative; height: 48px; }
.nfs-search form { height: 100%; display: flex; }
.nfs-search input[type="text"] {
  width: 100%; height: 100%;
  border: 1px solid #e5e7eb; border-radius: 8px;
  padding: 0 56px 0 18px;
  font-size: 14px; font-family: inherit;
  color: #1f2937; background: #fff; outline: none;
  transition: border-color .15s;
}
.nfs-search input[type="text"]:focus { border-color: #1d4ed8; }
.nfs-search input::placeholder { color: #9ca3af; }
.nfs-search-btn {
  position: absolute; right: 6px; top: 6px;
  width: 36px; height: 36px;
  background: #1d4ed8; border-radius: 6px; border: none; padding: 0;
  display: grid; place-items: center; cursor: pointer;
}
.nfs-search-btn svg { width: 16px; height: 16px; color: #fff; }

/* ── Search dropdown results ── */
.nfs-search .products-search { position: relative; height: 100%; }
.nfs-search .form-search { height: 100%; display: flex; position: relative; }
.nfs-search .search-results {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 200;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.14);
  max-height: 420px;
  overflow-y: auto;
  padding: 8px;
}
.nfs-search .form-search.found-products .search-results,
.nfs-search .form-search.found-no-product .search-results {
  display: block;
}
.nfs-search .search-results .list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: #1f2937;
  transition: background 0.12s;
}
.nfs-search .search-results .list-item:hover {
  background: #f6f7f9;
}
.nfs-search .search-results .list-item a {
  text-decoration: none;
  color: inherit;
}
.nfs-search .search-results .list-item .image-item {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f6f7f9;
  border-radius: 8px;
  overflow: hidden;
}
.nfs-search .search-results .list-item .image-item img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}
.nfs-search .search-results .list-item .content-item {
  flex: 1;
  min-width: 0;
}
.nfs-search .search-results .list-item .title-item {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #1f2937;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.nfs-search .search-results .list-item .price-item {
  font-size: 13px;
  font-weight: 700;
  color: #1d4ed8;
  margin-top: 3px;
}
.nfs-search .search-results .list-item .rating-item {
  display: none;
}
.nfs-search .search-results .view-more {
  border-top: 1px solid #e5e7eb;
  margin-top: 4px;
  padding-top: 8px;
}
.nfs-search .search-results .view-more a {
  display: block;
  text-align: center;
  padding: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #1d4ed8;
  text-decoration: none;
  border-radius: 8px;
}
.nfs-search .search-results .view-more a:hover {
  background: #f0f4ff;
}
.nfs-search .merchant-loading {
  display: none;
  position: absolute;
  right: 52px;
  top: 50%;
  transform: translateY(-50%);
}
.nfs-search .form-search.searching .merchant-loading {
  display: block;
}

/* ── Actions ── */
.nfs-hdr-actions { display: flex; gap: 26px; align-items: center; }
.nfs-ha-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 12px; color: #374151; position: relative; text-decoration: none;
  font-family: inherit;
}
.nfs-ha-item svg { width: 22px; height: 22px; color: #111827; }
.nfs-ha-item:hover svg { color: #1d4ed8; }
.nfs-ha-item:hover { color: #1d4ed8; }
.nfs-badge {
  position: absolute; top: -4px; right: -10px;
  background: #1d4ed8; color: #fff; border-radius: 999px;
  font-size: 10px; font-weight: 700; padding: 1px 5px;
  min-width: 16px; height: 16px;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ── Mobile menu button ── */
.nfs-mobile-menu-btn {
  display: none;
  width: 44px; height: 44px;
  border: 1px solid #e5e7eb; border-radius: 8px;
  align-items: center; justify-content: center;
  background: #fff; cursor: pointer;
  color: #111827;
}
.nfs-mobile-menu-btn svg { width: 24px; height: 24px; stroke: currentColor; }

/* ── Mobile menu ── */
.nfs-mobile-menu {
  display: none; /* shown in mobile media query */
}
.nfs-mobile-overlay {
  display: none; position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.4);
  opacity: 0; transition: opacity .25s ease;
}
.nfs-mobile-overlay.open { display: block; opacity: 1; }
.nfs-mobile-menu-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid #e5e7eb;
}
.nfs-mobile-close {
  width: 36px; height: 36px;
  border: 1px solid #e5e7eb; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; cursor: pointer;
  padding: 0; color: #111827;
}
.nfs-mobile-close svg { width: 20px; height: 20px; stroke: currentColor; }
.nfs-mobile-nav ul { list-style: none; margin: 0; padding: 0; }
.nfs-mobile-nav > ul > li { border-bottom: 1px solid #e5e7eb; }
.nfs-mobile-nav a {
  display: block; padding: 14px 0;
  font-size: 16px; font-weight: 700; color: #0a2540; text-decoration: none;
}
.nfs-mobile-nav a:hover { color: #1d4ed8; }
.nfs-mobile-nav .sub-menu { padding-left: 16px; }
.nfs-mobile-nav .sub-menu a { font-size: 14px; font-weight: 500; color: #4b5563; }
.nfs-mobile-contacts {
  margin-top: 24px; display: flex; flex-direction: column; gap: 4px; font-size: 14px;
}
.nfs-mobile-contacts a { text-decoration: none; }

/* ── Sticky header ── */
.nfs-header.is-sticky {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
  animation: nfs-slide-down 0.25s ease;
}
.admin-bar .nfs-header.is-sticky {
  top: 32px;
}
.nfs-header-placeholder {
  display: none;
}
.nfs-header.is-sticky ~ .nfs-header-placeholder {
  display: block;
}
@keyframes nfs-slide-down {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

/* ── Callback link ── */
.nfs-callback-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: #1d4ed8;
  text-decoration: none;
  border-bottom: 1px dashed #1d4ed8;
  transition: color 0.15s;
}
.nfs-callback-link:hover {
  color: #1e40af;
  border-bottom-color: #1e40af;
}

/* ── Callback modal ── */
.nfs-callback-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
}
.nfs-callback-overlay.is-open { display: block; }

.nfs-callback-modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10002;
  width: 90%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.nfs-callback-modal.is-open { display: block; }

.nfs-callback-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}

.nfs-callback-modal__title {
  font-size: 20px;
  font-weight: 800;
  color: #0a2540;
}

.nfs-callback-modal__close {
  width: 36px;
  height: 36px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #6b7280;
  transition: background 0.12s, color 0.12s;
}
.nfs-callback-modal__close:hover {
  background: #f3f4f6;
  color: #111827;
}

.nfs-callback-modal__body {
  padding: 20px 24px 24px;
}

.nfs-callback-modal__body .wpcf7-form p {
  margin-bottom: 12px;
}

.nfs-callback-modal__body .wpcf7-form input[type="text"],
.nfs-callback-modal__body .wpcf7-form input[type="tel"],
.nfs-callback-modal__body .wpcf7-form input[type="email"],
.nfs-callback-modal__body .wpcf7-form textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  color: #1f2937;
  outline: none;
  transition: border-color 0.15s;
}

.nfs-callback-modal__body .wpcf7-form input:focus,
.nfs-callback-modal__body .wpcf7-form textarea:focus {
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.1);
}

.nfs-callback-modal__body .wpcf7-form input[type="submit"] {
  width: 100%;
  min-height: 48px;
  border: none;
  border-radius: 10px;
  background: #1d4ed8;
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.nfs-callback-modal__body .wpcf7-form input[type="submit"]:hover {
  background: #1e40af;
}

.nfs-callback-modal__body .wpcf7-response-output {
  margin: 12px 0 0 !important;
  padding: 10px 14px !important;
  border-radius: 8px !important;
  font-size: 13px;
}

/* ── Content spacing below header ── */
.nfs-header + .nfs-header-placeholder + *,
.nfs-header + * {
  margin-top: 0;
}
body:not(.home) .site-content {
  padding-top: 16px;
}

/* ── Hide theme header elements when custom header active ── */
.site-header .header-main,
.site-header .header-bottom,
.site-header .header-mobile,
.merchant-premium-topline,
#topbar.topbar { display: none !important; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
  .nfs-header > .container {
    grid-template-columns: auto 1fr auto auto;
    gap: 14px; height: 72px;
  }
  .nfs-btn-catalog { font-size: 13px; padding: 0 14px; height: 42px; gap: 7px; }
}

@media (max-width: 768px) {
  .nfs-topbar { display: none; }
  .nfs-header > .container {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    gap: 10px; height: auto;
    padding: 12px 16px;
    align-items: center;
  }
  .nfs-mobile-menu-btn {
    display: none;
  }
  .nfs-logo {
    grid-column: 1; grid-row: 1;
    justify-self: start;
  }
  .nfs-header-phone-mobile {
    display: inline-flex; align-items: center; gap: 6px;
    grid-column: 3; grid-row: 1;
    justify-self: end;
    color: #111827; font-weight: 700; font-size: 14px;
    text-decoration: none; white-space: nowrap;
  }
  .nfs-header-phone-mobile svg { width: 18px; height: 18px; flex: none; }
  /* Mobile: show combined logo image, hide icon + text.
     Scoped under .nfs-header to beat footer.css's unscoped .nfs-logo-text{display:flex}. */
  .nfs-header .nfs-logo-img { display: none; }
  .nfs-header .nfs-logo-text { display: none; }
  .nfs-header .nfs-logo-img-mobile { display: block; }
  .nfs-catalog-wrap { display: none; }
  .nfs-hdr-actions { display: none; }
  .nfs-search { grid-column: 1 / -1; grid-row: 2; }

  /* Mobile menu: slide from right */
  .nfs-mobile-menu {
    position: fixed; top: 0; right: 0; bottom: 0;
    left: auto; width: 85%; max-width: 360px;
    z-index: 10000;
    background: #fff;
    display: flex; flex-direction: column;
    padding: 20px; overflow-y: auto;
    font-family: 'Manrope', sans-serif;
    transform: translateX(100%);
    transition: transform .25s ease;
    box-shadow: -4px 0 24px rgba(0,0,0,.12);
  }
  .nfs-mobile-menu.open {
    transform: translateX(0);
  }
}
