/* =============================================================================
   Shop by Department (shop/ViewCatWiseStore.aspx) - "Option A": one panel per
   department with store logos, a store count, a View-all link, a sticky jump
   bar, and a quiet placeholder for empty departments.

   Loaded by that page only, after the master's stylesheets, together with
   js/dept-panels.js (jump bar, counts, empty-state class).

   Colours are the page's own: heading #3b6bb4 on #ececec, text #2e2e2e,
   hover #f78d1e, rules #d0d0d0 / #eaeaea, muted #878787.
   ============================================================================= */

/* ---- sticky jump bar (built by dept-panels.js) ---- */
@media only screen and (min-width: 768px) {
    body {
        overflow-x: clip;               /* clips like hidden, but is not a scroll container */
        overflow-y: visible;
    }
}

.dept-jump {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    box-sizing: border-box;
    margin: 8px 0 16px;
    padding: 10px 12px;
    border: 1px solid #eaeaea;
    border-radius: 8px;
    background: #fafbfc;
}

    .dept-jump:empty {
        display: none;
    }

    .dept-jump a {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 4px 10px;
        border: 1px solid #d0d0d0;
        border-radius: 14px;
        background: #fff;
        font-size: 12px;
        line-height: 16px;
        color: #2e2e2e;
        text-decoration: none;
        white-space: nowrap;
    }

        .dept-jump a b {
            font-weight: 700;
            font-size: 11px;
            color: #3b6bb4;
        }

        .dept-jump a:hover {
            color: #f78d1e;
            border-color: #f78d1e;
        }

        .dept-jump a.is-empty {
            color: #9a9a9a;
        }

            .dept-jump a.is-empty b {
                color: #9a9a9a;
            }

/* ---- one department = one panel ---- */
.shoByDptsec {
    float: none;
    width: auto;
    margin: 0 0 14px;
    border: 1px solid #eaeaea;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    scroll-margin-top: 100px;       /* land below the sticky jump bar, even when its chips wrap to two rows */
}

    /* header bar: marker, name, count */
    .shoByDptsec .hBoxsec {
        float: none;
        width: auto;
        margin: 0;
        padding: 9px 16px;
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 14px;
        line-height: 20px;
        background: #ececec;
        border-bottom: 1px solid #d0d0d0;
        box-sizing: border-box;
    }

        .shoByDptsec .hBoxsec::before {
            content: "";
            flex: none;
            width: 8px;
            height: 20px;
            border-radius: 3px;
            background: #3b6bb4;
        }

        .shoByDptsec .hBoxsec .dept-title {
            min-width: 0;
        }

        .shoByDptsec .hBoxsec .dept-count {
            flex: none;
            min-width: 18px;
            height: 18px;
            line-height: 18px;
            padding: 0 6px;
            border-radius: 9px;
            border: 1px solid #d0d0d0;
            background: #fff;
            color: #3b6bb4;
            font-size: 11px;
            font-weight: 700;
            text-align: center;
        }

    /* store list: names, four across */
    .shoByDptsec ul.plisTing {
        float: none;
        width: auto;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 2px 14px;
        margin: 0;
        padding: 8px 16px 10px;
    }

        .shoByDptsec ul.plisTing li {
            float: none;
            width: auto;
            margin: 0;
            padding: 0;
            font-size: 12px;
            display: block;
        }

            .shoByDptsec ul.plisTing li a {
                display: block;
                padding: 6px 8px;
                border-radius: 6px;
                color: #2e2e2e;
                line-height: 16px;
                text-decoration: none;
            }

                .shoByDptsec ul.plisTing li a:hover {
                    background: #fafbfc;
                    color: #f78d1e;
                    border-bottom: none;
                }

                .shoByDptsec ul.plisTing li a .dept-store-name {
                    font-weight: 600;
                    min-width: 0;
                }

    /* ---- empty department ---- */
    .shoByDptsec.is-empty .hBoxsec {
        color: #878787 !important;
    }

        .shoByDptsec.is-empty .hBoxsec::before {
            background: #c9c9c9;
        }

        .shoByDptsec.is-empty .hBoxsec .dept-count {
            color: #9a9a9a;
        }

    .shoByDptsec.is-empty ul.plisTing {
        display: block;
        padding: 10px 16px;
    }

        .shoByDptsec.is-empty ul.plisTing li a {
            padding: 0;
            pointer-events: none;
            background: none;
        }

    .dept-empty {
        color: #878787;
        font-size: 12px;
        font-style: italic;
    }

/* ---- responsive ---- */
@media only screen and (max-width: 991.98px) {
    .shoByDptsec ul.plisTing {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media only screen and (max-width: 767.98px) {
    .dept-jump {
        position: static;               /* a long chip list would eat the phone screen */
    }

    .shoByDptsec ul.plisTing {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 4px 10px;
        padding: 10px 12px;
    }

    .shoByDptsec .hBoxsec {
        padding: 8px 12px;
        font-size: 13px;
    }
}

@media only screen and (max-width: 479.98px) {
    .shoByDptsec ul.plisTing {
        grid-template-columns: minmax(0, 1fr);
    }
}
