/* =========================================================
   Phenomenal Wear additions
   Loader, language switch, WhatsApp icon, smooth scrolling
   and typography consistency fixes.
   ========================================================= */

/* ---------- Typography consistency ---------- */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

/* Body copy used 1.3 on large screens and 1.4 elsewhere; one comfortable value everywhere */
p.mbr-text,
p.card-text {
  line-height: 1.5;
}

/* Multi-line headings had line-height 1 at these widths (lines touching), 1.1 / 1.3 elsewhere */
@media (min-width: 769px) and (max-width: 991px), (min-width: 1401px) {
  .display-1 { line-height: 1.1; }
  .display-2 { line-height: 1.2; }
}

/* Justified text in narrow columns stretched the gaps between words
   (home slider captions, About hero). Keep the left edge, drop the stretching. */
.cid-vbErzjm0vd .mbr-section-text,
.cid-vbErzjm0vd .mbr-section-btn,
.cid-vduNUwkyBN .mbr-text,
.cid-vduNUwkyBN .mbr-section-btn,
.cid-vduNUwkyBN .mbr-section-title {
  text-align: left;
}

/* Translated text wrappers keep their parent's line spacing */
span[data-i18n] {
  line-height: inherit;
}

/* Polish has longer words: hyphenate instead of breaking mid-word */
html[lang="pl"] p,
html[lang="pl"] h1,
html[lang="pl"] h2,
html[lang="pl"] h3,
html[lang="pl"] h4,
html[lang="pl"] h5 {
  -webkit-hyphens: auto;
  hyphens: auto;
}

/* ---------- Smooth scrolling (Lenis) ---------- */

html.lenis,
html.lenis body {
  height: auto;
}

html.lenis {
  scroll-behavior: auto !important;
}

.lenis:not(.lenis-autoToggle).lenis-stopped {
  overflow: clip;
}

.lenis [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-smooth iframe {
  pointer-events: none;
}

/* ---------- Site loader ---------- */

html.pw-loading,
html.pw-loading body {
  overflow: hidden;
}

#pwLoader {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #000;
  color: #fff;
  clip-path: inset(0 0 0 0);
  transition: clip-path 0.9s cubic-bezier(0.76, 0, 0.24, 1), visibility 0s linear 0.9s;
}

#pwLoader.pwl-done {
  clip-path: inset(0 0 100% 0);
  visibility: hidden;
  pointer-events: none;
}

/* soft breathing light behind the logo */
#pwLoader::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 80vmax;
  height: 80vmax;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0) 55%);
  animation: pwlBreathe 2.6s ease-in-out infinite;
  pointer-events: none;
}

.pwl-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 24px;
  transition: transform 0.9s cubic-bezier(0.76, 0, 0.24, 1), opacity 0.6s ease;
}

#pwLoader.pwl-done .pwl-inner {
  transform: translateY(-40px);
  opacity: 0;
}

.pwl-logo-wrap {
  position: relative;
  width: clamp(104px, 26vw, 148px);
  aspect-ratio: 1 / 1;
  margin-bottom: 28px;
}

/* background image rather than <img>: theme/js/script.js hides every <img>
   until it is scrolled into view, which would hide the loader logo */
.pwl-logo {
  position: relative;
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
  background: url("../images/roundlogo.png") center / cover no-repeat;
  opacity: 0;
  transform: scale(0.55);
  filter: blur(8px);
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.35);
  animation:
    pwlLogoIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards,
    pwlPulse 2s ease-out 1.1s infinite;
}

.pwl-ring {
  position: absolute;
  inset: -12px;
  width: calc(100% + 24px);
  height: calc(100% + 24px);
  overflow: visible;
  animation: pwlSpin 2.4s linear infinite;
}

.pwl-ring circle {
  fill: none;
  stroke: #fff;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: 360;
  stroke-dashoffset: 360;
  animation: pwlDraw 1.6s cubic-bezier(0.65, 0, 0.35, 1) 0.2s forwards;
}

.pwl-brand {
  font-family: 'Montserrat', 'Inter Tight', Arial, sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1.05;
}

.pwl-line {
  display: block;
  overflow: hidden;
  padding: 0.04em 0;
}

.pwl-line span {
  display: inline-block;
  font-size: clamp(26px, 7vw, 54px);
  font-weight: 900; /* theme/css/style.css forces 400 on every span */
  line-height: 1.05;
  letter-spacing: 0.35em;
  transform: translateY(110%);
  background: linear-gradient(100deg, #fff 38%, #8a8a8a 50%, #fff 62%);
  background-size: 250% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation:
    pwlRise 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards,
    pwlTrack 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards,
    pwlShine 2.4s linear 1.5s infinite;
}

.pwl-line + .pwl-or + .pwl-line span {
  animation-delay: 0.72s, 0.72s, 1.7s;
}

.pwl-or {
  display: block;
  margin: 6px 0;
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: #777;
  letter-spacing: 0.45em;
  text-transform: lowercase;
  opacity: 0;
  animation: pwlFade 0.6s ease 0.65s forwards;
}

.pwl-bar-wrap {
  width: 180px;
  height: 2px;
  margin-top: 30px;
  background: #222;
  overflow: hidden;
  border-radius: 2px;
  opacity: 0;
  animation: pwlFade 0.4s ease 0.4s forwards;
}

.pwl-bar {
  height: 100%;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left center;
  animation: pwlFill 2.1s cubic-bezier(0.4, 0, 0.2, 1) 0.45s forwards;
}

.pwl-tag {
  margin-top: 16px;
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: #9a9a9a;
  letter-spacing: 0.28em;
  line-height: 1.6;
  text-transform: uppercase;
  opacity: 0;
  animation: pwlFadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 1.25s forwards;
}

/* Returning pages in the same visit: quick branded loader (logo + ring + bar) */
html.pw-seen .pwl-brand,
html.pw-seen .pwl-tag {
  display: none;
}

html.pw-seen .pwl-logo {
  animation:
    pwlLogoIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards,
    pwlPulse 2s ease-out 0.5s infinite;
}

html.pw-seen .pwl-ring circle {
  animation-duration: 0.8s;
  animation-delay: 0s;
}

html.pw-seen .pwl-bar-wrap {
  margin-top: 8px;
  animation-delay: 0s;
}

html.pw-seen .pwl-bar {
  animation-duration: 0.7s;
  animation-delay: 0s;
}

@keyframes pwlLogoIn {
  to { opacity: 1; transform: scale(1); filter: blur(0); }
}

@keyframes pwlPulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.35); }
  100% { box-shadow: 0 0 0 26px rgba(255, 255, 255, 0); }
}

@keyframes pwlSpin {
  to { transform: rotate(360deg); }
}

@keyframes pwlDraw {
  to { stroke-dashoffset: 90; }
}

@keyframes pwlRise {
  to { transform: translateY(0); }
}

@keyframes pwlTrack {
  to { letter-spacing: 0.02em; }
}

@keyframes pwlShine {
  from { background-position: 100% 0; }
  to { background-position: -150% 0; }
}

@keyframes pwlFade {
  to { opacity: 1; }
}

@keyframes pwlFadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pwlFill {
  to { transform: scaleX(1); }
}

@keyframes pwlBreathe {
  0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(0.92); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.04); }
}

@media (prefers-reduced-motion: reduce) {
  #pwLoader *,
  #pwLoader::before {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
  }
  #pwLoader {
    clip-path: none;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
  }
  #pwLoader.pwl-done {
    clip-path: none;
    opacity: 0;
  }
}

/* ---------- Language switch (EN / PL) ---------- */

.pw-lang {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 3px;
  border: 1.5px solid #000;
  border-radius: 999px;
  background: #fff;
}

.pw-lang::before {
  content: "";
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  border-radius: 999px;
  background: #000;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

html[lang="pl"] .pw-lang::before {
  transform: translateX(100%);
}

.pw-lang button {
  position: relative;
  z-index: 1;
  width: 2.6rem;
  margin: 0;
  padding: 0.45rem 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #000;
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  cursor: pointer;
  transition: color 0.3s ease;
}

.pw-lang button[aria-pressed="true"] {
  color: #fff;
}

.pw-lang--desktop {
  margin-left: 0.75rem;
}

.pw-lang--mobile {
  display: none;
  order: 999;
}

@media (max-width: 991px) {
  .pw-lang--desktop { display: none; }
  .pw-lang--mobile { display: inline-flex; }
}

@media (max-width: 767px) {
  .pw-lang button {
    width: 2.3rem;
    padding: 0.4rem 0;
    font-size: 0.7rem;
  }
}

/* ---------- WhatsApp chatbot icon ---------- */

.wa-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.wa-button svg {
  width: 32px;
  height: 32px;
  fill: #fff;
  display: block;
}
