html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

[id] {
  scroll-margin-top: 6rem;
}

.site-hero-shell {
  padding-top: 96px;
}

.site-header {
  position: fixed;
  z-index: 50;
  inset: 0 0 auto;
  background: rgb(11 11 10 / 94%);
  backdrop-filter: blur(12px);
  transition:
    box-shadow 220ms ease,
    background-color 220ms ease;
}

.site-header > div {
  transition:
    min-height 220ms ease,
    padding 220ms ease;
}

.site-header img {
  transition:
    width 220ms ease,
    height 220ms ease;
}

.site-header .action-link {
  transition:
    height 220ms ease,
    padding 220ms ease,
    transform 180ms ease,
    background-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

.site-header.is-compact {
  background: rgb(11 11 10 / 97%);
  box-shadow: 0 8px 28px rgb(0 0 0 / 24%);
}

.site-header.is-compact > div {
  min-height: 68px;
  padding-block: 8px;
}

.site-header.is-compact > div > a:first-child img {
  width: 90px;
}

.site-header.is-compact .action-link {
  height: 44px;
  padding-inline: 18px;
}

.site-header.is-compact nav {
  gap: 18px;
}

.site-header nav a {
  position: relative;
  padding-block: 8px;
  transition: color 180ms ease;
}

.site-header nav a::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  border-radius: 2px;
  background: #d5a63a;
  content: "";
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

.site-header nav a[aria-current="location"] {
  color: #f1ce72;
}

.site-header nav a[aria-current="location"]::after {
  transform: scaleX(1);
}

a,
button:not(:disabled),
summary {
  cursor: pointer;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid #d5a63a;
  outline-offset: 4px;
}

.action-link {
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

.hero-content > * {
  animation: hero-enter 700ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero-content > :nth-child(2) {
  animation-delay: 90ms;
}

.hero-content > :nth-child(3) {
  animation-delay: 170ms;
}

.hero-content > :nth-child(4) {
  animation-delay: 250ms;
}

.hero-content > :nth-child(5) {
  animation-delay: 330ms;
}

.hero-content > :first-child > :first-child {
  animation: warm-glow 2.4s ease-in-out infinite;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 650ms cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 650ms cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

#pellet figure > img,
figure img {
  transition: transform 700ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

#pellet figure > div {
  animation: gentle-float 4s ease-in-out infinite;
}

.text-card-foreground,
#wegiel .grid > div,
#dystrybutor-dolnoslaskie,
#dystrybutor-lodzkie,
#lista-dystrybutorow li {
  transition:
    transform 240ms ease,
    box-shadow 240ms ease,
    border-color 240ms ease;
}

.map-pin-main {
  animation: pin-pulse 2.6s ease-out infinite;
}

@media (hover: hover) {
  .action-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgb(0 0 0 / 12%);
  }

  nav a:hover {
    color: #d5a63a;
  }

  .text-card-foreground:hover,
  #wegiel .grid > div:hover,
  #dystrybutor-dolnoslaskie:hover,
  #dystrybutor-lodzkie:hover,
  #lista-dystrybutorow li:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 32px rgb(0 0 0 / 12%);
  }

  figure:hover img {
    transform: scale(1.035);
  }

  .action-link:hover svg,
  .action-link:hover img {
    transform: translate(2px, -2px);
  }
}

.action-link:active {
  transform: translateY(0) scale(0.98);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.distributor-map-scroll {
  width: 100%;
  overflow-x: auto;
  border-radius: 16px;
}

.distributor-map {
  min-width: 960px;
  height: 600px;
}

.distributor-map-scroll:focus-visible {
  outline: 2px solid #d5a63a;
  outline-offset: 4px;
}

.map-pin {
  display: block;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border: 2px solid #f1ce72;
  border-radius: 50%;
  background: #d5a63a;
  box-shadow: 0 3px 10px rgb(0 0 0 / 35%);
  background-image: url("images/location-pin.svg");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 11px 14px;
  transition: background-color 180ms ease;
}

.distributor-map a > span:last-child {
  font-size: 13px;
}

.map-pin-main {
  background-color: #f1ce72;
}

.distributor-map a {
  min-width: 44px;
  min-height: 44px;
  padding: 6px;
  border-radius: 8px;
}

.distributor-map a:hover .map-pin,
.distributor-map a:focus-visible .map-pin {
  background-color: #fff3ce;
}

html:has(.distributor-dialog[open]) {
  overflow: hidden;
}

.distributor-dialog {
  width: min(560px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 24px;
  overflow: auto;
  border: 1px solid #d5a63a;
  border-radius: 16px;
  background: #0b0b0a;
  color: #fff;
  box-shadow: 0 24px 80px rgb(0 0 0 / 40%);
}

.distributor-dialog::backdrop {
  background: rgb(0 0 0 / 65%);
}

.distributor-dialog[open] {
  animation: dialog-enter 240ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.distributor-dialog[open]::backdrop {
  animation: backdrop-enter 240ms ease-out both;
}

.distributor-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.distributor-dialog-header h2 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 28px;
  font-weight: 700;
  color: #f1ce72;
}

.distributor-dialog-close {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  font-size: 28px;
  transition: background-color 180ms ease;
}

.distributor-dialog-close:hover {
  background: #3a352a;
}

.distributor-dialog-note {
  margin: 12px 0 20px;
  font-size: 13px;
  color: #aaa294;
}

#distributor-dialog-content {
  overflow-wrap: anywhere;
}

.distributor-contact-icon {
  display: block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  object-fit: contain;
}

.distributor-heading-icon {
  display: block;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  object-fit: contain;
}

.certificate-mark {
  animation: certificate-mark-float 3.2s ease-in-out infinite;
}

.mobile-menu-toggle,
.mobile-menu-contact {
  display: none;
}

.mobile-menu-toggle .close-icon {
  display: none;
}

.mobile-menu-toggle[aria-expanded="true"] .menu-icon {
  display: none;
}

.mobile-menu-toggle[aria-expanded="true"] .close-icon {
  display: block;
}

@media (max-width: 1279px) {
  .site-hero-shell {
    padding-top: 96px;
  }

  .site-header > div,
  .site-header.is-compact > div {
    position: relative;
    min-height: 72px;
    gap: 12px;
    padding: 10px 20px;
  }

  .site-header img {
    width: 96px;
  }

  .site-header.is-compact > div > a:first-child img {
    width: 64px;
  }

  .site-header .action-link {
    display: none;
  }

  .mobile-menu-toggle {
    display: inline-flex;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    border: 1px solid #3a352a;
    border-radius: 8px;
    background: transparent;
    color: #f1ce72;
  }

  .mobile-menu-toggle svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 2;
  }

  .site-header nav,
  .site-header.is-compact nav {
    position: absolute;
    top: calc(100% + 1px);
    right: 16px;
    left: 16px;
    z-index: 1;
    display: none;
    max-height: calc(100dvh - 96px);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    overflow-y: auto;
    padding: 8px 16px 16px;
    border: 1px solid #3a352a;
    border-radius: 0 0 12px 12px;
    background: #0b0b0a;
    box-shadow: 0 16px 32px rgb(0 0 0 / 35%);
  }

  .site-header nav.is-open {
    display: flex;
  }

  .site-header nav a {
    min-height: 48px;
    display: flex;
    align-items: center;
    padding: 10px 4px;
    border-bottom: 1px solid #29261f;
    color: #d9d2c5;
    font-size: 16px;
  }

  .site-header nav a::after {
    display: none;
  }

  .site-header nav .mobile-menu-contact {
    display: flex;
    min-height: 48px;
    justify-content: center;
    margin-top: 12px;
    padding: 12px 16px;
    border: 0;
    border-radius: 6px;
    background: #d5a63a;
    color: #0b0b0a;
    font-weight: 700;
    text-transform: uppercase;
  }
}

@media (max-width: 639px) {
  .site-hero-shell > section[aria-labelledby="pellet-hero-title"] > div {
    min-height: 590px;
    padding: 44px 20px;
  }

  .site-hero-shell > section[aria-labelledby="pellet-hero-title"] {
    background-image:
      linear-gradient(90deg, rgb(0 0 0 / 88%) 0%, rgb(0 0 0 / 76%) 58%, rgb(0 0 0 / 48%) 100%),
      url("images/hero.jpg") !important;
    background-position: 62% center !important;
  }

  .hero-content {
    gap: 22px;
  }

  .hero-content h1 {
    font-size: clamp(2.5rem, 12vw, 3.25rem);
    line-height: 1;
  }

  .hero-content > p {
    font-size: 17px;
  }

  .hero-content > div:nth-of-type(2) {
    gap: 10px;
  }

  [aria-label="Parametry produktu"] > div {
    gap: 10px;
  }

  [aria-label="Parametry produktu"] > div > div {
    min-height: 112px;
    padding: 12px;
    border: 1px solid #b88822;
    border-radius: 8px;
    background: rgb(255 236 183 / 30%);
  }

  [aria-label="Parametry produktu"] strong {
    font-size: 32px;
  }

  #pellet figure {
    height: 360px;
    padding: 16px;
    background: #f4efe5;
  }

  #pellet figure > img {
    object-fit: contain;
  }

  #pellet .text-card-foreground {
    height: auto;
    min-height: 140px;
  }

  .distributor-map-scroll {
    overflow: visible;
  }

  .distributor-map {
    min-width: 0;
    height: auto;
    aspect-ratio: 1.2;
  }

  .distributor-map > div:first-child {
    background-size: auto 115%;
    background-position: center;
    gap: 6px;
    padding: 8px 10px 0;
  }

  .distributor-map > div:first-child img {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
  }

  .distributor-map > div:first-child span {
    font-size: 9px;
    line-height: 1.2;
  }

  .distributor-map > a[href="#dystrybutor-dolnoslaskie"] {
    top: 54%;
    left: 25%;
  }

  .distributor-map > a[href="#dystrybutor-lodzkie"] {
    top: 47%;
    left: 52%;
  }

  .distributor-map > p {
    display: none;
  }

  .site-footer > div {
    align-items: center;
    padding: 48px 20px 24px;
  }

  .site-footer > div > .grid,
  .site-footer > div > div:last-child {
    width: 100%;
    justify-items: center;
    text-align: center;
  }

  .site-footer > div > .grid > div,
  .site-footer > div > .grid > nav {
    width: 100%;
    align-items: center;
    text-align: center;
  }

  .site-footer > div > .grid > div:first-child > p {
    margin-inline: auto;
  }

  .site-footer > div > .grid > div:nth-child(2) .grid > div {
    align-items: center;
  }

  .site-footer > div > div:last-child {
    align-items: center;
  }

  .site-footer > div > div:last-child > div {
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition: none;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .action-link:hover,
  .action-link:active,
  figure:hover img,
  .text-card-foreground:hover,
  #wegiel .grid > div:hover,
  #dystrybutor-dolnoslaskie:hover,
  #dystrybutor-lodzkie:hover,
  #lista-dystrybutorow li:hover {
    transform: none;
  }
}

@keyframes hero-enter {
  from {
    opacity: 0;
    transform: translateY(22px);
  }

  @keyframes dialog-enter {
    from {
      opacity: 0;
      transform: translateY(12px) scale(0.97);
    }

    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }

  @keyframes backdrop-enter {
    from {
      opacity: 0;
    }

    to {
      opacity: 1;
    }
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes warm-glow {
  50% {
    box-shadow: 0 0 0 6px rgb(213 166 58 / 16%);
  }
}

@keyframes gentle-float {
  50% {
    transform: translateY(-5px);
  }
}

@keyframes certificate-mark-float {
  50% {
    transform: translateY(-4px) scale(1.035);
  }
}

@keyframes pin-pulse {
  70%,
  100% {
    box-shadow:
      0 3px 10px rgb(0 0 0 / 35%),
      0 0 0 10px rgb(213 166 58 / 0%);
  }

  0% {
    box-shadow:
      0 3px 10px rgb(0 0 0 / 35%),
      0 0 0 0 rgb(213 166 58 / 30%);
  }
}
