/**
 * TUF Custom Header — front-end styles
 * Scoped under .uf-header-wrap to avoid theme collisions.
 */

.uf-header-wrap {
    --red:         #dc0c23;
    --green:       #17b678;
    --orange:      #f98d43;
    --black:       #262626;
    --deep:      #034963:
    --grey-1:      #333;
    --grey-4:      #bdbdbd;
    --grey-8:      #034963;
    --grey-border: #f2f2f2;
    --input-border:#e0e0e0;
    --white:       #fff;
    --input:       linear-gradient(180deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 100%), #f9f9f9;

    position: relative;
    z-index: 100;
}

.uf-header-wrap a { text-decoration: none; color: inherit; }

/* Reset WP menu lists rendered by walkers (we use raw <a>s) */
.uf-tabs ul,
.uf-row1-right ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: contents;
}

/* ─────────────────────────────────────────────
   ROW 1
───────────────────────────────────────────── */
.uf-header-wrap .uf-row1 {
    background: #034963;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 0 1.5rem;
    min-height: 44px;
}

.uf-header-wrap .uf-tabs {
    display: flex;
    align-items: flex-end;
    gap: 2px;
}

.uf-header-wrap .uf-tabs__tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 24px 9px;
    border-radius: 8px 8px 0 0;
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.55);
    font-family: "Nunito", sans-serif;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: background 0.15s, color 0.15s;
    cursor: pointer;
    line-height: 1.2;
}

.uf-header-wrap .uf-tabs__tab:hover {
    background: rgba(255,255,255,0.13);
    color: rgba(255,255,255,0.85);
}

.uf-header-wrap .uf-tabs__tab--active {
    background: var(--grey-border) !important;
    color: var(--black) !important;
    box-shadow: 2px -2px 6px rgba(0,0,0,0.18), -2px -2px 6px rgba(0,0,0,0.1);
    padding-bottom: 11px;
    margin-bottom: -2px;
    z-index: 2;
    position: relative;
}

.uf-header-wrap .uf-tabs__tab svg {
    flex-shrink: 0;
}

/* Pre-header right */
.uf-header-wrap .uf-row1-right {
    display: flex;
    align-items: center;
    padding-bottom: 6px;
}

.uf-header-wrap .uf-preheader-phone {
    font-family: "Nunito", sans-serif;
    font-size: 0.75rem;
    color: var(--white);
    padding: 0.5rem 0.75rem;
    white-space: nowrap;
}

.uf-header-wrap .uf-preheader-phone .phone-number {
    color: var(--green);
    font-size: 0.9rem;
    font-weight: 700;
}

.uf-header-wrap .uf-preheader-link {
    font-family: "Nunito", sans-serif;
    font-size: 0.75rem;
    color: var(--white);
    padding: 0.4rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 5px;
    border-left: 1px solid rgba(255,255,255,0.12);
    white-space: nowrap;
}

.uf-header-wrap .uf-preheader-link:hover { color: var(--grey-4); }

.uf-header-wrap .tag-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.uf-header-wrap .tag-dot--red    { background: var(--red); }
.uf-header-wrap .tag-dot--orange { background: var(--orange); }

/* ─────────────────────────────────────────────
   ROW 2
───────────────────────────────────────────── */
.uf-header-wrap .uf-row2 {
    background: var(--grey-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 1.5rem;
    gap: 1rem;
    border-bottom: 2px solid var(--input-border);
    position: relative;
    z-index: 1;
}

/* Search */
.uf-header-wrap .uf-search {
    flex: 1;
    max-width: 360px;
    height: 3rem;
    display: flex;
    margin: 0;
}

.uf-header-wrap .uf-search__input {
    flex: 1;
    height: 3rem;
    border: 1px solid var(--input-border);
    background: var(--input);
    padding: 0 1rem;
    font-size: 1rem;
    font-family: "Open Sans", sans-serif;
    border-radius: 6px 0 0 6px;
    outline: none;
    color: var(--black);
    box-shadow: none;
    margin: 0;
}

.uf-header-wrap .uf-search__input::placeholder { color: var(--grey-4); font-style: italic; }
.uf-header-wrap .uf-search__input:focus { border-color: var(--red); }

.uf-header-wrap .uf-search__btn {
    height: 3rem;
    width: 3rem;
    background: var(--orange);
    border: none;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
}

.uf-header-wrap .uf-search__btn:hover { opacity: 0.88; }
.uf-header-wrap .uf-search__btn svg { width: 20px; height: 20px; }

/* Logo — centred via absolute */
.uf-header-wrap .uf-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
}

.uf-header-wrap .uf-logo img {
    height: 52px;
    width: auto;
    display: block;
    max-width: 100%;
}

/* Actions */
.uf-header-wrap .uf-actions {
    flex: 1;
    max-width: 360px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.uf-header-wrap .uf-action {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 6px;
    font-family: "Open Sans", sans-serif;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--grey-1);
    background: transparent;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.uf-header-wrap .uf-action:hover { background: var(--input-border); color: var(--black); }

.uf-header-wrap .uf-action svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.uf-header-wrap .uf-action--basket {
    border-color: var(--input-border);
    background: var(--white);
}

.uf-header-wrap .uf-action--basket:hover { border-color: var(--red); }

.uf-header-wrap .uf-badge {
    background: var(--red);
    color: var(--white);
    font-size: 0.625rem;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

/* ─────────────────────────────────────────────
   TRUST BAR
───────────────────────────────────────────── */
.uf-header-wrap .uf-trust-bar {
    background: var(--white);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-bottom: 1px solid #e5e5e5;
}

.uf-header-wrap .uf-trust-item {
    padding: 10px 6px;
    text-align: center;
    border-right: 1px solid #e5e5e5;
}

.uf-header-wrap .uf-trust-item:last-child { border-right: none; }

.uf-header-wrap .uf-trust-icon {
    font-size: 22px;
    margin-bottom: 4px;
    line-height: 1;
}

.uf-header-wrap .uf-trust-val {
    font-size: 14px;
    font-weight: 700;
    color: #454545;
    margin-bottom: 2px;
    line-height: 1.3;
}

.uf-header-wrap .uf-trust-lbl {
    font-size: 11px;
    color: #666;
    line-height: 1.3;
}

/* ─────────────────────────────────────────────
   MOBILE
───────────────────────────────────────────── */
.uf-header-wrap .uf-search-toggle { display: none; }
.uf-header-wrap .uf-search-overlay { display: none; }
.uf-header-wrap .uf-mobile-actions { display: none; }

@keyframes ufSlideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 959px) {

    /* Row 1 */
    .uf-header-wrap .uf-row1 {
        justify-content: center;
        padding: 0 0.75rem;
        min-height: 40px;
    }
    .uf-header-wrap .uf-row1-right { display: none; }
    .uf-header-wrap .uf-tabs { width: 100%; justify-content: center; gap: 4px; }
    .uf-header-wrap .uf-tabs__tab {
        font-size: 0.55rem;
    }

    /* Row 2 */
    .uf-header-wrap .uf-row2 {
        flex-direction: row;
        justify-content: center;
        padding: 10px 1rem;
        position: relative;
    }
    .uf-header-wrap .uf-search { display: none; }
    .uf-header-wrap .uf-actions { display: none; }

    .uf-header-wrap .uf-logo {
        position: relative;
        left: auto;
        transform: none;
    }
    .uf-header-wrap .uf-logo img { height: 44px; }

    /* Search toggle */
    .uf-header-wrap .uf-search-toggle {
        display: flex;
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        border-radius: 6px;
        background: var(--orange);
        border: none;
        cursor: pointer;
        z-index: 0;
        padding: 0;
    }
    .uf-header-wrap .uf-search-toggle svg { width: 18px; height: 18px; }

    /* Search overlay */
    .uf-header-wrap .uf-search-overlay {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #034963;
        z-index: 100;
        padding: 12px 1rem;
        animation: ufSlideDown 0.2s ease;
        display: none;
    }
    .uf-header-wrap .uf-search-overlay.is-open { display: flex; gap: 0; }
    .uf-header-wrap .uf-search-overlay .uf-search__input {
        border-radius: 6px 0 0 6px;
        border-color: transparent;
        background: var(--white);
        height: 2.75rem;
    }
    .uf-header-wrap .uf-search-overlay .uf-search__btn {
        height: 2.75rem;
        border-radius: 0 6px 6px 0;
    }

    /* Mobile actions row */
    .uf-header-wrap .uf-mobile-actions {
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--grey-border);
        border-top: 1px solid var(--input-border);
        border-bottom: 2px solid var(--input-border);
        padding: 8px 1rem;
        gap: 0;
    }
    .uf-header-wrap .uf-mobile-actions .uf-action {
        flex: 1;
        justify-content: center;
        padding: 7px 8px;
        font-size: 0.75rem;
        border-radius: 0;
    }
    .uf-header-wrap .uf-mobile-actions .uf-action + .uf-action {
        border-left: 1px solid var(--input-border);
    }
    .uf-header-wrap .uf-mobile-actions .uf-action--basket {
        background: transparent;
        border-color: transparent;
        border-left: 1px solid var(--input-border);
    }

    /* Primary nav becomes a hamburger drawer */
    .uf-header-wrap .uf-primary-nav__inner {
        flex-direction: column;
        align-items: stretch;
        padding: 0;
    }
    .uf-header-wrap .uf-primary-toggle {
        display: flex;
        justify-content: flex-start;
        width: 100%;
        padding: 14px 1rem;
        border-bottom: 1px solid var(--input-border);
    }
    .uf-header-wrap .uf-primary-menu {
        display: none;
        flex-direction: column;
        width: 100%;
    }
    .uf-header-wrap .uf-primary-menu.is-open { display: flex; }
    .uf-header-wrap .uf-primary-menu li { width: 100%; }
    .uf-header-wrap .uf-primary-menu a {
        padding: 12px 1rem;
        border-bottom: 1px solid var(--input-border);
    }

    .uf-header-wrap .uf-primary-menu .sub-menu {
        position: static;
        display: block;
        border: none;
        box-shadow: none;
        padding: 0;
        background: #f9f9f9;
    }
    .uf-header-wrap .uf-primary-menu .sub-menu a { padding-left: 2rem; }
}

@media (max-width: 600px) {
    .uf-header-wrap .uf-trust-bar {
        grid-template-columns: repeat(2, 1fr);
    }
    .uf-header-wrap .uf-trust-item:nth-child(2) { border-right: none; }
    .uf-header-wrap .uf-trust-item:nth-child(-n+2) { border-bottom: 1px solid #e5e5e5; }
}


/* ==========================================================
   ADDED: MOBILE HEADER LAYOUT (≤959px — matches header + MMM)
   IMPORTANT: Mega Menu → Menu Themes → Mobile Menu →
   Responsive Breakpoint must be set to 959px.
   Row 1: Tabs
   Row 2: Burger | Logo | Search
   Row 3: Mobile Only Action row
   Row 4: Trust bar
   ========================================================== */
@media (max-width: 959px) {

  .uf-header-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 !important;
  }
  .uf-header-wrap > * {
    flex: 0 0 100%;
    min-width: 0;
  }

  /* Row 1 */
  .uf-header-wrap > .uf-row1 { order: 1; }

  /* Row 2 – unwrap so its children share a line with the burger */
  .uf-header-wrap > .uf-row2 { display: contents; }

  /* Burger (48px slot) */
  .uf-header-wrap > #mega-menu-wrap-primary {
    order: 2;
    flex: 0 0 48px !important;
    width: 48px !important;
    max-width: 48px !important;
    margin: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
  }
  #mega-menu-wrap-primary .mega-menu-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 44px !important;
    height: 44px !important;
    padding: 0 !important;
    background: transparent !important;
  }
  #mega-menu-wrap-primary .mega-menu-toggle .mega-toggle-animated-inner,
  #mega-menu-wrap-primary .mega-menu-toggle .mega-toggle-animated-inner::before,
  #mega-menu-wrap-primary .mega-menu-toggle .mega-toggle-animated-inner::after {
    background-color: #034963 !important;
  }

  /* Logo (whatever's left: 100% − 48px − 48px) */
  .uf-header-wrap .uf-row2 > .uf-logo {
    order: 3;
    position: static !important;
    left: auto !important;
    transform: none !important;
    box-sizing: border-box;
    flex: 0 0 calc(100% - 96px) !important;
    width: calc(100% - 96px) !important;
    max-width: calc(100% - 96px) !important;
    margin: 0 !important;
    padding: 8px 6px !important;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
  }
  .uf-header-wrap .uf-row2 > .uf-logo img {
    height: auto !important;
    width: auto !important;
    max-width: 100% !important;
    max-height: 40px !important;
  }

  /* Search button (38px + 10px right margin = 48px slot) */
  .uf-header-wrap .uf-row2 > .uf-search-toggle {
    order: 4;
    position: static !important;
    transform: none !important;
    top: auto !important;
    right: auto !important;
    flex: 0 0 38px !important;
    width: 38px !important;
    height: 38px !important;
    margin: 0 10px 0 0 !important;
  }

  /* Search overlay – drops in as a full row under Row 2 */
  .uf-header-wrap .uf-row2 > .uf-search-overlay {
    order: 5;
    position: static !important;
    flex: 0 0 100%;
    width: 100%;
    box-sizing: border-box;
  }

  /* Row 3 + Row 4 */
  .uf-header-wrap > .uf-mobile-actions { order: 6; }
  .uf-header-wrap > .uf-clean          { order: 7; }

  /* LOCK (Oct 2026): beats any stray rule that turns the header into a grid
     (the old "Shop Polish" code put the burger in the Sign in row and pushed
     search below the ticker). Extra specificity + !important so it always wins. */
  html body .uf-header-wrap {
    display: flex !important;
    flex-wrap: wrap !important;
    grid-template-areas: none !important;
    grid-template-columns: none !important;
  }
  html body .uf-header-wrap > .uf-row2 { display: contents !important; }
  html body .uf-header-wrap > .uf-mobile-actions {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
}

/* Paint Protection Film flyout: open nested sub-menu to the left */
@media (min-width: 960px) {
  #mega-menu-wrap-primary #mega-menu-primary li#mega-menu-item-1004 ul.mega-sub-menu li.mega-menu-item-has-children > ul.mega-sub-menu {
    left: auto !important;
    right: 100% !important;
  }
}