/* ==========================================================================
   Womix 2026 — warstwa odświeżająca stare szablony CMS (Bootstrap 3 + womix.min.css).
   Ładowana PO womix.min.css. Wszystko zawężone do body.wx-legacy.
   Treści i struktura szablonów bez zmian — tylko wygląd.
   Docelowo do usunięcia przy migracji szablonów na Bootstrap 5.
   ========================================================================== */

/* ---------- baza ---------- */
html, body.wx-legacy { height: auto; }
body.wx-legacy {
  min-height: 100vh;
  background: var(--wx-paper-2);
  color: var(--wx-text);
  font-family: var(--wx-font);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.wx-legacy :focus-visible { outline: 2px solid var(--wx-red) !important; outline-offset: 2px; }
.wx-legacy ::selection { background: var(--wx-red); color: #fff; }

/* nagłówki */
.wx-legacy h1, .wx-legacy h2, .wx-legacy h3, .wx-legacy h4, .wx-legacy h5, .wx-legacy h6 {
  font-family: var(--wx-display); font-weight: 600; line-height: 1.1; color: var(--wx-ink); letter-spacing: .005em;
}
.wx-legacy h1 { font-size: clamp(2rem, 1.4rem + 1.8vw, 3rem); margin: 0 0 1.5rem; }
.wx-legacy h2 { font-size: clamp(1.6rem, 1.3rem + .9vw, 2.1rem); }
.wx-legacy h3, .wx-legacy h4 { font-size: clamp(1.35rem, 1.2rem + .5vw, 1.6rem); }
.wx-legacy h5 { font-size: 1.35rem; }
.wx-legacy h6 { font-size: 1.2rem; }
.wx-legacy main > h1:first-child::before, .wx-legacy main > h1:first-of-type::before {
  content: ""; display: block; width: 48px; height: 3px; background: var(--wx-red); margin-bottom: 1rem;
}
.wx-legacy main > h1.text-center::before { margin-left: auto; margin-right: auto; }
.wx-legacy .text-light { font-weight: 300; }
.wx-legacy hr { height: 2px; }

/* linki w treści */
.wx-legacy main a:not(.btn):hover { color: var(--wx-red); }
.wx-legacy main p a:not(.btn), .wx-legacy main li a:not(.btn), .wx-legacy main td a:not(.btn) {
  color: var(--wx-red-dark); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px;
}
.wx-legacy main p a:not(.btn):hover, .wx-legacy main li a:not(.btn):hover, .wx-legacy main td a:not(.btn):hover { color: var(--wx-red); }
.wx-legacy main p a:has(> img), .wx-legacy main td a:has(> img) { text-decoration: none; }

/* ---------- układ: szerszy kontener jak na stronie głównej ---------- */
.wx-legacy .container {
  width: auto; max-width: var(--wx-max);
  padding-left: var(--wx-gutter); padding-right: var(--wx-gutter);
}
.wx-legacy .container.main { padding-top: clamp(1.5rem, 3vw, 3rem); padding-bottom: clamp(3rem, 6vw, 5rem); }
.wx-legacy .main > div {
  background: #fff; min-height: 50vh;
  box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 18px 40px -30px rgba(0,0,0,.25);
}
.wx-legacy .main > .row { margin-left: 0; margin-right: 0; }
.wx-legacy .border-left, .wx-legacy .border-right { border-color: var(--wx-line); }
.wx-legacy .border-left > main, .wx-legacy .border-right > main { min-height: 36rem; }
.wx-legacy .no-gutter .border-left > main { padding: clamp(1.5rem, 3vw, 3rem); }
.wx-legacy .col-lg-12 > main { padding: clamp(1rem, 2.5vw, 2.5rem); }
.wx-legacy main img { max-width: 100%; height: auto; }
.wx-legacy main video { display: block; width: 100%; height: auto; margin-bottom: 1.5rem; }
.wx-legacy main iframe { max-width: 100%; }

/* ---------- menu boczne ---------- */
.wx-legacy #nav-side { padding: clamp(1rem, 2vw, 2rem) 0; }
.wx-legacy #nav-sidemenu ul,
.wx-legacy #nav-sidemenu li { background: transparent !important; }
.wx-legacy #nav-sidemenu ul::before,
.wx-legacy #nav-sidemenu ul:before { content: none !important; display: none !important; }
.wx-legacy #nav-sidemenu > ul { margin: 0; padding: 0; }
.wx-legacy #nav-sidemenu ul { padding: 0; margin: 0; }
.wx-legacy #nav-sidemenu > ul > li { margin: 0 !important; padding: 0 !important; }
.wx-legacy #nav-sidemenu li > a {
  position: relative; display: block;
  padding: .55rem 1.25rem .55rem 1.5rem !important;
  font-size: .9688rem; line-height: 1.3; color: var(--wx-text) !important;
  transition: color .15s, background-color .15s;
}
.wx-legacy #nav-sidemenu li > a:hover { color: var(--wx-red) !important; background: var(--wx-paper-2); }
.wx-legacy #nav-sidemenu li > a::before {
  content: ""; position: absolute; left: 0; top: .35rem; bottom: .35rem; width: 3px; background: transparent;
}
/* aktywna gałąź */
.wx-legacy #nav-sidemenu li.selected > a { color: var(--wx-ink) !important; font-weight: 600; }
.wx-legacy #nav-sidemenu > ul > li.selected > a::before { background: var(--wx-red); }
.wx-legacy #nav-sidemenu > ul > li.selected > ul { background: var(--wx-paper-2) !important; padding: .35rem 0 !important; margin: 0 0 .35rem !important; }
.wx-legacy #nav-sidemenu > ul li ul li a { padding-left: 2.25rem !important; font-size: .9063rem; }
.wx-legacy #nav-sidemenu > ul li ul li ul li a { padding-left: 3rem !important; }
.wx-legacy #nav-sidemenu > ul li ul li ul li ul li a { padding-left: 3.75rem !important; }
.wx-legacy #nav-sidemenu ul ul li.selected > a { color: var(--wx-red) !important; }
.wx-legacy #nav-sidemenu ul ul li.selected > ul { padding: 0 !important; margin: 0 !important; }
.wx-legacy #nav-sidemenu li:hover.selected > a { color: var(--wx-red) !important; }

/* przycisk rozwijania menu bocznego (tylko mobile, dodawany przez womix-2026-chrome.js) */
.wx-sidetoggle { display: none; }
@media (max-width: 1199.98px) {
  .wx-legacy .wx-sidetoggle {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: 100%;
    padding: 1rem 1.5rem; border: 0; border-bottom: 1px solid var(--wx-line); background: #fff; cursor: pointer;
    font: 600 1.05rem/1.2 var(--wx-display); letter-spacing: .06em; text-transform: uppercase; color: var(--wx-ink); text-align: left;
  }
  .wx-legacy .wx-sidetoggle .wxi { transition: transform .2s; color: var(--wx-red); transform: rotate(90deg); }
  .wx-legacy .wx-sidetoggle[aria-expanded="true"] .wxi { transform: rotate(-90deg); }
  .wx-legacy #nav-side.has-toggle { padding: 0; }
  .wx-legacy #nav-side.has-toggle #nav-sidemenu { padding: .5rem 0; border-bottom: 1px solid var(--wx-line); }
  .wx-legacy #nav-side.has-toggle #nav-sidemenu[hidden] { display: none; }
}
/* puste menu boczne (np. Aktualności bez archiwum) — treść na całą szerokość */
@media (min-width: 1200px) {
  .wx-legacy .main .row > .col-lg-3:not(:has(#nav-sidemenu li)) { display: none; }
  .wx-legacy .main .row:has(> .col-lg-3:not(:has(#nav-sidemenu li))) > .col-lg-9 { width: 100%; border-left: 0; }
}

/* ---------- kafelki kategorii (.cat-grupy .box) ---------- */
.wx-legacy .cat-grupy {
  display: grid; gap: 1rem; overflow: visible;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr));
  margin-bottom: 2rem;
}
.wx-legacy .cat-grupy .box {
  width: auto; height: auto; margin: 0; padding: 1.25rem 1.25rem 1rem;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  background: #fff; border: 1px solid var(--wx-line); border-radius: 2px;
  transition: border-color .2s, box-shadow .25s, transform .25s var(--wx-ease);
}
.wx-legacy .cat-grupy .box:hover {
  border-color: var(--wx-red);
  box-shadow: 0 16px 30px -22px rgba(0,0,0,.45);
  transform: translateY(-2px);
}
.wx-legacy .cat-grupy .box a.foto { width: 100%; margin-bottom: 1rem; }
.wx-legacy .cat-grupy .box .product-thb { transition: transform .35s var(--wx-ease); }
.wx-legacy .cat-grupy .box:hover .product-thb { transform: scale(1.04); }
.wx-legacy .cat-grupy .box p { margin: 0; }
.wx-legacy .cat-grupy .box p a {
  color: var(--wx-ink) !important; text-decoration: none !important;
  font-family: var(--wx-display); font-weight: 500; font-size: 1.125rem; line-height: 1.2;
}
.wx-legacy .cat-grupy .box:hover p a { color: var(--wx-red) !important; }
.wx-legacy .boxdouble .cat-grupy, .wx-legacy .cat-grupy.boxdouble { grid-template-columns: 1fr; }
.wx-legacy .boxdouble .box { height: 400px; }

/* ---------- przyciski ---------- */
.wx-legacy .btn {
  border-radius: 2px; font-family: var(--wx-font); font-weight: 500; letter-spacing: .01em;
  transition: background-color .2s, border-color .2s, color .2s;
}
.wx-legacy .btn-default { background: #fff; border-color: #c4c9ce; color: var(--wx-text) !important; }
.wx-legacy .btn-default:hover, .wx-legacy .btn-default:focus { background: #fff; border-color: var(--wx-ink); color: var(--wx-ink) !important; }
.wx-legacy .btn-default.active, .wx-legacy .btn-default:active { background: var(--wx-paper-2); }
.wx-legacy .btn-primary { background: var(--wx-red); border-color: var(--wx-red); }
.wx-legacy .btn-primary:hover, .wx-legacy .btn-primary:focus { background: var(--wx-red-dark); border-color: var(--wx-red-dark); }
.wx-legacy .back { margin: 3rem 0 0; }

/* ---------- formularze ---------- */
.wx-legacy .form-control { border-radius: 2px; border-color: #c4c9ce; box-shadow: none; font-family: var(--wx-font); }
.wx-legacy .form-control:focus { border-color: var(--wx-red); box-shadow: 0 0 0 3px rgba(230,0,0,.12); }

/* ---------- tabele ---------- */
.wx-legacy table.data { font-family: var(--wx-font); font-size: .875rem; text-shadow: none; background: #fff; border: 1px solid var(--wx-line); border-radius: 0; }
.wx-legacy table.data th { background: var(--wx-paper-2); border-bottom: 1px solid var(--wx-line); border-top: 0; font-weight: 600; color: var(--wx-ink); }
.wx-legacy table.data td { border-top: 0; border-bottom: 1px solid var(--wx-line); }
.wx-legacy table.data tr:hover td { background: #fafafa; }
.wx-legacy table.data a:link, .wx-legacy table.data a:visited { color: var(--wx-red-dark); }
.wx-legacy .table > thead > tr > th { border-bottom-width: 1px; border-color: var(--wx-line); font-weight: 600; }
.wx-legacy .table > tbody > tr > td, .wx-legacy .table > tbody > tr > th { border-color: var(--wx-line); }

/* panele (m.in. konfigurator) — kolory i krawędzie, bez zmian układu */
.wx-legacy .panel { border-radius: 2px; box-shadow: none; }
.wx-legacy .panel-default { border-color: var(--wx-line); }
.wx-legacy .panel-default > .panel-heading { background: var(--wx-paper-2); border-color: var(--wx-line); color: var(--wx-ink); border-radius: 0; }
.wx-legacy .konfigurator .panel-heading h6 { font-size: 1.35rem; }
.wx-legacy .bootstrapWizard li .title { font-family: var(--wx-font); font-size: 13px; }
.wx-legacy .bootstrapWizard li.complete .title, .wx-legacy .bootstrapWizard li.active .title { color: var(--wx-ink); }

/* ---------- aktualności / wyniki wyszukiwania ---------- */
.wx-legacy .newsentry, .wx-legacy #search_query .query { border-color: var(--wx-line); }

/* ---------- mobile ---------- */
@media (max-width: 767px) {
  .wx-legacy .container.main { padding-left: 0; padding-right: 0; padding-top: 0; }
  .wx-legacy .no-gutter .border-left > main { padding: 1.5rem var(--wx-gutter) 2.5rem; }
  .wx-legacy .col-lg-12 > main { padding: 1rem var(--wx-gutter) 2.5rem; }
  .wx-legacy .out-gutter > [class*=col-]:first-child { padding-left: 0; }
  .wx-legacy .out-gutter > [class*=col-]:last-child { padding-right: 0; }
  .wx-legacy .cat-grupy { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .wx-legacy .cat-grupy .box { padding: .75rem; }
  .wx-legacy .cat-grupy .box a.foto { height: 110px; line-height: 110px; }
  .wx-legacy .cat-grupy .box .product-thb { max-height: 110px; }
  .wx-legacy .cat-grupy .box p a { font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .wx-legacy .cat-grupy .box, .wx-legacy .cat-grupy .box .product-thb { transition: none; }
  .wx-legacy .cat-grupy .box:hover, .wx-legacy .cat-grupy .box:hover .product-thb { transform: none; }
}
