/* ANC KOREA - product navigator, product search and "more products" note (product pages only) */

/* reset.css sets overflow-x:hidden on html/body, which turns body into a scroll container and
   stops position:sticky from working. clip hides horizontal overflow the same way without that. */
html, body {
    overflow-x: clip;
}
html.pnav-lock,
html.pnav-lock body {
    overflow: hidden;
}

/* ---------- layout ---------- */
.pnav-layout {
    display: flex;
    align-items: flex-start;
    gap: 32px;
}

.pnav {
    flex: 0 0 260px;
    position: sticky;
    top: calc(var(--pnav-top, 90px) + 20px);
    max-height: calc(100vh - var(--pnav-top, 90px) - 40px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.pnav-main {
    flex: 1;
    min-width: 0;
}

/* the product list's last block already has bottom margin; keep the note close to it */
.pnav-main > .content-layout {
    margin-bottom: 0;
}

.pnav-main > .content-layout .mb-5:last-child,
.pnav-main > .product-categories {
    margin-bottom: 24px !important;
}

/* reset.css gives nav/aside an explicit display, which would override the hidden attribute */
.pnav-inner [hidden] {
    display: none !important;
}

.product-category-wrapper {
    scroll-margin-top: calc(var(--pnav-top, 90px) + 20px);
}

/* ---------- panel ---------- */
.pnav-inner {
    background: var(--white, #fff);
    border: 1px solid #e3e8ee;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
    padding: 16px;
}

.pnav-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.pnav-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-color, #333);
}

.pnav-close {
    display: none;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: #f1f3f5;
    color: #555;
    cursor: pointer;
    font-size: 1rem;
}

/* ---------- search ---------- */
.pnav-search {
    position: relative;
    margin-bottom: 14px;
}

.pnav-search .pnav-input::placeholder {
    color: #9aa3ad;
}

.pnav-search > .fa-magnifying-glass {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9aa3ad;
    font-size: 0.85rem;
    pointer-events: none;
}

.pnav-input {
    width: 100%;
    padding: 10px 34px 10px 34px;
    border: 1px solid #d6dce3;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.88rem;
    color: var(--text-color, #333);
    background: #fafbfc;
    -webkit-appearance: none;
    appearance: none;
}

.pnav-input::-webkit-search-cancel-button {
    display: none;
}

.pnav-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(45, 157, 90, 0.15);
}

.pnav-clear {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #8a939c;
    cursor: pointer;
}

.pnav-clear:hover {
    background: #eef1f4;
}

.pnav-hint {
    margin: -8px 2px 12px;
    font-size: 0.74rem;
    color: #8a939c;
}

.pnav-search + .pnav-hint + .pnav-results:not([hidden]) {
    margin-top: -4px;
}

.pnav-results-meta {
    font-size: 0.78rem;
    color: #7a838c;
    margin: 0 2px 6px;
}

.pnav-results-list {
    max-height: 60vh;
    overflow-y: auto;
}

.pnav-result {
    display: block;
    padding: 9px 10px;
    border-radius: 6px;
    border-bottom: 1px solid #f0f2f4;
    color: var(--text-color, #333);
    text-decoration: none;
}

.pnav-result:hover,
.pnav-result:focus {
    background: #f2f8f4;
    outline: none;
}

.pnav-result-name {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--secondary-color, #085E31);
}

.pnav-result-path {
    font-size: 0.74rem;
    color: #8a939c;
    margin-top: 2px;
}

.pnav-result-desc {
    font-size: 0.78rem;
    color: #5f6870;
    margin-top: 3px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

mark.pnav-mark {
    background: #fff0a3;
    color: inherit;
    padding: 0 1px;
    border-radius: 2px;
}

.pnav-empty {
    font-size: 0.85rem;
    color: #6b747d;
    line-height: 1.7;
    padding: 6px 4px;
}

.pnav-empty a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: underline;
}

/* ---------- tree ---------- */
.pnav-tree ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.pnav-group + .pnav-group {
    margin-top: 2px;
}

.pnav-group > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 10px;
    border-radius: 7px;
    font-size: 0.9rem;
    line-height: 1.35;
    color: var(--text-color, #333);
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
}

.pnav-group > a i {
    font-size: 0.7rem;
    color: #a3abb3;
    flex-shrink: 0;
}

.pnav-group > a:hover {
    background: #f2f8f4;
    color: var(--primary-color);
}

.pnav-group.is-current > a {
    background: var(--primary-color);
    color: #fff;
    font-weight: 600;
}

.pnav-group.is-current > a i {
    color: rgba(255, 255, 255, 0.85);
}

.pnav-cats {
    margin: 6px 0 8px 12px !important;
    padding-left: 10px !important;
    border-left: 2px solid #dcebe1;
}

.pnav-cats a {
    display: block;
    padding: 6px 8px;
    border-radius: 5px;
    font-size: 0.84rem;
    line-height: 1.4;
    color: #555e66;
    text-decoration: none;
}

.pnav-cats a:hover {
    color: var(--primary-color);
    background: #f5faf6;
}

.pnav-cats a.is-active {
    color: var(--primary-color);
    font-weight: 600;
    background: #eef7f1;
}

.pnav-count {
    font-size: 0.74rem;
    color: #9aa3ad;
    font-weight: 400;
}

/* product highlighted after a search jump */
.product-item.pnav-hit {
    animation: pnavHit 2.6s ease;
}

@keyframes pnavHit {
    0%, 55% {
        background-color: #fff4bd;
        box-shadow: inset 4px 0 0 var(--primary-color);
    }
    100% {
        background-color: transparent;
        box-shadow: inset 0 0 0 transparent;
    }
}

/* ---------- "more products" note ---------- */
.product-more-note {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 0;
    padding: 18px 20px;
    background: #f5faf6;
    border: 1px solid #dcebe1;
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
}

.product-more-note i {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-top: 3px;
}

.product-more-note p {
    margin: 0;
    line-height: 1.75;
    color: #444;
}

.product-more-note a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ---------- mobile: sticky bar + bottom sheet ---------- */
.pnav-mobile-bar,
.pnav-sheet,
.pnav-overlay {
    display: none;
}

@media (max-width: 1024px) {
    .pnav {
        display: none;
    }

    .pnav-layout {
        display: block;
    }

    .product-category-wrapper {
        scroll-margin-top: calc(var(--pnav-top, 70px) + 76px);
    }

    .pnav-mobile-bar {
        display: flex;
        position: sticky;
        top: calc(var(--pnav-top, 70px) + 8px);
        z-index: 900;
        width: 100%;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        margin: 0 0 24px;
        padding: 13px 16px;
        border: none;
        border-radius: 10px;
        background: var(--primary-color);
        color: #fff;
        font-family: inherit;
        font-size: 0.92rem;
        font-weight: 600;
        text-align: left;
        box-shadow: 0 6px 16px rgba(8, 94, 49, 0.25);
        cursor: pointer;
    }

    .pnav-mobile-bar i {
        margin-right: 6px;
    }

    /* "Product menu · Search" stays on one line; the page name gets the "…" instead */
    .pnav-mobile-bar > span:first-child {
        white-space: nowrap;
        flex-shrink: 0;
    }

    .pnav-bar-current {
        display: inline-flex;
        align-items: center;
        justify-content: flex-end;
        flex: 1 1 auto;
        min-width: 0;
        font-weight: 400;
        font-size: 0.82rem;
        opacity: 0.9;
    }

    /* long page names (e.g. Industrial Cleaning Solutions) get "…", the arrow always stays visible */
    .pnav-bar-label {
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .pnav-bar-current i {
        flex-shrink: 0;
        margin: 0 0 0 6px;
    }

    .pnav-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
        z-index: 1090;
    }

    .pnav-overlay.open {
        opacity: 1;
        pointer-events: auto;
    }

    .pnav-sheet {
        display: block;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        max-height: 86vh;
        overflow-y: auto;
        overscroll-behavior: contain;
        background: #fff;
        border-radius: 18px 18px 0 0;
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.18);
        transform: translateY(105%);
        transition: transform 0.3s ease;
        z-index: 1100;
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    .pnav-sheet.open {
        transform: translateY(0);
    }

    .pnav-sheet::before {
        content: "";
        display: block;
        width: 42px;
        height: 4px;
        margin: 10px auto 0;
        border-radius: 2px;
        background: #d5dade;
    }

    .pnav-sheet .pnav-inner {
        border: none;
        box-shadow: none;
        border-radius: 0;
        padding: 12px 18px 24px;
    }

    .pnav-sheet .pnav-close {
        display: inline-flex;
    }

    .pnav-sheet .pnav-input {
        font-size: 16px; /* prevents iOS zoom on focus */
    }

    .pnav-results-list {
        max-height: none;
    }

    .product-more-note {
        padding: 16px;
        font-size: 0.92rem;
    }
}
