/* Responsive fixes layered AFTER build/css/intertech.min.css */

/* Nagłówki h1–h3 bez letter-spacing */
h1, h2, h3,
.h1, .h2, .h3 {
  letter-spacing: normal !important;
}

/*
 * Global horizontal overflow (mobile): bez usuwania istniejących reguł —
 * dodajemy warstwę bezpieczeństwa + korygowanie typowych winowajców (logo, grid, flex).
 */
html {
  overflow-x: hidden;
  width: 100%;
}

body {
  overflow-x: hidden;
  width: 100%;
}

@media (min-width: 992px) {
  .intertech-single-content .container {
    max-width: 1320px;
  }
}

/* Bezpieczne marginesy na telefonach z „wyspą” / notch */
@supports (padding: max(0px)) {
  @media (max-width: 991.98px) {
    .intertech-header__inner,
    .intertech-mobile-panel .intertech-header__inner {
      padding-left: max(16px, env(safe-area-inset-left, 0px));
      padding-right: max(16px, env(safe-area-inset-right, 0px));
    }
  }
}

/* Prevent fixed-size media from overflowing */
img,
svg,
video,
canvas {
  max-width: 100%;
  height: auto;
}

/* Flex/grid children: pozwól kurczyć się kolumnom (text overflow / przepełnienie) */
.intertech-header__bottom .intertech-header__inner > *,
.intertech-hero .slider-content .row > [class*="col-"],
.intertech-product-lines__grid {
  min-width: 0;
}

/* Logo w headerze: na wąskich ekranach max-width 250px potrafi + padding rozbić rząd */
@media (max-width: 575.98px) {
  img.custom-logo,
  .intertech-header__brand img.custom-logo,
  .intertech-header__brand .custom-logo {
    max-width: min(180px, 58vw) !important;
    height: auto !important;
  }
}

/* Hero: długie słowa / nagłówki bez zawijania */
.intertech-hero .slider-content .h1,
.intertech-hero .slider-content h1,
.intertech-hero .slider-content p {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Wskaźniki karuzeli — nie wychodzą poza viewport */
@media (max-width: 767.98px) {
  .intertech-hero .carousel-indicators {
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 100%;
    margin-left: 0 !important;
    margin-right: 0 !important;
    flex-wrap: wrap;
    justify-content: center;
    box-sizing: border-box;
  }
}

/* Sekcja „Linie produktowe” — nagłówki z Yoast / ACF mogą być bardzo długie */
section.intertech-product-lines.intertech-product-lines--redesign .intertech-product-lines__pretitle,
section.intertech-product-lines.intertech-product-lines--redesign .intertech-product-lines__title,
section.intertech-product-lines.intertech-product-lines--redesign .intertech-product-lines__desc {
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

/* Inline z motywu: 3 kolumny na mobile = typowe przepełnienie */
@media (max-width: 991.98px) {
  .information-about-managers {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
  .information-about-managers {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* Ajax Search Lite / kontener w headerze i panelu mobilnym */
@media (max-width: 991.98px) {
  .intertech-header__search .asl_w_container,
  .intertech-mobile-panel__search .asl_w_container,
  div[id^="ajaxsearchlite"].asl_w_container {
    max-width: 100% !important;
    min-width: 0 !important;
    width: 100% !important;
    box-sizing: border-box;
  }

  .intertech-header__search .asl_w,
  .intertech-mobile-panel__search .asl_w {
    max-width: 100%;
  }
}

/* Dropdown oferty / mega-menu na małych szerokościach */
@media (max-width: 767.98px) {
  header .dropdown-menu.show,
  .intertech-header .dropdown-menu.show {
    max-width: calc(100vw - 32px);
    box-sizing: border-box;
  }
}

/* Treść CMS: szerokie tabele / kod — scroll poziomy zamiast rozpychania strony */
@media (max-width: 767.98px) {
  .intertech-single-content .table-responsive,
  .page__main-content .table-responsive,
  .intertech-product__desc .table-responsive {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .page__main-content pre,
  .intertech-single-content pre,
  .intertech-product__desc pre {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ===== About page: timeline layout (mobile/tablet) ===== */
@media (max-width: 767.98px) {
  .timeline::before {
    left: 12px;
  }

  .timeline .timeline-item {
    width: 100%;
    margin-left: 0 !important;
    padding: 1.25rem 1rem 1.25rem 2.5rem;
  }

  .timeline .timeline-item:nth-child(odd),
  .timeline .timeline-item:nth-child(even) {
    padding-left: 2.5rem;
    padding-right: 1rem;
    text-align: left;
  }

  .timeline .timeline-item:nth-child(odd)::before,
  .timeline .timeline-item:nth-child(even)::before {
    left: 6px !important;
    right: auto !important;
  }

  .timeline-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .timeline-item .timeline-item-date {
    font-size: 1.75rem;
    line-height: 1.1;
  }

  .timeline-item .timeline-item-date::after {
    display: none;
  }

  .timeline-item .timeline-item-description {
    margin-left: 0;
    font-size: 1rem;
  }
}

@media (max-width: 575.98px) {
  .intertech-about .intertech-timeline .card {
    margin-left: 1.5rem;
    margin-right: 1rem;
  }

  .intertech-about .intertech-timeline .card-dot {
    left: -1.5rem;
  }

  .intertech-about .intertech-timeline__line {
    left: 1.25rem;
  }
}

/* ===== Shared page banner ===== */
@media (max-width: 991.98px) {
  .intertech-page-banner {
    min-height: 18rem;
    padding: 48px 0;
  }

  .intertech-page-banner .row,
  .intertech-page-banner .col-lg-6 {
    min-height: auto;
  }

  .intertech-page-banner h2,
  .intertech-page-banner .h2 {
    font-size: clamp(26px, 4.6vw, 34px);
    line-height: 1.15;
  }

  .intertech-page-banner p {
    max-width: 60ch;
  }
}

/* ===== Front-page hero text padding (avoid overflow on tablet/mobile) ===== */
@media (max-width: 991.98px) {
  .intertech-hero .slider-content h1,
  .intertech-hero .slider-content .h1,
  .intertech-hero .slider-content p {
    padding-right: 0 !important;
  }
}

/* ===== Contact: departments cards/images should not overflow on small screens ===== */
@media (max-width: 767.98px) {
  .intertech-departments__grid {
    justify-items: stretch;
  }

  .intertech-departments__grid .card {
    max-width: none;
  }

  .intertech-departments__grid img {
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
  }
}

/* ===== Mobile panel: Oferta (podmenu) i języki — rozwijanie / zwijanie po kliknięciu ===== */
@media (max-width: 991.98px) {
  .intertech-mobile-panel .intertech-mobile-panel__menu .menu-item-has-children > .sub-menu {
    display: none !important;
    flex-direction: column;
  }

  .intertech-mobile-panel .intertech-mobile-panel__menu li.intertech-mobile-submenu-open > .sub-menu {
    display: flex !important;
  }

  .intertech-mobile-panel .intertech-mobile-panel__menu .menu-item-has-children > a::after {
    transition: transform 0.25s ease;
  }

  .intertech-mobile-panel .intertech-mobile-panel__menu li.intertech-mobile-submenu-open.menu-item-has-children > a::after {
    transform: rotate(225deg) translateY(-2px);
  }

  /* Języki: lista pod przyciskiem, bez hover (klasa steruje widocznością) */
  .intertech-mobile-panel__language-list {
    position: static !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    width: 100%;
    margin-top: 10px;
    box-shadow: none;
    border: 1px solid rgba(10, 10, 10, 0.08);
  }

  .intertech-mobile-panel__language:not(.intertech-mobile-lang-open) .intertech-mobile-panel__language-list {
    display: none !important;
  }

  .intertech-mobile-panel__language.intertech-mobile-lang-open .intertech-mobile-panel__language-list {
    display: block !important;
    position: absolute !important;
  }

  .intertech-mobile-panel__language.intertech-mobile-lang-open .intertech-mobile-panel__language-current::after {
    transform: rotate(225deg) translateY(-2px);
  }
}

/* ===== Formularze CF7 jak na stronie Kontakt (.intertech-contact-new__form-box) ===== */
.intertech-cf7-like-contact {
  padding: 42px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 55px rgba(0, 0, 0, 0.07);
}

@media (max-width: 575px) {
  .intertech-cf7-like-contact {
    padding: 28px 22px;
  }
}

.intertech-cf7-like-contact__title {
  margin: 0 0 12px;
  font-size: clamp(22px, 3.5vw, 31px);
  line-height: 1.2;
  font-weight: 800;
  color: #090909;
}

section.intertech-single-content .intertech-single-content__form {
  margin-top: 2.5rem;
}

.intertech-cf7-like-contact .wpcf7-form {
  display: grid;
  gap: 18px;
}

.intertech-cf7-like-contact .wpcf7-form p {
  margin: 0;
}

.intertech-cf7-like-contact .wpcf7 input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
.intertech-cf7-like-contact .wpcf7 select,
.intertech-cf7-like-contact .wpcf7 textarea {
  width: 100%;
  min-height: 48px;
  padding: 13px 16px;
  border: 1px solid #dcdfe4;
  border-radius: 10px;
  background: #fafafa;
  font-size: 15px;
  color: #222;
  box-sizing: border-box;
}

.intertech-cf7-like-contact .wpcf7 textarea {
  min-height: 130px;
  resize: vertical;
}

.intertech-cf7-like-contact .wpcf7 input[type="file"] {
  width: 100%;
  padding: 12px;
  border: 1px dashed #dcdfe4;
  border-radius: 10px;
  background: #fafafa;
  font-size: 14px;
}

.intertech-cf7-like-contact .wpcf7 input[type="submit"] {
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 9px;
  background: #5eb82e;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  transition: 0.25s ease;
}

.intertech-cf7-like-contact .wpcf7 input[type="submit"]:hover {
  background: #21875c;
}

.intertech-cf7-like-contact .wpcf7 input[type="checkbox"],
.intertech-cf7-like-contact .wpcf7 input[type="radio"] {
  width: auto;
  min-height: auto;
  margin-right: 8px;
  vertical-align: middle;
}

.intertech-cf7-like-contact .wpcf7-list-item-label {
  font-size: 14px;
  line-height: 1.45;
  color: #424143;
}

.intertech-cf7-like-contact .wpcf7-not-valid-tip {
  margin-top: 6px;
  font-size: 13px;
}

.intertech-find-dealer__map--error {
  align-items: center;
  background: #f8f8f8;
  display: flex;
  min-height: 420px;
  padding: 24px;
}

.intertech-find-dealer__map-error {
  background: #fff;
  border-left: 4px solid #d63638;
  box-shadow: 0 12px 28px rgba(14, 20, 27, 0.08);
  color: #424143;
  line-height: 1.5;
  margin: auto;
  max-width: 560px;
  padding: 18px 20px;
}

.intertech-dealer-map-pin-wrap {
  background: transparent;
  border: 0;
}

.intertech-dealer-map-pin {
  background: #5eb82e;
  border: 2px solid #fff;
  border-radius: 50% 50% 50% 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
  display: block;
  height: 30px;
  transform: rotate(-45deg);
  width: 30px;
}

.intertech-dealer-map-pin::after {
  background: #fff;
  border-radius: 50%;
  content: "";
  display: block;
  height: 10px;
  left: 8px;
  position: absolute;
  top: 8px;
  width: 10px;
}

/* Product downloads */
#download-tab-pane .product-downloads {
    display: grid;
    grid-template-columns: repeat(var(--product-download-columns, 2), minmax(0, 1fr));
    gap: 12px;
}

#download-tab-pane .product-downloads__item {
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
    padding: 16px 18px;
    border: 1px solid #e8eaee;
    border-radius: 16px;
    background: #f5f6f7;
    color: #111318;
    text-decoration: none;
}

#download-tab-pane .product-downloads__item:hover {
    border-color: var(--color1);
    background: #fff;
    color: #111318;
}

.product-downloads__icon {
    display: grid;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    margin-right: 14px;
    place-items: center;
    border-radius: 12px;
    background: var(--color1);
    color: #fff;
    font-size: 23px;
}

.product-downloads__content {
    display: block;
    min-width: 0;
}

.product-downloads__name {
    display: block;
    overflow-wrap: anywhere;
    font-weight: 800;
    line-height: 1.3;
}

.product-downloads__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 14px;
    margin-top: 5px;
    color: #6d7280;
    font-size: 13px;
    font-weight: 500;
}

.product-downloads__meta span + span::before {
    content: "\2022";
    margin-right: 14px;
    color: #adb1b9;
}

.product-downloads__arrow {
    flex: 0 0 auto;
    margin-left: auto;
    padding-left: 14px;
    color: var(--color1);
    font-size: 20px;
}

@media (max-width: 991.98px) {
    #download-tab-pane .product-downloads {
        grid-template-columns: 1fr;
    }
}
