/* ═══════════════════════════════════════════════
   ULTIMATEPRO — Navigation & Shared Components (v3 Premium Light)
   ═══════════════════════════════════════════════ */

/* ─── NAVBAR BASE ─── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 14px 24px;
  pointer-events: none;
  transition: background 300ms var(--ease-premium), padding 300ms var(--ease-premium), border-bottom 300ms var(--ease-premium);
}
@media (min-width: 768px) { .navbar { padding: 14px 40px; } }

.navbar.scrolled {
  background: rgba(236, 233, 228, 0.85); /* Warm Stone matching page canvas */
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(27, 29, 28, 0.06);
  padding: 8px 24px;
}
@media (min-width: 768px) {
  .navbar.scrolled {
    padding: 8px 40px;
  }
}
.dark-theme .navbar.scrolled {
  background: rgba(19, 21, 26, 0.85); /* Deep Charcoal Basalt */
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* ─── HEADER CONTAINER & 3-SLOT LAYOUT ─── */
.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

.header-logo {
  display: flex;
  align-items: center;
  pointer-events: all;
  text-decoration: none;
}

.header-actions {
  display: none;
  align-items: center;
  pointer-events: all;
}

.header-phone-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--bg-2);
  border: 1.5px solid var(--accent);
  border-radius: 100px;
  color: var(--accent);
  font-size: .875rem;
  font-weight: 700;
  transition: background-color 200ms var(--ease-premium), border-color 200ms var(--ease-premium),
              color 200ms var(--ease-premium), transform 200ms var(--ease-premium),
              box-shadow 200ms var(--ease-premium);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  pointer-events: all;
}
.header-phone-btn:hover {
  background: var(--accent);
  color: var(--white-real);
  transform: translateY(-1px);
  box-shadow: var(--shadow-accent);
}
.header-phone-btn svg {
  width: 14px;
  height: 14px;
  color: currentColor;
  transition: color var(--t);
}

@media (min-width: 1024px) {
  .header-logo {
    flex: 1 1 0%;
    justify-content: flex-start;
  }
  .nav-pill {
    margin: 0 auto !important;
  }
  .header-actions {
    display: flex;
    flex: 1 1 0%;
    justify-content: flex-end;
  }
}

/* ─── PILL — light glassmorphism ─── */
.nav-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  max-width: 95%;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(27, 29, 28, 0.08);
  border-radius: 100px;
  pointer-events: all;
  transition: background-color 300ms var(--ease-premium), border-color 300ms var(--ease-premium),
              box-shadow 300ms var(--ease-premium);
  box-shadow: 0 8px 32px rgba(27, 29, 28, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.nav-pill.pill-scrolled {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(27, 29, 28, 0.12);
  box-shadow: 0 12px 40px rgba(27, 29, 28, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  padding: 6px 16px;
}

/* ─── LOGO ─── */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-right: 8px;
  text-decoration: none;
}

/* Transparent logo badge container to fit logo perfectly on Warm Stone background */
.logo-badge {
  background: transparent;
  border: none;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--t);
}
.logo-badge:hover {
  transform: scale(1.02) translateY(-1px);
}
.logo-badge img {
  display: block;
  height: 138px;
  width: auto;
  transition: height 300ms var(--ease-premium);
}
.navbar.scrolled .logo-badge img {
  height: 104px;
}

/* Dark theme page logo blending override */
.dark-theme .logo-badge img {
  filter: brightness(0) invert(1);
}

/* Footer logo image inside transparent badge */
.footer-brand .footer-logo-badge {
  background: transparent;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  transition: transform var(--t);
}
.footer-brand .footer-logo-badge:hover {
  transform: scale(1.02) translateY(-1px);
}
.footer-brand .footer-logo-badge img {
  display: block;
  height: 110px;
  width: auto;
  filter: brightness(0);
}

/* ─── NAV LINKS ─── */
.nav-links {
  display: none;
  position: relative;
  align-items: center;
  gap: 2px;
  margin: 0 auto;
  flex: 1;
  justify-content: center;
}
@media (min-width: 1024px) { .nav-links { display: flex; } }

.nav-indicator {
  position: absolute;
  bottom: -6px;
  left: 0;
  /* Szerokość bazowa 1px — realną szerokość i pozycję ustawia nav.js
     przez scaleX/translateX, żeby nie animować left/width (layout). */
  width: 1px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transform-origin: left center;
  transition: transform 250ms cubic-bezier(.4,0,.2,1), opacity 250ms cubic-bezier(.4,0,.2,1);
  opacity: 0;
  pointer-events: none;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 100px;
  background: none;
  border: none;
  cursor: pointer;
  transition: color var(--t), background var(--t);
  white-space: nowrap;
  letter-spacing: .01em;
}
.nav-link:hover {
  color: var(--text-primary);
  background: rgba(27, 29, 28, 0.04);
}
.nav-link.active {
  color: var(--accent);
  background: var(--accent-dim);
}

.nav-chevron {
  width: 14px;
  height: 14px;
  transition: transform 250ms;
  color: var(--text-muted);
}
.nav-mega-trigger[aria-expanded="true"] .nav-chevron { transform: rotate(180deg); }

.mega-menu {
  position: absolute;
  top: calc(100% + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  width: min(900px, 92vw);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(27, 29, 28, 0.08);
  border-radius: 20px;
  box-shadow: 0 24px 72px rgba(27, 29, 28, 0.06), 0 0 0 1px rgba(181, 111, 27, 0.04);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms, transform 200ms;
  z-index: 100;
}
.mega-menu.open {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
}

.mega-inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(27, 29, 28, 0.06);
  padding: 1px;
}

.mega-col {
  background: var(--bg-2);
  padding: 20px;
  transition: background var(--t);
}
.mega-col:hover { background: #F4F2EE; }

.mega-category {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  text-decoration: none;
  transition: opacity 180ms;
}
.mega-category:hover { opacity: .75; }

.mega-cat-icon {
  width: 36px;
  height: 36px;
  background: var(--accent-dim);
  border: 1px solid rgba(232,160,0,.22);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}
.mega-cat-icon svg { width: 18px; height: 18px; }

.mega-category strong {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}
.mega-category span {
  font-size: .75rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.mega-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 48px;
}
.mega-links a {
  font-size: .8125rem;
  color: var(--text-secondary);
  padding: 4px 8px;
  border-radius: 6px;
  transition: background-color 150ms, color 150ms;
  text-decoration: none;
}
.mega-links a:hover {
  color: var(--accent);
  background: var(--accent-dim);
  padding-left: 12px;
}

.mega-footer {
  grid-column: span 3;
  background: var(--bg);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
}

.mega-all-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--accent);
  transition: gap 180ms;
}
.mega-all-link:hover { gap: 12px; }
.mega-all-link svg { width: 16px; height: 16px; }

.mega-contact-teaser {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .8125rem;
  color: var(--text-muted);
}
.mega-contact-teaser svg { width: 16px; height: 16px; color: var(--accent); }
.mega-contact-teaser a { color: var(--accent); font-weight: 600; }
.mega-contact-teaser a:hover { text-decoration: underline; }

/* ─── HAMBURGER ─── */
.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: auto;
}
@media (min-width: 1024px) { .hamburger { display: none; } }

.hamburger span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 220ms, opacity 220ms, background-color 220ms;
  transform-origin: center;
}
.hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ─── MOBILE OVERLAY ─── */
.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(236, 233, 228, 0.98);
  backdrop-filter: blur(24px);
  z-index: 999;
  display: flex;
  flex-direction: column;
  padding: 100px 32px 40px;
  transform: translateX(100%);
  opacity: 0;
  transition: transform 350ms var(--ease-premium), opacity 350ms;
  pointer-events: none;
  overflow-y: auto;
}
.mobile-overlay.open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: all;
}
@media (min-width: 1024px) { .mobile-overlay { display: none !important; } }

/* Style adjustments for navbar when mobile menu is open */
.navbar.menu-open {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-bottom: none !important;
}

.navbar.menu-open .nav-pill {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

/* Overlay menu mobilnego ma jasne tło (.mobile-overlay: rgba(236,233,228,.98)),
   więc tam logo i hamburger muszą być ciemne. */
.dark-theme .navbar.menu-open .logo-badge img {
  filter: brightness(0) !important;
}

/* UWAGA: na stronach .dark-theme pasek po przewinięciu jest CIEMNY
   (.dark-theme .navbar.scrolled → rgba(19,21,26,.85), linia 28).
   Logo zostaje więc białe — wcześniejsze wymuszanie brightness(0)
   dawało czarny znak na czarnym tle i logo znikało. */

/* Dark theme hamburger color handling */
.dark-theme .hamburger span {
  background: var(--text-dark-primary); /* Biały na ciemnym hero i na ciemnym pasku po scrollu */
}
.dark-theme .navbar.menu-open .hamburger span {
  background: var(--text-primary) !important; /* Ciemny tylko na jasnym overlayu menu */
}


.mobile-nav { display: flex; flex-direction: column; gap: 4px; }

.mob-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: color 180ms;
  letter-spacing: -.01em;
}
.mob-link:hover, .mob-link.active { color: var(--accent); }
.mob-link svg { width: 20px; height: 20px; color: var(--text-secondary); transition: transform 220ms; }
.mob-link.open svg { transform: rotate(180deg); }
.mob-link:last-child { border-bottom: none; }

.mob-accordion-body {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 8px 0 16px 16px;
  overflow: hidden;
}
.mob-accordion-body.open { display: flex; }
.mob-accordion-body a {
  font-size: 1rem;
  color: var(--text-secondary);
  padding: 8px 0;
  font-family: var(--font-body);
  font-weight: 500;
  transition: color 150ms;
  border-bottom: none;
}
.mob-accordion-body a:hover { color: var(--accent); }

.mob-cta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 32px;
}

/* ─── NAV CTA ─── */
.nav-cta {
  display: none;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  background: var(--accent);
  color: var(--dark) !important;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: .02em;
  border-radius: 100px;
  white-space: nowrap;
  text-decoration: none;
  flex-shrink: 0;
  transition: background 180ms, transform 150ms;
}
.nav-cta svg { width: 15px; height: 15px; flex-shrink: 0; }
.nav-cta:hover { background: var(--accent-dark); transform: scale(1.03); }
@media (min-width: 1024px) { .nav-cta { display: inline-flex; } }

/* ─── FOOTER ─── */
.footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding-top: 80px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 48px;
  padding-bottom: 64px;
}
@media (max-width: 900px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: span 2; }
}
@media (max-width: 480px) {
  .footer-inner { grid-template-columns: 1fr; }
  .footer-brand { grid-column: span 1; }
}

/* Footer logo inverted so it reads on dark bg — defined above in LOGO section */
.footer-brand p { font-size: .875rem; color: var(--text-secondary); line-height: 1.7; max-width: 300px; }
.footer-brand .footer-legal-info {
  margin-top: 16px;
  font-size: .75rem;
  color: var(--text-muted);
  line-height: 1.8;
}

.footer-col h4 {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: 20px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 12px; }
.footer-col li, .footer-col a {
  font-size: .875rem;
  color: var(--text-secondary);
  transition: color 180ms;
}
.footer-col a:hover { color: var(--accent); }
.footer-contact-link { display: inline-flex; align-items: center; gap: 9px; }
.footer-contact-link svg {
  width: 16px; height: 16px; flex-shrink: 0; color: var(--accent);
}
.footer-credit { color: var(--accent) !important; font-weight: 600; }
.footer-credit:hover { color: var(--accent-dark) !important; text-decoration: underline; }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 22px 0;
}
.footer-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-bottom span { font-size: .8125rem; color: var(--text-muted); }
.footer-legal { display: flex; gap: 20px; }
.footer-legal a { font-size: .8125rem; color: var(--text-muted); transition: color 180ms; }
.footer-legal a:hover { color: var(--accent); }

/* ─── BACK TO TOP ─── */
/* ─── FLOATING CONTACT BUTTONS ─── */
.float-contact {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 950;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.fc-btn {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,.22);
  transition: transform 200ms var(--ease-premium), box-shadow 200ms, background 200ms;
}
.fc-btn svg { width: 24px; height: 24px; }
.fc-phone { background: var(--accent); color: #fff; }
.fc-phone:hover { background: var(--accent-light); }
.fc-mail { background: var(--dark); color: #fff; }
.fc-mail:hover { background: #25272e; }
.fc-btn:hover { transform: translateY(-3px) scale(1.05); box-shadow: 0 12px 30px rgba(0,0,0,.3); }
.fc-phone::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: fcPulse 2s ease-out infinite;
  pointer-events: none;
}
@keyframes fcPulse {
  0%   { transform: scale(1); opacity: .7; }
  100% { transform: scale(1.6); opacity: 0; }
}
.fc-tip {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  background: var(--dark);
  color: #fff;
  font-size: .8125rem;
  font-weight: 600;
  white-space: nowrap;
  padding: 7px 12px;
  border-radius: 8px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 180ms, transform 180ms;
  pointer-events: none;
}
.fc-btn:hover .fc-tip { opacity: 1; visibility: visible; transform: translateY(-50%) translateX(0); }
@media (max-width: 600px) {
  .float-contact { bottom: 20px; right: 18px; gap: 12px; }
  .fc-btn { width: 50px; height: 50px; }
  .fc-btn svg { width: 21px; height: 21px; }
  .fc-tip { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .fc-phone::after { animation: none; }
}

.back-to-top {
  position: fixed;
  bottom: 32px;
  left: 32px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--dark);
  border-radius: 12px;
  box-shadow: var(--shadow-accent);
  transition: background-color 200ms, transform 200ms, box-shadow 200ms;
  z-index: 900;
  border: none;
  cursor: pointer;
}
.back-to-top:hover { background: var(--accent-light); transform: translateY(-3px); box-shadow: 0 12px 32px rgba(232,160,0,.4); }
.back-to-top svg { width: 20px; height: 20px; }
.back-to-top[hidden] { display: none; }

/* ─── PAGE HERO (subpages) ─── */
.page-hero {
  padding: calc(var(--nav-h, 76px) + 80px) 0 80px;
  background: var(--dark);
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 30% 50%, rgba(232,160,0,.07), transparent 65%);
  pointer-events: none;
}
.page-hero-content { position: relative; z-index: 1; }

/* Breadcrumb on dark hero */
.page-hero .page-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .8125rem;
  color: rgba(156,163,175,.7);
  margin-bottom: 24px;
}
.page-breadcrumb a { color: rgba(156,163,175,.7); transition: color 180ms; }
.page-breadcrumb a:hover { color: var(--accent); }
.page-breadcrumb span { color: rgba(245,244,242,.5); }
.page-breadcrumb svg { width: 14px; height: 14px; }

/* Section title/label on page-hero (dark) */
.page-hero .section-title { color: var(--white); }
.page-hero .section-label { color: var(--accent); }
.page-hero .section-label::before { background: var(--accent); }
.page-hero .section-desc { color: rgba(245,244,242,.6); }

/* Responsive adjustments for enlarged logo */
@media (max-width: 480px) {
  .logo-badge {
    padding: 6px 12px;
    border-radius: 8px;
  }
  .logo-badge img {
    height: 92px;
    transition: height 300ms var(--ease-premium);
  }
  .navbar.scrolled .logo-badge img {
    height: 74px;
  }
  .footer-brand .footer-logo-badge {
    padding: 6px 12px;
    border-radius: 8px;
  }
  .footer-brand .footer-logo-badge img {
    height: 75px;
  }
}

/* Bramkowanie ruchu na hover — na dotyku tapnięcie zostawiało element
   uniesiony. Kolory i tła zmieniają się dalej. */
@media (hover: none) {
  .nav-cta:hover,
  .fc-btn:hover,
  .fc-btn:hover .fc-tip,
  .back-to-top:hover,
  .logo-badge:hover,
  .footer-brand .footer-logo-badge:hover {
    transform: none;
  }
}
