/* Desktop-only header parity and category dropdown.
   Mobile header/search remain controlled by the existing <=900px styles. */
@media (min-width: 901px) {
    .market-header-row {
        overflow: visible;
    }

    .shop-category-menu {
        position: relative;
        z-index: 180;
        min-width: 82px;
    }

    .shop-category-link {
        max-width: none;
        display: grid;
        justify-items: start;
        gap: 2px;
        padding: 7px 4px;
        color: #60646c;
        border: 0;
        background: transparent;
        font: inherit;
        font-size: .76rem;
        line-height: 1.05;
        text-align: left;
        cursor: pointer;
    }

    .shop-category-link span {
        display: block;
    }

    .shop-category-link strong {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        color: #191919;
        font-size: .8rem;
        font-weight: 500;
        white-space: nowrap;
    }

    .shop-category-link strong i {
        position: relative;
        top: 0;
        display: inline-grid;
        place-items: center;
        width: 11px;
        height: 11px;
        font-size: .58rem;
        line-height: 1;
        transform-origin: 50% 50%;
        transition: transform .16s ease;
    }

    .shop-category-link[aria-expanded="true"] strong i {
        transform: rotate(180deg);
    }

    html[data-theme="dark"] .shop-category-link {
        color: #aeb6c3;
    }

    html[data-theme="dark"] .shop-category-link strong {
        color: #f5f7fa;
    }

    .shop-category-popover {
        position: absolute;
        top: calc(100% + 10px);
        left: -10px;
        z-index: 260;
        width: 286px;
        padding: 8px;
        overflow: hidden;
        border: 1px solid #d9dce2;
        border-radius: 16px;
        background: #fff;
        box-shadow: 0 18px 50px rgba(0, 0, 0, .20);
    }

    .shop-category-popover[hidden] {
        display: none !important;
    }

    .shop-category-popover a {
        min-height: 43px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        padding: 9px 12px;
        color: #20242b !important;
        border-radius: 10px;
        font-size: .84rem;
        font-weight: 600;
        text-decoration: none;
    }

    .shop-category-popover a:hover,
    .shop-category-popover a:focus-visible {
        color: #204fcf !important;
        background: #eef3ff;
        outline: none;
    }

    .shop-category-popover a i {
        color: #747b86;
        font-size: .68rem;
    }

    /* Keep the desktop search control identical in light and dark themes. */
    .header-search-market,
    html[data-theme="dark"] .header-search-market {
        height: 50px !important;
        grid-template-columns: minmax(0, 1fr) 160px !important;
        overflow: hidden !important;
        border: 2px solid #191919 !important;
        border-radius: 999px !important;
        background: #fff !important;
        box-shadow: none !important;
    }

    .header-search-market:focus-within,
    html[data-theme="dark"] .header-search-market:focus-within {
        border-color: #191919 !important;
        box-shadow: 0 0 0 2px rgba(54, 101, 243, .20) !important;
    }

    .header-search-market input,
    html[data-theme="dark"] .header-search-market input {
        color: #191919 !important;
        border: 0 !important;
        border-right: 1px solid #c7c7c7 !important;
        background: #fff !important;
    }

    .header-search-market input::placeholder,
    html[data-theme="dark"] .header-search-market input::placeholder {
        color: #707070 !important;
        opacity: 1;
    }

    .header-search-market select,
    html[data-theme="dark"] .header-search-market select {
        appearance: none;
        -webkit-appearance: none;
        padding: 0 42px 0 14px !important;
        color: #4f535a !important;
        border: 0 !important;
        background-color: #fff !important;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.25 6 6.25 11 1.25' fill='none' stroke='%2321262d' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
        background-repeat: no-repeat !important;
        background-position: right 17px center !important;
        background-size: 11px 7px !important;
        line-height: 50px;
    }

    .header-search-market option,
    html[data-theme="dark"] .header-search-market option {
        color: #191919 !important;
        background: #fff !important;
    }

    .market-search-button,
    html[data-theme="dark"] .market-search-button {
        min-width: 116px !important;
        height: 50px !important;
        padding-inline: 24px !important;
        color: #fff !important;
        border: 1px solid #3665f3 !important;
        border-radius: 999px !important;
        background: #3665f3 !important;
        box-shadow: none !important;
        transform: none !important;
    }

    .market-search-button:hover,
    html[data-theme="dark"] .market-search-button:hover {
        color: #fff !important;
        border-color: #2b52cc !important;
        background: #2b52cc !important;
        transform: none !important;
    }
}

@media (min-width: 901px) and (max-width: 1180px) {
    .shop-category-menu {
        display: none;
    }

    .header-search-market,
    html[data-theme="dark"] .header-search-market {
        grid-template-columns: minmax(0, 1fr) 128px !important;
    }

    .market-search-button,
    html[data-theme="dark"] .market-search-button {
        min-width: 104px !important;
        padding-inline: 16px !important;
    }
}
