/* WordPress integration layer — KrepTech v0.2.0 */
html { scroll-behavior: auto; }
body.admin-bar .site-header { top: 32px; }
@media (max-width:782px) { body.admin-bar .site-header { top: 46px; } }

/* Native WordPress navigation mapped to the approved header. */
.main-nav .kreptech-nav-list,
.main-nav .menu { display:flex; align-items:stretch; margin:0; padding:0; list-style:none; }
.main-nav .kreptech-nav-list > li,
.main-nav .menu > li { display:flex; align-items:stretch; margin:0; }
.main-nav .kreptech-nav-list > li > a,
.main-nav .menu > li > a {
  position:relative; display:flex; align-items:center; min-height:48px; padding:0 18px;
  border-right:1px solid rgba(255,255,255,.13); color:#fff; font-size:13px; font-weight:800;
  text-transform:uppercase; letter-spacing:.015em;
}
.main-nav .kreptech-nav-list > li:first-child > a,
.main-nav .menu > li:first-child > a { border-left:1px solid rgba(255,255,255,.13); }
.main-nav .kreptech-nav-list > li > a::after,
.main-nav .menu > li > a::after {
  content:""; position:absolute; left:18px; right:18px; bottom:7px; height:2px; background:var(--orange);
  transform:scaleX(0); transform-origin:left; transition:transform .24s ease;
}
.main-nav .kreptech-nav-list > li > a:hover::after,
.main-nav .kreptech-nav-list > li.current-menu-item > a::after,
.main-nav .menu > li > a:hover::after,
.main-nav .menu > li.current-menu-item > a::after { transform:scaleX(1); }
.main-nav .menu-catalog > a { background:var(--orange); color:#102c42; }
.main-nav .menu-catalog > a::after { background:#fff; }
.main-nav .menu-catalog > a:hover { background:var(--orange-dark); color:#fff; }

/* The catalogue is intentionally a light placeholder until kreptech-catalog is installed. */
.catalog-placeholder-panel {
  display:grid; grid-template-columns:minmax(0,1fr) auto; gap:28px; align-items:center;
  padding:36px 38px; border:1px solid var(--line); background:#fff;
}
.catalog-placeholder-panel h2 { margin:0; color:var(--blue-950); font-size:28px; }
.catalog-placeholder-panel p { max-width:760px; margin:9px 0 0; color:var(--muted); line-height:1.65; }
.catalog-placeholder-badge { display:inline-flex; align-items:center; gap:8px; margin-bottom:8px; color:var(--blue-700); font-size:12px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.catalog-placeholder-badge::before { content:""; width:22px; height:2px; background:var(--orange); }

/* Home hero backgrounds come from theme settings; motion is crossfade only. */
.home-page .hero-media { overflow:hidden; }
.home-page .hero-slide {
  position:absolute; inset:0; opacity:0; background-position:center bottom; background-repeat:no-repeat; background-size:cover;
  transform:none !important; animation:none !important; transition:opacity 1.25s cubic-bezier(.2,.7,.2,1);
}
.home-page .hero-slide.is-active { opacity:1; }
@media (max-width:1040px) {
  .home-page .hero-slide { transition:none; }
  .home-page .hero-slide:not(:first-child) { display:none; }
  .home-page .hero-slide:first-child { opacity:1; }
}

/* Gutenberg/page content is constrained by the designed components. */
.kreptech-editor-content > :first-child { margin-top:0; }
.kreptech-editor-content > :last-child { margin-bottom:0; }
.kreptech-editor-content h1,
.kreptech-editor-content h2 { color:var(--blue-950); }
.kreptech-editor-content h2 { font-size:28px; line-height:1.2; margin:30px 0 14px; }
.kreptech-editor-content h3 { color:var(--blue-900); font-size:20px; }
.kreptech-editor-content p,
.kreptech-editor-content li { color:var(--text); line-height:1.72; }
.kreptech-editor-content a:not(.button) { color:var(--blue-700); text-decoration:underline; text-underline-offset:3px; }
.kreptech-editor-content table { width:100%; border-collapse:collapse; }
.kreptech-editor-content th,
.kreptech-editor-content td { padding:10px 12px; border:1px solid var(--line); vertical-align:top; }

/* News generated by native WP posts. */
.news-list-image img,
.news-mini-image img { width:100%; height:100%; object-fit:contain; object-position:center; }
.news-list-card .news-list-image { overflow:hidden; }
.news-article-title { max-width:900px; }
.article-content .wp-block-image img,
.article-content > img { width:100%; height:auto; }
.article-navigation a { text-decoration:none; }

/* Contacts / CF7. */
.kreptech-contact-form { margin-top:26px; }
.kreptech-contact-form .wpcf7-form { display:grid; gap:15px; }
.kreptech-contact-form .wpcf7-form-control-wrap { display:block; }
.kreptech-contact-form input:not([type="submit"]),
.kreptech-contact-form textarea,
.kreptech-contact-form select {
  width:100%; min-height:46px; padding:10px 12px; border:1px solid var(--line-strong); border-radius:0; background:#fff; color:var(--ink); outline:none;
}
.kreptech-contact-form textarea { min-height:130px; resize:vertical; }
.kreptech-contact-form input:focus,
.kreptech-contact-form textarea:focus,
.kreptech-contact-form select:focus { border-color:var(--blue-600); box-shadow:0 0 0 2px rgba(24,121,189,.1); }
.kreptech-contact-form input[type="submit"] { min-height:46px; padding:0 20px; border:0; background:var(--blue-700); color:#fff; font-weight:800; cursor:pointer; }
.kreptech-contact-form input[type="submit"]:hover { background:var(--blue-900); }

/* Branch list/table generated from one source of truth in admin. */
.branch-directory { margin-top:34px; border-top:1px solid var(--line); }
.branch-directory-row {
  display:grid; grid-template-columns:180px minmax(0,1.2fr) minmax(190px,.8fr) minmax(160px,.8fr); gap:20px;
  padding:18px 0; border-bottom:1px solid var(--line); align-items:start;
}
.branch-directory-row strong { color:var(--blue-950); }
.branch-directory-row span,
.branch-directory-row a { color:var(--muted); font-size:14px; line-height:1.55; }
.branch-directory-row a { color:var(--blue-700); }
.branch-directory-phones { display:flex; flex-wrap:wrap; gap:0 6px; }

/* WordPress footer menus. */
.footer-col .menu { margin:0; padding:0; list-style:none; }
.footer-col .menu li + li { margin-top:8px; }
.footer-col .menu a { color:inherit; }
.footer-contact .footer-phone-line { display:flex; flex-wrap:wrap; gap:0 4px; }

.to-top {
  position:fixed; right:20px; bottom:20px; z-index:80; width:42px; height:42px; border:1px solid rgba(255,255,255,.18);
  background:var(--blue-900); color:#fff; opacity:0; pointer-events:none; transform:translateY(8px); transition:.2s ease;
}
.to-top.is-visible { opacity:.92; pointer-events:auto; transform:none; }
.to-top:hover { background:var(--orange); color:#102c42; }

/* Placeholder page and empty states. */
.module-placeholder { min-height:330px; display:grid; place-items:center; padding:52px 24px; text-align:center; border:1px solid var(--line); background:#fff; }
.module-placeholder__inner { max-width:720px; }
.module-placeholder h1 { margin:0; color:var(--blue-950); font-size:32px; }
.module-placeholder p { margin:14px auto 0; color:var(--muted); line-height:1.7; }
.module-placeholder .button { margin-top:22px; }

/* Header search must stay compact before the catalogue plugin takes over. */
.header-search input { min-width:0; }

@media (max-width:1040px) {
  .main-nav .kreptech-nav-list,
  .main-nav .menu { display:block; width:100%; }
  .main-nav .kreptech-nav-list > li,
  .main-nav .menu > li { display:block; width:100%; }
  .main-nav .kreptech-nav-list > li > a,
  .main-nav .menu > li > a { width:100%; min-height:50px; border:0; border-bottom:1px solid rgba(255,255,255,.1); padding:0 20px; }
  .main-nav .kreptech-nav-list > li:first-child > a,
  .main-nav .menu > li:first-child > a { border-left:0; }
  .main-nav .kreptech-nav-list > li > a::after,
  .main-nav .menu > li > a::after { display:none; }
  .catalog-placeholder-panel { grid-template-columns:1fr; padding:28px; }
  .branch-directory-row { grid-template-columns:150px minmax(0,1fr) minmax(170px,.7fr); }
  .branch-directory-row > :last-child { grid-column:2 / -1; }
}
@media (max-width:680px) {
  .catalog-placeholder-panel { padding:22px 18px; }
  .catalog-placeholder-panel h2 { font-size:24px; }
  .branch-directory-row { grid-template-columns:1fr; gap:8px; }
  .branch-directory-row > :last-child { grid-column:auto; }
}


/* Bootstrap-lite compatibility for the few grid gaps used by the prototype. */
.row.g-3 { gap:1rem; margin-left:0; margin-right:0; }
.row.g-3 > [class*="col-"] { padding-left:0; padding-right:0; }


/* v0.2.4 — Contact Form 7 aligned with the approved HTML contact form */
.kreptech-contact-form-wrap .wpcf7 { width:100%; }
.kreptech-contact-form-wrap .wpcf7-form.contact-form { margin:0; }
.kreptech-contact-form-wrap .wpcf7-form-control-wrap { display:block; width:100%; }
.kreptech-contact-form-wrap .wpcf7-form-control-wrap input,
.kreptech-contact-form-wrap .wpcf7-form-control-wrap textarea,
.kreptech-contact-form-wrap .wpcf7-form-control-wrap select { width:100%; }
.kreptech-contact-form-wrap .wpcf7-spinner { margin:10px 0 0 12px; vertical-align:middle; }
.kreptech-contact-form-wrap .wpcf7-response-output { grid-column:1/-1; margin:12px 0 0 !important; }

/* Where to buy / Technical information: links use component styling without text underlines. */
body.page-template-page-where-to-buy #main a,
body.page-template-page-where-to-buy .breadcrumbs a,
body.page-template-page-documents #main a,
body.page-template-page-documents .breadcrumbs a {
  text-decoration: none !important;
}
body.page-template-page-where-to-buy #main a:hover,
body.page-template-page-where-to-buy #main a:focus-visible,
body.page-template-page-where-to-buy .breadcrumbs a:hover,
body.page-template-page-where-to-buy .breadcrumbs a:focus-visible,
body.page-template-page-documents #main a:hover,
body.page-template-page-documents #main a:focus-visible,
body.page-template-page-documents .breadcrumbs a:hover,
body.page-template-page-documents .breadcrumbs a:focus-visible {
  text-decoration: none !important;
}

/* v0.2.9 — header interactions and tablet/mobile drawer */
.header-phone-menu {
  padding-right: 0;
}
.header-phone-trigger {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: stretch;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.header-phone-trigger .header-phone-current {
  flex: 1 1 auto;
  padding-right: 6px;
}
.header-phone-trigger .header-phone-current strong {
  color: var(--blue-950);
  white-space: nowrap;
}
.header-phone-trigger:hover .header-phone-current strong,
.header-phone-trigger:focus-visible .header-phone-current strong {
  color: var(--orange-dark);
}
.header-phone-trigger:focus-visible {
  outline: 2px solid var(--blue-600);
  outline-offset: 2px;
}
.header-phone-trigger .header-phone-toggle {
  align-self: stretch;
}

/* Lightweight theme-native tooltips; no Bootstrap JS dependency. */
.kreptech-tooltip {
  position: relative;
}
.kreptech-tooltip::before,
.kreptech-tooltip::after {
  position: absolute;
  left: 50%;
  z-index: 520;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
}
.kreptech-tooltip::after {
  content: attr(data-kreptech-tooltip);
  top: calc(100% + 10px);
  transform: translate(-50%, -3px);
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,.12);
  background: var(--blue-950);
  color: #fff;
  box-shadow: 0 8px 24px rgba(7,42,68,.22);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}
.kreptech-tooltip::before {
  content: "";
  top: calc(100% + 5px);
  width: 9px;
  height: 9px;
  background: var(--blue-950);
  transform: translate(-50%, -2px) rotate(45deg);
}
@media (hover: hover) {
  .kreptech-tooltip:hover::before,
  .kreptech-tooltip:hover::after {
    opacity: 1;
    visibility: visible;
  }
  .kreptech-tooltip:hover::after { transform: translate(-50%, 0); }
  .kreptech-tooltip:hover::before { transform: translate(-50%, 0) rotate(45deg); }
}
.kreptech-tooltip:focus-visible::before,
.kreptech-tooltip:focus-visible::after {
  opacity: 1;
  visibility: visible;
}
.kreptech-tooltip:focus-visible::after { transform: translate(-50%, 0); }
.kreptech-tooltip:focus-visible::before { transform: translate(-50%, 0) rotate(45deg); }

/* The request button has visible text on desktop, so its hint is only needed
   once the compact icon-only state is active. */
.kreptech-tooltip-compact::before,
.kreptech-tooltip-compact::after { display: none; }

.mobile-menu-head,
.mobile-menu-contacts { display: none; }

@media (max-width: 1040px) {
  .kreptech-tooltip-compact::before,
  .kreptech-tooltip-compact::after { display: block; }

  .main-nav {
    display: flex;
    flex-direction: column;
  }
  .mobile-menu-head {
    position: sticky;
    top: 0;
    z-index: 8;
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 14px 11px 20px;
    border-bottom: 1px solid rgba(255,255,255,.14);
    background: #092f4d;
  }
  .mobile-menu-logo {
    display: inline-flex;
    align-items: center;
    width: 190px;
    max-width: calc(100% - 64px);
  }
  .mobile-menu-logo img {
    width: 100%;
    max-height: 44px;
    object-fit: contain;
    object-position: left center;
    filter: brightness(0) invert(1);
    opacity: .96;
  }
  .mobile-menu-head .menu-close {
    position: static;
    width: 42px;
    min-width: 42px;
    min-height: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid rgba(255,255,255,.18);
    background: transparent;
    display: grid;
    place-items: center;
    align-items: center;
    justify-content: center;
  }
  .mobile-menu-head .menu-close:hover,
  .mobile-menu-head .menu-close:focus-visible { background: rgba(255,255,255,.08); }
  .mobile-menu-head .menu-close b {
    width: auto;
    height: auto;
    display: block;
    font-size: 30px;
  }

  /* Current page state remains visible in the drawer, including WP custom menus. */
  .main-nav .kreptech-nav-list > li.current-menu-item > a,
  .main-nav .kreptech-nav-list > li.current_page_item > a,
  .main-nav .kreptech-nav-list > li.current-menu-ancestor > a,
  .main-nav .kreptech-nav-list > li.current_page_parent > a,
  .main-nav .kreptech-nav-list > li.is-current > a,
  .main-nav .menu > li.current-menu-item > a,
  .main-nav .menu > li.current_page_item > a,
  .main-nav .menu > li.current-menu-ancestor > a,
  .main-nav .menu > li.current_page_parent > a,
  .main-nav .menu > li.is-current > a {
    position: relative;
    background: rgba(255,255,255,.09);
    color: #fff;
  }
  .main-nav .kreptech-nav-list > li.current-menu-item > a::before,
  .main-nav .kreptech-nav-list > li.current_page_item > a::before,
  .main-nav .kreptech-nav-list > li.current-menu-ancestor > a::before,
  .main-nav .kreptech-nav-list > li.current_page_parent > a::before,
  .main-nav .kreptech-nav-list > li.is-current > a::before,
  .main-nav .menu > li.current-menu-item > a::before,
  .main-nav .menu > li.current_page_item > a::before,
  .main-nav .menu > li.current-menu-ancestor > a::before,
  .main-nav .menu > li.current_page_parent > a::before,
  .main-nav .menu > li.is-current > a::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--orange);
  }
  .main-nav .menu-catalog.current-menu-item > a,
  .main-nav .menu-catalog.current_page_item > a,
  .main-nav .menu-catalog.is-current > a {
    background: var(--orange);
    color: #102c42;
  }
  .main-nav .menu-catalog.current-menu-item > a::before,
  .main-nav .menu-catalog.current_page_item > a::before,
  .main-nav .menu-catalog.is-current > a::before { background: #fff; }

  .mobile-menu-contacts {
    display: block;
    margin-top: auto;
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,.14);
    background: #082b47;
    color: #d7e7f2;
  }
  .mobile-menu-contacts-title {
    display: block;
    margin-bottom: 14px;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
  }
  .mobile-menu-contact-row {
    display: grid;
    gap: 3px;
    padding: 10px 0;
    border-top: 1px solid rgba(255,255,255,.09);
  }
  .mobile-menu-contact-row:first-of-type { border-top: 0; padding-top: 0; }
  .mobile-menu-contact-row > span {
    color: #8fb3cc;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .035em;
  }
  .mobile-menu-contact-row b,
  .mobile-menu-contact-row a {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
    overflow-wrap: anywhere;
  }
  .mobile-menu-contact-row a:hover,
  .mobile-menu-contact-row a:focus-visible { color: #ffb64b; }
  .mobile-menu-phone-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
  }
}

@media (max-width: 480px) {
  .mobile-menu-logo { width: 168px; }
  .mobile-menu-contacts { padding: 18px; }
  .kreptech-tooltip::after {
    max-width: calc(100vw - 24px);
    white-space: normal;
    text-align: center;
  }
}

@media (min-width: 1041px) {
  .main-nav .kreptech-nav-list > li.is-current > a::after,
  .main-nav .menu > li.is-current > a::after { transform: scaleX(1); }
}

@media (max-width: 1040px) {
  .quote-button.kreptech-tooltip::after {
    left: auto;
    right: 0;
    transform: translateY(-3px);
  }
  .quote-button.kreptech-tooltip::before {
    left: auto;
    right: 16px;
    transform: translateY(-2px) rotate(45deg);
  }
  @media (hover: hover) {
    .quote-button.kreptech-tooltip:hover::after { transform: translateY(0); }
    .quote-button.kreptech-tooltip:hover::before { transform: translateY(0) rotate(45deg); }
  }
  .quote-button.kreptech-tooltip:focus-visible::after { transform: translateY(0); }
  .quote-button.kreptech-tooltip:focus-visible::before { transform: translateY(0) rotate(45deg); }
}
