/* ================================================================
   Header responsive overrides
   - Mobile/tablet uses the real WordPress main menu from Header Tools.
   - Desktop Bricks nav + product category mega menu remain unchanged.
   ================================================================ */

.tkk-mobile-main-menu {
  display: none;
  position: relative;
}

@media (max-width: 991px) {
  /* Remove the old separate nav row (including the blue category hamburger). */
  .tkk-header-nav {
    display: none !important;
  }

  .tkk-header-main {
    position: relative;
    z-index: 120;
  }

  .tkk-header-main__inner {
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 10px 8px !important;
  }

  .tkk-header-tools {
    position: relative;
    gap: 2px;
  }

  .tkk-mobile-main-menu {
    display: block;
    flex: 0 0 auto;
  }

  .tkk-mobile-main-menu__trigger {
    width: 44px;
    height: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--tkk-blue-700, #2f66c8);
    cursor: pointer;
  }

  .tkk-mobile-main-menu__trigger:hover,
  .tkk-mobile-main-menu.is-open .tkk-mobile-main-menu__trigger {
    background: var(--tkk-blue-050, #f7faff);
    color: var(--tkk-blue-800, #2454a4);
  }

  .tkk-mobile-main-menu__trigger i {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--tkk-blue-100, #eef4ff);
    color: var(--tkk-blue-700, #2f66c8);
    font-size: 18px;
  }

  .tkk-mobile-main-menu__panel {
    position: fixed;
    left: 14px;
    right: 14px;
    z-index: 9999;
    max-height: min(68vh, 560px);
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid var(--tkk-border, #dce7f8);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(24, 52, 98, 0.2);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
  }

  .tkk-mobile-main-menu.is-open .tkk-mobile-main-menu__panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

  .tkk-mobile-main-menu__head {
    min-height: 48px;
    padding: 0 13px 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 2;
    border-bottom: 1px solid #e8eef7;
    background: #fff;
  }

  .tkk-mobile-main-menu__head strong {
    color: var(--tkk-ink, #17366b);
    font-size: 15px;
    font-weight: 700;
  }

  .tkk-mobile-main-menu__close {
    width: 34px;
    height: 34px;
    padding: 0;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: var(--tkk-blue-050, #f7faff);
    color: #63758f;
    cursor: pointer;
  }

  .tkk-mobile-main-menu__list,
  .tkk-mobile-main-menu__list .sub-menu {
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .tkk-mobile-main-menu__list > li {
    margin: 0;
    border-bottom: 1px solid #edf2f8;
  }

  .tkk-mobile-main-menu__list > li:last-child {
    border-bottom: 0;
  }

  .tkk-mobile-main-menu__list a {
    min-height: 48px;
    padding: 11px 16px;
    display: flex;
    align-items: center;
    color: #304764;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    text-decoration: none;
  }

  .tkk-mobile-main-menu__list > li.current-menu-item > a,
  .tkk-mobile-main-menu__list > li.current-menu-ancestor > a,
  .tkk-mobile-main-menu__list a:hover {
    background: var(--tkk-blue-050, #f7faff);
    color: var(--tkk-blue-700, #2f66c8);
  }

  .tkk-mobile-main-menu__list .sub-menu {
    padding: 2px 0 8px 14px;
    background: #fbfcff;
  }

  .tkk-mobile-main-menu__list .sub-menu a {
    min-height: 40px;
    padding-block: 8px;
    font-size: 13px;
  }

  /* Brand + actions stay on the first row; search spans the second row. */
  .tkk-header-search {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    margin-top: 0;
  }
}

@media (max-width: 640px) {
  .tkk-mobile-main-menu__panel {
    left: 11px;
    right: 11px;
    max-height: 64vh;
  }

  .tkk-header-main__inner {
    padding-top: 8px;
    padding-bottom: 9px;
  }
}
