/* ============================================================================
   NAV — original two-tier arrangement, modern execution
   proofing preview, revised 2026-09-09
   ----------------------------------------------------------------------------
   Tier 1 (white): logo · four shopper tasks · Fresh Rewards
   Tier 2 (Karns blue): Meal Deals · About Us · Careers · Shop Online · Facebook
                        · search
   Mobile (<=991px): tier-2 links move into the drawer; the four tasks stay.

   The layout is the one the site has always had. The modernising is in type,
   spacing, a single icon set, real hover/focus states and the outline-to-solid
   current-item swap — not in moving things around.

   Loaded from inc/header-nav.php, not inc/topscripts.php, so the CIPA-preserved
   topscripts.php needs no cache-buster bump. All rules namespaced .kn-*.
   Karns palette: blue #114a96, deep blue #0d3a75, red #ad1f34.
   ========================================================================== */

.kn {
    --kn-blue: #114a96;
    --kn-blue-deep: #0d3a75;
    --kn-red: #ad1f34;
    --kn-ink: #1e2833;
    --kn-ink-2: #4a5563;
    --kn-rule: #e2e7ee;
}

/* Cross-hatch texture removed from <header>, per review. */
header.navbar-fixed-top { background-image: none; background-color: #fff; }

/* An inline <svg> still generates a line box even at width/height 0. */
.kn-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------------- tier 1 ---------------- */
.kn-bar { background: #fff; }
.kn-bar-in { display: flex; align-items: center; gap: 18px; padding: 8px 0; }
.kn-spacer { flex: 1 1 auto; }

.kn-menu-btn {
    display: none;
    align-items: center; gap: 9px; flex: none;
    border: 1px solid #cfd8e3; background: #fff; color: var(--kn-ink, #1e2833);
    border-radius: 8px; padding: 10px 14px;
    font-size: 14px; font-weight: 700; line-height: 1; cursor: pointer;
}
.kn-menu-btn:hover { background: #f2f6fc; border-color: #b9c8dc; }
.kn-burger { display: inline-block; width: 18px; }
.kn-burger span { display: block; height: 2px; background: currentColor; border-radius: 2px; margin: 3.5px 0; }

/* logo — class `logo` kept: bottomscripts.php sets its z-index directly */
.kn-bar .kn-logo { flex: none; height: auto; }
.kn-bar .kn-logo a { position: static; top: auto; display: block; }
.kn-bar .kn-logo img { display: block; width: auto; max-width: 104px; height: auto; }

/* the four shopper tasks */
.kn-tasks { display: flex; align-items: stretch; gap: 6px; flex: none; }
.kn-task {
    display: block;
    padding: 9px 16px 7px;
    border-radius: 10px;
    border-bottom: 3px solid transparent;
    color: var(--kn-ink, #1e2833);
    font-size: 13px; font-weight: 700; line-height: 1;
    text-align: center; white-space: nowrap;
}
.kn-task .kn-ic { width: 27px; height: 27px; color: var(--kn-red, #ad1f34); margin: 0 auto 7px; display: inline-block; }
.kn-task span { display: block; }
.kn-task:hover, .kn-task:focus { background: #f4f8fd; color: var(--kn-blue, #114a96); text-decoration: none; }
.kn-task.is-on { color: var(--kn-red, #ad1f34); border-bottom-color: var(--kn-red, #ad1f34); }
.kn-task.is-on .kn-ic { color: var(--kn-red, #ad1f34); }

/* Fresh Rewards: mark above its own control */
.kn-rw { flex: none; display: flex; flex-direction: column; align-items: center; gap: 7px; }
.kn-rw-mark { display: block; }
.kn-rw-mark img { height: 46px; width: auto; display: block; }
.kn-rewards { display: flex; align-items: center; gap: 10px; }
.kn-cta {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--kn-red, #ad1f34); color: #fff;
    border: 2px solid var(--kn-red, #ad1f34); border-radius: 999px;
    padding: 9px 20px;
    font-size: 14px; font-weight: 700; line-height: 1; white-space: nowrap;
}
.kn-cta:hover, .kn-cta:focus { background: #8f1a2b; border-color: #8f1a2b; color: #fff; text-decoration: none; }
.kn-cta-ghost { background: #fff; color: var(--kn-blue, #114a96); border-color: var(--kn-blue, #114a96); }
.kn-cta-ghost:hover, .kn-cta-ghost:focus { background: #eef3fb; border-color: var(--kn-blue-deep, #0d3a75); color: var(--kn-blue-deep, #0d3a75); }
.kn-cta .kn-ic { width: 17px; height: 17px; }
.kn-rewards .wc-info-link { font-size: 13px; font-weight: 500; color: var(--kn-ink-2, #4a5563); white-space: nowrap; }
.kn-rewards .wc-info-link:hover { color: var(--kn-blue, #114a96); }
.kn-rewards .wc-badge-wrap { display: flex; align-items: center; }

/* ---------------- tier 2: the blue strip ---------------- */
.kn-strip { background: var(--kn-blue, #114a96); }
.kn-strip-in { display: flex; align-items: center; gap: 2px; min-height: 48px; }
.kn-strip-links { display: flex; align-items: center; gap: 2px; }
.kn-slink {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 14px 13px 11px;
    border: 0; background: transparent;
    border-bottom: 3px solid transparent;
    color: #fff; font-size: 14.5px; font-weight: 600; line-height: 1.2;
    white-space: nowrap; cursor: pointer;
}
.kn-slink:hover, .kn-slink:focus { background: rgba(255, 255, 255, .15); color: #fff; text-decoration: none; }
.kn-slink.is-on { border-bottom-color: #fff; font-weight: 700; }
.kn-slink-icon { padding-left: 11px; padding-right: 11px; }
.kn-slink-icon .kn-ic { width: 19px; height: 19px; }

/* search sits at the right of the strip, where it has always been */
.kn-strip .kn-search {
    flex: none; width: 330px;
    display: flex; align-items: center;
    background: #fff; border: 2px solid #fff; border-radius: 999px; overflow: hidden;
}
.kn-search-ico { display: flex; align-items: center; padding: 0 4px 0 14px; color: var(--kn-blue, #114a96); }
.kn-search-ico .kn-ic { width: 17px; height: 17px; }
.kn-search-input {
    flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
    padding: 8px 8px; font-size: 14.5px; color: var(--kn-ink, #1e2833);
}
.kn-search-go {
    border: 0; background: var(--kn-blue, #114a96); color: #fff;
    font-size: 13.5px; font-weight: 700; padding: 9px 20px; cursor: pointer; align-self: stretch;
}
.kn-search-go:hover { background: var(--kn-blue-deep, #0d3a75); }

/* ---------------- dropdown panels ---------------- */
.kn-chip-wrap { position: relative; }
.kn-pop {
    position: absolute; top: calc(100% + 2px); left: 0; z-index: 2100;
    min-width: 252px; background: #fff;
    border: 1px solid #dde3ea; border-radius: 10px;
    box-shadow: 0 14px 40px rgba(17, 24, 35, .22); padding: 7px;
}
.kn-pop a { display: block; padding: 8px 12px; border-radius: 6px; font-size: 14px; color: #26313f; white-space: nowrap; }
.kn-pop a:hover, .kn-pop a:focus { background: #eef3fb; color: var(--kn-blue, #114a96); text-decoration: none; }
.kn-poprule { display: block; height: 1px; background: var(--kn-rule, #e2e7ee); margin: 6px 10px; }

/* ---------------- notification strip ---------------- */
.kn-notice { padding: 6px 16px; text-align: center; }

/* ---------------- icons: outline idle, solid current ---------------- */
/* <use> clones a symbol into a shadow tree, where descendant selectors like
   `.kn-ic .s` never match — that left every icon filled default black. Set the
   values on the <svg> instead: fill and stroke are INHERITED SVG properties, so
   they do cross the shadow boundary. Paths that must not fill carry their own
   fill="none" attribute in the sprite. */
.kn-ic {
    width: 21px; height: 21px; flex: none; display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linejoin: round;
    stroke-linecap: round;
}
.is-on .kn-ic { fill: currentColor; stroke-width: .9; }

.kn-chev {
    width: 14px; height: 14px; fill: none; stroke: currentColor;
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
    opacity: .8; transition: transform .2s ease;
}
.kn-item-toggle[aria-expanded="true"] .kn-chev,
.kn-chip-toggle[aria-expanded="true"] .kn-chev { transform: rotate(90deg); }
.kn-item .kn-chev { margin-left: auto; width: 15px; height: 15px; opacity: .55; }

/* ---------------- scrim + drawer (mobile) ---------------- */
.kn-scrim { position: fixed; inset: 0; background: rgba(9, 22, 43, .5); z-index: 2990; opacity: 0; transition: opacity .22s ease; }
.kn-scrim.is-open { opacity: 1; }
.kn-drawer {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 330px; max-width: 86vw; background: #fff; z-index: 3000;
    display: flex; flex-direction: column;
    box-shadow: 4px 0 30px rgba(9, 22, 43, .3);
    transform: translateX(-100%); transition: transform .24s ease;
}
.kn-drawer.is-open { transform: translateX(0); }
.kn-drawer-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 18px; background: var(--kn-blue, #114a96); color: #fff; flex: none;
}
.kn-drawer-title { font-family: 'Oswald', sans-serif; font-size: 19px; letter-spacing: .04em; text-transform: uppercase; }
.kn-close { border: 0; background: transparent; color: #fff; font-size: 30px; line-height: 1; padding: 0 6px; cursor: pointer; border-radius: 6px; }
.kn-close:hover { background: rgba(255, 255, 255, .18); }
.kn-drawer-body { padding: 10px; overflow-y: auto; flex: 1; }
.kn-group { margin: 14px 12px 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: #7d8794; }
.kn-group:first-child { margin-top: 4px; }
.kn-item {
    display: flex; align-items: center; gap: 13px; width: 100%;
    padding: 11px 13px; border: 0; background: transparent; border-radius: 9px;
    color: var(--kn-ink, #1e2833); font-size: 15px; font-weight: 500; text-align: left; cursor: pointer;
}
.kn-item:hover, .kn-item:focus { background: #eef3fb; color: var(--kn-blue, #114a96); text-decoration: none; }
.kn-item.is-on { background: var(--kn-blue, #114a96); color: #fff; font-weight: 700; }
.kn-item.is-on:hover, .kn-item.is-on:focus { background: var(--kn-blue-deep, #0d3a75); color: #fff; }
.kn-item-quiet { color: var(--kn-ink-2, #4a5563); font-size: 14px; }
.kn-sublist { padding: 2px 0 8px 46px; }
.kn-sublist a { display: block; padding: 8px 12px; border-radius: 7px; font-size: 14px; color: #3f4a58; }
.kn-sublist a:hover, .kn-sublist a:focus { background: #eef3fb; color: var(--kn-blue, #114a96); text-decoration: none; }
.kn-subrule { display: block; height: 1px; background: var(--kn-rule, #e2e7ee); margin: 7px 12px; }
.kn-drawer-foot { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--kn-rule, #e2e7ee); }

/* ---------------- focus visibility (WCAG 2.4.7) ---------------- */
.kn a:focus-visible, .kn button:focus-visible,
.kn-drawer a:focus-visible, .kn-drawer button:focus-visible,
.kn-search-input:focus-visible { outline: 3px solid #0d3a75; outline-offset: 2px; }
.kn-slink:focus-visible, .kn-item.is-on:focus-visible,
.kn-drawer-head .kn-close:focus-visible { outline: 3px solid #fff; outline-offset: -3px; }

/* ---------------- responsive ---------------- */
@media (max-width: 1199px) {
    .kn-task { padding: 9px 11px 7px; font-size: 12.5px; }
    .kn-task .kn-ic { width: 24px; height: 24px; }
    .kn-bar-in { gap: 12px; }
    .kn-strip .kn-search { width: 270px; }
    .kn-slink { padding: 14px 10px 11px; font-size: 14px; }
}

/* Below 992 the strip links move into the drawer; the four tasks stay put. */
@media (max-width: 991px) {
    .kn-menu-btn { display: inline-flex; }
    .kn-strip-links { display: none; }
    .kn-strip .kn-search { flex: 1 1 auto; width: auto; }
    .kn-strip-in { padding: 8px 0; }
    .kn-rw-mark img { height: 38px; }
}

@media (max-width: 767px) {
    .kn-bar-in { flex-wrap: wrap; gap: 10px; padding: 9px 0 4px; }
    .kn-menu-label { display: none; }
    .kn-menu-btn { padding: 11px 13px; }
    .kn-bar .kn-logo img { max-width: 66px; }
    .kn-rw-mark img { height: 30px; }
    .kn-cta { padding: 9px 14px; font-size: 13px; }
    .kn-rewards .wc-info-link { display: none; }
    .kn-tasks { order: 5; flex-basis: 100%; gap: 2px; }
    .kn-task { flex: 1 1 0; padding: 8px 2px 6px; font-size: 10.5px; }
    .kn-task .kn-ic { width: 21px; height: 21px; }
}

@media (prefers-reduced-motion: reduce) { .kn-drawer, .kn-scrim, .kn-chev { transition: none; } }
