/* =========================================================================
   RARCO – nagłówek, megamenu i stopka
   Kolory szablonu: czerwień #b9200f / ciemna czerwień #7d1615,
   grafit #26292c, jasne tło #f9f7f6, linie #f1dfdc
   ========================================================================= */

:root {
  --rc-red: #b9200f;
  --rc-red-dark: #7d1615;
  --rc-ink: #26292c;
  --rc-ink-soft: #5b6066;
  --rc-bg: #f9f7f6;
  --rc-line: #efe7e4;
  --rc-line-red: #f1dfdc;
  --rc-shadow: 0 24px 48px rgba(38, 41, 44, 0.14);
}

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

/* ---------- Nagłówek ---------- */
.header {
  position: relative;
  z-index: 100;
  background: #fff;
}
.header__content .container {
  gap: 24px;
}
.header__logo {
  flex-shrink: 0;
}
.header__nav {
  width: auto;
  flex: 1 1 auto;
}
.header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.header__search-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  color: var(--rc-ink);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.header__search-toggle:hover,
.header__search-toggle[aria-expanded="true"] {
  color: var(--rc-red);
  border-color: var(--rc-line-red);
}
.header__search-toggle svg {
  width: 24px;
  height: 24px;
}
.header__cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--rc-red);
  border: 1px solid var(--rc-red);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
  white-space: nowrap;
  transition: background 0.25s ease, color 0.25s ease;
}
.header__cta:hover {
  background: #fff;
  color: var(--rc-red);
}
.header__cta .mm-arrow {
  width: 18px;
  height: 18px;
  transition: transform 0.25s ease;
}
.header__cta:hover .mm-arrow {
  transform: translateX(3px);
}
.header__cta--mobile {
  display: none;
}

/* Wyszukiwarka */
.header__search {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: min(1618px, 92vw);
  display: flex;
  gap: 0;
  padding: 24px;
  background: #fff;
  border-top: 3px solid var(--rc-red);
  box-shadow: var(--rc-shadow);
  z-index: 120;
}
.header__search[hidden] {
  display: none;
}
.header__search input {
  flex: 1;
  min-width: 0;
  height: 56px;
  padding: 0 20px;
  border: 1px solid #ddd5d2;
  border-right: 0;
  font: inherit;
  font-size: 17px;
  color: var(--rc-ink);
  outline: none;
}
.header__search input:focus {
  border-color: var(--rc-red);
}
.header__search button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 28px;
  border: 0;
  background: var(--rc-red);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease;
}
.header__search button:hover {
  background: var(--rc-red-dark);
}
.header__search button svg {
  width: 20px;
  height: 20px;
}

@media only screen and (max-width: 1600px) {
  .header__nav ul li a {
    font-size: 18px;
  }
  .header__nav ul .menu-item-has-children {
    padding-right: 30px;
  }
}
@media only screen and (max-width: 1450px) {
  .header__nav ul li a {
    font-size: 16px;
  }
  .header__cta {
    padding: 11px 14px;
    font-size: 14px;
  }
}

/* ---------- Megamenu: desktop ---------- */
@media only screen and (min-width: 1201px) {
  #primary-menu > li > a {
    position: relative;
    display: inline-block;
  }
  #primary-menu > li > a::after {
    content: "";
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 4px;
    height: 3px;
    background: var(--rc-red);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
  }
  #primary-menu > li.mega-open > a,
  #primary-menu > li.current-menu-ancestor > a,
  #primary-menu > li.current-menu-item > a {
    color: var(--rc-red);
  }
  #primary-menu > li.mega-open > a::after,
  #primary-menu > li.current-menu-ancestor > a::after,
  #primary-menu > li.current-menu-item > a::after {
    transform: scaleX(1);
  }

  #primary-menu > li.mega {
    position: static;
  }

  /* Panel */
  #primary-menu > li.mega > .mega-panel {
    display: flex;
    position: absolute;
    top: 100%;
    left: 50%;
    width: min(1618px, 92vw);
    margin: 0;
    padding: 36px 8px 36px 8px;
    background: #fff;
    border-top: 3px solid var(--rc-red);
    box-shadow: var(--rc-shadow);
    z-index: 110;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, 10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
  }
  #primary-menu > li.mega.mega-open > .mega-panel,
  #primary-menu > li.mega:focus-within > .mega-panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, 0);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s;
  }

  /* Reset stylów starego dropdownu wewnątrz panelu */
  #primary-menu .mega-panel ul,
  #primary-menu .mega-panel .sub-menu {
    display: block;
    position: static;
    margin: 0;
    padding: 0;
    background: none;
    box-shadow: none;
    border: 0;
    gap: 0;
    list-style: none;
    transform: none;
    opacity: 1;
    visibility: inherit;
    min-width: 0;
    width: auto;
  }
  #primary-menu .mega-panel li {
    margin: 0;
    padding: 0;
    background: none;
    position: static;
  }
  #primary-menu .mega-panel a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    font-size: 15px;
    line-height: 1.4;
    letter-spacing: 0;
    text-transform: none;
    font-weight: 400;
    white-space: normal;
    color: var(--rc-ink);
    text-align: left;
  }
  #primary-menu .mega-panel a:hover,
  #primary-menu .mega-panel .current-menu-item > a {
    color: var(--rc-red);
  }

  /* Kolumna */
  #primary-menu > li.mega > .mega-panel,
  #primary-menu .mega-tab-panel {
    align-items: stretch;
    justify-content: flex-start;
  }
  #primary-menu .mega-panel li.mega-col {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 28px;
    border-left: 1px solid var(--rc-line);
  }
  #primary-menu .mega-panel > .mega-col:first-child,
  #primary-menu .mega-tab-panel > .mega-col:first-child {
    border-left: 0;
  }
  #primary-menu .mega-col > a {
    gap: 14px;
    padding-bottom: 16px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--rc-line-red);
    font-family: "Prompt", sans-serif;
    font-weight: 700;
    font-size: 18px;
    line-height: 1.25;
  }
  #primary-menu .mega-col > a[href="#"] {
    cursor: default;
  }
  #primary-menu .mega-col > a[href="#"]:hover {
    color: var(--rc-ink);
  }
  #primary-menu .mega-col > a .mm-icon {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    color: var(--rc-red);
    stroke-width: 1.4;
  }
  .mm-arrow {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    color: var(--rc-red);
    transition: transform 0.2s ease;
  }
  #primary-menu .mega-col > a:hover .mm-arrow {
    transform: translateX(4px);
  }

  /* Linki w kolumnie */
  #primary-menu .mega-col > .sub-menu > li > a {
    padding: 7px 0;
  }
  #primary-menu .mega-col > .sub-menu > li:not(.has-icon) > a::before {
    content: "";
    flex: 0 0 auto;
    width: 6px;
    height: 6px;
    margin: 0 6px 0 2px;
    border-top: 2px solid var(--rc-red);
    border-right: 2px solid var(--rc-red);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
  }
  #primary-menu .mega-col > .sub-menu > li:not(.has-icon) > a:hover::before {
    transform: translateX(2px) rotate(45deg);
  }

  /* Linki z ikonami (np. zastosowania) */
  #primary-menu .mega-col > .sub-menu > li.has-icon > a {
    gap: 14px;
    padding: 9px 0;
    border-bottom: 1px solid var(--rc-line);
  }
  #primary-menu .mega-col > .sub-menu > li.has-icon > a::after {
    content: "";
    flex: 0 0 auto;
    margin-left: auto;
    width: 8px;
    height: 8px;
    border-top: 2px solid var(--rc-red);
    border-right: 2px solid var(--rc-red);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
  }
  #primary-menu .mega-col > .sub-menu > li.has-icon > a:hover::after {
    transform: translateX(3px) rotate(45deg);
  }
  #primary-menu .mega-col > .sub-menu > li.has-icon .mm-icon {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    color: var(--rc-ink);
    transition: color 0.2s ease;
  }
  #primary-menu .mega-col > .sub-menu > li.has-icon > a:hover .mm-icon {
    color: var(--rc-red);
  }

  /* Linki w 2 kolumnach (np. serie) */
  #primary-menu .mega-col > .sub-menu.mm-cols-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 24px;
  }
  #primary-menu .mm-cols-2 > li.has-icon {
    grid-column: 1 / -1;
  }
  #primary-menu .mm-cols-2 > li:not(.has-icon) + li.has-icon {
    margin-top: 12px;
    border-top: 1px solid var(--rc-line-red);
  }

  /* Karta promo */
  #primary-menu .mega-panel li.mega-promo {
    flex: 0 0 clamp(280px, 24%, 380px);
    padding: 0 0 0 28px;
    display: flex;
  }
  #primary-menu .mega-promo .mega-promo__card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    background: var(--rc-bg);
    overflow: hidden;
    padding: 0;
  }
  .mega-promo__img {
    position: relative;
    display: block;
    flex: 1 1 auto;
    min-height: 200px;
    overflow: hidden;
  }
  .mega-promo__img img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
  }
  .mega-promo__card:hover .mega-promo__img img {
    transform: scale(1.04);
  }
  .mega-promo__body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px 20px 20px;
  }
  .mega-promo__title {
    font-family: "Prompt", sans-serif;
    font-weight: 700;
    font-size: 20px;
    line-height: 1.2;
    color: var(--rc-red);
  }
  .mega-promo__text {
    font-size: 14px;
    line-height: 1.45;
    color: var(--rc-ink);
  }
  .mega-promo__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    padding: 10px 14px;
    border: 1px solid var(--rc-red);
    color: var(--rc-red);
    font-weight: 700;
    font-size: 14px;
    transition: background 0.2s ease, color 0.2s ease;
  }
  .mega-promo__card:hover .mega-promo__button {
    background: var(--rc-red);
    color: #fff;
  }
  .mega-promo__card:hover .mega-promo__button .mm-arrow {
    color: #fff;
  }

  /* ---------- Układ: zakładki (Marki) ---------- */
  #primary-menu > li.mega > .mega-panel--tabs {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    column-gap: 12px;
    align-items: start;
    padding-left: 32px;
  }
  #primary-menu .mega-panel--tabs::before {
    content: attr(data-label);
    grid-column: 1;
    grid-row: 1;
    margin-bottom: 14px;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--rc-ink-soft);
  }
  #primary-menu .mega-panel--tabs > li.mega-tab {
    display: contents;
  }
  #primary-menu .mega-panel--tabs > li.mega-tab > a {
    grid-column: 1;
    justify-content: space-between;
    min-height: 64px;
    margin-bottom: 12px;
    padding: 14px 18px;
    border: 1px solid var(--rc-line);
    background: #fff;
    font-family: "Prompt", sans-serif;
    font-weight: 700;
    font-size: 18px;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  }
  #primary-menu .mega-panel--tabs > li.mega-tab > a:hover {
    border-color: var(--rc-red);
  }
  #primary-menu .mega-panel--tabs > li.mega-tab.is-active > a {
    background: var(--rc-red);
    border-color: var(--rc-red);
    color: #fff;
  }
  #primary-menu .mega-panel--tabs > li.mega-tab.is-active > a .mm-arrow {
    color: #fff;
  }
  #primary-menu .mega-tab .mm-logo {
    max-height: 34px;
    width: auto;
  }
  #primary-menu .mega-tab.is-active .mm-logo {
    filter: brightness(0) invert(1);
  }
  .mm-title--hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
  }
  #primary-menu .mega-panel--tabs > li.mega-tab > .mega-tab-panel {
    grid-column: 2;
    grid-row: 1 / span 12;
    display: none;
    min-height: 100%;
  }
  #primary-menu .mega-panel--tabs > li.mega-tab.is-active > .mega-tab-panel {
    display: flex;
  }
  #primary-menu .mega-tab-only li.mega-promo {
    flex: 1 1 auto;
    max-width: 640px;
  }
  #primary-menu .mega-tab-only .mega-promo .mega-promo__card {
    flex-direction: row;
  }
  #primary-menu .mega-tab-only .mega-promo__img {
    flex: 0 0 50%;
  }
}

@media only screen and (min-width: 1201px) and (max-width: 1500px) {
  #primary-menu .mega-panel li.mega-col {
    padding: 0 18px;
  }
  #primary-menu .mega-col > a {
    font-size: 16px;
  }
  #primary-menu .mega-col > a .mm-icon {
    width: 30px;
    height: 30px;
  }
  #primary-menu > li.mega > .mega-panel--tabs {
    grid-template-columns: 230px minmax(0, 1fr);
    padding-left: 20px;
  }
  #primary-menu .mega-panel li.mega-promo {
    flex-basis: 260px;
    padding-left: 18px;
  }
}

/* ---------- Megamenu: mobile (akordeon z custom.js) ---------- */
@media only screen and (max-width: 1200px) {
  .header__actions,
  .header__search {
    display: none !important;
  }
  .header__nav .mega-promo,
  .header__nav .mega-tab-only,
  .header__nav .mm-icon,
  .header__nav .mm-arrow,
  .header__nav .mm-logo {
    display: none !important;
  }
  .header__nav .mm-title--hidden {
    position: static;
    width: auto;
    height: auto;
    clip: auto;
  }
  .hamburger-active .header__cta--mobile {
    display: flex;
    justify-content: center;
    margin-top: 28px;
    padding: 14px 20px;
    font-size: 16px;
  }
  .hamburger-active .header__cta--mobile .mm-arrow {
    display: block !important;
    color: currentColor;
  }
}

/* =========================================================================
   STOPKA
   ========================================================================= */
.footer.footer--v2 {
  padding: 0;
  background: var(--rc-ink);
  color: #fff;
}
.footer--v2 .footer__grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.95fr) minmax(0, 1.5fr) minmax(0, 1.45fr);
  gap: 24px;
  align-items: start;
  padding-block: 64px 56px;
}

/* Kolumna marki */
.footer--v2 .footer__brand {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-right: 16px;
}
.footer--v2 .footer__logo img {
  max-width: 220px;
}
.footer--v2 .footer__logo:hover {
  opacity: 1;
}
.footer__tagline {
  margin: 0;
  padding-left: 16px;
  border-left: 3px solid var(--rc-red);
  font-family: "Prompt", sans-serif;
  font-weight: 700;
  font-size: 21px;
  line-height: 1.3;
  color: #fff;
}
.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.footer--v2 .footer-contact__item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  color: #fff;
  font-size: 15px;
  line-height: 1.5;
}
.footer--v2 a.footer-contact__item {
  align-items: center;
}
.footer--v2 a.footer-contact__item:hover {
  opacity: 1;
  color: #fff;
}
.footer--v2 a.footer-contact__item:hover span {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.footer-contact__item p {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
}
.footer-contact__item strong {
  color: #fff;
}
.footer-contact__icon {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  color: var(--rc-red);
  stroke: #e2523f;
}
.footer--v2 .footer__cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  align-self: flex-start;
  padding: 15px 22px;
  background: var(--rc-red);
  border: 1px solid var(--rc-red);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  transition: background 0.25s ease, color 0.25s ease;
}
.footer--v2 .footer__cta svg {
  width: 22px;
  height: 22px;
}
.footer--v2 .footer__cta .mm-arrow {
  width: 18px;
  height: 18px;
  color: currentColor;
}
.footer--v2 .footer__cta:hover {
  opacity: 1;
  background: #fff;
  color: var(--rc-red);
}
.footer--v2 .footer__social {
  justify-content: flex-start;
  width: auto;
  padding: 0;
}

/* Karty */
.footer--v2 .footer-card {
  padding: 28px 32px 24px;
  background: #fff;
  color: var(--rc-ink);
  border-radius: 4px;
}
.footer--v2 .footer-card__title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 8px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rc-line-red);
  font-family: "Prompt", sans-serif;
  font-weight: 700;
  font-size: 24px;
  line-height: 1.2;
  color: var(--rc-ink);
}
.footer--v2 .footer-card--products .footer-card__title {
  font-size: 30px;
}
.footer-card__icon {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  color: var(--rc-red);
  stroke-width: 1.4;
}
.footer--v2 .footer-card--products .footer-card__icon {
  width: 44px;
  height: 44px;
}
.footer--v2 .footer-card__list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer--v2 .footer-card__list li {
  margin: 0;
}
.footer--v2 .footer-card__list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  color: var(--rc-ink);
  font-size: 15px;
  line-height: 1.4;
}
.footer--v2 .footer-card__list a:hover {
  opacity: 1;
  color: var(--rc-red);
}
.footer-card__chevron {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: var(--rc-red);
  stroke-width: 2.4;
  transition: transform 0.2s ease;
}
.footer--v2 .footer-card__list a:hover .footer-card__chevron {
  transform: translateX(3px);
}

/* Popularne produkty – 2 kolumny z liniami */
.footer--v2 .footer-card--products .footer-card__list {
  columns: 2;
  column-gap: 32px;
}
.footer--v2 .footer-card--products .footer-card__list li {
  break-inside: avoid;
  border-bottom: 1px solid var(--rc-line);
}
.footer--v2 .footer-card--products .footer-card__list a {
  padding: 13px 0;
  font-family: "Prompt", sans-serif;
  font-weight: 700;
  font-size: 17px;
}

.footer--v2 .footer__side {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.footer--v2 .footer__side-row {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 24px;
}
.footer--v2 .footer-card--brands .footer-card__list li + li {
  border-top: 1px solid var(--rc-line);
}
.footer--v2 .footer-card--brands .footer-card__list a {
  padding: 12px 0;
  font-family: "Prompt", sans-serif;
  font-weight: 700;
  font-size: 17px;
}

/* Pasek dolny */
.footer--v2 .footer__bottom {
  background: #1d1f22;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.footer--v2 .footer__bottom .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  padding-block: 22px;
}
.footer--v2 .footer__legal {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer--v2 .footer__legal li {
  margin: 0;
  font-size: 14px;
}
.footer--v2 .footer__legal li + li::before {
  content: "|";
  margin: 0 18px;
  color: var(--rc-red);
  font-weight: 700;
}
.footer--v2 .footer__legal a {
  color: rgba(255, 255, 255, 0.85);
}
.footer--v2 .footer__legal a:hover {
  opacity: 1;
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.footer--v2 .copy {
  width: auto;
  margin: 0;
  text-align: right;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
}

@media only screen and (max-width: 1500px) {
  .footer--v2 .footer__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  }
  .footer--v2 .footer__side {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  }
}
@media only screen and (max-width: 1200px) {
  .footer--v2 .footer__grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-block: 48px 40px;
  }
  .footer--v2 .footer__grid > .footer-card {
    padding: 24px 22px 18px !important;
  }
  .footer--v2 .footer__grid > .footer__brand {
    gap: 22px !important;
    padding-right: 0 !important;
    margin-bottom: 8px;
  }
  .footer--v2 .footer__side {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  .footer--v2 .footer__side-row {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .footer--v2 .footer-card--products .footer-card__title {
    font-size: 24px;
  }
}
@media only screen and (max-width: 700px) {
  .footer--v2 .footer-card--products .footer-card__list {
    columns: 1;
  }
  .footer--v2 .footer__bottom .container {
    flex-direction: column;
    align-items: flex-start;
  }
  .footer--v2 .footer__legal {
    flex-direction: column;
    gap: 10px;
  }
  .footer--v2 .footer__legal li + li::before {
    content: none;
  }
  .footer--v2 .copy {
    text-align: left;
  }
}
