/* === Montserrat — self-hosted (latin + latin-ext, 400 + 700) === */
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/montserrat-latin-ext-400-normal.woff2') format('woff2');
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/montserrat-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/montserrat-latin-ext-700-normal.woff2') format('woff2');
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/montserrat-latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* === Design Tokens (CSS Variables) === */
:root {
  --color-white: #FFFFFF;
  --color-primary-dark: #394C58;
  --color-accent-blue: #B4CBD9;
  --color-accent-magenta: #B73E66;
  --color-text-dark: #000000;
  --color-text-muted: #5E7D90;
}

/* === Reset & Base === */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* <picture> bierze udzial w drzewie tylko jako wrapper <img>+<source>.
   display:contents sprawia ze elementy-dzieci sa traktowane jakby byly
   bezposrednimi dziecmi rodzica <picture>, dzieki czemu istniejace klasy
   Tailwinda na <img> (np. w-full h-full absolute) dzialaja bez zmian. */
picture {
  display: contents;
}

/* === Scrollbar Hide (horizontal scroll sections) === */
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

/* === Focus ring (a11y) — visible only for keyboard users === */
:focus-visible {
  outline: 2px solid var(--color-primary-dark);
  outline-offset: 2px;
}

/* === Color Picker Section === */
.color-dot {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.color-dot:hover {
  transform: scale(1.15);
}

.color-dot.active {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--color-primary-dark);
}

/* Pop animation — odpalane po zmianie aktywnego koloru.
   cubic-bezier daje delikatny "sprężysty" overshoot. */
@keyframes mug-pop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}
.mug-pop {
  animation: mug-pop 450ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Desktop: animacja FLIP (translateX) kubków może wychodzić poza kontener
   podczas przejścia — clip zamiast auto-scroll, żeby nie dostać paska i
   żeby scroll-handler nie odpalał się w trakcie carouselu. */
@media (min-width: 1024px) {
  #color-mugs { overflow-x: clip; }
}

/* === Features Section === */
.feature-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--color-accent-magenta);
}

/* Desktop layout (xl+): feature titles semi-transparent at rest, full on active.
   Title toggles INSTANT (no transition) — the highlight should feel like a hard
   snap. Description fades in slowly with a small delay, fast fade-out. */
@media (min-width: 1280px) {
  .feature-hover h3 {
    opacity: 0.3;
  }
  .feature-hover.is-hover h3 {
    opacity: 1;
  }
  .feature-hover .feature-desc {
    opacity: 0;
    transition: opacity 0.2s ease-out;
    pointer-events: none;
  }
  .feature-hover.is-hover .feature-desc {
    opacity: 1;
    transition: opacity 0.4s ease-out 0.1s;
  }
}

/* Pulsing dots — draw attention to the clickable feature markers */
@keyframes feature-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(183, 62, 102, 0.55); }
  70%  { box-shadow: 0 0 0 24px rgba(183, 62, 102, 0);   }
  100% { box-shadow: 0 0 0 0   rgba(183, 62, 102, 0);    }
}
.feature-pulse {
  animation: feature-pulse 2s ease-out infinite;
}
.feature-hover.is-hover .feature-pulse {
  animation: none;
}

/* Phone dots: ALL pulse always (via ::before). Inactive at 25% opacity, active full.
   Animation-delay per-dot via --pulse-delay so they don't all flash in unison. */
.feature-dot-m {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: transparent !important;
  opacity: 0.5;
  touch-action: manipulation;
  transition: opacity 200ms ease;
}
.feature-dot-m.is-active {
  opacity: 1;
}
.feature-dot-m.is-active::before {
  animation: none;
}
.feature-dot-m::after {
  content: '';
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--color-accent-magenta);
}
.feature-dot-m::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--color-accent-magenta);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(1);
  animation: feature-pulse-m 2s ease-out infinite;
  animation-delay: var(--pulse-delay, 0s);
}
@keyframes feature-pulse-m {
  0%   { transform: translate(-50%, -50%) scale(1);   opacity: 0.55; }
  70%  { transform: translate(-50%, -50%) scale(5.6); opacity: 0;    }
  100% { transform: translate(-50%, -50%) scale(5.6); opacity: 0;    }
}

.features-cta-wrap {
  max-width: 1920px;
  margin: 28px auto 0;
  padding: 0 20px;
  display: flex;
  justify-content: center;
}

#features + #why-water {
  margin-top: 28px;
}

.shop-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 608px;
  height: 43px;
  background-color: var(--color-accent-blue);
  border: 2px solid var(--color-primary-dark);
  color: var(--color-primary-dark);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color 200ms ease, color 200ms ease, opacity 200ms ease;
}

.shop-cta-btn:hover {
  background-color: var(--color-primary-dark);
  color: #fff;
}

.shop-cta-btn[aria-disabled="true"] {
  cursor: default;
  opacity: 0.55;
}

.shop-cta-btn[aria-disabled="true"]:hover {
  background-color: var(--color-accent-blue);
  color: var(--color-primary-dark);
}

.cart-item[aria-disabled="true"],
.cart-cta-btn[aria-disabled="true"] {
  cursor: default;
  opacity: 0.55;
}

.cart-cta-btn[aria-disabled="true"]:hover {
  background-color: #fff;
}

@media (min-width: 1024px) {
  .features-cta-wrap {
    margin-top: 38px;
    padding: 0 50px;
  }

  #features + #why-water {
    margin-top: 38px;
  }

  .shop-cta-btn {
    height: 58px;
    font-size: 22px;
  }
}

/* === Hero Section === */
#hero {
  --hero-copy-edge: 20px;
  --hero-subheadline-bottom: 16px;
  --hero-subheadline-padding: 14px;
}

.hero-swiper .swiper-slide {
  overflow: hidden;
}

.hero-subheadline-wrap {
  position: absolute;
  right: var(--hero-copy-edge);
  bottom: var(--hero-subheadline-bottom);
  width: calc(100% - (var(--hero-copy-edge) * 2));
  display: flex;
  justify-content: flex-end;
  margin: 0;
}

.hero-subheadline {
  width: max-content;
  max-width: calc(100vw - (var(--hero-copy-edge) * 2));
  box-sizing: border-box;
  padding: var(--hero-subheadline-padding);
  background-color: rgba(180, 203, 217, 0.7);
}

.hero-subheadline-text {
  margin: 0;
  color: var(--color-primary-dark);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.08;
  text-align: right;
}

.hero-arrow-prev,
.hero-arrow-next {
  transition: opacity 0.2s ease;
  cursor: pointer;
}

.hero-arrow-prev:hover,
.hero-arrow-next:hover {
  opacity: 0.75;
}

/* Hero pagination — below the slider (style matches color picker dots pattern) */
.hero-pagination {
  display: flex;
  justify-content: center;
  gap: 14px;
  padding: 20px 0;
}

.hero-bullet {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--color-accent-blue);
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
  border: none;
  padding: 0;
}

.hero-bullet:hover {
  transform: scale(1.15);
}

.hero-bullet-active {
  background-color: var(--color-primary-dark);
  transform: scale(1.15);
}

@media (min-width: 1024px) {
  #hero {
    --hero-copy-edge: 50px;
    --hero-subheadline-bottom: 45px;
    --hero-subheadline-padding: 29px;
  }

  .hero-subheadline {
    max-width: calc(100vw - (var(--hero-copy-edge) * 2));
  }

  .hero-subheadline-text {
    font-size: clamp(24px, 2.25vw, 43px);
  }

  .hero-pagination {
    gap: 14px;
    padding: 24px 0;
  }
  .hero-bullet {
    width: 14px;
    height: 14px;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .hero-subheadline-text {
    font-size: 26px;
  }
}

/* === Why Water Section === */
.why-water-track {
  position: absolute;
  top: 0;
  display: flex;
  flex-direction: column;
  animation: hashtag-scroll 60s linear infinite;
  will-change: transform;
}

.why-water-hashtag {
  writing-mode: vertical-rl;
}

#why-water h2 {
  text-wrap:balance;
}

#why-water p {
  text-align: left;
}

@keyframes hashtag-scroll {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(0, -50%, 0); }
}

/* === Marquee Animation === */
@keyframes marquee {
  /* Do uzupełnienia przy implementacji sekcji 7 */
}

/* === Cart Button & Panel === */

.cart-btn {
  border: 2px solid var(--color-primary-dark);
  background: rgba(255, 255, 255, 0.80);
  color: var(--color-primary-dark);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.cart-btn[aria-expanded="true"] {
  background-color: rgba(180, 203, 217, 0.5);
  color: var(--color-primary-dark);
}
@media (hover: hover) and (pointer: fine) {
  .cart-btn:hover {
    background-color: rgba(180, 203, 217, 0.5);
    color: var(--color-primary-dark);
    transform: translateY(-1px);
  }
}
.cart-btn:focus-visible {
  outline: 2px solid var(--color-accent-magenta);
  outline-offset: 3px;
}

@media (min-width: 1024px) {
  .cart-btn {
    font-size: 14px;
  }
}

/* sticky header — tło z delikatną przezroczystością */
#header {
  background-color: rgba(255, 255, 255, 0.80);
  transform: translateZ(0);
  will-change: transform;
}

#header.is-scrolled {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

@media (max-width: 1023px) {
  #header {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
  }

  main {
    padding-top: 64px;
  }
}

/* Popover — desktop: anchored under header, fixed to viewport */
.cart-panel-desktop {
  position: fixed;
  top: calc(64px + 8px);
  right: 20px;
  width: 340px;
  background: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(57, 76, 88, 0.06);
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease-out, transform 250ms cubic-bezier(0.25, 0.8, 0.25, 1);
  z-index: 60;
}
.cart-panel-desktop.is-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

@media (min-width: 1024px) {
  .cart-panel-desktop {
    top: calc(104px + 8px);
    right: 50px;
  }
}

/* Bottom-sheet — mobile (< 1024px): slides up from bottom */
.cart-panel-mobile {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  max-height: min(80svh, 640px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.18);
  transform: translateY(100%);
  transition: transform 350ms cubic-bezier(0.25, 0.8, 0.25, 1);
}
.cart-panel-mobile.is-open {
  transform: translateY(0);
}

.cart-sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: rgba(57, 76, 88, 0.2);
  margin: 10px auto 4px;
}

/* Wyłącz tap-highlight i focus outline na X w menu na touch-only.
   Niektóre mobile browsery niespójnie applikują :focus-visible po tapie —
   raz pokazuje outline, raz nie. Na desktopie (klawiatura) outline zostaje. */
#cart-close {
  -webkit-tap-highlight-color: transparent;
}
@media (hover: none) {
  #cart-close:focus,
  #cart-close:focus-visible {
    outline: none;
  }
}

#cart-list {
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

/* Cart item rows */
.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  text-decoration: none;
  transition: background 200ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .cart-item {
    transition: background 200ms ease, transform 200ms ease;
  }
  .cart-item:hover {
    background: rgba(180, 203, 217, 0.2);
    transform: translateX(2px);
  }
}
/* Touch: bez translateX (powodowałby widoczne skakanie pod palcem przy szybkim
   togglowaniu klasy); bez tranzycji żeby nie było rwanych in-flight transitions */
.cart-item.is-touch-hover {
  background: rgba(180, 203, 217, 0.2);
  transition: none;
}

.cart-swatch {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  border-radius: 9999px;
  box-shadow: 0 0 0 1px rgba(57, 76, 88, 0.2);
}

.cart-arrow {
  flex-shrink: 0;
  transition: transform 200ms ease, color 200ms ease;
  color: var(--color-text-muted);
}
@media (hover: hover) and (pointer: fine) {
  .cart-item:hover .cart-arrow {
    transform: translateX(3px);
    color: var(--color-accent-magenta);
  }
}
.cart-item.is-touch-hover .cart-arrow {
  color: var(--color-accent-magenta);
  transition: none;
}

.cart-cta-btn:hover {
  background-color: rgba(180, 203, 217, 0.5);
}
