/* ============================================================
   tp-header.css v2 — шапка tehps.ru «как была»: тёмный топбар
   с контактами по центру + белая строка (лого, поиск-кнопка,
   меню, оранжевая ЗАЯВКА). Мега-панель КАТАЛОГ и выпадающие
   списки сохранены. Мобильная шторка. 2026-11-10.
   ============================================================ */

.tp-header {
  --tp-blue: #0a66b7;
  --tp-blue-d: #085a9e;
  --tp-dark: #0f172a;
  --tp-navy: #1B365D;
  --tp-orange: #F15A24;
  --tp-gray: #64748b;
  --tp-line: #e5e9f0;
  --tp-bg: #ffffff;
  background: var(--tp-bg);
  position: relative;
  z-index: 99990;
  font-size: 15px;
}
.tp-wrap { max-width: 1720px; margin: 0 auto; padding: 0 24px; }

/* ---------- верхняя тёмная строка ---------- */
.tp-topbar { background: var(--tp-navy); font-size: 13.5px; }
.tp-topbar-in {
  display: flex; align-items: center; justify-content: center;
  gap: 14px; min-height: 42px; position: relative;
}
.tp-topbar-center { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.tp-topbar-center .tp-tel {
  display: inline-flex; align-items: baseline; gap: 6px;
  text-decoration: none; white-space: nowrap;
}
.tp-tel-lbl { color: rgba(255,255,255,.72); font-size: 12.5px; }
.tp-topbar-center .tp-tel b { color: #9cc3ff; font-size: 13.5px; font-weight: 700; }
.tp-topbar-center .tp-tel:hover b { color: #fff; }
.tp-sep { color: rgba(255,255,255,.32); font-size: 12px; }
.tp-topbar-contacts { position: absolute; right: 24px; display: flex; align-items: center; gap: 8px; }
.tp-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px;
  border-radius: 6px; font-size: 12px; font-weight: 700; color: #fff; text-decoration: none; white-space: nowrap;
}
.tp-chip-wa { background: #16a34a; }
.tp-chip-max { background: #5856d6; }
.tp-chip:hover { filter: brightness(1.08); }

/* ---------- основная белая строка ---------- */
.tp-main {
  background: #fff;
  border-bottom: 2px solid #e2e8f0;
  box-shadow: 0 4px 10px rgba(0,0,0,.06);
}
.tp-main-in { display: flex; align-items: center; gap: 14px; min-height: 76px; }
.tp-logo { flex: 0 0 auto; display: flex; }
.tp-logo img { height: 62px; width: auto; }

.tp-search-toggle {
  flex: 0 0 auto; padding: 0; width: 44px; height: 44px; border-radius: 50%;
  background: #eef3fa; border: 1.5px solid #d7dfe9; color: var(--tp-blue);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all .15s ease;
}
.tp-search-toggle:hover, .tp-search-toggle.open { background: var(--tp-blue); border-color: var(--tp-blue); color: #fff; }

/* ---------- меню ---------- */
.tp-menu { display: flex; align-items: center; flex: 1 1 auto; justify-content: center; gap: 0; }
.tp-menu-item, .tp-menu-link {
  position: relative;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 11px 14px; border-radius: 8px;
  font-weight: 800; font-size: 13.5px; letter-spacing: .35px; text-transform: uppercase;
  color: #16305a; text-decoration: none; white-space: nowrap; line-height: 1.2;
}
.tp-menu-item:hover, .tp-menu-link:hover { color: var(--tp-blue); background: #f1f5fd; }
.tp-menu-link svg { opacity: .5; transition: transform .18s ease; }
.tp-has-dd:hover > .tp-menu-link svg { transform: rotate(180deg); opacity: 1; }

/* ---------- выпадающие панели ---------- */
.tp-has-dd { position: relative; }
.tp-has-dd::after { /* мостик между пунктом и панелью, чтобы не «падало» при движении мыши */
  content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 14px; display: none;
}
.tp-has-dd:hover::after { display: block; }
.tp-dd-panel {
  display: none; position: absolute; top: calc(100% + 12px); left: 0; z-index: 80;
  background: #fff; border: 1px solid var(--tp-line); border-radius: 12px;
  box-shadow: 0 22px 44px rgba(15,23,42,.16);
  text-transform: none; letter-spacing: normal;
}
.tp-has-dd:hover > .tp-dd-panel, .tp-has-dd.open > .tp-dd-panel { display: block; }
.tp-has-dd:hover > .tp-menu-link { color: var(--tp-blue); background: #f1f5fd; }

.tp-dd-list { min-width: 330px; padding: 10px 0; }
.tp-dd-list a {
  display: block; padding: 9px 22px; font-size: 14.5px; font-weight: 600;
  color: #1e293b; text-decoration: none; line-height: 1.35;
}
.tp-dd-list a:hover { background: #f1f5fd; color: var(--tp-blue); }

/* мега-панель КАТАЛОГ — на всю ширину шапки */
.tp-dd-catalog { position: static; }
.tp-dd-catalog::after { left: 0; right: 0; }
.tp-catpanel {
  left: 0; right: 0; top: 100%;
  border-radius: 0 0 14px 14px; border-top: 1px solid var(--tp-line);
  max-height: calc(100vh - 60px); overflow-y: auto;
}
.tp-catpanel-in { display: flex; gap: 26px; padding: 22px 30px 26px; max-width: 1720px; margin: 0 auto; }
.tp-mc-left { flex: 1 1 auto; min-width: 0; }
.tp-mc-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 4px 22px; }
.tp-mc-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border-radius: 8px; text-decoration: none; color: #1e293b; font-weight: 600; font-size: 14.5px;
}
.tp-mc-item:hover { background: #f1f5fd; color: var(--tp-blue); }
.tp-mc-cnt { color: #94a3b8; font-size: 12.5px; font-weight: 600; }
.tp-mc-right { flex: 0 0 330px; display: grid; grid-template-columns: 1fr; gap: 14px; }
.tp-mc-block {
  border: 1px solid var(--tp-line); border-radius: 10px; padding: 12px 14px;
  display: flex; flex-direction: column;
}
.tp-mc-title {
  font-size: 12px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase;
  color: var(--tp-gray); margin-bottom: 6px;
}
.tp-mc-block a { color: #1e293b; text-decoration: none; font-size: 13.5px; font-weight: 500; padding: 3px 0; }
.tp-mc-block a:hover { color: var(--tp-blue); }
.tp-mc-block-tel a b { font-size: 15px; }
.tp-mc-block-tel span { color: var(--tp-gray); font-size: 11.5px; margin: -2px 0 4px; }

/* ---------- строка поиска (раскрывается под шапкой) ---------- */
.tp-searchrow {
  display: none; background: #fff; border-bottom: 2px solid #e2e8f0;
  box-shadow: 0 18px 30px rgba(15,23,42,.08);
}
.tp-searchrow.open { display: block; }
.tp-searchrow .tp-wrap { padding-top: 14px; padding-bottom: 14px; }
.tp-search {
  display: flex; align-items: center; max-width: 860px; margin: 0 auto;
  border: 2px solid var(--tp-blue); border-radius: 10px; overflow: hidden; background: #fff;
}
.tp-search input[type="search"] {
  flex: 1 1 auto; border: none; outline: none; background: transparent;
  font-size: 16px; color: var(--tp-dark); padding: 13px 18px; min-width: 0;
  box-shadow: none; height: auto; line-height: 1.4;
}
.tp-search input::placeholder { color: #94a3b8; }
.tp-search button {
  flex: 0 0 auto; width: 56px; height: 50px; border: none; cursor: pointer;
  background: var(--tp-blue); color: #fff; display: flex; align-items: center; justify-content: center;
}
.tp-search button:hover { background: var(--tp-blue-d); }

/* ---------- правые действия ---------- */
.tp-main-actions { flex: 0 0 auto; margin-left: auto; display: flex; align-items: center; gap: 10px; }
.tp-ico-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%; color: #334155;
  border: 1.5px solid #d7dfe9; background: #fff; text-decoration: none;
}
.tp-ico-btn:hover { color: var(--tp-blue); border-color: var(--tp-blue); background: #f1f5fd; }
.tp-request-btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--tp-orange); color: #fff;
  font-weight: 800; font-size: 14px; letter-spacing: .5px; text-transform: uppercase;
  padding: 14px 26px; border-radius: 6px; text-decoration: none; white-space: nowrap;
  transition: background .15s ease;
}
.tp-request-btn:hover { background: #d94c1a; color: #fff; }
.tp-mob-actions { display: none; }

/* ---------- мобильная шторка ---------- */
.tp-drawer-wrap { display: none; }
@media (max-width: 1099px) {
  .tp-menu, .tp-search-toggle, .tp-main-actions { display: none !important; }
  .tp-main-in { justify-content: space-between; padding-top: 8px; padding-bottom: 8px; min-height: 64px; }
  .tp-logo img { height: 48px; }
  .tp-mob-actions { display: flex; align-items: center; gap: 8px; }
  .tp-mob-call {
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; border-radius: 8px; background: var(--tp-blue); color: #fff; text-decoration: none;
  }
  .tp-burger {
    display: inline-flex; align-items: center; justify-content: center; padding: 0;
    width: 42px; height: 42px; border-radius: 8px; background: #f1f5f9; color: var(--tp-dark); border: none; cursor: pointer;
  }
  .tp-header { position: sticky; top: 0; }
  .tp-searchrow.open { display: none; }
  .tp-drawer-wrap { display: block; position: fixed; inset: 0; z-index: 99999; pointer-events: none; visibility: hidden; }
  .tp-drawer-wrap.open { pointer-events: auto; visibility: visible; }
  .tp-drawer-bg { position: absolute; inset: 0; background: rgba(15,23,42,.5); opacity: 0; transition: opacity .2s ease; }
  .tp-drawer-wrap.open .tp-drawer-bg { opacity: 1; }
  .tp-drawer {
    position: absolute; left: 0; top: 0; bottom: 0; width: min(88vw, 400px);
    background: #fff; overflow-y: auto; padding: 14px 16px 26px;
    transform: translateX(-102%); transition: transform .22s ease;
    -webkit-overflow-scrolling: touch;
  }
  .tp-drawer-wrap.open .tp-drawer { transform: none; }
  .tp-dr-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
  .tp-dr-title { font-size: 17px; font-weight: 800; color: var(--tp-dark); }
  .tp-dr-close { background: #f1f5f9; border: none; border-radius: 8px; width: 38px; height: 38px; padding: 0; color: var(--tp-dark); cursor: pointer; display: flex; align-items: center; justify-content: center; }
  .tp-dr-search form { display: flex; border: 1.5px solid #d7dfe9; border-radius: 8px; overflow: hidden; }
  .tp-dr-search input { flex: 1; border: none; outline: none; padding: 11px 14px; font-size: 15px; color: var(--tp-dark); min-width: 0; }
  .tp-dr-search button { width: 44px; border: none; background: transparent; color: var(--tp-gray); display: flex; align-items: center; justify-content: center; cursor: pointer; }
  .tp-dr-list { list-style: none; margin: 12px 0 0; padding: 0; }
  .tp-dr-list > li { border-bottom: 1px solid #eef1f6; }
  .tp-dr-list > li > a, .tp-dr-acc-btn {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
    padding: 13px 2px; font-size: 15.5px; font-weight: 600; color: var(--tp-dark);
    text-decoration: none; background: none; border: none; cursor: pointer; text-align: left;
  }
  .tp-dr-acc-btn svg { opacity: .5; transition: transform .18s ease; }
  .tp-dr-acc.open .tp-dr-acc-btn svg { transform: rotate(180deg); }
  .tp-dr-sub { list-style: none; margin: 0; padding: 0 0 10px 8px; display: none; }
  .tp-dr-acc.open .tp-dr-sub { display: block; }
  .tp-dr-sub li a { display: block; padding: 8px 4px; color: #475569; font-size: 14.5px; text-decoration: none; }
  .tp-dr-sub li a:hover { color: var(--tp-blue); }
  .tp-dr-phones { display: flex; flex-direction: column; gap: 8px; margin: 16px 0 12px; }
  .tp-dr-phones a { display: flex; align-items: baseline; gap: 8px; text-decoration: none; }
  .tp-dr-phones b { color: var(--tp-dark); font-size: 15.5px; }
  .tp-dr-phones span { color: var(--tp-gray); font-size: 12px; }
  .tp-dr-social { display: flex; gap: 8px; margin-bottom: 14px; }
  .tp-dr-request {
    display: flex; align-items: center; justify-content: center;
    background: var(--tp-orange); color: #fff; font-weight: 800; letter-spacing: .4px; text-transform: uppercase;
    padding: 14px; border-radius: 8px; text-decoration: none; font-size: 14.5px;
  }
}

/* ---------- десктоп: на широких экранах ---------- */
@media (min-width: 1100px) {
  .tp-wrap { padding: 0 32px; }
}

/* Средние экраны: часть контактов сверху прячем */
@media (max-width: 1500px) and (min-width: 1100px) {
  .tp-topbar-contacts { position: static; }
  .tp-topbar-in { justify-content: space-between; }
}
@media (max-width: 1280px) and (min-width: 1100px) {
  .tp-tel-lbl { display: none; }
  .tp-sep { display: none; }
  .tp-menu-item, .tp-menu-link { padding: 11px 10px; font-size: 12.5px; }
  .tp-request-btn { padding: 12px 18px; }
}

/* ---------- вспомогательное ---------- */
.tp-shop-root-hint {
  max-width: 1720px; margin: 0 auto; padding: 14px 32px 4px; color: #475569; font-size: 15px;
}
.tp-shop-root-hint a { color: var(--tp-blue); font-weight: 700; text-decoration: none; }
body .ast-woocommerce-container { max-width: 100%; }

/* защита от глобальных стилей кнопок темы */
.tp-search-toggle, .tp-burger, .tp-dr-close, .tp-ico-btn, .tp-search button, .tp-dr-search button { padding: 0 !important; }
.tp-search-toggle svg, .tp-ico-btn svg, .tp-burger svg, .tp-dr-close svg, .tp-menu-link svg, .tp-search button svg { width: 20px; height: 20px; }
.tp-dr-search button svg { width: 18px; height: 18px; }
