/* --- Mobile Optimization (generic, non-destructive) --- */
:root{--container-pad:clamp(12px,4vw,24px);--gap:clamp(12px,3vw,24px)}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
html,body{overflow-x:hidden}
body{-webkit-text-size-adjust:100%;text-rendering:optimizeLegibility}
img,video,canvas,iframe{max-width:100%;height:auto}
picture,figure{display:block}
a,button{-webkit-tap-highlight-color:rgba(0,0,0,.1)}
/* Containers */
.container,[class*="container"]{padding-left:var(--container-pad);padding-right:var(--container-pad)}
/* Tables */
table{width:100%;display:block;overflow-x:auto;-webkit-overflow-scrolling:touch}
/* Buttons */
button,.btn,a.button{min-height:44px;padding:.6rem 1rem}
/* Typography scaling */
h1{font-size:clamp(28px,7vw,48px);line-height:1.1}
h2{font-size:clamp(22px,5.5vw,36px)}
h3{font-size:clamp(18px,4.5vw,28px)}
p,li{font-size:clamp(14px,4vw,18px)}
/* Grid fallback */
.grid,[class*="grid"],.row{gap:var(--gap)}
@media (max-width:1024px){
  nav ul{gap:clamp(8px,2vw,16px)}
}
@media (max-width:768px){
  /* Hide desktop nav if present */
  /* removed conflicting hide rule */
  /* Generic single column */
  .grid,[class*="grid"],.row{display:grid !important;grid-template-columns:1fr !important}
  .col,[class^="col-"],[class*=" col-"]{width:100% !important;max-width:100% !important}
  /* Footer sanity */
  footer, footer .row{display:block !important}
  footer .inline, footer nav{overflow-x:auto;white-space:nowrap;gap:16px}
  /* Drawer */
  .mobile-nav-button{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;background:transparent;border:0;margin-left:auto}
  .mobile-nav-drawer{position:fixed;inset:0 0 0 30%;background:rgba(255,255,255,.98);backdrop-filter:blur(4px);transform:translateX(100%);transition:transform .3s ease;padding:24px;z-index:9999;box-shadow:-8px 0 24px rgba(0,0,0,.08)}
  .mobile-nav-drawer.open{transform:translateX(0)}
  .mobile-nav-drawer nav, .mobile-nav-drawer ul{display:block !important}
  .mobile-nav-drawer a{display:block;padding:.75rem 0;border-bottom:1px solid rgba(0,0,0,.07)}
  .mobile-nav-close{position:absolute;top:8px;right:12px;font-size:28px;background:transparent;border:0}
}
/* Utility */
.hide-mobile{display:none}
@media (min-width:769px){.hide-desktop{display:none}.hide-mobile{display:revert}}
/* Prevent layout jumps on images without size */
img[loading="lazy"]{contain:paint}

/* --- Fix: Google Maps embed responsive & full height --- */
.map, .map-embed, .mapWrapper, .map-container { position: relative; width: 100%; overflow: hidden; border-radius: inherit; }
.map, .map-embed, .mapWrapper, .map-container { aspect-ratio: 16 / 9; } /* fallback when parent has no fixed height */
.map iframe, .map-embed iframe, .mapWrapper iframe, .map-container iframe, iframe[src*="google.com/maps"]{width:100% !important;max-width:100%;border:0;display:block;height:320px}
/* Ensure cards/columns don't clip the map on mobile */
@media (max-width: 768px){
  .map, .map-embed, .mapWrapper, .map-container { min-height: 320px; }
}

/* --- Fix: top safe-area & unexpected top stripe on iOS (granatowy pasek) --- */
:root{ --header-bg: #ffffff; } /* dopasuj do tła nagłówka */
@supports (padding: env(safe-area-inset-top)) {
  header { padding-top: max(env(safe-area-inset-top), 0px); background: var(--header-bg); }
  body { background: #ffffff; }
}
/* Guard: usuń ewentualne cienkie paski nad headerem na mobile */
@media (max-width: 768px){
  .top-bar, .blue-bar, .nav-top-stripe { display: none !important; }
  header { margin-top: 0 !important; }
}

/* Scoped absolute fill only when wrapped in a map container */
.map, .map-embed, .mapWrapper, .map-container { position: relative; width: 100%; overflow: hidden; border-radius: inherit; }
.map, .map-embed, .mapWrapper, .map-container { aspect-ratio: 16 / 9; }
.map iframe, .map-embed iframe, .mapWrapper iframe, .map-container iframe {
  position: absolute; inset: 0; width: 100% !important; height: 100% !important; border: 0; display: block;
}
@media (max-width:768px){ .map, .map-embed, .mapWrapper, .map-container { min-height: 320px; } }

/* --- Map fill: make Google Maps iframe fill the entire card --- */
.card.map-container{position:relative; overflow:hidden; padding:0 !important; border-radius:inherit; min-height:320px}
.card.map-container iframe[src*="google.com/maps"]{position:absolute; inset:0; width:100% !important; height:100% !important; border:0; display:block}
@media (min-width:769px){ .card.map-container{min-height:380px} }


/* --- Mobile: 'Oferta' section - image on top, text below --- */
@media (max-width: 768px){
  #tab-oferta .service-slab,
  #tab-oferta .service-slab.alt{
    display:flex !important;
    flex-direction:column !important;
  }
  #tab-oferta .slab-media{ order:0 !important; }
  #tab-oferta .slab-body{ order:1 !important; }
}


/* --- Topbar polish: tighter spacing & single-line contacts --- */
.topbar .inner{ gap:12px; }
.topbar .row{ display:flex; align-items:center; gap:12px; flex-wrap:nowrap; }
.topbar .row a{ white-space:nowrap; }
@media (max-width: 600px){
  .topbar .inner{ flex-wrap:wrap; justify-content:center; text-align:center; gap:8px; }
  .topbar .row{ gap:10px; }
}



}


/* --- Mobile: 'Zespół' section - big photo panel first, description below --- */
@media (max-width: 768px){
  #tab-zespol .team-layout{ display:flex !important; flex-direction:column !important; gap:16px; }
  #tab-zespol .left-col{ order:0 !important; }
  #tab-zespol .team-aside{ order:1 !important; margin-top:8px; }
}


/* --- Topbar redesign --- */
.topbar{
  background: linear-gradient(90deg, #0B1F3A 0%, #113864 100%);
  color:#fff;
  font-size:14px;
  line-height:1.1;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.topbar .inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:8px 0;
}
.topbar a{ color:#fff; text-decoration:none; }
.topbar .row{
  display:flex;
  align-items:center;
  gap:14px;
  flex-wrap:nowrap;
}
/* subtle separators between links */
.topbar .row a + a{ position:relative; padding-left:12px; }
.topbar .row a + a::before{
  content:'';
  position:absolute; left:0; top:50%; transform:translateY(-50%);
  width:1px; height:14px; background:rgba(255,255,255,.25);
}

/* icons via CSS masks (wide support incl. iOS with -webkit-mask) */
.topbar .row a[href^="tel"]::before,
.topbar .row a[href^="mailto"]::before{
  content:''; display:inline-block; width:14px; height:14px; margin-right:6px;
  background:#fff;
  -webkit-mask-repeat:no-repeat; mask-repeat:no-repeat;
  -webkit-mask-position:center; mask-position:center;
  -webkit-mask-size:contain; mask-size:contain;
}
.topbar .row a[href^="tel"]::before{
  -webkit-mask-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23000" d="M6.6 10.8c1.5 2.9 3.7 5.1 6.6 6.6l2.2-2.2c.3-.3.8-.4 1.2-.3 1.3.4 2.8.6 4.3.6.7 0 1.2.5 1.2 1.2V21c0 .7-.5 1.2-1.2 1.2C10.5 22.2 1.8 13.5 1.8 2.4 1.8 1.7 2.3 1.2 3 1.2H6c.7 0 1.2.5 1.2 1.2 0 1.5.2 3 .6 4.3.1.4 0 .9-.3 1.2L6.6 10.8z"/></svg>');
          mask-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23000" d="M6.6 10.8c1.5 2.9 3.7 5.1 6.6 6.6l2.2-2.2c.3-.3.8-.4 1.2-.3 1.3.4 2.8.6 4.3.6.7 0 1.2.5 1.2 1.2V21c0 .7-.5 1.2-1.2 1.2C10.5 22.2 1.8 13.5 1.8 2.4 1.8 1.7 2.3 1.2 3 1.2H6c.7 0 1.2.5 1.2 1.2 0 1.5.2 3 .6 4.3.1.4 0 .9-.3 1.2L6.6 10.8z"/></svg>');
}
.topbar .row a[href^="mailto"]::before{
  -webkit-mask-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23000" d="M20 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zm0 4-8 5L4 8V6l8 5 8-5v2z"/></svg>');
          mask-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23000" d="M20 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zm0 4-8 5L4 8V6l8 5 8-5v2z"/></svg>');
}

/* address icon */
.topbar .inner > div:first-child{ position:relative; padding-left:20px; }
.topbar .inner > div:first-child::before{
  content:''; position:absolute; left:0; top:50%; transform:translateY(-50%);
  width:14px; height:14px; background:#fff;
  -webkit-mask-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23000" d="M12 2a7 7 0 0 0-7 7c0 5.25 7 13 7 13s7-7.75 7-13a7 7 0 0 0-7-7zm0 9.5a2.5 2.5 0 1 1 0-5 2.5 2.5 0 0 1 0 5z"/></svg>');
          mask-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23000" d="M12 2a7 7 0 0 0-7 7c0 5.25 7 13 7 13s7-7.75 7-13a7 7 0 0 0-7-7zm0 9.5a2.5 2.5 0 1 1 0-5 2.5 2.5 0 0 1 0 5z"/></svg>');
}

/* mobile layout tweaks */
@media (max-width: 768px){
  .topbar .inner{ flex-wrap:wrap; justify-content:center; text-align:center; padding:6px 0; gap:10px; }
  .topbar .row{ gap:12px; }
  .topbar .row a + a{ padding-left:0; }
  .topbar .row a + a::before{ display:none; }
}


/* --- Mobile strict layout for 'Zespół' --- */
@media (max-width: 768px){
  /* stack */
  #tab-zespol .team-layout{ display:flex !important; flex-direction:column !important; gap:16px !important; }
  #tab-zespol .left-col{ order:0 !important; }
  #tab-zespol .team-aside{ order:1 !important; margin-top:12px !important; width:100% !important; padding:0 16px !important; }
  #tab-zespol .team-aside *{ max-width:100% !important; }
  /* center slider and prevent overflow */
  #tab-zespol .team-slider{ width:100% !important; max-width:100% !important; margin:12px auto !important; }
  #tab-zespol .team-slider .panel{ width:100% !important; height:auto !important; aspect-ratio: 3 / 4 !important; }
  #tab-zespol .team-slider .layer{ inset:0 !important; }
}


/* --- Ensure hamburger menu is closed by default on mobile --- */
@media (max-width: 900px){
  .nav ul{ display:none; }
}


/* --- Hide topbar on small screens --- */
@media (max-width: 768px){
  .topbar{ display:none !important; }
}


/* --- Support class to force 100% width/ratio on slider --- */
#tab-zespol #team-slider.mobile-override{ width:100% !important; max-width:100% !important; }
#tab-zespol #team-slider.mobile-override .panel{ width:100% !important; height:auto !important; aspect-ratio:3/4 !important; }


/* --- Mobile nav dropdown clickability & stacking --- */
@media (max-width: 900px){
  .nav{ z-index: 2000; }
  .nav .inner{ position: relative; }
  .nav ul{
    z-index: 2100;
    pointer-events: auto;
  }
}


/* --- Oferta mobile: text edge padding --- */
@media (max-width: 768px){
  #tab-oferta .slab-body{ padding: 12px 16px !important; }
}


/* --- Improve tap behavior & prevent invisible overlays from blocking --- */
@media (max-width: 900px){
  a, button, [role="button"]{ touch-action: manipulation; cursor: pointer; }
  /* ensure sticky nav does not block clicks below it */
  .nav{ pointer-events: auto; }
  /* when menu is hidden, links container must not receive events */
  
}


/* --- Class-based mobile nav (robust) --- */
@media (max-width: 900px){
  .nav ul{ display:none; position:absolute; right:20px; top:58px; }
  .nav.is-open ul{ display:flex; }
  #hamb[aria-expanded="true"]::after{ content:''; }
}


/* --- Ensure hamburger is top-most and clickable --- */
@media (max-width: 900px){
  .nav{ z-index: 3000; }
  .nav .inner{ position: relative; }
  #hamb{ position: relative; z-index: 3100; }
  .nav ul{ z-index: 3050; }
}


/* --- Mobile team panel: ensure visible height on WebViews without aspect-ratio support --- */
@media (max-width: 768px){
  #tab-zespol .team-slider{ width:100% !important; max-width:100% !important; }
  #tab-zespol .team-slider .panel{
    aspect-ratio: auto !important;
    height: clamp(360px, calc(100vw * 1.20), 620px) !important;
    min-height: 360px !important;
  }
}


/* --- Team slider layers: ensure visible background on mobile --- */
#tab-zespol .team-slider .panel{ background:#000; }
#tab-zespol .team-slider .layer{ background-size:cover; background-position:center; }


/* --- Strong mobile nav state (override any inline display) --- */
@media (max-width: 900px){
  .nav ul{ display:none; position:absolute; right:20px; top:58px; }
  .nav.is-open ul{ display:flex; }
}


/* --- Team slider panel background rendering --- */
#tab-zespol .team-slider .panel{ background-color:#000; background-size:cover; background-position:center; }


/* --- Mobile: center the team slider panel above text (final) --- */
@media (max-width: 768px){
  #tab-zespol .team-layout{ display:block !important; }
  #tab-zespol .team-slider{ display:block; width:100% !important; max-width:100% !important; margin:0 auto 16px auto !important; overflow:hidden; border-radius:18px; }
  #tab-zespol .team-slider .panel{ width:100% !important; min-height:360px !important; height: calc(100vw * 1.2) !important; }
  #tab-zespol .team-slider .layer{ background-size:cover !important; background-position:center !important; }
}
/* --- Menu clickability --- */
@media (max-width: 900px){
  .nav.is-open ul{ pointer-events:auto !important; }
}


/* --- Desktop: make Google Map fill its card --- */
@media (min-width: 1025px){
  .map-container{ aspect-ratio: auto !important; height: 100% !important; }
  .map-container iframe{ height: 100% !important; width: 100% !important; display:block; }
}


/* --- Ensure mobile nav button and list are clickable above content --- */
@media (max-width: 900px){
  .nav{ z-index: 3000; }
  .nav .inner{ position: relative; }
  #hamb{ position: relative; z-index: 3100; }
  .nav ul{ z-index: 3050; }
}
