/* ==========================================================================
   RECODE40 — Global Layout
   Header / Navigation / Footer
   File: assets/css/recode-layout.css
   ========================================================================== */


/* ==========================================================================
   SKIP LINK
   ========================================================================== */

.r40-skip {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 99999;
  background: var(--r40-black);
  color: var(--r40-white);
  padding: 12px 16px;
  border-radius: 12px;
  text-decoration: none;
}

.r40-skip:focus {
  top: 16px;
}


/* ==========================================================================
   HEADER
   ========================================================================== */

.r40-header {
  position: sticky;
  top: 0;
  z-index: 999;
  height: var(--r40-header);
  border-bottom: 1px solid var(--r40-line);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

body.recode40-page.admin-bar .r40-header {
  top: 32px;
}

.r40-header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
}

.r40-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex: 0 0 auto;
}

.r40-logo img {
  display: block;
  height: 21px;
  width: auto;
}

.r40-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(22px, 3vw, 44px);
  flex: 1;
}

.r40-nav a {
  position: relative;
  font-size: 13px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(5, 5, 5, 0.72);
  transition: color 0.2s ease;
}

.r40-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -11px;
  height: 2px;
  transform: scaleX(0);
  background: var(--r40-black);
  transform-origin: center;
  transition: transform 0.2s ease;
}

.r40-nav a:hover,
.r40-nav a.is-active {
  color: var(--r40-black);
}

.r40-nav a.is-active::after {
  transform: scaleX(1);
}

.r40-header__actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
}


/* ==========================================================================
   HEADER BUTTONS / ICONS
   ========================================================================== */

.r40-mobile-menu-cta {
  display: none;
}

/* Desktop CTA w headerze — celowo pełna definicja, niezależna od innych plików CSS */
.r40-header .r40-header__actions .r40-btn.r40-btn--nav,
.r40-header .r40-header__actions a.r40-btn.r40-btn--nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 0;
  min-height: 48px;
  height: 48px;
  padding: 0 22px;
  border: 1px solid var(--r40-black);
  border-radius: 14px;
  background: var(--r40-black);
  color: var(--r40-white);
  font-family: 'Outfit', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: none;
  cursor: pointer;
  appearance: none;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    background 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease;
}

.r40-header .r40-header__actions .r40-btn.r40-btn--nav:hover,
.r40-header .r40-header__actions a.r40-btn.r40-btn--nav:hover {
  transform: translateY(-1px);
  background: var(--r40-accent);
  border-color: var(--r40-accent);
  color: var(--r40-black);
  box-shadow: 0 18px 48px var(--r40-accent-shadow);
}

.r40-account-toggle,
.r40-cart-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 14px;
  border: 1px solid rgba(5, 5, 5, 0.12);
  background: var(--r40-white);
  color: var(--r40-black);
  text-decoration: none;
  transition:
    transform 0.25s ease,
    border-color 0.25s ease,
    background 0.25s ease,
    color 0.25s ease;
}

.r40-account-toggle:hover,
.r40-cart-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--r40-black);
  background: var(--r40-soft);
  color: var(--r40-black);
}

.r40-account-toggle svg,
.r40-cart-toggle svg {
  width: 21px;
  height: 21px;
  display: block;
}

.r40-cart-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--r40-accent);
  color: var(--r40-black);
  font-size: 11px;
  line-height: 1;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(5, 5, 5, 0.18);
} 

/* ==========================================================================
   MOBILE MENU BUTTON
   ========================================================================== */

.r40-menu-toggle {
  display: none;
  width: 52px;
  height: 52px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.r40-menu-toggle span {
  display: block;
  width: 34px;
  height: 3px;
  margin: 7px auto;
  background: var(--r40-black);
  border-radius: 10px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.r40-menu-toggle.is-open span:first-child {
  transform: translateY(5px) rotate(45deg);
}

.r40-menu-toggle.is-open span:last-child {
  transform: translateY(-5px) rotate(-45deg);
}


/* ==========================================================================
   HEADER RESPONSIVE
   ========================================================================== */

@media (max-width: 1180px) {
  :root {
    --r40-header: 70px;
  }

  body.recode40-page.admin-bar .r40-header {
    top: 0;
  }

  .r40-header__inner {
    gap: 10px;
  }

  .r40-logo img {
    height: 19px;
  }

  .r40-header__actions {
    order: 2;
    margin-left: auto;
    gap: 8px;
  }

  .r40-header__actions .r40-btn--nav {
    display: none!important;
  }

  .r40-menu-toggle {
    display: block;
    order: 3;
    flex: 0 0 auto;
  }

  .r40-account-toggle,
  .r40-cart-toggle {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
    border-radius: 13px;
  }

  .r40-account-toggle svg,
  .r40-cart-toggle svg {
    width: 20px;
    height: 20px;
  }

  .r40-nav {
    position: fixed;
    left: 0;
    right: 0;
    top: var(--r40-header);
    z-index: 998;
    display: grid;
    gap: 0;
    padding: 18px;
    background: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid var(--r40-line);
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.08);
    transform: translateY(-130%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s ease;
  }

  .r40-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .r40-nav a {
    padding: 18px 4px;
    font-size: 15px;
    border-bottom: 1px solid rgba(5, 5, 5, 0.08);
  }

  .r40-nav a::after {
    display: none;
  }

  .r40-nav .r40-mobile-menu-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    margin-top: 18px;
    padding: 18px 22px;
    border: 1px solid var(--r40-black);
    border-radius: 16px;
    background: var(--r40-black);
    color: var(--r40-white);
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.04em;
    text-align: center;
    text-transform: uppercase;
    text-decoration: none;
  }

  .r40-nav .r40-mobile-menu-cta:hover {
    background: var(--r40-accent);
    border-color: var(--r40-accent);
    color: var(--r40-black);
  }
}

@media (max-width: 640px) {
  :root {
    --r40-header: 66px;
  }

  .r40-header {
    height: 66px;
  }

  .r40-header__inner {
    gap: 8px;
  }

  .r40-logo img {
    height: 18px;
  }

  .r40-header__actions {
    gap: 6px;
  }

  .r40-account-toggle,
  .r40-cart-toggle {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
    border-radius: 12px;
  }

  .r40-account-toggle svg,
  .r40-cart-toggle svg {
    width: 19px;
    height: 19px;
  }

  .r40-cart-count {
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 10px;
  }

  .r40-menu-toggle {
    width: 44px;
    height: 44px;
  }

  .r40-menu-toggle span {
    width: 31px;
    height: 3px;
  }
}

@media (max-width: 390px) {
  .r40-logo img {
    height: 16px;
  }

  .r40-header__actions {
    gap: 5px;
  }

  .r40-account-toggle,
  .r40-cart-toggle {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .r40-menu-toggle {
    width: 40px;
    height: 40px;
  }

  .r40-menu-toggle span {
    width: 29px;
  }
}


/* ==========================================================================
   FOOTER
   ========================================================================== */

.r40-footer {
  background: var(--r40-black);
  color: var(--r40-white);
  padding: 52px 0;
}

.r40-footer__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 32px;
  align-items: center;
}

.r40-footer img {
  height: 22px;
  width: auto;
  display: block;
  margin-bottom: 16px;
}

.r40-footer p,
.r40-footer span {
  color: var(--r40-muted-dark);
}

.r40-footer nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
}

.r40-footer a {
  color: var(--r40-white);
  text-decoration: none;
  font-weight: 700;
}

.r40-footer a:hover {
  color: var(--r40-accent);
}

.r40-footer__meta {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.r40-footer__brand {
  display: grid;
  gap: 14px;
}

.r40-footer__brand a {
  display: inline-flex;
  width: max-content;
}

.r40-footer__nav {
  max-width: 420px;
}

.r40-footer__company,
.r40-footer__contact {
  display: grid;
  gap: 6px;
  text-align: right;
}

.r40-footer__company strong {
  color: var(--r40-white);
  font-size: 15px;
  font-weight: 700;
}

.r40-footer__company span,
.r40-footer__contact a {
  font-size: 14px;
  line-height: 1.45;
}

.r40-footer__contact {
  margin-top: 14px;
}

.r40-footer__contact a {
  color: var(--r40-white);
  text-decoration: none;
  font-weight: 700;
}

.r40-footer__contact a:hover {
  color: var(--r40-accent);
}


/* ==========================================================================
   FOOTER RESPONSIVE
   ========================================================================== */

@media (max-width: 980px) {
  .r40-footer__inner {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .r40-footer nav {
    justify-content: flex-start;
  }

  .r40-footer__meta {
    justify-items: start;
  }

  .r40-footer__company,
  .r40-footer__contact {
    text-align: left;
  }

  .r40-footer__nav {
    max-width: none;
  }
}

@media (max-width: 640px) {
  .r40-footer {
    padding: 42px 0;
  }

  .r40-footer__inner {
    gap: 26px;
  }

  .r40-footer img {
    height: 19px;
    margin-bottom: 12px;
  }

  .r40-footer nav {
    gap: 14px;
  }

  .r40-footer a,
  .r40-footer p,
  .r40-footer span {
    font-size: 14px;
  }

  .r40-footer__company span,
  .r40-footer__contact a {
    font-size: 13px;
  }
}