@media screen and (min-width: 768px) {

    /* ------------------------------------------------------------ list rows */
    .shopbydepartment ul.dropdown-menu {
        padding: 4px 0;
    }

        .shopbydepartment ul.dropdown-menu > li {
            float: none;
            width: auto;
        }

            .shopbydepartment ul.dropdown-menu > li > a {
                position: relative;
                display: flex;
                align-items: center;
                width: auto;
                min-height: 36px;
                box-sizing: border-box;
                margin: 0 !important; /* bootstrap: margin-bottom:10px !important */
                padding: 4px 12px 4px 54px;
                border-left: 3px solid transparent;
                white-space: normal;
                line-height: 1.25;
                font-size: 12.5px;
                font-weight: 400; /* was 700 */
                color: #333;
                transition: background 0.12s ease, border-color 0.12s ease;
            }

            .shopbydepartment ul.dropdown-menu > li:not(.has-thumb) > a {
                padding-left: 14px;
            }

            /* round thumbnail */
            .shopbydepartment ul.dropdown-menu > li.has-thumb > a:before {
                content: "";
                position: absolute;
                left: 12px;
                top: 50%;
                width: 32px;
                height: 32px;
                margin-top: -16px;
                border-radius: 7px; /* rounded square (was a round bubble) */
                border: 0;
                box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
                background-color: #fff;
                background-image: var(--dept-thumb);
                background-position: right bottom; /* subject sits bottom-right in the photos */
                background-size: cover;
                background-repeat: no-repeat;
            }

            /* icon rows (js/dept-thumbs.js adds span.dept-ico + li.has-icon): line icon instead of the photo,
               same icons as the search box's "Search in" panel */
            .shopbydepartment ul.dropdown-menu > li.has-icon > a {
                padding-left: 44px;
            }
            .shopbydepartment ul.dropdown-menu > li.has-icon > a:before {
                display: none;
            }
            .shopbydepartment ul.dropdown-menu > li > a .dept-ico {
                position: absolute;
                left: 15px;
                top: 50%;
                width: 18px !important;
                min-width: 0 !important;
                right: auto !important;
                height: 18px;
                margin: -9px 0 0 0;
                padding: 0 !important;
                display: block;
                color: #277487;
                line-height: 0;
            }
                .shopbydepartment ul.dropdown-menu > li > a .dept-ico svg {
                    width: 18px;
                    height: 18px;
                }
            .shopbydepartment ul.dropdown-menu > li > a:hover .dept-ico,
            .shopbydepartment ul.dropdown-menu > li > a.maintainHover .dept-ico {
                color: #f78d1e;
            }

            /* the ">" in each row is hidden (the hover bar shows the open row) */
            .shopbydepartment ul.dropdown-menu > li > a strong,
            .shopbydepartment ul.dropdown-menu > li:last-child > a strong {
                display: none !important;
            }

            /* tagline is shown in the flyout instead */
            .shopbydepartment ul.dropdown-menu > li > a span:not(.dept-ico) {
                display: none;
            }

            /* hover / flyout-open row */
            .shopbydepartment ul.dropdown-menu > li > a:hover,
            .shopbydepartment ul.dropdown-menu > li > a.maintainHover {
                background: #f5f7fa;
                border-left-color: #f78d1e;
                color: #FF3300;
            }

            /* "All departments" (added by the script, same target as the phone menu's View All) */
            .shopbydepartment ul.dropdown-menu > li.dept-all {
                margin-top: 4px;
                border-top: 1px solid #eef1f4;
            }

                .shopbydepartment ul.dropdown-menu > li.dept-all > a {
                    min-height: 34px;
                    padding-left: 14px;
                    font-size: 12.5px;
                    font-weight: 600;
                    color: #277487;
                }

                    .shopbydepartment ul.dropdown-menu > li.dept-all > a:after {
                        content: "\2192";
                        margin-left: 6px;
                    }

                    .shopbydepartment ul.dropdown-menu > li.dept-all > a:hover {
                        background: #f3fbfc;
                        border-left-color: #277487;
                        color: #0c252b;
                    }

    /* --------------------------------------------------------------- flyout */
    .shopbydepartment .popover.has-photo {
        box-sizing: border-box;
        width: 560px;
        padding: 0;
        /* keep the inline photo, but pin it bottom-right at full panel height */
        background-color: #fff !important; /* inline shorthand resets it to transparent */
        background-position: right bottom !important;
        background-size: cover !important;
        background-repeat: no-repeat !important;
        border: 1px solid #e3e7ec;
        border-left: 0;
        border-radius: 0 10px 10px 0 !important;
        box-shadow: 6px 6px 14px rgba(16, 42, 67, 0.14);
        overflow: hidden;
        text-align: left;
    }

        /* same height as the list on the left: js/shopmaster.js activateSubmenu sets an inline
           height of (list height - 4px), which left the flyout 4px short. Pin it to the list instead. */
        .shopbydepartment ul.dropdown-menu > li > .popover {
            top: 0 !important;
            bottom: 0 !important;
            height: auto !important;
            box-sizing: border-box;
        }

        /* white fade so the links read on the left */
        .shopbydepartment .popover.has-photo:before {
            content: "";
            position: absolute;
            top: 0;
            right: 0;
            bottom: 0;
            left: 0;
            background: linear-gradient(90deg, #fff 0, #fff 34%, rgba(255, 255, 255, 0.85) 45%, rgba(255, 255, 255, 0.3) 55%, rgba(255, 255, 255, 0) 63%);
            pointer-events: none;
        }

        /* brand gradient rule along the top (same trio as the orange header) */
        .shopbydepartment .popover.has-photo:after {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 4px;
            background: linear-gradient(90deg, #f7c11e 0%, #f78d1e 50%, #ee2b24 100%);
        }

        /* small source photos: show whole in the lower-right corner, no blur-up */
        .shopbydepartment .popover.has-photo.photo-small {
            background-size: auto 40% !important;
            background-position: right 24px bottom 24px !important;
        }

        /* title + tagline */
        .shopbydepartment .popover.has-photo .popover-title {
            position: relative;
            width: auto;
            margin: 0;
            padding: 20px 20px 8px;
            background: none;
            border: 0;
            font-size: 16px;
            font-weight: 600;
            line-height: 1.2;
            color: #e47911;
            text-transform: none;
        }

            .shopbydepartment .popover.has-photo .popover-title:after {
                content: attr(data-tagline);
                display: block;
                margin-top: 3px;
                font-size: 11px;
                font-weight: normal;
                line-height: 1.3;
                color: #8a949c;
            }

        /* links: two even columns on the left ~62% */
        .shopbydepartment .popover.has-photo .popover-content {
            position: relative;
            width: auto;
            padding: 6px 170px 60px 20px; 
            text-align: left;
        }

            .shopbydepartment .popover.has-photo .popover-content > div {
                display: flex;
                gap: 0 14px;
            }

        .shopbydepartment .popover.has-photo .categorylinkbox {
            float: none;
            flex: 1 1 0;
            width: auto;
            min-width: 0;
        }

            .shopbydepartment .popover.has-photo .categorylinkbox ul li {
                margin-bottom: 7px;
                line-height: 1.35;
            }

                .shopbydepartment .popover.has-photo .categorylinkbox ul li a {
                    font-size: 12.5px;
                }

            /* "Shop all <department>" pill, brand orange, pinned bottom-left */
            .shopbydepartment .popover.has-photo .categorylinkbox ul li.dept-viewall {
                position: absolute;
                left: 20px;
                bottom: 18px;
                margin: 0;
            }

                .shopbydepartment .popover.has-photo .categorylinkbox ul li.dept-viewall a {
                    display: inline-block;
                    padding: 0 14px;
                    line-height: 28px;
                    border-radius: 14px;
                    background: linear-gradient(to bottom, #f7c11e 0%, #f78d1e 60%, #ee2b24 100%);
                    color: #fff !important;
                    font-size: 12.5px;
                    font-weight: 600;
                    box-shadow: 0 2px 6px rgba(238, 43, 36, 0.25);
                }

                    .shopbydepartment .popover.has-photo .categorylinkbox ul li.dept-viewall a:after {
                        content: "\2192";
                        margin-left: 6px;
                    }

                    .shopbydepartment .popover.has-photo .categorylinkbox ul li.dept-viewall a:hover {
                        background: linear-gradient(to bottom, #f78d1e 0%, #ee2b24 100%);
                        color: #fff !important;
                    }
}

@media only screen and (min-width: 768px) and (max-width: 1024px) {
    .leftshoppart .shopbydepartment {
        overflow: visible !important;
    }
        .leftshoppart .shopbydepartment a.dropdown-toggle {
            display: block;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
}
